{"id":47566198,"url":"https://github.com/mariusbock/dl-for-har","last_synced_at":"2026-04-13T23:01:01.764Z","repository":{"id":44893604,"uuid":"379572843","full_name":"mariusbock/dl-for-har","owner":"mariusbock","description":"Official GitHub page of the best-paper award publication \"Improving Deep Learning for HAR with shallow LSTMs\" presented at the International Symposium on Wearable Computers 21' (ISWC 21')","archived":false,"fork":false,"pushed_at":"2025-03-17T19:41:59.000Z","size":34774,"stargazers_count":51,"open_issues_count":0,"forks_count":30,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-17T20:38:04.531Z","etag":null,"topics":["deep-learning","human-activity-recognition"],"latest_commit_sha":null,"homepage":"https://doi.org/10.1145/3460421.3480419","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mariusbock.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-23T11:00:58.000Z","updated_at":"2025-03-17T19:42:06.000Z","dependencies_parsed_at":"2024-10-29T09:34:02.966Z","dependency_job_id":null,"html_url":"https://github.com/mariusbock/dl-for-har","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mariusbock/dl-for-har","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusbock%2Fdl-for-har","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusbock%2Fdl-for-har/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusbock%2Fdl-for-har/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusbock%2Fdl-for-har/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mariusbock","download_url":"https://codeload.github.com/mariusbock/dl-for-har/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mariusbock%2Fdl-for-har/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31774547,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","human-activity-recognition"],"created_at":"2026-03-30T04:00:25.634Z","updated_at":"2026-04-13T23:01:01.758Z","avatar_url":"https://github.com/mariusbock.png","language":"Jupyter Notebook","funding_links":[],"categories":["Tutorials and Courses"],"sub_categories":["Motion Generation and Estimation"],"readme":"# Improving Deep Learning for HAR with shallow LSTMs (ISWC 21' best-paper award)\n\nThis is the official GitHub page of the **best-paper award-winning** publication \"Improving Deep Learning for HAR with shallow LSTMs\" presented at the International Symposium on Wearable Computers 21' (ISWC 21'). [[cite our work]](#cite)\n\n## Abstract\nRecent studies in Human Activity Recognition (HAR) have shown that Deep Learning methods are able to outperform classical Machine Learning algorithms. One popular Deep Learning architecture in HAR is the DeepConvLSTM. In this paper we propose to alter the DeepConvLSTM architecture to employ a 1-layered instead of a 2-layered LSTM. We validate our architecture change on 5 publicly available HAR datasets by comparing the predictive performance with and without the change employing varying hidden units within the LSTM layer(s). Results show that across all datasets, our architecture consistently improves on the original one: Recognition performance increases up to 11.7% for the F1-score,and our architecture significantly decreases the amount of learnable parameters. This improvement over DeepConvLSTM decreases training time by as much as 48%. Our results stand in contrast to the belief that one needs at least a 2-layered LSTM when dealing with sequential data. Based on our results we argue that said claim might not be applicable to sensor-based HAR.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/architecture.png\"\u003e\n\u003c/p\u003e\n\n## YouTube Video\n[![IMAGE ALT TEXT HERE](https://img.youtube.com/vi/fggty_qgZNA/0.jpg)](https://www.youtube.com/watch?v=fggty_qgZNA)\n\n## Results\nResults were obtained on the Wetlab [[4]](#4), RWHAR [[6]](#6), SBHAR [[2]](#2) and HHAR [[5]](#5) dataset using LOSO cross-validation and Opportunity dataset [[3]](#3) using the train-test split as employed in [[1]](#1) averaged across 5 runs using a set of 5 different random seeds.\n\n### Overall results\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/results.png\"\u003e\n\u003c/p\u003e\n\n### Standard deviation across runs\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/average_stdev_runs.png\"\u003e\n\u003c/p\u003e\n\n### Per-class results\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/per_class_HHAR.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/per_class_RWHAR.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/per_class_Wetlab.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/per_class_sbhar.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"\" height=\"\" src=\"images/per_class_opportunity.png\"\u003e\n\u003c/p\u003e\n\n## Repo Structure\n- log_files: folder containing all log files of experiments mentioned in the paper\n- job_scripts: contains files with terminal commands corresponding to the experiments mentioned in the paper\n- data_processing: contains file for data processing (analysis, creation, preprocessing and sliding window approach)\n- model: folder containing the DeepConvLSTM model, train and evaluation script\n- main.py: main script which is to be run in order to commence experiments\n- Results.xlsx: excel file containing all expererimental results presented in the paper\n\n## Installing requirements\n\nPlease install the required python packages as noted in the ```requirements.txt```. We recommend using ```pip``` by running:\n\n```\npip install -r requirements.txt\n```\n\n## Datasets\n\nThe datasets (raw and preprocessed data) used during experiments can be either downloaded via this link: \n\nOnly processed dataset: https://uni-siegen.sciebo.de/s/XleBdbYic7ctiXF\nProcessed + raw data: https://uni-siegen.sciebo.de/s/J9AjZL2g30fPh6c\n\nPW: iswc21\n\nThe datasets need to be put in a seperate '/data' directory within the main directory of the repository in order for the main.py script to work.\n\n### Dataset creation\n\nIn order to (re-)create the datasets used within these experiments, please additionally install the modified version of ```PyAV``` by Philipp Scholl (https://github.com/pscholl/PyAV). \n\n- For Linux: \n```\ncd data_processing\ngit clone https://github.com/pscholl/PyAV\nsudo apt-get install libx264-dev\nsudo apt-get install libavformat-dev\nsudo apt-get install libavdevice-dev\ncd PyAV\n./scripts/build-deps\nmake\n```\n\nOnce installed, you can run the ```dataset_creation.py``` file within the ```data_processing``` directory and it will create all relevant datasets and save them to the ```data``` directory within the root directory of this project.\n\n## (Re-)running experiments\n\nTo run experiments one can either modify the main.py file (see hyperparameter settings in the beginning of the file or run the script via terminal and giving necessary hyperparameters via flags. See the main.py file for all possible hyperparameters which can be used. All terminal commands used during our experiments can be found in the corresponding job script file in the job_scripts folder. \n\n## Available log files of experiments\n\nNote that within the log files accuracy, precision, recall and F1-score inbetween epochs were calculated using a 'weighted' and not 'macro' approach (see https://scikit-learn.org/stable/modules/generated/sklearn.metrics.f1_score.html for the difference between the two). Note that thus temporary results will be different if re-run, but final results will still be the same as reported in our publication.\n\n## Results file\n\nThe results excel sheet (results.xlsx) contains all results mentioned within the paper and GitHub as well as aggregated information about the standard deviation across runs, per-class results and standard deviation across subjects.\n\n## Citation\n```\n  @inproceedings{bock2021improving,\n    author = {Bock, Marius and Hölzemann, Alexander and Moeller, Michael and Van Laerhoven, Kristof},\n    title = {Improving Deep Learning for HAR with Shallow LSTMs},\n    year = {2021},\n    booktitle = {Proceedings of the 2021 ACM International Symposium on Wearable Computers},\n    pages = {7–12},\n    numpages = {6},\n    doi = {10.1145/3460421.3480419},\n    url = {https://dl.acm.org/doi/10.1145/3460421.3480419}\n}\n\n```\n\n## Dataset References\n\u003ca id=\"1\"\u003e[1]\u003c/a\u003e \nFrancisco Javier Ordóñez and Daniel Roggen. 2016. \nDeep Convolutional and LSTM Recurrent Neural Networks for Multimodal Wearable Activity Recognition.\nSensors16, 1 (2016).  https://doi.org/10.3390/s16010115\n\n\u003ca id=\"2\"\u003e[2]\u003c/a\u003e \nJorge-L. Reyes-Ortiz, Luca Oneto, Albert Samà, Xavier Parra, and Davide Anguita. 2016. Transition-Aware Human Activity Recognition Using Smartphoneson-Body Localization of Wearable Devices: An Investigation of Position-Aware ActivityRecognition. Neurocomputing 171 (2016), 754–767.    https://doi.org/10.1016/j.neucom.2015.07.085\n\n\u003ca id=\"3\"\u003e[3]\u003c/a\u003e \nDaniel Roggen, Alberto Calatroni, Mirco Rossi, Thomas Holleczek, Kilian Förster,Gerhard Tröster, Paul Lukowicz, David Bannach, Gerald Pirkl, Alois Ferscha, Jakob Doppler, Clemens Holzmann, Marc Kurz, Gerald Holl, Ricardo Chavarriaga, Hesam Sagha, Hamidreza Bayati, Marco Creatura, and José del R. Millàn. 2010. Collecting Complex Activity Datasets in Highly Rich Networked Sensor Environments. In 7th International Conference on Networked Sensing Systems. 233-240. https://doi.org/10.1109/INSS.2010.5573462\n\n\u003ca id=\"4\"\u003e[4]\u003c/a\u003e \nPhilipp M. Scholl, Matthias Wille, and Kristof Van Laerhoven. 2015. Wearables in the Wet Lab: A Laboratory System for Capturing and Guiding Experiments. 589–599.  https://doi.org/10.1145/2750858.2807547\n\n\u003ca id=\"5\"\u003e[5]\u003c/a\u003e \nAllan Stisen, Henrik Blunck, Sourav Bhattacharya, Thor S. Prentow, Mikkel B.Kjærgaard, Anind Dey, Tobias Sonne, and Mads M. Jensen. 2015. Smart Devices are Different: Assessing and Mitigating Mobile Sensing Heterogeneities for Activity Recognition. In Proceedings of the 13th ACM Conference on Embedded Networked Sensor Systems. 127–140. https://doi.org/10.1145/2809695.2809718\n\n\u003ca id=\"6\"\u003e[6]\u003c/a\u003e \nTimo Sztyler and Heiner Stuckenschmidt. 2016. On-Body Localization of Wearable Devices: An Investigation of Position-Aware Activity Recognition. In IEEE International Conference on Pervasive Computing and Communications. 1–9. https://doi.org/10.1109/PERCOM.2016.7456521\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariusbock%2Fdl-for-har","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmariusbock%2Fdl-for-har","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmariusbock%2Fdl-for-har/lists"}