Code Monkey home page Code Monkey logo

hierarchical-har-pbd-imwut21's Introduction

Hierarchical HAR-PBD architecture

GitHub stars GitHub folks GitHub GitHub issues My achievement

This is for our paper, Leveraging Activity Recognition to Enable Protective Behavior Detection in Continuous Data,
accepted in Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies (IMWUT), Feb round, 2021.


General

From this repository, you will find all the necessary components that you may feel interesting and helpful for your own research in our paper.
However, codes provided here are not directly executable, e.g., you would not be able to download and run simply with a python command on your machine. You will be able to copy the useful segments, paste and modify into your own script.
This is mainly because, the EmoPain data is not publicly available, but downloadable upon application. In the end, the testing data is held by the EmoPain developer.


Intro

In this paper, our aim was to establish accurate protective behavior detection (PBD) along a continuous movement data sequence of a participant with chronic pain (CP). A figure illustrating such data sequence is given below.

Along the data sequence, the participant performed five activities-of-interest (AoIs), between which he/she was allowed to take some rest and move freely, referred to as transition activities.

The proposed solution is to leverage the human activity recognition (HAR) to contextualize the PBD using a hierarchical architecture, which is, by default, a two stage process during training and an end-to-end process during inference or testing. This architecture comprising two modules (HAR and PBD) could be trained together, and the code is available.

Tips

Check if i) joint training of the two modules fits your own problem better; ii) using one-hot encoding for the HAR output during contextualization is doable for your experiment, otherwise you may just pass a number (n) representing the predicted class of activity or using extra embedding layers to help pass the information.


Code

Prerequisites

The code has been tested on a machine with RTX 3080 (: D) and R9 3900X, with

  • tensorflow (tf-nightly-gpu==2.6.0) (dev20210409)
  • keras (keras-nightly==2.6.0) (dev2021040900, installed automatically with tf-nightly-gpu)
  • cuda (11.2)
  • cudnn (8.1.0)
  • python (>=3.8.0)

You may not need to use such an up-to-date environment, depending on the GPU version you have. For 20s or 10s GPU, older versions of these packages are 100% doable. BUT, be careful to change some codes thereon, given the update of tensorflow always come with different properties. You can leave an issue if this troubles you too much.

Description

  • utils.py: useful plug-and-play functions, e.g. the Class-balanced Focal Categorical Cross-entropy (CFCC) loss and a function to build callbacks. The callbacks are used by me to automatically save the best results during training and Skip the current training if acc reaches 100%.
  • gc-LSTM.py: a basic GC-LSTM implementation, which could be adapted to be the PBD/HAR GC-LSTM.
  • HierarchicalHAR-PBD.py: the hierarchical HAR-PBD architecture in its joint-training variant, see Section 5.3 of the paper.

With the above codes, you are ready to implement the methods proposed in our paper, while also develop yours.


Reference

Feel benefited? Please consider citing

Chongyang Wang, Yuan Gao, Akhil Mathur, Amanda C. De C. Williams, Nicholas D. Lane, and Nadia Bianchi-Berthouze. 2021. Leveraging Activity Recognition to Enable Protective Behavior Detection in Continuous Data. Proc. ACM Interact. Mob. Wearable Ubiquitous Technol (IMWUT). 5, 2. https://doi.org/10.1145/3463508

@article{wang2021leveraging,
     title={Leveraging Activity Recognition to Enable Protective Behavior Detection in Continuous Data},
     author={Wang, Chongyang and Gao, Yuan and Mathur, Akhil and Williams, Amanda C. DE C. and Lane, Nicholas D and Bianchi-Berthouze, Nadia},
     journal={Proceedings of the ACM on Interactive, Mobile, Wearable and Ubiquitous Technologies (IMWUT)},
     volume={5},
     number={2},
     DOI={10.1145/3463508},
     publisher={ACM},
     year={2021}}

hierarchical-har-pbd-imwut21's People

Contributors

mvrjustid avatar

Stargazers

罗映淞 avatar wdkhuans avatar Yi Kexin avatar Joyoung avatar  avatar

Watchers

 avatar  avatar

Forkers

codesharebot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.