This is the source code of Human Activity Recognition Using Attention Mechanism Based Deep Learning Feature Combination. We provide the datasets, processed datasets, data preprocess code, model development code, and the pretrained model.
Akter, M.; Ansary, S.; Khan, M.A.-M.; Kim, D. Human Activity Recognition Using Attention-Mechanism-Based Deep Learning Feature Combination. Sensors 2023, 23, 5715. https://doi.org/10.3390/s23125715
In this work, we have used three public benchmark datasets including KU-HAR dataset, UCI-HAR Dataset, WISDM dataset. These datasets can be found at https://data.mendeley.com/datasets/45f952y38r/5, https://archive.ics.uci.edu/dataset/240/human+activity+recognition+using+smartphones, https://www.cis.fordham.edu/wisdm/dataset.php
In many instances, 2D CNNS outperform 1D CNNs with same number of parameters. For taking the advantages of 2D Convolution and 2D pooling layers, this work converted the 1D time-series signals into 2D image. To convert the signals into 2D images, this work utilized the technique of spectrogram. This work considered short time Fourier Transform (SIFT) for generating the spectrogram. After converting the spectrogram, the raw samples turned into a shape of 8×129×6, where the height, width and the channel of the samples are 8, 129, 6 respectively.
The processed datasets and the labels can be found https://drive.google.com/drive/folders/1A3MU5Aw_9dIY1ISWAFB0MqQjsA3aaas0 and https://drive.google.com/drive/folders/1DcxNs007afh-uryic9ngcOLGy2ST-xUK
- KUhar_time_freq_spectrogram.m-Assuming you have downloaded the raw data, this code can be used to generate the spectograms for KU-HAR, UCI-HAR, WISDM datasets.
- AM_DLFC.ipynb- Assuming you have downloaded the processed data, this is the proposed AM_DLFC model to train using that data.
- Signal.h5-These are the final outputs from the above CNN. Note that if you train the file above the originals here will be overwritten!
Please cite our paper if you use this code or the processed dataset in your own work: @article{sensors-23-05715, title={Human Activity Recognition Using Attention-Mechanism-Based Deep Learning Feature Combination}, author={Akter, M.; Ansary, S.; Khan, M.A.-M.; Kim, D}, journal={Sensors}, volume={23}, year={2023} }