{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/leveraging-activity-recognition-to-enable","title":"Leveraging Activity Recognition to Enable Protective Behavior Detection in Continuous Data","arxiv_id":"2011.01776","date":"2020-11-03","proceeding":null,"authors":["Chongyang Wang","Yuan Gao","Akhil Mathur","Amanda C. De C. Williams","Nicholas D. Lane","Nadia Bianchi-Berthouze"],"abstract":"Protective behavior exhibited by people with chronic pain (CP) during physical activities is the key to understanding their physical and emotional states. Existing automatic protective behavior detection (PBD) methods rely on pre-segmentation of activities predefined by users. However, in real life, people perform activities casually. Therefore, where those activities present difficulties for people with chronic pain, technology-enabled support should be delivered continuously and automatically adapted to activity type and occurrence of protective behavior. Hence, to facilitate ubiquitous CP management, it becomes critical to enable accurate PBD over continuous data. In this paper, we propose to integrate human activity recognition (HAR) with PBD via a novel hierarchical HAR-PBD architecture comprising graph-convolution and long short-term memory (GC-LSTM) networks, and alleviate class imbalances using a class-balanced focal categorical-cross-entropy (CFCC) loss. Through in-depth evaluation of the approach using a CP patients' dataset, we show that the leveraging of HAR, GC-LSTM networks, and CFCC loss leads to clear increase in PBD performance against the baseline (macro F1 score of 0.81 vs. 0.66 and precision-recall area-under-the-curve (PR-AUC) of 0.60 vs. 0.44). We conclude by discussing possible use cases of the hierarchical architecture in CP management and beyond. We also discuss current limitations and ways forward.","url_abs":"https://arxiv.org/abs/2011.01776v4","url_pdf":"https://arxiv.org/pdf/2011.01776v4.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"leveraging-activity-recognition-to-enable","repo_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD","is_official":1,"mentioned_in_paper":0,"mentioned_in_github":1,"framework":"tf","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"activity-recognition","task_name":"Activity Recognition"},{"task_slug":"human-activity-recognition","task_name":"Human Activity Recognition"},{"task_slug":"management","task_name":"Management"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2011.01776","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2011.01776"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":7},"by_repo_kind":{"official":{"samples":7,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"24b4d234620d9739","entry":"HARExtend","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/HierarchicalHAR-PBD.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/HierarchicalHAR-PBD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"24b4d234620d9739"}},{"code_sha256_prefix":"baf34e51345c75c8","entry":"adjmul","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/HierarchicalHAR-PBD.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/HierarchicalHAR-PBD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"baf34e51345c75c8"}},{"code_sha256_prefix":"4fc2e305cd8947e6","entry":"build_model","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/gc-LSTM.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/gc-LSTM.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"4fc2e305cd8947e6"}},{"code_sha256_prefix":"ae056e4ff565a8a4","entry":"class_balance_weights","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/utils.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"ae056e4ff565a8a4"}},{"code_sha256_prefix":"7ca5ca815c2f5c6f","entry":"crop","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/utils.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7ca5ca815c2f5c6f"}},{"code_sha256_prefix":"6853f6c77c17fc20","entry":"focal_loss","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/utils.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/utils.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6853f6c77c17fc20"}},{"code_sha256_prefix":"a0f88d29e3b32aa7","entry":"output_of_adjmul","repo":"Mvrjustid/IMWUT-Hierarchical-HAR-PBD","repo_kind":"official","path":"code/HierarchicalHAR-PBD.py","file_url":"https://github.com/Mvrjustid/IMWUT-Hierarchical-HAR-PBD/blob/HEAD/code/HierarchicalHAR-PBD.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a0f88d29e3b32aa7"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}