Skip to content

Baseline Machine Learning models for the Human Activity Recognition Trondheim (HARTH) dataset

License

Notifications You must be signed in to change notification settings

ntnu-ai-lab/harth-ml-experiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HAR/SWR Datasets and Machine Learning experiments

Baseline Machine Learning models for Human Activity Recognition (HAR) and Sleep Wakefulness Recognition (SWR) using the Human Activity Recognition Trondheim (HARTH), the Human Activity Recognition 70+ (HAR70+), the DualSleep, the HARChildren, and the walking speed datasets, proposed and used in our papers: HARTH: A Human Activity Recognition Dataset for Machine Learning, A Machine Learning Classifier for Detection of Physical Activity Types and Postures During Free-Living, Validation of an Activity Type Recognition Model Classifying Daily Physical Behavior in Older Adults: The HAR70+ Model, A Machine Learning Model for Predicting Sleep and Wakefulness Based on Accelerometry, Skin Temperature and Contextual Information, Validation of two novel human activity recognition models for typically developing children and children with Cerebral Palsy, and The performance of a machine learning model in predicting accelerometer-derived walking speed.

HARTH Dataset

The folder harth contains the newest version (v2.0) of the Human Activity Recognition Trondheim Dataset (HARTH). It consists of acceleration data of 31 subjects, which wore two three-axial Axivity AX3 (Axivity Ltd., Newcastle, UK) accelerometers on the thigh and lower back. An older version (v1.2) of the dataset with 22 subjects is also uploaded to the UC Irvine Machine Learning Repository.

Setup

  • Acceleration signals
  • 2 three-axial Axivity AX3 accelerometers
  • Attached to: thigh and lower back

Activity Annotations

Label Activity Notes
1 walking
2 running
3 shuffling standing with leg movement
4 stairs (ascending)
5 stairs (descending)
6 standing
7 sitting
8 lying
13 cycling (sit)
14 cycling (stand)
130 cycling (sit, inactive) cycling (sit) without leg movement
140 cycling (stand, inactive) cycling (stand) without leg movement

HAR70+ Dataset

The folder har70plus contains the Human Activity Recognition 70+ (HAR70+) dataset. It consists of acceleration data of 18 older-adult subjects, which wore two three-axial Axivity AX3 (Axivity Ltd., Newcastle, UK) accelerometers on the thigh and lower back. The dataset is also uploaded to the UC Irvine Machine Learning Repository.

Setup

  • Acceleration signals
  • 2 three-axial Axivity AX3 accelerometers
  • Attached to: thigh and lower back

Activity Annotations

Label Activity Notes
1 walking
3 shuffling standing with leg movement
4 stairs (ascending)
5 stairs (descending)
6 standing
7 sitting
8 lying

DualSleep Dataset

The DualSleep dataset contains accelerometer recordings with sleep-stage annotations. It consists of acceleration data of 29 subjects, which wore two three-axial Axivity AX3 (Axivity Ltd., Newcastle, UK) accelerometers on the thigh and lower back. The dataset is available here. Download it for the sleep experiments. The config files for the DualSleep experiments are here.

Setup

  • Acceleration signals
  • 2 three-axial Axivity AX3 accelerometers
  • Attached to: thigh and lower back

Activity Annotations

Label Activity Notes
81 Wake
82 Non-REM1
83 Non-REM2
84 Non-REM3
85 REM
86 Movement Body movements during sleep

HARChildren Dataset

The HARChildren dataset contains activity annotations of 63 typically developing children and 16 children with Cerebral Palsy. The children were between 6 and 17 years old. Each wore two three-axial Axivity AX3 (Axivity Ltd., Newcastle, UK) accelerometers on the thigh and lower back. The dataset is available here. Download it for the HARChildren experiments. The config files for the HARChildren experiments are here.

Setup

  • Acceleration signals
  • 2 three-axial Axivity AX3 accelerometers
  • Attached to: thigh and lower back

Activity Annotations

Label Activity Notes
1 walking
2 running
3 shuffling standing with leg movement
4 stairs (ascending)
5 stairs (descending)
6 standing
7 sitting
8 lying
9 transition (not used in experiments)
10 bending
13 cycling (sit)
14 cycling (stand)
20 jumping

Walking Speed Dataset

The folder adult_walking_speed contains the walking speed dataset. It consists of acceleration data of 24 subjects, which wore two three-axial Axivity AX3 (Axivity Ltd., Newcastle, UK) accelerometers on the thigh and lower back. A measuring wheel with a speedometer and video recording were used to capture consecutive 5-min periods at three walking speeds and running, simulating free-living conditions. Additionally, a 5-min period with a gradual increase and decrease in walking speed (from slow to brisk) was included.

Setup

  • Acceleration signals
  • 2 three-axial Axivity AX3 accelerometers
  • Attached to: thigh and lower back

Activity Annotations

Label Activity Notes
2 running
101 slow-walking ≤4 km/h
102 moderate-walking 4.1-5.4 km/h
103 brisk-walking ≥5.5 km/h

Machine Learning Experiments

