Abstract
Human Activity Recognition plays a vital role in various fields, such as healthcare and smart environments. Traditional HAR methods rely on sensor or video data, but sensor-based systems have gained popularity due to their non-intrusive nature. Current challenges in HAR systems include variability in sensor data influenced by factors like sensor placement, user differences, and environmental conditions. Additionally, imbalanced datasets and computational complexity hinder the performance of these systems in real-world applications. To address these challenges, this paper proposes an LSTM-based HAR model enhanced with attention and squeeze-and-excitation blocks. The LSTM captures temporal dependencies, while the attention mechanism dynamically focuses on important parts of the input sequence. The squeeze-and-excitation block recalibrates channel-wise feature importance, allowing the model to emphasize the most informative features. The proposed model demonstrated a 99% accuracy rate, showcasing its effectiveness in recognizing various activities from sensor data. The integration of attention and squeeze-and-excitation mechanisms further boosted the model’s ability to handle complex datasets. Comparative analysis with existing LSTM models confirms that the proposed approach improves accuracy and reduces computational complexity, making it a highly suitable model for real-world applications.
Keywords: Activity recognition, Deep learning, LSTM, Squeeze and excitation, Attention, Multi-head
Subject terms: Mathematics and computing, Computer science
Introduction
Human Activity Recognition (HAR) is a critical area in machine learning and artificial intelligence, with applications spanning health monitoring, smart environments, and beyond. HAR can be broadly classified into two categories: sensor-based and video-based recognition. Sensor-based HAR relies on data from accelerometers, gyroscopes, and magnetometers, typically embedded in smartphones, wearable devices, or specialized hardware. In contrast, video-based HAR uses visual data captured by cameras to identify and classify human activities. Among these, sensor-based HAR has gained significant traction due to its non-intrusive nature and lower computational requirements than video-based systems. The HAR process typically involves several stages, starting with data collection, then preprocessing to filter and normalize the data, feature extraction or automatic feature learning, and finally, classification, where machine learning or deep learning models are applied to recognize specific activities. Accelerometer data, characterized by its multi-dimensional time-series nature, provides valuable insights into various physical activities. Accurately recognizing these activities is vital for enhancing user experiences in applications like healthcare, sports, and security systems. AI has been widely used to identify Human Activity Recognition (HAR), and it shows significant advantages in the fields mentioned above.
The advent of deep learning models has transformed the approach to HAR, enabling the automatic extraction of complex features from raw sensor data—something that traditional machine learning methods often struggle to achieve. As discussed above, earlier methods relied heavily on manually crafted features, which are time-consuming and often lack generalizability across different datasets. Deep learning offers a promising alternative by automatically learning hierarchical data representations, particularly with Long Short-Term Memory (LSTM) networks and Convolutional Neural Networks (CNN). This shift from feature engineering to feature learning has significantly improved HAR accuracy, making deep learning models the preferred choice in recent research1. Moreover, incorporating advanced techniques like attention mechanisms and squeeze-and-excitation networks enables these models to prioritize critical input features, significantly boosting their effectiveness and accuracy2,3.
Deep learning models have become the cornerstone of modern HAR systems, leveraging the power of neural networks to process and learn from extensive accelerometer data. Among these models, the LSTM network stands out for its ability to capture temporal dependencies in time-series data. LSTM networks are particularly suited for HAR because they can maintain information over long sequences, making them ideal for recognizing activities that unfold over time4. Recent studies have shown the effectiveness of LSTM networks in various HAR applications, consistently outperforming traditional methods like Support Vector Machines (SVM) and k-Nearest Neighbours (k-NN)5. Another widely used model in HAR is the Convolutional Neural Network (CNN), which excels at extracting spatial features from raw sensor data. When applied to accelerometer data, CNNs can identify intricate patterns in the signal, such as periodic movements associated with walking or running6. Researchers have also explored the combination of CNNs with LSTMs, where CNNs handle spatial feature extraction, and LSTMs manage the temporal aspect. This hybrid model leverages the strengths of both architectures, resulting in improved performance for HAR tasks7. Additionally, more recent advancements have introduced attention mechanisms into these models, allowing the network to focus on the most relevant portions of the input sequence, further enhancing HAR accuracy and robustness8,9.
Despite the advancements in deep learning models for HAR, several challenges persist. One of the significant challenges in HAR is ensuring robustness against inconsistencies in sensor data, which arise from diverse user behaviors, irregular sensor calibration, and fluctuating environmental conditions. These factors introduce noise into the data and complicate the development of models that can generalize effectively across different real-world scenarios. This variability often results in decreased model performance when applied to real-world data instead of controlled experimental settings10,11. Additionally, the class imbalance in activity data, where some activities occur more frequently than others, poses a significant challenge for model training. Models tend to be biased towards recognizing more everyday activities, leading to poorer performance on less frequent ones12. Another significant challenge is the computational complexity of training and deploying deep learning models for HAR. These models often require large amounts of labeled data and substantial computational resources, which can hinder their implementation in resource-constrained environments, such as mobile or embedded devices13. Moreover, the interpretability of deep learning models remains a concern. While these models achieve high accuracy, they often function as “black boxes,” making it difficult to understand the decision-making process behind activity recognition14. This lack of transparency can hinder the adoption of these models in critical applications, such as healthcare, where understanding the rationale behind predictions is crucial15.
To address the challenges above, we propose a comparative analysis of various LSTM-based models for HAR using accelerometer data. The baseline model in our analysis is a simple LSTM network, which serves as a foundation for further enhancements. The next model incorporates an attention mechanism into the LSTM framework, allowing the network to dynamically focus on the most relevant parts of the input sequence, thereby improving recognition accuracy for complex activities16. Building upon this, we introduce an LSTM model augmented with a squeeze-and-excitation (SE) network. The SE module helps the model recalibrate the importance of different features, enhancing its ability to distinguish between similar activities by focusing on the most informative aspects of the data17. We aim to comprehensively compare these models, highlighting their strengths and weaknesses in the context of HAR using accelerometer data. Through this analysis, we seek to identify the most effective model for real-world applications, considering factors such as accuracy, computational efficiency, and robustness to data variability. Finally, the following are the key contributions of the paper.
We propose an LSTM-based model integrated with attention mechanisms and SE blocks for improved HAR.
Conducting a comprehensive comparative analysis of various LSTM-based architectures, including baseline and enhanced models, to evaluate their performance on diverse datasets.
We demonstrate the effectiveness of the proposed model in terms of accuracy, computational efficiency, and robustness in handling variability in sensor data and class imbalances.
Finally, offering insights into the practical implications of using such models for real-world applications in healthcare, smart environments, and other domains.
Related works
In recent years, several researchers have been working in the field of human activity recognition (HAR). For instance, an et al. proposed the Squeeze-and-Excitation Long-term Recurrent Convolutional Networks (SE-LRCN) for human action recognition. Their model effectively utilizes both spatial and temporal features by incorporating Squeeze-and-Excitation operations. The SE-ResNet-34 network is employed to extract spatial features, enhancing the dependencies and importance of feature channels at a pixel level, while the SE-LSTM network models temporal relationships at a frame level. Evaluated on the HMDB51 and UCF101 benchmarks, the SE-LRCN model achieved competitive results with state-of-the-art methods, demonstrating its effectiveness in capturing complex action dynamics18. For instance, Milenkoski et al. presented a lightweight LSTM-based algorithm for real-time human activity recognition using raw smartphone accelerometer data, bypassing hand-crafted features. Their model demonstrates robust performance across both controlled and field conditions, outperforming existing approaches19. Similar to Milenkoski’s work, Yu et al. proposed a novel C-LSTM neural network framework for HAR using wearable sensors. This model integrates convolutional layers for feature extraction with recurrent layers to capture the temporal dynamics of the data. Evaluated on the Opportunity dataset, their approach achieved an F1 score of 0.918, representing a 2.4% improvement over baseline LSTM models. This demonstrates enhanced recognition accuracy and reduced reliance on engineered features, making it a significant advancement in HAR for wearable technology20.
Pienaar et al. assessed LSTM networks for HAR, presenting an LSTM-RNN architecture that achieves an accuracy of over 94% with a loss of less than 30% within the first 500 training epochs. This showcases the potential of LSTM networks in effectively capturing temporal dependencies in sensor data for accurate activity recognition21. In addition, Sun et al. leveraged an attention-based Long Short-Term Memory (LSTM) network for wearable human activity recognition (HAR). Their model effectively handles complex activities by focusing on the most relevant parts of high-dimensional sensor data. Tested on the Opportunity dataset, their approach increased the F1-score by 2.6% compared to baseline LSTM results, showcasing the benefits of integrating attention mechanisms with LSTM networks for enhanced HAR accuracy22. Further, Uddin et al. created a system combining wearable sensors, kernel-based discriminant analysis (KDA), and Long Short-Term Memory (LSTM) within a Neural Structured Learning (NSL) framework, achieving a recall rate of around 99% on a public dataset. This approach emphasizes the importance of time-sequential data in HAR, demonstrating the robustness and interpretability of their method through the use of explainable AI techniques like Local Interpretable Model-Agnostic Explanations (LIME)23.
Buffelli et al. developed an advanced attention-based deep learning framework called TrASenD for HAR. Addressing the limitations of recurrent neural networks (RNNs) in handling long-term dependencies, their purely attention-based approach significantly outperformed previous models, with an average F1 score increase of more than 7%. Additionally, they developed a transfer-learning strategy for user-specific model adaptation, further improving the F1 score by 6% on personalized predictions, demonstrating the framework’s superiority and adaptability in HAR tasks24. In addition, Singh et al. devised a deep neural network architecture that enhances human activity decoding from wearable sensors by integrating self-attention mechanisms with convolutional and recurrent models. Their approach captures both spatio-temporal features and learns important time points, leading to significant performance improvements across six public datasets. The self-attention mechanism provided notable enhancements over existing deep networks, demonstrating its effectiveness in improving human activity recognition and opening new possibilities for decoding activities from extended sensor data25.
Gajjala et al. optimized an LSTM neural network using the Particle Swarm Optimization (PSO) algorithm. This approach addresses the challenge of fine-tuning LSTM parameters to achieve optimal performance. By utilizing PSO for parameter optimization, the model exhibits a quick convergence rate and improved prediction accuracy. Applied to the WISDM dataset, the LSTM-PSO model achieved a recognition rate of up to 97%, surpassing other recurrent neural networks in accuracy and demonstrating the benefits of integrating optimization techniques with deep learning models for HAR26. Further, Zhang et al. developed a multi-scale feature extraction fusion model that combines CNNs and Gated Recurrent Units (GRU). Their approach achieved high accuracy on the WISDM, UCI-HAR, and PAMAP2 datasets while reducing computational costs, making it suitable for deployment on devices with limited memory27.
Domingo et al. developed an LSTM-based model that integrates image feature extraction, object detection, and skeleton tracking to enhance HAR in indoor environments. By combining recurrent networks with these diverse techniques, their approach significantly improves the accuracy of action detection in live video streams, outperforming existing models across various datasets28. In addition, Ponsam et al. incorporated a dropout mechanism to address the challenges of vanishing gradients and overfitting. Their model leverages the Long Short-Term Memory (LSTM) architecture, which includes a cell state for memory preservation and a dropout mechanism that nullifies certain active states, allowing other states to participate and train the data more effectively. This approach resulted in a high accuracy of 92.67% on the experimented dataset, illustrating the effectiveness of combining LSTM with dropout techniques in improving HAR model performance29. In addition, Khatun et al. created a hybrid deep learning model for HAR that combines convolutional neural networks (CNN) and long short-term memory (LSTM) networks with a self-attention mechanism. Evaluated on both a new dataset collected via an Android application (H-Activity) and benchmark datasets (MHEALTH and UCI-HAR), their model achieved high accuracy rates of 99.93% on H-Activity, 98.76% on MHEALTH, and 93.11% on UCI-HAR. This demonstrates the model’s effectiveness in accurately recognizing human activities using smartphone sensor data and its potential for clinical and research applications30.
Raj et al. proposed an advanced CNN-based model that achieves a 97.20% accuracy using the WISDM dataset, demonstrating the effectiveness of CNNs in processing temporal and spatial data for HAR tasks. Their work surpasses previous state-of-the-art methods and highlights the potential of deep learning to enhance HAR accuracy and applications31. Similarly, Kumar et al. developed an attention-based bidirectional long short-term memory (Bi-LSTM) model for detecting abnormal human activity. Their framework integrates CNNs, Bi-LSTM, and an attention mechanism to effectively capture the unique spatiotemporal characteristics of raw video streams, achieving accuracies of 98.9%, 96.04%, and 61.04% on the UCF11, UCF50, and subUCF crime datasets, respectively. This highlights the model’s capability in categorizing abnormal behaviors with high precision32. In addition, Wei et al. revealed the TCN-Attention-HAR model, which leverages a time convolutional network enhanced with an attention mechanism. This model addresses challenges like insufficient time-varying feature extraction and gradient explosion, showing significant improvements in accuracy across the WISDM, PAMAP2, and USC-HAD datasets33.
A comparison of the well-known schemes discussed in the above literature with the proposed scheme is summerized in the following Table 1.
Table 1.
A theoratical comparison of the most relevant schemes and proposed scheme.
| References | Model name | Number of layers | Advantages | Limitations | Datasets used | Performance |
|---|---|---|---|---|---|---|
| Raj et al.32 | Attention-Based LSTM | 2 | Focuses on temporal dependencies using attention | Lacks feature recalibration; performance depends on dataset noise | UCI-HAR | High precision and recall on balanced datasets |
| Buffelli et al.24 | Attention-Only Framework | 3 | Handles long-term dependencies effectively with attention | Requires large computational resources for high attention layers | Opportunity | Excels in long-term activity recognition |
| Kumar et al.17 | SE-LSTM | 2 | Recalibrates feature importance via SE blocks | Limited temporal modeling compared to attention mechanisms | WISDM | Improves spatial feature representation |
| Sun et al.22 | Attention LSTM | 2 | Dynamically focuses on relevant temporal information | Struggles with highly imbalanced datasets | Opportunity | Effective in recognizing complex sequences |
| Milenkoski et al.19 | Lightweight LSTM | 1 | Lightweight and effective for real-time applications | Performance degrades with complex datasets | Custom Dataset | Good for low-resource applications |
| Pienaar et al.21 | LSTM-RNN | 1 | Captures sequential patterns in sensor data | Limited generalization across diverse datasets | WISDM | Satisfactory on standard HAR datasets |
| Uddin et al.23 | Neural Structured LSTM | 2 | Robust performance with structured learning | Higher computational overhead due to structured learning | UCI-HAR | Highly accurate for structured activities |
| Zhang et al.27 | Multi-Scale CNN-GRU | 3 | High accuracy with multi-scale feature fusion | High computational cost; limited application on constrained devices | PAMAP2 | Top-tier accuracy for multi-scale activities |
| Wei et al.33 | TCN-Attention-HAR | 3 | Enhances temporal modeling with TCN and attention | Suboptimal feature recalibration for specific datasets | PAMAP2, USC-HAD | Superior temporal feature extraction |
| Proposed scheme | Multi-Head LSTM with SE and Attention | 3 | Combines temporal and feature recalibration for superior results | Requires slightly more resources but excels in performance across datasets | WISDM, UCI-HAR, Opportunity, PAMAP2 | Best overall performance across datasets |
Theoretical background
Squeeze and excitation
The Squeeze-and-Excitation (SE) mechanism is a neural network architectural unit designed to improve the quality of representations produced by a network by explicitly modeling the interdependencies between the channels of its convolutional features. Jie Hu et al. introduced an SE block that enhances a network’s representational power by enabling dynamic channel-wise feature recalibration IN 201734. In traditional convolutional neural networks (CNNs), convolutional filters are applied uniformly across all channels, treating each channel equally without considering their varying levels of importance. The SE block addresses this limitation by adaptively recalibrating channel-wise feature responses, allowing the network to focus more on informative features and suppress less useful ones. The SE mechanism comprises two primary operations:
Squeeze: Aggregates global spatial information into a channel-wise descriptor.
Excitation: Fully captures channel-wise dependencies by producing a set of weights for each channel.
In order to understand the workings of these steps, we consider a feature map
, where H and W are the spatial dimensions for height and weight and C represents the number of channels. Consequently, the squeeze operation aims to condense global spatial information into a channel-wise descriptor by using global average pooling as follows.
![]() |
1 |
for each channel
resulting in a vector
.
The excitation operation captures channel-wise dependencies and generates a set of weights to recalibrate the channels. This is achieved through a two-layer fully connected (FC) network, wherein the first layer the dimensions are reduced to
where r is the reduction ratio and finally applies ReLU activation function
to it as follows.
![]() |
2 |
Where
.
Similarly, in the second layer, the dimensions are restored back to
. This process is done by applying the sigmoid activation function
to obtain the weights between 0 and 1 as follows.
![]() |
3 |
Where
.
Finally, the original feature map U is recalibrated using the generated weights s as follows.
![]() |
4 |
For each channel c, where
is the c-th element of s and
is the c-th channel of U mathematically, it is represented as follows.
![]() |
5 |
where ⊙ denotes channel-wise multiplication.
Finally, the architecture of the SE block is shown in the following Fig. 1.
Fig. 1.
A squeeze-and-excitation architecture.
Necessity of using SE with LSTM model
Long-short-term memory (LSTM) networks are a type of recurrent neural network (RNN) adept at modeling sequential data by capturing long-range dependencies. However, LSTMs may not efficiently capture feature-wise importance within each time step, as they process input sequences uniformly across all features. Integrating the SE mechanism with LSTM models introduces an attention-like mechanism that allows the network to:
Adaptively emphasize important features: By recalibrating features at each time step, the model can focus on the most informative aspects of the input.
Improve representational capacity: The SE blocks enhance the LSTM’s ability to model complex patterns by considering feature interdependencies.
Reduce redundancy: The model can reduce noise and improve generalization by suppressing less useful features.
In LSTM networks, the SE mechanism is applied to the hidden states to enhance feature-wise modeling. We consider an LSTM processing an input sequence
where
and T is the sequence length. A standard LSTM model updates its cell state
and hidden state
using the following Eq.
![]() |
6 |
![]() |
7 |
![]() |
8 |
![]() |
9 |
![]() |
10 |
![]() |
11 |
In the following section, we update the above equations with SE block. In the case of squeeze block, we obtain a channel-wise descriptor from the hidden state
. As we know that
we can use
. Similarly, in the excitation block, we compute the recalibration weights
as follows.
![]() |
12 |
The hidden state is adjusted as follows.
![]() |
13 |
Similarly, for the subsequent processing, we have used
in place of
for output or as input to the next layer.
Enhancing LSTM model with attention mechanisms
Attention mechanisms have become pivotal in modern neural network architectures, particularly in natural language processing (NLP) tasks. They allow models to focus on specific parts of the input sequence when generating outputs, significantly enhancing their ability to handle long-range dependencies and capture relevant context. Traditional LSTM networks process sequences step-by-step, updating their hidden states at each time step. However, they might struggle with:
Long-term dependencies: Capturing dependencies between distant time steps can be challenging.
Information bottleneck: The hidden state vector may not sufficiently capture all necessary information from the past.
Therefore, the attention mechanisms address these issues by:
Direct access to past outputs: The model can refer back to all previously hidden states or inputs when generating each output.
Weighted summation: Assigning weights to different input sequence parts, emphasizing relevant information.
To understand how the above advantages were incorporated, we considered an LSTM encoder-decoder model for sequence-to-sequence tasks. The decoder typically applies the attention mechanism to focus on relevant parts of the encoder’s outputs. In this regard, we define an encoder’s hidden states as follows.
![]() |
14 |
Where T is the length of the input sequence. Similarly, the decoder’s hidden state at time t as
.
We leveraged the scaled dot product
to compute a score that measures the alignment between the decoder state
and each encoder’s hidden state
as follows.
![]() |
15 |
where d is the dimensionality of the hidden states.
In the next step, we applied the softmax function as follows to obtain the following normalized attention weights.
![]() |
16 |
We create a fixed-size context vector
that summarizes the relevant information from the encoder’s hidden states for the current decoder time step. The context vector
is a dynamic representation that captures the parts of the input sequence most relevant to generating the next output at time t. Further, it effectively condenses the entire input sequence into a single vector, with more emphasis on important elements as determined by the attention weights.
![]() |
17 |
In the next step, we compute the new decoder hidden state
using the previous output, previous decoder state, and the context vector as follows.
![]() |
18 |
Finally, the modified LSTM cell incorporates
into every gate as follows.
![]() |
19 |
![]() |
20 |
![]() |
21 |
![]() |
22 |
![]() |
23 |
![]() |
24 |
Where
denotes the concatenation of
and
.
Finally, the working mechanism of the LSTM with the attention module is shown in Fig. 2.
Fig. 2.
The LSTM architecture with an attention mechanism.
Multi-head deep LSTM model
Multi-head deep LSTM models are an advanced extension of traditional Long Short-Term Memory (LSTM) networks, designed to capture complex patterns and dependencies in sequential data. An LSTM network is a type of recurrent neural network (RNN) that effectively models sequences by maintaining hidden and cell states, allowing it to capture long-term dependencies while mitigating issues like the vanishing gradient problem. Deep LSTM models enhance this capability by stacking multiple LSTM layers on top of each other, enabling the network to learn hierarchical representations where higher layers capture more abstract features.
The multi-head approach further extends the deep LSTM architecture by incorporating multiple parallel LSTM networks, referred to as “heads,” which process the input sequence simultaneously. Each head is intended to learn different aspects or representations of the input data, enabling the model to capture a richer and more diverse set of features. This concept is inspired by the multi-head attention mechanism used in Transformer models. Still, in LSTMs, they operate on the feature representation dimension rather than the sequence positions.
Mathematically, a standard LSTM cell processes an input sequence by updating its cell state
and hidden state
at each time step t as presented in Section “Related works”. The multi-head deep LSTM model extends this concept by processing the input sequence through multiple LSTM networks (heads) in parallel. Each head has its own set of parameters and processes the input sequence independently, potentially after applying a unique transformation. For each head
, the input at time
is transformed using a projection matrix
.
![]() |
25 |
Each head then processes its respective input using its own LSTM cell equations as follows.
![]() |
26 |
![]() |
27 |
![]() |
28 |
![]() |
29 |
![]() |
30 |
![]() |
31 |
After processing, the outputs from all heads are combined to form the final hidden state. This combination can be performed in several ways, such as concatenation:
![]() |
32 |
Or it can be done using averaging.
![]() |
33 |
Alternatively, a weighted sum can be used where the weights
are learnable parameters as follows:
![]() |
34 |
A deep architecture is formed by stacking multiple layers of these multi-head LSTM networks. In each layer, the combined output from the previous layer serves as the input to each head in the current layer, allowing the model to learn complex hierarchical representations. The primary benefits of multi-head deep LSTM models include their ability to capture diverse patterns and dependencies within the data. Each head may specialize in learning different input aspects, leading to richer feature representations and improved performance on tasks such as language modeling, speech recognition, and time-series forecasting. Additionally, the parallel processing inherent in multi-head architectures can enhance learning efficiency and potentially reduce training time.
However, there are important considerations when using multi-head deep LSTM models. The increased number of parameters due to multiple heads can lead to higher computational costs and more significant memory requirements. This complexity may also raise the risk of overfitting, mainly if the amount of training data is limited. Consequently, careful tuning of hyperparameters—such as the number of heads, the size of each head, and the method of combining outputs—is essential to optimize performance while managing computational resources.
Experiments and discussion
This section presents the experimental methodology and empirical findings from evaluating the proposed models across four established human activity recognition datasets: 1- WISDM Activity Recognition, 2- Opportunity Activity Recognition, 3- PAMAP2 Physical Activity Monitoring, and 4- Human Activity Recognition Using Smartphones. These diverse datasets represent a comprehensive spectrum of real-world activity recognition scenarios.
The experiments were executed on a system configured with a 64-bit Windows 11 Pro operating system (Build 22631), powered by a 12th Generation Intel® Core™ i9-12900HX processor with 24 CPUs clocked at approximately 2.3 GHz. The system had 32 GB of RAM available. Model experiments, training, and testing phases were conducted using this setup to ensure optimal performance and efficiency.
Datasets
In order to validate the working of the proposed analysis, we have used the following datasets for the experiments. These datasets are publicly available for research purposes.
WISDM activity recognition dataset
WISDM Activity Recognition is a time-series set of data designed to evaluate activity recognition algorithms35. The dataset comprises over 1 million instances, representing recordings collected from wearable devices worn by 29 participants as they performed six activities: walking, jogging, ascending stairs, descending stairs, sitting, and standing. Each recording consists of sequential data points, each labelled with the corresponding activity being performed.
Opportunity activity recognition dataset
The opportunity Activity Recognition dataset focuses especially on complex human activities in realistic settings36. The dataset includes 2551 instances, gathering a range of human actions and gestures performed by four subjects in a sensor-rich environment. The recordings include data from multiple sensor modalities, such as on-body, object, and ambient sensors, providing a detailed representation of the subjects’ activities and their interactions with objects. Each data point is precisely labelled with the corresponding activity being performed, enabling the training and evaluation of activity recognition algorithms.
Physical activity monitoring dataset (PAMAP2)
PAMAP2 is a dataset acquired to evaluate algorithms for physical activity recognition and estimating energy expenditure37. The dataset consists of 3,850,505 instances from 9 participants wearing three inertial measurement units (IMUs) and a heart rate monitor. The IMUs were placed on the dominant wrist, chest, and ankle. Participants performed 18 activities in laboratory and free-living environments, including household chores, walking, cycling, and running. The dataset provides comprehensive measurements from the IMUs and heart rate monitors.
Human activity recognition using smartphone dataset (UCI)
Human Activity Recognition Using Smartphones is a dataset mainly designed for human activity recognition38. It encompasses 10,299 instances recorded from 30 participants performing six activities: walking, walking upstairs, walking downstairs, sitting, standing, and lying. Participants carried a smartphone with an embedded inertial sensor, recording 3-axis linear acceleration and 3-axis angular velocity at a constant rate of 50 Hz. The dataset includes meticulously labeled time-series data.
WISDOM dataset
The following Fig. 3 presents five confusion matrices illustrating the performance of various LSTM models, i.e., Simple LSTM, Deep LSTM, LSTM with attention module, multi-head with attention, and finally, multi-head with Squeeze and Excitation in recognizing human activities. Each matrix compares true labels with predicted labels across six activities: downstairs, jogging, sitting, standing, upstairs, and walking. The Simple LSTM model shows strong performance, with only one misclassification where sitting is predicted as standing. The Deep LSTM model exhibits similar results but with two additional misclassifications: sitting as standing and upstairs as walking. The LSTM with Attention exhibits a slight increase in errors, particularly in the process of activity classification, such as sitting misclassified as standing and upstairs being predicted as jogging or standing. The Multi-head LSTM with Attention performs comparably, with minimal classification errors primarily involving sitting and upstairs classifications. Finally, the Multi-head LSTM with SE performs marginally better than the other models, with only a few misclassifications, particularly in sitting and upstairs activities. Overall, the Multi-head LSTM with SE is accurate, minimizing classification errors across most activities.
Fig. 3.
Comparison among LSTM models using confusion matrices for various activities in the WISDOM dataset.
The following Fig. 4 compares the training and validation accuracy for all five models over 20 epochs. The Simple LSTM starts with moderate performance but steadily improves, reaching around 97% accuracy, with minimal overfitting as its validation accuracy closely follows. The Deep LSTM performs better, achieving faster convergence and reaching approximately 98% in training and validation, indicating stronger overall accuracy. The LSTM with Attention follows a similar path, with training and validation accuracy nearing 98%, despite initial variability in performance. The Multi-head LSTM with Attention stabilizes at around 98%, with closely aligned training and validation accuracy, demonstrating good generalization. The Multi-head LSTM with SE yields the highest performance metrics, showing the fastest convergence and final accuracy, reaching around 99%. The small gap between training and validation curves across all models suggests they generalize well with minimal overfitting, particularly the multi-head models. Similarly, The training loss trajectory over 20 epochs is depicted in Fig. 4b. The Simple LSTM model (solid blue and dashed orange lines) begins with a high loss but quickly reduces, stabilizing around 0.1, indicating effective training and low overfitting. The Deep LSTM (solid red and dashed purple lines) starts with a similar trajectory but converges with greater speed, reaching a lower loss of around 0.08. The LSTM with Attention (solid green and dashed Gray lines) also performs well, with both training and validation losses decreasing rapidly to approximately 0.1, though with slightly higher variation in validation loss. The Multi-head LSTM with Attention (solid orange and dashed brown lines) displays expedited loss reduction, achieving a stable loss of around 0.07 by the 10th epoch. Finally, the Multi-head LSTM with SE (solid teal and dashed light blue lines) demonstrates the best performance, with both training and validation losses dropping swiftly and stabilizing at around 0.05, indicating superior model convergence and minimal overfitting.
Fig. 4.
(a) Comparison of model training and validation accuracies, (b) Comparison of model training and validation loss.
The following Fig. 5 compares the F1 score, precision, and recall across all the five LSTM-based models. All three metrics, such as F1 score (blue), precision (orange), and recall (green), display consistently high performance across all models, with scores close to 1, indicating excellent classification accuracy across all models.
Fig. 5.
Comparison between LSTM models for F1, Precision, and Recall.
Further, the Simple LSTM achieves slightly lower values compared to other models but still maintains high precision and recall, which results in a strong F1 score. The Deep LSTM shows marginally improved precision and recall, contributing to a higher F1 score. The LSTM with Attention performs similarly, with very little deviation between precision, recall, and F1 score. Both Multi-head LSTM with Attention and Multi-head LSTM with SE exhibit nearly identical performance, with all metrics nearing 1, highlighting their superior ability to handle the task with balanced precision and recall. Overall, all models perform exceptionally well with minimal differences between them.
A comparative analysis of each model for the WISDOM dataset is given in the following Table 2.
Table 2.
Comparative analysis of each model in the WISDOM dataset.
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| Simple LSTM | 0.9894 | 0.9894 | 0.9894 | 0.9894 |
| Deep LSTM | 0.9958 | 0.9958 | 0.9958 | 0.9958 |
| LSTM with Attention | 0.9936 | 0.9936 | 0.9936 | 0.9936 |
| Multi-head LSTM with Attention | 0.9882 | 0.9882 | 0.9882 | 0.9882 |
| Multi-head LSTM with SE | 0.9908 | 0.9907 | 0.9908 | 0.9907 |
PAMAP2 dataset
The following Fig. 6 shows confusion matrices for all the five LSTM models on a multi-activity recognition task involving activities like sitting, walking, running, ironing, etc. Each matrix illustrates how accurately the models classify activities. The Simple LSTM misclassifies activities like folding laundry and vacuum cleaning more frequently, though it performs well on common tasks like walking and sitting. The Deep LSTM shows improvements with fewer misclassifications, particularly in activities like ironing and ascending stairs. The LSTM with Attention better handles varied activities but struggles with ironing and vacuum cleaning, displaying higher confusion rates in activities such as folding laundry. Similarly, the Multi-head LSTM with Attention model reduces misclassifications, particularly under challenging activities like Nordic walking and car driving. Finally, the results indicate that the Multi-head LSTM with SE architecture yields the best performance, with minimal confusion across all activities, showing the most balanced and accurate classification across tasks like ironing, vacuum cleaning, and folding laundry.
Fig. 6.
Comparison among LSTM models using confusion matrices for various activities in the PAMAP2 dataset.
The following Fig. 7 compare the accuracy and loss trends across all five LSTM-based models over 50 epochs. In Fig. 7a, the Simple LSTM exhibits reduced convergence speed and inferior final accuracy, levelling off around 80%. The Deep LSTM improves significantly, reaching about 85% accuracy. Similarly, LSTM and Multi-head LSTM architectures, when augmented with Attention mechanisms, demonstrate superior results and performance metrics, converging faster and reaching over 85% validation accuracy, with similar behavior between training and validation curves. Among all evaluated architectures, the Multi-head LSTM with SE model outperforms all the other models. Its validation and training accuracy consistently close to 90%, indicating superior generalization.
Fig. 7.
(a) Comparison of model training and validation accuracies, (b) Comparison of model training and validation loss.
In Fig. 7b, The results demonstrate that the Simple LSTM has the highest loss, suggesting slower learning. While Deep LSTM and LSTM with Attention demonstrate effective loss reduction, the Multi-head LSTM with Attention architecture achieves consistently lower and more stable loss during training. Finally, the Multi-head LSTM with SE has the lowest loss, indicating fast convergence and minimal overfitting, validating its superior performance across metrics.
The following Fig. 8 compares the F1 score, precision, and recall across all five models within the PAMAP2 dataset. All models demonstrate high values for these metrics, with F1 scores, precision, and recall all approaching or exceeding 0.9, indicating strong classification performance. The Simple LSTM has slightly lower scores across all three metrics compared to the other models, suggesting it is less effective in achieving a balanced trade-off between precision and recall. The Deep LSTM and LSTM with Attention show very similar performance, with both achieving high precision and recall, contributing to strong F1 scores. In addition, Multi-head LSTM with Attention and Multi-head LSTM with SE show the highest and most consistent performance across all metrics, indicating superior balance in correctly identifying both true positives and minimizing false positives and false negatives. Overall, all models perform well, but the multi-head LSTM models, especially with SE, perform the best.
Fig. 8.