The folder experiments contains all our experiments. It is possible to train a K-Nearest Neighbors, a Support Vector Machine, a Random Forest, an Extreme Gradient Boost, a Convolutional Neural Network, a Bidirectional Long Short-term Memory, and a CNN with multi-resolution blocks.

Requirements

  • Python 3.8.10+
cd experiments
pip install -r requirements.txt

Usage

Start a model training using HARTH

cd experiments
./run_training.sh -c <path/to/model/config.yml> -d <path/to/dataset>
# Example: ./run_training.sh -c traditional_machine_learning/params/xgb_50hz/config.yml -d ../harth/

Start a LOSO using HARTH

cd experiments
./run_loocv.sh -c <path/to/model/config.yml> -d <path/to/dataset>
# Example: ./run_loocv.sh -c traditional_machine_learning/params/xgb_50hz/config.yml -d ../harth/

Each model can be configured using the corresponding config.yml file: xgb, svm, rf, knn, cnn, multi_resolution_cnn, lstm

Citation

If you use the HARTH dataset for your research, please cite the following papers:

@article{logacjovHARTHHumanActivity2021,
  title = {{{HARTH}}: {{A Human Activity Recognition Dataset}} for {{Machine Learning}}},
  shorttitle = {{{HARTH}}},
  author = {Logacjov, Aleksej and Bach, Kerstin and Kongsvold, Atle and B{\aa}rdstu, Hilde Bremseth and Mork, Paul Jarle},
  year = {2021},
  month = nov,
  journal = {Sensors},
  volume = {21},
  number = {23},
  pages = {7853},
  publisher = {{Multidisciplinary Digital Publishing Institute}},
  doi = {10.3390/s21237853}
}
@article{bachMachineLearningClassifier2021,
  title = {A {{Machine Learning Classifier}} for {{Detection}} of {{Physical Activity Types}} and {{Postures During Free-Living}}},
  author = {Bach, Kerstin and Kongsvold, Atle and B{\aa}rdstu, Hilde and Bardal, Ellen Marie and Kj{\ae}rnli, H{\aa}kon S. and Herland, Sverre and Logacjov, Aleksej and Mork, Paul Jarle},
  year = {2021},
  month = dec,
  journal = {Journal for the Measurement of Physical Behaviour},
  pages = {1--8},
  publisher = {{Human Kinetics}},
  doi = {10.1123/jmpb.2021-0015},
}

If you use the HAR70+ dataset for your research, please cite the following paper:

@article{ustadValidationActivityType2023,
  title = {Validation of an {{Activity Type Recognition Model Classifying Daily Physical Behavior}} in {{Older Adults}}: {{The HAR70}}+ {{Model}}},
  shorttitle = {Validation of an {{Activity Type Recognition Model Classifying Daily Physical Behavior}} in {{Older Adults}}},
  author = {Ustad, Astrid and Logacjov, Aleksej and Trolleb{\o}, Stine {\O}verengen and Thingstad, Pernille and Vereijken, Beatrix and Bach, Kerstin and Maroni, Nina Skj{\ae}ret},
  year = {2023},
  month = jan,
  journal = {Sensors},
  volume = {23},
  number = {5},
  pages = {2368},
  publisher = {{Multidisciplinary Digital Publishing Institute}},
  issn = {1424-8220},
  doi = {10.3390/s23052368},
  copyright = {http://creativecommons.org/licenses/by/3.0/}
}

If you use the DualSleep dataset for your research, please cite the following papers:

@article{logacjovMachineLearningModel2024,
  title = {A {{Machine Learning Model}} for {{Predicting Sleep}} and {{Wakefulness Based}} on {{Accelerometry}}, {{Skin Temperature}} and {{Contextual Information}}},
  author = {Logacjov, Aleksej and Skarpsno, Eivind Schjelderup and Kongsvold, Atle and Bach, Kerstin and Mork, Paul Jarle},
  date = {2024-06-06},
  journaltitle = {Nature and Science of Sleep},
  shortjournal = {NSS},
  volume = {16},
  pages = {699--710},
  publisher = {Dove Press},
  doi = {10.2147/NSS.S452799}
}

If you use the HARChildren dataset for your research, please cite the following papers:

@article{torringValidationTwoNovel2024,
  title = {Validation of Two Novel Human Activity Recognition Models for Typically Developing Children and Children with {{Cerebral Palsy}}},
  author = {Tørring, Marte Fossflaten and Logacjov, Aleksej and Brændvik, Siri Merete and Ustad, Astrid and Roeleveld, Karin and Bardal, Ellen Marie},
  date = {2024-09-23},
  journaltitle = {PLOS ONE},
  shortjournal = {PLOS ONE},
  volume = {19},
  number = {9},
  pages = {e0308853},
  publisher = {Public Library of Science},
  issn = {1932-6203},
  doi = {10.1371/journal.pone.0308853}
}

Note

Our HARTH dataset is subject to changes in future releases. Therefore, consider version v1.0 for reproducibility purposes. It contains the dataset and experiments used in our article, HARTH: A Human Activity Recognition Dataset for Machine Learning

About

Baseline Machine Learning models for the Human Activity Recognition Trondheim (HARTH) dataset

Resources

License

Stars

Watchers

Forks

Packages

No packages published