Comparison between LSTM models for F1, Precision, and Recall.
A comparative analysis of each model in activity recognition in PAMAP2 dataset is given in the following Table 3.
Table 3.
Comparative analysis of each model in the PAMAP2 dataset.
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| Simple LSTM | 0.8473 | 0.8494 | 0.8473 | 0.8462 |
| Deep LSTM | 0.8800 | 0.8809 | 0.8800 | 0.8796 |
| LSTM with Attention | 0.8628 | 0.8633 | 0.8628 | 0.8622 |
| Multi-head LSTM with Attention | 0.8910 | 0.8911 | 0.8910 | 0.8904 |
| Multi-head LSTM with SE | 0.8820 | 0.8831 | 0.8820 | 0.8818 |
Opportunity activity recognition dataset
Figure 9 shows the confusion matrices of the five LSTM model variants evaluated on the OPPORTUNITY dataset. Across all models, the majority class, such as “Open Dishwasher,” is predicted with high accuracy. The Simple LSTM shows a reasonable performance but struggles with some smaller classes like “Clean Table” and “Drink from Cup,” indicating more confusion in those categories. The Deep LSTM improves over the Simple LSTM, achieving superior accuracy rates across diverse activity categories, particularly in handling tasks like “Close Fridge” and “Toggle Switch.” The LSTM with Attention performs similarly to the Deep LSTM but further reduces misclassifications for tasks like “Close Drawer” and “Open Door.” The Multi-head LSTM with Attention and Multi-head LSTM with SE exhibit the best performance, particularly in distinguishing smaller classes with minimal confusion, reflecting more robust generalization and precision across a wider range of activities.
Fig. 9.
Comparison among LSTM models using confusion matrices for various activities in the OPPORTUNITY dataset.
The following Fig. 10 presents comparative accuracy and loss metrics for the five LSTM-based architectures trained on the OPPORTUNITY dataset. In Fig. 10a, the Simple LSTM has the slowest convergence, with training and validation accuracy remaining below 95%. The Deep LSTM shows better performance, reaching around 97% validation accuracy. The LSTM, with Attention, improves upon this, showing rapid convergence and stabilizing near 98%. Both the Multi-head LSTM with Attention and Multi-head LSTM with SE models demonstrate the best performance, reaching near 99% validation accuracy and consistently maintaining it over the epochs, indicating excellent generalization.
Fig. 10.
(a) Comparison of model training and validation accuracies, (b) Comparison of model training and validation loss.
Similarly, in Fig. 10b, the Simple LSTM starts with a higher initial loss and declines gradually but remains above 0.2. The Deep LSTM achieves better loss minimization, around 0.1. The LSTM with Attention further reduces loss, but the Multi-head LSTM with Attention and Multi-head LSTM with SE models show the lowest training and validation losses, stabilizing near zero, suggesting excellent convergence and minimal overfitting.
In the Fig. 11, the F1 score, precision, and recall for five LSTM models are illustrated below. All models demonstrate strong overall classification performance, with high values across all three metrics. The Simple LSTM model shows slightly lower precision and recall scores than the other models, indicating potential for improvement in balancing these metrics. The Deep LSTM model shows promising improvement, achieving closer to 0.95 in performance. Both the LSTM with Attention and Multi-head LSTM with Attention models perform similarly, achieving high precision and recall, resulting in consistently high F1 scores around 0.98. The Multi-head LSTM with SE model has the highest scores across all metrics, suggesting an optimal balance between precision and recall, resulting in a near-perfect F1 score. Overall, all models perform well, with the multi-head models, particularly with SE, demonstrating the best overall performance.
Fig. 11.
Comparison between LSTM models for F1, Precision, and Recall.
Table 4 compares each model in activity recognition in the OPPORTUNITY dataset.
Table 4.
Comparative analysis of each model in the OPPORTUNITY dataset.
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| Simple LSTM | 0.9855 | 0.9854 | 0.9855 | 0.9854 |
| Deep LSTM | 0.9851 | 0.9852 | 0.9851 | 0.9851 |
| LSTM with attention | 0.9854 | 0.9854 | 0.9854 | 0.9854 |
| Multi-head LSTM with attention | 0.9966 | 0.9966 | 0.9966 | 0.9966 |
| Multi-head LSTM with SE | 0.9965 | 0.9965 | 0.9965 | 0.9965 |
UCI human activity recognition dataset
The following Fig. 12 displays confusion matrices for all five LSTM models for the UCI dataset. The Simple LSTM performs well in distinguishing walking and laying activities, However, it shows reduced accuracy in distinguishing between “Walking Upstairs” and “Walking Downstairs” activities, where some confusion is present. The Deep LSTM improves slightly, reducing errors in “Walking Downstairs” and “Sitting,” although some confusion remains between sitting and standing. The LSTM with Attention displays higher confusion rates in walking-related activities while attaining enhanced accuracy in distinguishing between laying and sitting activities. Similarly, the Multi-head LSTM with Attention further improves accuracy, especially in walking tasks, with fewer misclassifications, particularly in walking upstairs/downstairs activities. Finally, the Multi-head LSTM with SE yields the best results among all tested models, minimizing confusion across all activities, especially in distinguishing between sitting and standing.
Fig. 12.
Comparison among LSTM models using confusion matrices for various activities in the UCI dataset.
In Fig. 13a, we compare accuracy and loss trends across all five LSTM models trained on the UCI dataset over 16 epochs. The Simple LSTM shows slower convergence in the accuracy plot, with validation accuracy levelling off at around 93%. The Deep LSTM performs similarly, but its validation accuracy remains slightly lower, stabilizing around 91%. LSTM with Attention rapidly improves, with both training and validation accuracy approaching 95%. The Multi-head LSTM with Attention and Multi-head LSTM with SE models outperform the rest, reaching nearly 98% accuracy by epoch 5 and maintaining it consistently, with minimal fluctuations.
Fig. 13.

(a) Comparison of model training and validation accuracies, (b) Comparison of model training and validation loss.
In Fig. 13b, the Simple LSTM shows slower loss reduction, with both training and validation losses stabilizing around 0.2. On the other hand, the Deep LSTM similarly shows higher loss values. Both LSTM with Attention and Multi-head LSTM models demonstrate lower loss, converging quickly. The Multi-head LSTM with SE achieves the best results, showing minimal loss and indicating fast convergence and better generalization across the dataset.
The following Fig. 14 compares the precision, recall, and F1 scores across all five LSTM models. All models attain high performance, with precision, recall, and F1 scores ranging between 0.90 and 0.95. The Simple LSTM scores are slightly lower than the other models, indicating it is less effective at maintaining the balance between precision and recall. The Deep LSTM slightly improves, bringing its metrics closer to 0.92, suggesting better overall performance. The LSTM with Attention and Multi-head LSTM with Attention perform similarly, achieving high and balanced precision and recall, contributing to F1 scores nearing 0.95. The Multi-head LSTM with SE demonstrates the best overall performance, with all metrics reaching close to 0.97, indicating a well-optimized balance of precision and recall and overall better classification performance. All models perform well, but the multi-head models, especially with SE, show the highest accuracy.
Fig. 14.
Comparison between LSTM models for F1, Precision, and Recall.
Table 5 compares each model in activity recognition in the UCI HAR dataset.
Table 5.
Comparative analysis of each model in the UCI dataset.
| Model | Accuracy | Precision | Recall | F1-score |
|---|---|---|---|---|
| Simple LSTM | 0.9304 | 0.9341 | 0.9304 | 0.9305 |
| Deep LSTM | 0.9389 | 0.9403 | 0.9389 | 0.9391 |
| LSTM with Attention | 0.9237 | 0.9265 | 0.9237 | 0.9231 |
| Multi-head LSTM with attention | 0.9352 | 0.9381 | 0.9352 | 0.9351 |
| Multi-head LSTM with SE | 0.9376 | 0.9392 | 0.9376 | 0.9374 |
Conclusion
In conclusion, this paper proposes an LSTM-based model enhanced with attention mechanisms and squeeze-and-excitation (SE) blocks for Human Activity Recognition (HAR), achieving a 99% accuracy rate. By leveraging the strengths of LSTM to capture temporal dependencies, attention mechanisms to dynamically focus on critical sequence segments, and SE blocks to recalibrate channel-wise importance, the proposed model significantly improves upon traditional HAR approaches. Comparative analysis with existing models demonstrated superior performance, reducing computational complexity and enhancing robustness in real-world scenarios. The results highlight that combining LSTM with advanced mechanisms boosts accuracy and generalizes well across diverse datasets, making it suitable for applications in healthcare, sports, and smart environments.
In the future, we will explore integrating other neural architectures, such as transformers, which could further enhance long-range dependencies. Additionally, optimizing mobile device deployment models by reducing computational overhead could broaden their practical applications. Finally, addressing sensor placement variability and improving interpretability for critical applications like healthcare will also be crucial.
Acknowledgements
We deeply acknowledge Kuwait College of Science and Technology for supporting and providing a research environment to conduct this study.
Author contributions
Murad Khan (M.K) and Yousef Hossni (Y.H) collaboratively contributed to this research. M.K. conceptualized the problem statement, formulated the proposed approach, and led the manuscript’s writing. M.K. also provided significant guidance throughout the research process, ensuring theoretical rigor and clarity in presenting ideas. Y.H. conducted the simulations and analyzed the results under M.K’s supervision, applying the proposed model to validate its efficacy. Both M.K. and Y.H. reviewed the manuscript and approved the final version. Our combined efforts were instrumental in achieving the study’s objectives and refining the practical implementation of the proposed approach.
Funding
The Project was Funded by Kuwait Foundation for the Advancement of Sciences (KFAS) under project code: PN23-15EM-1901.
Data availability
The datasets generated and/or analyzed during the current study are publicly available and are cited in the Datasets Section. The web link for each dataset is given in references34–37 and also at the end of this section. The programming code written in Python is available at the private gitfront link below. Simulation Code: https://gitfront.io/r/yousefz77/iuV6fBwpz1uP/ML-REFRANCE-CODES/. Datasets: WISDM Activity Recognition Dataset: https://www.cis.fordham.edu/wisdm/dataset.php. PAMAP2 Dataset: https://archive.ics.uci.edu/dataset/231/pamap2+physical+activity+monitoring. OPPORTUNITY Activity Recognition Dataset: https://archive.ics.uci.edu/dataset/226/opportunity+activity+recognition. UCI Human Activity Recognition Dataset: https://archive.ics.uci.edu/dataset/240/human%2Bactivity%2Brecognition%2Busing%2Bsmartphones.
Declarations
Competing interests
The authors declare no competing interests.
Footnotes
Publisher’s note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
References
- 1.Liu, H., Li, M. & Zhao, X. A novel deep learning framework for human activity recognition using LSTM networks. IEEE Access8, 11012–11024 (2020). [Google Scholar]
- 2.Zhang, X., Wu, Y. & Zhou, L. Improved LSTM network for human activity recognition using wearable sensors. IEEE Sens. J.21(14), 15968–15978 (2021). [Google Scholar]
- 3.Raj, M., Basu, A. & Natarajan, S. Attention-based LSTM for human activity recognition. Sci. Rep., 10(1), (2020).
- 4.Wang, M., Chen, X. & Chen, S. An enhanced CNN model for human activity recognition based on accelerometer data. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), (2021).
- 5.Qiu, L., Li, Y. & Zhang, J. Hybrid CNN-LSTM model for human activity recognition using wearable sensors. IEEE Trans. Ind. Inf.18(3), 1676–1684 (2022). [Google Scholar]
- 6.Wang, J., Zhou, Z. & Li, P. Attention-augmented LSTM for human activity recognition using wearable sensors. IEEE Access9, 134797–134809 (2021). [Google Scholar]
- 7.Chen, Y., Zhang, J. & Li, Y. Challenges in human activity recognition using wearable sensors: A review. IEEE Access9, 108724–108743 (2021). [Google Scholar]
- 8.Chang, H., Liu, Q. & Li, J. Deep learning-based human activity recognition using multi-sensor fusion. Sci. Rep., 11(1), (2021).
- 9.Singh, & Jain, A. Handling imbalanced data in human activity recognition using synthetic oversampling and deep learning. IEEE Sens. J.21(19), 22218–22225 (2021). [Google Scholar]
- 10.Zhang, M., Wang, R. & Zheng, X. Towards explainable human activity recognition using deep learning. IEEE Access9, 23394–23405 (2021). [Google Scholar]
- 11.Sayed, M. Abd El-Monem, and K. Ismail, "Challenges in Deep Learning-Based Human Activity Recognition: A Review," Scientific Reports, vol. 10, no. 1, 2022.
- 12.Park, S. & Choi, J. Attention-based LSTM model for human activity recognition using wearable sensors. IEEE Sens. J.22(5), 4945–4954 (2022). [Google Scholar]
- 13.Wang, T., Lin, K. & Zheng, L. Squeeze-and-excitation networks for human activity recognition in wearable computing. In Proceedings of the IEEE International Conference on Big Data (Big Data), (2020).
- 14.Luo, Y., Sun, Z. & Wang, M. Bidirectional LSTM networks for improved human activity recognition using wearable sensors. IEEE Sens. J.23(4), 12965–12975 (2023). [Google Scholar]
- 15.Lee, R., Kim, M. & Shin, J. A comprehensive study on the interpretability of deep learning models in HAR. Sci. Rep., 12(1), (2023).
- 16.J. Zhang, Y. Tao, and Z. Han, "Enhanced Bi-LSTM Model with Attention Mechanism for Human Activity Recognition," Scientific Reports, vol. 12, no. 1, 2023. [DOI] [PMC free article] [PubMed]
- 17.Kumar, P., Sharma, M. & Dhaka, S. Squeeze-and-excitation networks with LSTM for human activity recognition. Sci. Rep., 11(1), (2021).
- 18.An, G., Zhou, W., Wu, Y., Zheng, Z. & Liu, Y. Squeeze-and-excitation on spatial and temporal deep feature space for action recognition. In 2018 14th IEEE international conference on signal processing (ICSP) 648–653 (IEEE, Beijing, China, 2018). 10.1109/ICSP.2018.8652287.
- 19.Milenkoski, M., Trivodaliev, K., Kalajdziski, S., Jovanov, M. & Stojkoska, B. R. Real time human activity recognition on smartphones using LSTM networks. In 2018 41st international convention on information and communication technology, electronics and microelectronics (MIPRO) 1126–1131 (IEEE, Opatija, 2018). 10.23919/MIPRO.2018.8400205.
- 20.Yu, S., Qin, L. & Yin, Q. A C-LSTM neural network for human activity recognition using wearables. In 2018 International Symposium in Sensing and Instrumentation in IoT Era (ISSI) 1–6 (IEEE, Shanghai, 2018). 10.1109/ISSI.2018.8538129.
- 21.Pienaar, S. W. & Malekian, R. Human activity recognition using LSTM-RNN deep neural network architecture. In 2019 IEEE 2nd Wireless Africa Conference (WAC) 1–5 (IEEE, Pretoria, South Africa, 2019). 10.1109/AFRICA.2019.8843403.
- 22.Sun, B., Liu, M., Zheng, R. & Zhang, S. Attention-based LSTM network for wearable human activity recognition. In 2019 Chinese control conference (CCC) 8677–8682 (IEEE, Guangzhou, China, 2019). 10.23919/ChiCC.2019.8865360.
- 23.Uddin, M. Z. & Soylu, A. Human activity recognition using wearable sensors, discriminant analysis, and long short-term memory-based neural structured learning. Sci. Rep.11, 16455 (2021). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Buffelli, D. & Vandin, F. Attention-based deep learning framework for human activity recognition with user adaptation. IEEE Sens. J.21, 13474–13483 (2021). [Google Scholar]
- 25.Singh, S. P., Sharma, M. K., Lay-Ekuakille, A., Gangwar, D. & Gupta, S. Deep ConvLSTM with self-attention for human activity decoding using wearable sensors. IEEE Sens. J.21, 8575–8582 (2021). [Google Scholar]
- 26.Gajjala, K. S. & Chakraborty, B. Human activity recognition based on LSTM neural network optimized by PSO algorithm. In 2021 IEEE 4th international conference on knowledge innovation and invention (ICKII) 128–133 (IEEE, Taichung, Taiwan, 2021). 10.1109/ICKII51822.2021.9574788.
- 27.Zhang, C., Cao, K., Lu, L. & Deng, T. A multi-scale feature extraction fusion model for human activity recognition. Sci. Rep.12, 20620 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 28.Domingo, J. D., Gomez-Garcia-Bermejo, J. & Zalama, E. Improving human activity recognition integrating LSTM with different data sources: Features, object detection and skeleton tracking. IEEE Access10, 68213–68230 (2022). [Google Scholar]
- 29.Ponsam, J. G. et al. Human activity recognition using LSTM network with dropout technique. In 2022 International conference on power, energy, control and transmission systems (ICPECTS) 1–4 (IEEE, Chennai, India, 2022). 10.1109/ICPECTS56089.2022.10046785.
- 30.Khatun, M. A. et al. Deep CNN-LSTM with self-attention model for human activity recognition using wearable sensor. IEEE J. Transl. Eng. Health Med.10, 1–16 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 31.Raj, R. & Kos, A. An improved human activity recognition technique based on convolutional neural network. Sci. Rep.13, 22581 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 32.Kumar, M., Patel, A. K., Biswas, M. & Shitharth, S. Attention-based bidirectional-long short-term memory for abnormal human activity detection. Sci. Rep.13, 14442 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 33.Wei, X. & Wang, Z. TCN-attention-HAR: Human activity recognition based on attention mechanism time convolutional network. Sci. Rep.14, 7414 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 34.Hu, J., Shen, L., Albanie, S., Sun, G. & Wu, E. Squeeze-and-Excitation Networks. arXiv:1709.01507 (2017). [DOI] [PubMed]
- 35.Kwapisz, J. R., Weiss, G. M. & Moore, S. A. Activity recognition using cell phone accelerometers, proceedings of the fourth international workshop on knowledge discovery from sensor data (at KDD-10), (Washington DC, 2010.
- 36.Roggen, D., Calatroni, A., Nguyen-Dinh, L., Chavarriaga, R., & Sagha, H. OPPORTUNITY activity recognition. UCI machine learning repository. 10.24432/C5M027, (2010).
- 37.Reiss, A. PAMAP2 physical activity monitoring. UCI machine learning repository. 10.24432/C5NW2H, (2012).
- 38.Reyes-Ortiz, J., Anguita, D., Ghio, A., Oneto, L., & Parra, X. Human activity recognition using smartphones. UCI machine learning repository. 10.24432/C54S4K, (2013).
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The datasets generated and/or analyzed during the current study are publicly available and are cited in the Datasets Section. The web link for each dataset is given in references34–37 and also at the end of this section. The programming code written in Python is available at the private gitfront link below. Simulation Code: https://gitfront.io/r/yousefz77/iuV6fBwpz1uP/ML-REFRANCE-CODES/. Datasets: WISDM Activity Recognition Dataset: https://www.cis.fordham.edu/wisdm/dataset.php. PAMAP2 Dataset: https://archive.ics.uci.edu/dataset/231/pamap2+physical+activity+monitoring. OPPORTUNITY Activity Recognition Dataset: https://archive.ics.uci.edu/dataset/226/opportunity+activity+recognition. UCI Human Activity Recognition Dataset: https://archive.ics.uci.edu/dataset/240/human%2Bactivity%2Brecognition%2Busing%2Bsmartphones.














































