Submitted:
06 August 2026
Posted:
07 August 2026
You are already at the latest version
Abstract
Gait analysis is a robust, non-invasive method for evaluating motor function and detecting neurological dysfunctions, as slight abnormalities in walking patterns often indicate underlying medical conditions. With the increasing global prevalence of neurological and motor impairments, there is a rising need for scalable objective methods capable of supporting diagnosis, monitoring progression and guiding rehabilitation. In this work, we present a Spatial-Temporal Attention-Guided Network (STAG-Net) for pathological gait classification using the GAIT-IT dataset, including five gait types associated with different problems: scissor, spastic, steppage, propulsive, and normal. The dataset provides a challenging benchmark characterised by class imbalance, high inter-class similarity, and significant intra-subject variability. To address these challenges, we develop a hybrid architecture combining Convolutional Neural Networks for spatial feature extraction with Recurrent Neural Networks to model temporal gait dynamics. We propose a Bidirectional Long Short-Term Memory module that captures gait dynamics, enabling the model to better represent cyclical and symmetrical gait characteristics. Furthermore, we integrate a temporal attention mechanism to dynamically weight salient gait phases, supporting the network’s ability to discriminate between visually similar gait abnormalities. The resulting STAG-Net framework achieves 96.82% classification accuracy, demonstrating robustness in capturing gait differences and scalability for clinical and real-world applications.
Keywords:
gait analysis
; hybrid deep learning
; bilstm with attention
; neurological and motor disorders classification
1. Introduction
Gait analysis [1] is the systematic assessment of an individual’s walking pattern, focusing on measurable parameters such as stride length, cadence, joint angles, balance, and movement coordination. The act of walking is a complex motor activity controlled by the central and peripheral nervous systems; thus, even small abnormalities in gait can reveal neurological dysfunction. Neurodegenerative conditions such as Parkinson’s disease (PD), multiple sclerosis, Alzheimer’s disease (AD), and stroke often cause alterations in walking patterns [2], such as reduced step symmetry or impaired balance and decreased mobility. By capturing and quantifying these deviations, gait analysis enables clinicians to identify early signs of disease onset [3], monitor progression over time, and evaluate the effectiveness of therapeutic interventions. This is particularly interesting, given that most neurodegenerative diseases have no definitive cure, making early detection and continuous monitoring essential for slowing progression and improving patients’ quality of life. Furthermore, as the global population ages, the prevalence of these conditions is expected to rise significantly. This trend highlights the critical need for scalable, objective, and accessible tools, such as gait analysis, to support timely diagnosis and effective long-term disease management. Beyond neurodegenerative disorders, gait analysis is also useful in characterising motor impairments associated with diplegia and hemiplegia [4], conditions commonly resulting from cerebral palsy, stroke, or other neurological lesions. These disorders produce distinctive gait abnormalities, such as reduced range of motion, asymmetrical limb trajectories, altered joint kinematics, and compensatory movement patterns, that can be objectively detected and quantified through advanced gait assessment techniques. By analysing these deviations, clinicians and researchers can accurately distinguish between diplegic and hemiplegic gait profiles, assess the severity of motor impairment, and define personalised rehabilitation strategies. Overall, gait analysis offers a highly informative, non-invasive approach to study the relationship between observable motor behaviour and neurological status, supporting timely diagnosis, personalised clinical decisions, and effective treatment planning across a wide range of motor and neurological impairments.
Deep learning approaches have demonstrated many advantages over traditional computer vision methods through automatic feature extraction. Convolutional Neural Networks (CNNs) have become widely regarded as superior for spatial feature extraction, with implementations ranging from 1D CNNs for coordinate-based inputs [5] to pretrained architectures such as VGG16 [6], AlexNet [7], and ResNet variants [5]. In case of temporal sequence processing, studies commonly employed Recurrent Neural Network (RNN), Long Short-Term Memory (LSTM), and Bidirectional Long Short-Term Memory (BiLSTM) to model sequential dependencies in gait data [8] [9]. Furthermore, a hybrid architecture that combines spatial and temporal learning components demonstrated improved generalisation to unseen data and greater robustness across diverse real-world scenarios by jointly learning appearance and motion patterns. This approach consistently achieved superior gait-classification performance, demonstrating improved accuracy, robustness, and generalisation to unseen subjects. The integration of attention mechanisms further improves performance by enabling models to focus on the most informative features and abnormal motion patterns while providing greater interpretability of the decision-making process.
The main contributions of the proposed work are the following:
- A Spatial-Temporal Attention-Guided Network (STAG-Net), a deep learning framework that combines spatial modelling (CNN), temporal modelling (BiLSTM), and a temporal attention mechanism to capture gait dynamics across multiple impairment types;
- A training strategy designed to handle the challenges of the GAIT-IT dataset, including class imbalance, inter-class similarity, and intra-subject variability;
- A cross-dataset evaluation demonstrating robustness to acquisition-domain shifts between two independent collections;
- A clean ablation across LSTM, BiLSTM, and STAG-Net showing the benefits of bidirectionality and attention.
The remainder of the paper is organized as follows: Section 2 reviews recent advances in gait analysis, Section 3 describes the data set and methods used in this study, Section 4 details the experimental methodology, and Section 5 presents and discusses the obtained results, including a real time evaluation of the proposed model. Finally, Section 6 discusses the findings and outlines future research directions.
2. Related Work
In recent years, biomedical engineering has made significant steps toward the development of advanced systems capable of remotely analysing and classifying human gait [10,11]. These systems aim to support clinicians in the early detection, differential diagnosis, and continuous monitoring of neurological pathologies by transforming fine movement patterns into objective, quantifiable indicators. Traditional clinical gait assessment is highly valuable, but it is typically confined to specialised laboratory environments and requires dedicated equipment, trained personnel, and structured testing sessions. Such constraints can limit accessibility, increase costs, and impede the frequent monitoring necessary for conditions that evolve over time.
To overcome the limitations of in-clinic assessments, modern remote gait analysis solutions utilise a range of sensing technologies, including wearable sensors, inertial measurement units, pressure insoles[8], and vision-based systems, implemented through both marker-based and markerless approaches. These devices capture high-resolution gait data in real-world settings, enabling continuous and ecologically valid monitoring of mobility. By using artificial intelligence algorithms, the collected data can be automatically processed to extract clinically relevant biomarkers and classify gait patterns with increasing precision. The study proposed in [12] introduces a markerless machine learning framework that uses VitPose for pose estimation and robust classifiers to accurately distinguish gait patterns in individuals with knee osteoarthritis and healthy controls. Building upon this, the Poseidon architecture [13] improves the ViTPose backbone by integrating temporal information through an Adaptive Frame Weighting (AFW) mechanism and cross-attention modules. By prioritising relevant frames and fusing multi-scale features across video sequences, Poseidon achieves superior pose tracking accuracy, which is essential for capturing the fluid dynamics of pathological gait. The research in [14] introduces a portable vision-based system that utilises a lightweight, attention-based CNN and 2D skeleton features to automatically assess stroke recovery by classifying hemiplegic gait severity. The authors of [15] propose a systematic review comparing Inertial Measurement Unit (IMU)- based wearable gait analysis systems against traditional optical motion capture to validate their real-world use. Many neurological disorders are associated with alterations in a patient’s walking behaviour. The early identification of these changes is critical for initiating timely interventions and treatments. A recent systematic review [16] indicates that vision-based gait features identified by AI classifiers show high correlations with established clinical rating scales, providing a reliable approach for objective, low-cost disease monitoring. Furthermore, biomechanics is necessary for diagnosing disorders in which motor symptoms predominate, such as PD and AD. While conventional laboratory techniques are often too complex for clinical translation, recent literature highlights a shift toward portable solutions, including inertial sensors for joint kinematics, foot-force measurement, and even therapeutic integrations such as Virtual Reality (VR) [17]. These wearable technologies show promise for home-based monitoring and rehabilitation, especially when validated against traditional kinetic and kinematic parameters. To further increase sensitivity in the early stages of neurodegeneration, researchers have explored modelling gait through the kinematic theory of rapid human movements [18]. By utilising the Sigma-Lognormal model to analyse velocity and angular features, these studies demonstrate that combining kinematic theory with automated feature extraction can effectively discriminate complex neurodegenerative patterns. In [19], the authors propose a markerless gait analysis approach for PD diagnosis, using VitPose for pose extraction followed by machine learning classification. The method achieves high performance by integrating SHAP-based explainability with the selection of key gait features, including knee angle, cadence, and double-support duration. The landscape of public gait datasets is varied. Among them are large-scale datasets, such as CASIA [20] and OU-ISIR [21] (which capture RGB video, silhouettes, and IMU data for gait recognition), as well as specialised options such as TUM-GAID [22] (which includes RGB and depth). However, a significant gap exists in datasets for pathological gait, which are often limited in sample size, suffer from data imbalance, or lack multiple severity levels. The GAIT-IT dataset [23] explicitly addresses the need for a pathological gait dataset by providing simulations of different gait types and, crucially, including data captured at two severity levels. Deep learning for gait recognition has increasingly employed hybrid CNN–RNN architectures, in which Convolutional Neural Networks (CNNs) first extract spatial features from silhouettes, skeletal data, or stride representations, capturing posture, joint configuration, and multi-scale appearance cues [24,25,26]. These frame-level features are then processed by temporal models, such as LSTMs and GRUs, which learn long-range gait dynamics, cyclic motion patterns, and phase transitions, thereby overcoming the limitations of traditional RNNs and enabling robust modelling of gait evolution over time [27,28]. However, standard unidirectional models may overlook the anticipatory or symmetrical cues inherent in a full gait cycle [29]. Recent advancements suggest that Bidirectional architectures (BiLSTMs) allow for a more accurate representation of movement dynamics by processing sequences in both temporal directions [30,31]. BiLSTMs employ two parallel LSTM layers, one processing the sequence forward and the other backward, allowing the model to integrate context from both past and future timesteps at every point in the sequence. This architectural innovation has demonstrated advantages in applications involving sequential data, and gait analysis represents a domain where these benefits are particularly pronounced [32,33]. Furthermore, attention mechanisms are added to improve these hybrid systems by selectively weighting the most informative spatial regions and temporal phases—such as heel strike, mid-swing, or toe-off using self-attention, temporal attention, or multi-head strategies that emphasise discriminative gait cues and improve interpretability and accuracy, especially in datasets where inter-class similarity is high [34,35]. The ultimate goal of these advanced systems is to provide reliable, scalable, and user-friendly tools that integrate into patients’ daily lives. By offering objective, longitudinal mobility data, remote gait analysis has the potential to transform neurological diagnostics and rehabilitation, enabling clinicians to better manage progression and therapeutic outcomes. Despite recent advances, few studies combine attention-aware BILSTM architectures with explainable AI for multi-severity pathological gait classification.
3. Materials and Methods
This section provides an overview of the dataset, including its structure, class distribution, and data representations, as well as the preprocessing steps applied to obtain suitable inputs for modelling. Furthermore, the section describes the spatial feature extraction strategy based on CNNs and the temporal modelling approaches used to capture gait dynamics. Finally, the classification pipeline and the overall learning architecture of the proposed STAG-Net framework are presented to ensure clarity of the methodology (see Figure 1).
3.1. Data
We used the Gait-IT dataset [23], which is accessible upon request. This dataset contains simulations of five gait types: Normal (healthy gait), Scissor gait (simulating diplegia), Spastic gait (simulating hemiplegia), Steppage gait (simulating neuropathy), and Propulsive gait (simulating PD). For the four pathological gaits, two levels of severity: light and severe. The dataset was collected from 23 subjects aged years, resulting in a total of 830 gait sequences. Each subject performed four normal gait sequences and four sequences per severity level for each pathological gait, for a total of 36 sequences per subject. The dataset maintains a balanced distribution across pathological categories, which reduces potential model bias toward specific gait types or severities. However, the normal gait category exhibits class imbalance. The class distribution and corresponding sequence counts are presented in Table 1.
The dataset provides four representations of gait data: sequences of binary silhouettes, sequences of skeletal images, Gait Energy Images (GEI), and Skeleton Energy Images (SEI). In our study, we focused exclusively on the sequence of binary silhouettes, directly as ordered frame sequences, which served as the input to our model. These silhouettes were extracted from the original video using a chroma-keying segmentation process, which transforms the raw video into an ordered sequence of frames. First, the background was converted to the Hue, Saturation, and Value (HSV) colour space, and hue, saturation, and value histograms were used to define the background’s specific colour range. Secondly, each frame of the gait sequence was compared to the background, and pixels outside the background range were marked as the human silhouette, resulting in a binary image in which silhouette pixels are represented by one value (e.g., 1) and background pixels by another (e.g., 0). Finally, morphological filtering was applied to remove noise and ensure clean silhouette boundaries. All resulting binary silhouette images were resized to pixels. We chose this representation because binary silhouettes preserve essential gait shape and motion information while removing irrelevant visual details such as background, clothing texture, or illumination variations. This makes them particularly suitable for sequence-based analysis, as the model can focus on learning temporal dynamics and changes in body shape across frames without being distracted by noise or appearance-related factors. Additionally, silhouettes provide a consistent and robust representation across subjects, thereby improving the reliability of temporal feature extraction in gait modelling. These silhouette representations are shown in Figure 2.
3.2. CNN for Spatial Feature Extraction
CNNs are highly effective for the extraction of spatial features because they automatically learn hierarchical patterns directly from raw images [36]. Their convolutional and pooling layers efficiently capture complex spatial structures, making them particularly suitable for tasks such as human activity recognition and gait analysis, where rich spatial information is essential. We conducted experiments with state-of-the-art CNN architectures: GhostNet [37] and EfficientNetV2S (ENV2S) [38].
GhostNet is a lightweight CNN that improves computational efficiency by generating additional feature maps using inexpensive linear operations instead of relying only on standard convolutions. Its Ghost modules and Ghost bottlenecks reduce the number of parameters and computational cost while maintaining strong feature extraction capability.
ENV2S benefits from a compound scaling strategy that jointly optimises network depth, width, and input resolution, enabling the extraction of rich visual representations with fewer computational resources than conventional CNN architectures. This combination of superior accuracy, efficient feature learning, and reduced training cost made ENV2S the most suitable backbone for our framework.
In our setup, we removed the network’s original classification head to adapt the ImageNet-pretrained model to our specific problem and classes, thereby enabling effective fine-tuning for our task. The CNN backbone was kept frozen during training. Since the pretrained model was initially designed for three-channel RGB images, we modified the input layer to accept single-channel (binary) silhouette images, which is the form of our dataset. This modification was achieved by applying weight averaging across the original RGB input channels to initialise the single-channel convolutional weights. Given the binary nature of the silhouette inputs, no normalisation was applied. This adjustment ensures the network can correctly process silhouette inputs while using the pretrained feature extraction capabilities of the original model. The spatial feature extraction module outputs a high-dimensional feature vector for each input silhouette frame, capturing hierarchical spatial patterns, including edges, textures, and shapes. These embeddings provide a compact and informative representation of the raw images, which are then fed to the temporal modelling module.
3.3. Temporal Feature Extraction
To effectively model the dynamic, sequential nature of human movement, the high-dimensional spatial features extracted from the silhouettes are processed by a temporal modelling module. We experimented with three increasingly complex architectures to capture temporal dependencies: LSTM, BiLSTM, and STAG-Net.
3.3.1. Long Short-Term Memory
LSTM [39] is a type of RNN designed to model long-term temporal dependencies and overcome the vanishing gradient. It incorporates memory cells and three control gates (input, forget, and output) that regulate how information is stored, updated, and retrieved over time. By dynamically managing the flow of information through these gates, the LSTM can effectively retain relevant temporal features while discarding redundant data. In the initial experiment, an LSTM was used to capture the sequential dependencies between frame-level features. The LSTM consisted of 3 stacked recurrent layers with a hidden size of 256. The hidden state of the last LSTM unit was passed to a fully connected layer followed by a softmax activation to produce the final class probabilities.
3.3.2. Bidirectional Long Short-Term Memory
A BiLSTM [40] extends the standard LSTM by processing a sequence in two directions—forward and backwards. While a regular LSTM can only use information from previous frames, this may not always provide enough context for accurate sequence analysis. By incorporating information from both past and future frames, a BiLSTM offers a more complete understanding of the entire sequence. In a second configuration, the unidirectional LSTM was replaced with a BiLSTM to allow the model to learn temporal dependencies in both directions. This bidirectional processing is particularly useful for capturing symmetrical or cyclic patterns within the sequence, such as those commonly observed in repetitive or structured movements. The BiLSTM consists of 3 stacked recurrent layers with a hidden size of 256. The hidden states generated by the forward and backward passes were concatenated and used for final classification.
3.3.3. Spatial-Temporal Attention-Guided Network
In the final and most effective configuration, STAG-Net, a score-based temporal attention mechanism was incorporated atop the BiLSTM output to dynamically weight each temporal feature. This mechanism computes per-frame alignment scores by applying a single linear projection to the BiLSTM hidden state, followed by softmax normalisation to obtain attention weights and produce a context vector for the final classification. This mechanism enables the model to focus on the most discriminative frames (e.g., key gait phases) during decision-making, thereby improving overall performance.
The score-based temporal attention mechanism dynamically weights each frame’s feature vector. Given the sequence of hidden states output by the BiLSTM, where T is the sequence length, the attention process works as follows. First, an unnormalized attention score is computed for each hidden state by applying a linear transformation using the learnable weight matrix :
Next, these scores are normalised throughout the sequence using the Softmax function to obtain the attention weights , ensuring that they sum up to one:
The final context vector is then computed as the weighted sum of the BiLSTM hidden states, where the attention weights determine the contribution of each frame:
Finally, the context vector , which contains the temporally aggregated and weighted features, is passed to a fully connected layer with weights and bias , followed by a Softmax activation to produce the final class probability vector y:
Due to its superior ability to highlight critical temporal information, this configuration constitutes the core of the proposed STAG-Net framework.
3.4. Classification
After spatial and temporal modelling, the resulting sequence representation is fed into a fully connected classification head comprising two linear layers. The first layer reduces the feature dimensionality from 512 to 128 with a ReLU activation, while the second layer maps the features to 5 output classes corresponding to the 5 defined gait types. These logits are optimised using a softmax-based cross-entropy loss during training and are used to obtain the predicted gait class at inference.
4. Experimental Setup
This section details the experimental hyperparameters and settings of the proposed STAG-Net framework for gait classification. The methodology is designed to extract robust spatio-temporal features by integrating convolutional and recurrent neural networks, thereby capturing the spatial form and temporal dynamics of gait from video data to increase classification accuracy and generalisation. Each input sequence was represented as a 32-frame clip, obtained through uniform sampling to ensure consistent temporal coverage of the entire walking cycle across all subjects and conditions. Using 32 frames provides sufficient temporal resolution to capture gait-specific patterns and key transitional movements, while also offering an effective compromise between computational cost and training time. The method first checks whether the sequence has fewer frames than required; if so, it applies loop padding, repeating frames until the desired length is reached. For longer sequences, the module performs uniform sampling by dividing the sequence into equal intervals and selecting one frame per interval. To improve generalisation, we applied horizontal flipping with a 50% probability as a data augmentation technique. To ensure robust evaluation and reduce overfitting, a 5-fold cross-validation strategy was employed, with a subject-wise data split to prevent identity leakage between the training and validation sets. In each fold, 80% of the subjects were used for training and 20% for validation. For training, we used the PyTorch framework and optimised the models with the Adam optimiser, setting an initial learning rate of and a weight decay of . The model was trained with a batch size of 16 for up to 100 epochs, using early stopping based on validation accuracy with a patience of 10 epochs. The cross-entropy loss function was used to minimise the classification error. Additionally, a learning rate scheduler was integrated into the training process to automatically reduce the learning rate whenever the validation performance stopped improving. The same experimental setting is adopted for all the tested models and configurations. To evaluate the model’s performance, we computed accuracy, precision, recall, and F1-score. Accuracy reflects the proportion of correctly classified instances out of the total number of instances. Precision measures the proportion of true positive predictions among all predicted positives, indicating the model’s ability to limit false positives. Recall, also known as the true positive rate, quantifies the proportion of actual positives correctly detected, highlighting the model’s ability to minimise false negatives. The F1-score, defined as the harmonic mean of precision and recall, provides a balanced metric that is particularly valuable when class distributions are uneven.
5. Results and Discussion
5.1. STAG-Net Performance and Ablation Study
The proposed STAG-Net and the selected gait-type classification models for ablation are evaluated using a 5-fold cross-validation protocol on the GAIT-IT dataset. This section presents and discusses the results obtained under this evaluation setup, highlighting the main observations derived from our experiments. The quantitative results demonstrate that the model’s overall effectiveness and predictive power improve progressively with each architectural upgrade, from LSTM to bidirectional processing and to attention mechanisms. Table 2 shows the results obtained from each model. Specifically, GhostNet did not show performance improvement from one configuration to another, whereas the ENV2S-BiLSTM model demonstrated a notable improvement, reaching 94.09% accuracy compared to the ENV2S-LSTM model’s 91.32%. This is because Bi-LSTMs can extract contextual features more effectively than unidirectional LSTMs, thereby improving performance. Further analysis revealed that STAG-Net, thanks to the integration of an attention mechanism into the ENV2S-BiLSTM framework, significantly improved the model’s ability to prioritise salient features, thus increasing accuracy to 96.62%.
The confusion matrix of the STAG-Net framework, as represented in Figure 3, provides a thorough evaluation of its gait classification performance. The strong diagonal pattern observed in the matrix indicates that most gait samples were correctly identified, demonstrating the model’s high discriminative power. A limited number of misclassifications were observed, primarily between gait patterns that differ in temporal or spatial dynamics, particularly between diplegia and Parkinson-associated gaits: 11 of the 184 Diplegic samples were classified as PD, and 6 of the 184 Parkinson samples were predicted as Diplegic. A minor source of confusion exists between Hemiplegic and Diplegic, as 5 Hemiplegic samples were classified as Diplegic. This outcome highlights the effectiveness of the attention mechanism in enabling the model to discern the most salient features in a gait sequence, thereby improving its ability to distinguish minor movement patterns critical to both clinical diagnostics and biometric identification. By assigning varying importance to different temporal segments, the network can capture long-range dependencies while selectively emphasising the most informative parts of the gait sequence for classification. This targeted focus not only improves predictive accuracy but also offers a more detailed insight into which specific phases of the gait cycle are most indicative of particular conditions or individual identities. Additionally, the high recall values obtained across all gait categories confirm that the model performs robustly and maintains balanced accuracy. In general, the confusion matrix indicates that integrating attention into the ENV2S–BiLSTM configuration significantly improves both precision and reliability in gait classification.
5.2. Comparison with Existing Models
We evaluate the proposed architecture by comparing its classification accuracy with established models, as presented in Table 3. All baseline metrics are pulled directly from [41] to ensure a standardised comparison using the same dataset. We did not reproduce these baseline experiments because the original publications omit critical implementation details, such as data splits, hyperparameter configurations, and training protocols, which prevent exact replication.
A fundamental methodological difference exists in data representation. The baseline architectures process static silhouette frames as independent samples, omitting temporal relationships. In contrast, our approach, STAG-Net, processes chronological sequences of silhouette frames to capture temporal dynamics. Our method achieves a competitive accuracy of 96.62%. Although purely spatial frameworks, such as CBAM, GhostNet, and CRA-Net, report higher nominal accuracies on this dataset, they do not model the sequential, time-dependent dynamics inherent to human locomotion. Since gait is a spatio-temporal process, models relying on isolated frames risk high dataset dependency and poor generalisation to unseen subjects. STAG-Net, with its BiLSTM + ENV2S + Attention pipeline, jointly models spatial features and temporal dependencies, improving robustness against inter-subject variations and data scarcity, which are common constraints in clinical deployment. This sequence-based formulation also provides a foundation for interpretability and explainability that static networks lack.
5.3. Model Evaluation Using GAIT-IST Dataset
A second set of evaluations is conducted by training STAG-Net on the GAIT-IT dataset and then testing the gait-type classification systems on all available subjects from the GAIT-IST dataset [42], which comprises 10 subjects and 360 gait sequences. It includes the same four pathologies as the Gat-IT dataset, each represented at two severity levels. In addition, it accounts for two walking directions and two repetitions per subject, except for the normal gait class. It should be noted that the GAIT-IST dataset acquisition setup is significantly different from that of GAIT-IT, with acquisition performed using a cell phone camera under a ceiling light at a resolution of pixels. This separation helps prevent overfitting, and by evaluating on a distinct test set, we obtain a more objective measure of the model’s ability to generalise, ensuring that its predictions remain accurate and robust when applied to new data. Table 4 reports the classification results obtained, and the best configuration is STAG-Net with accuracy. The consistent performance across models on an unseen dataset indicates good generalisation ability of the learned spatiotemporal representations.
5.4. Result Interpretability and Analysis
To examine STAG-Net interpretability, we computed the mean and standard deviation of temporal attention weights across all validation folds. Weights were extracted for each of the 32 sampled frames and averaged across subjects, as shown in Figure 4.
The resulting attention distribution exhibits a consistent pattern: the model assigns greater weight to central frames. Lower attention is observed at sequence boundaries, where transitional movements typically provide less discriminative information. This pattern offers meaningful insight into the model’s reasoning. The model’s focus on mid-gait frames, where distinctive leg mechanics are most apparent, suggests it has learned to prioritise biomechanically relevant segments rather than potentially noisy features, such as background elements or boundary artefacts. The low standard deviation observed in the central attention region further strengthens this interpretation. This consistency across subjects demonstrates that the model applies stable, repeatable decision logic, suggesting it has identified generalizable temporal features rather than subject-specific patterns. This reliability is essential for potential deployment in assistive diagnostic contexts, where consistent model behaviour across diverse patient populations is paramount.
6. Conclusions
This work presented STAG-Net, a unified spatio-temporal framework for automated gait classification that combines spatial representation, temporal modelling, and selective temporal weighting within a single learning pipeline. By integrating convolutional feature extraction with bidirectional sequence modelling and a temporal attention mechanism, the proposed approach captures the structural form of gait.
This design is particularly well-suited for pathological gait analysis, where clinically relevant differences often become apparent. Experiments conducted on the GAIT-IT dataset demonstrate that Bidirectional temporal modelling with score-based temporal attention improves the representation of cyclic and symmetric motion patterns, further refining the discrimination of the most informative frames of the gait sequence.
The resulting model achieves strong, balanced performance across all gait types and severity levels, even in the presence of high intra-class similarity. The analysis of attention weights provides insight into which part of the gait drives classification decisions. From a broader perspective, these findings reinforce the importance of jointly modelling space, time, and relevance in automated movement analysis. The use of binary silhouettes enables robust learning while remaining agnostic to appearance-related factors, supporting scalability and deployment in real-world settings.
While the present study demonstrates both the feasibility and potential of the proposed framework, several limitations should be acknowledged. First, the evaluation was limited to small, homogeneous cohorts obtained under controlled laboratory conditions, which may limit generalizability to broader clinical populations and real-world settings. Second, the current implementation relies primarily on a single data modality, which may reduce robustness to occlusions, sensor noise, or incomplete observations, as frequently encountered in practical applications.
These limitations motivate several directions for future research. Subsequent studies will prioritise large-scale validation using more diverse patient cohorts, including data collected outside controlled environments, to rigorously assess external validity and clinical applicability. In addition, the framework will be expanded to include multimodal inputs, such as skeletal kinematics and wearable inertial sensor streams, thereby enhancing robustness, expanding the feature space, and improving clinical utility. These efforts aim to develop accessible, objective, and interpretable gait assessment tools to support diagnosis, longitudinal monitoring, and personalised rehabilitation planning for individuals with neurological and motor disorders.
Conflicts of Interest
Declare conflicts of interest or state “The authors declare no conflicts of interest.” Authors must identify and declare any personal circumstances or interests that may be perceived as inappropriately influencing the representation or interpretation of reported research results. Any role of the funders in the design of the study; in the collection, analyses or interpretation of data; in the writing of the manuscript; or in the decision to publish the results must be declared in this section. If there is no role, please state “The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results”.
References
- Whittle, M.W. Gait analysis: an introduction; Butterworth-Heinemann, 2014.
- Buckley, C.; Alcock, L.; McArdle, R.; Rehman, R.Z.U.; Del Din, S.; Mazzà, C.; Yarnall, A.J.; Rochester, L. The role of movement analysis in diagnosing and monitoring neurodegenerative conditions: insights from gait and postural control. Brain sciences 2019, 9, 34. [CrossRef]
- Cicirelli, G.; Impedovo, D.; Dentamaro, V.; Marani, R.; Pirlo, G.; D’Orazio, T.R. Human gait analysis in neurodegenerative diseases: A review. IEEE journal of biomedical and health informatics 2021, 26, 229–242. [CrossRef]
- Armand, S.; Decoulon, G.; Bonnefoy-Mazure, A. Gait analysis in children with cerebral palsy. EFORT open reviews 2016, 1, 448–460. [CrossRef]
- Kaur, R.; Motl, R.W.; Sowers, R.B.; Hernandez, M.E. A Vision-Based Framework for Predicting Multiple Sclerosis and Parkinson’s Disease Gait Dysfunctions—A Deep Learning Approach. IEEE Journal of Biomedical and Health Informatics 2022, 27, 190–201. [CrossRef]
- Albuquerque, P.; Verlekar, T.T.; Correia, P.L.; Soares, L.D. A Spatiotemporal Deep Learning Approach for Automatic Pathological Gait Classification. Sensors 2021, 21. [CrossRef]
- Khan, M.A.; Kadry, S.; Parwekar, P.; Damaševičius, R.; Mehmood, A.; Khan, J.A.; Naqvi, S.R. Human gait analysis for osteoarthritis prediction: a framework of deep learning and kernel extreme learning machine. Complex & Intelligent Systems 2023, 9, 2665–2683. [CrossRef]
- Prasanth, H.; Caban, M.; Keller, U.; Courtine, G.; Ijspeert, A.; Vallery, H.; von Zitzewitz, J. Wearable Sensor-Based Real-Time Gait Detection: A Systematic Review. Sensors 2021, 21. [CrossRef]
- Monica, K.M.; Parvathi, R. Efficient Gait Analysis Using Deep Learning Techniques. Computers, Materials and Continua 2022, 74, 6229–6249. [CrossRef]
- Lee, L.; Grimson, W.E.L. Gait analysis for recognition and classification. In Proceedings of the Proceedings of Fifth IEEE International Conference on Automatic Face Gesture Recognition. IEEE, 2002, pp. 155–162.
- Schmid, A.; Duncan, P.W.; Studenski, S.; Lai, S.M.; Richards, L.; Perera, S.; Wu, S.S. Improvements in speed-based gait classifications are meaningful. Stroke 2007, 38, 2096–2100. [CrossRef]
- Pace, C.D.; De Nunzio, A.M.; De Stefrano, C.; Fontanella, F.; Molinara, M. Markerless Machine Learning Approach for Gait Classification in Knee Osteoarthritis. In Proceedings of the International Conference on Pattern Recognition. Springer, 2024, pp. 116–128.
- Pace, C.D.; De Nunzio, A.M.; De Stefano, C.; Fontanella, F.; Molinara, M. Poseidon: A ViT-based Architecture for Multi-Frame Pose Estimation with Adaptive Frame Weighting and Multi-Scale Feature Fusion. arXiv preprint arXiv:2501.08446 2025.
- Zhou, C.; Feng, D.; Chen, S.; Ban, N.; Pan, J. Portable vision-based gait assessment for post-stroke rehabilitation using an attention-based lightweight CNN. Expert Systems with Applications 2024, 238, 122074. [CrossRef]
- Prisco, G.; Pirozzi, M.A.; Santone, A.; Esposito, F.; Cesarelli, M.; Amato, F.; Donisi, L. Validity of wearable inertial sensors for gait analysis: a systematic review. Diagnostics 2024, 15, 36. [CrossRef]
- Vun, D.S.Y.; Bowers, R.; McGarry, A. Vision-based motion capture for the gait analysis of neurodegenerative diseases: A review. Gait & posture 2024, 112, 95–107. [CrossRef]
- Das, R.; Paul, S.; Mourya, G.K.; Kumar, N.; Hussain, M. Recent trends and practices toward assessment and rehabilitation of neurodegenerative disorders: Insights from human gait. Frontiers in Neuroscience 2022, 16, 859298. [CrossRef]
- Dentamaro, V.; Impedovo, D.; Pirlo, G. Gait analysis for early neurodegenerative diseases classification through the kinematic theory of rapid human movements. IEEE Access 2020, 8, 193966–193980. [CrossRef]
- Pace, C.D.; De Nunzio, A.M.; De Stefano, C.; Fontanella, F.; Molinara, M. Markerless Gait Analysis for Parkinson’s disease diagnosis: A study on machine learning integration and features explainability. Engineering Applications of Artificial Intelligence 2025, 161, 112031. [CrossRef]
- Song, C.; Huang, Y.; Wang, W.; Wang, L. CASIA-E: A large comprehensive dataset for gait recognition. IEEE transactions on pattern analysis and machine intelligence 2022, 45, 2801–2815. [CrossRef]
- Iwama, H.; Okumura, M.; Makihara, Y.; Yagi, Y. The OU-ISIR gait database comprising the large population dataset and performance evaluation of gait recognition. IEEE Transactions on Information Forensics and Security 2012, 7, 1511–1521. [CrossRef]
- Hofmann, M.; Geiger, J.; Bachmann, S.; Schuller, B.; Rigoll, G. The TUM Gait from Audio, Image and Depth (GAID) database: Multimodal recognition of subjects and traits. Journal of Visual Communication and Image Representation 2014, 25, 195–206. [CrossRef]
- Albuquerque, P.; Machado, J.P.; Verlekar, T.T.; Correia, P.L.; Soares, L.D. Remote gait type classification system using markerless 2d video. Diagnostics 2021, 11, 1824. [CrossRef]
- Sadeghzadehyazdi, N.; Batabyal, T.; Acton, S.T. Modeling spatiotemporal patterns of gait anomaly with a CNN-LSTM deep neural network. Expert Systems with Applications 2021, 185, 115582. [CrossRef]
- Min, F.; Guo, S.; Fan, H.; Dong, J. GaitMA: Pose-guided Multi-modal Feature Fusion for Gait Recognition. In Proceedings of the 2024 IEEE International Conference on Multimedia and Expo (ICME). IEEE, 2024, pp. 1–6.
- Munusamy, V.; Senthilkumar, S. Emerging trends in gait recognition based on deep learning: a survey. PeerJ Computer Science 2024, 10, e2158. [CrossRef]
- Tran, L.; Hoang, T.; Nguyen, T.; Kim, H.; Choi, D. Multi-model long short-term memory network for gait recognition using window-based data segment. IEEE Access 2021, 9, 23826–23839. [CrossRef]
- Khokhlova, M.; Migniot, C.; Morozov, A.; Sushkova, O.; Dipanda, A. Normal and pathological gait classification LSTM model. Artificial intelligence in medicine 2019, 94, 54–66.
- Ghojogh, B.; Ghodsi, A. Recurrent neural networks and long short-term memory networks: Tutorial and survey. arXiv preprint arXiv:2304.11461 2023. [CrossRef]
- Bian, Q.; Wang, W.; Duan, J.; Ding, Z. TFNet: A Temporal-Frequency Domain Model for Gait Biomechanical Signal Prediction. IEEE Journal of Biomedical and Health Informatics 2025, 29, 7080–7089. [CrossRef]
- Zeng, Q.; Shang, L. GaitCycFormer: Leveraging Gait Cycles and Transformers for Gait Emotion Recognition. In Proceedings of the Proceedings of the AAAI Conference on Artificial Intelligence, 2025, Vol. 39, pp. 9815–9823. [CrossRef]
- Li, J.; Liang, W.; Yin, X.; Li, J.; Guan, W. Multimodal gait abnormality recognition using a convolutional neural network bidirectional long short-term memory (CNN-BiLSTM) network based on multi-sensor data fusion. Sensors 2023, 23, 9101. [CrossRef]
- Lee, Y.; Shin, D.; Ji, Y.; Jang, H.; Han, C.; Lee, Y. Linearized Gait Phase Estimation Using BiLSTM. In Proceedings of the 2025 International Conference on Electronics, Information, and Communication (ICEIC). IEEE, 2025, pp. 1–4.
- Yhdego, H.; Li, J.; Paolini, C.; Audette, M. Wearable sensor gait analysis of fall detection using attention network. In Proceedings of the 2021 IEEE International Conference on Bioinformatics and Biomedicine (BIBM). IEEE, 2021, pp. 3137–3141.
- Zou, R.; Wang, C.; Zhang, Y.; Ma, R. Elderly Fall Risk Assessment Based on Kalman Filter and CNN-LSTM-Attention Model. In Proceedings of the 2025 40th Youth Academic Annual Conference of Chinese Association of Automation (YAC). IEEE, 2025, pp. 3042–3047.
- Nandakumar, V.; Tagade, A.; Liu, T. Why do CNNs excel at feature extraction? A mathematical explanation 2023. [arXiv:cs.CV/2307.00919].
- Han, K.; Wang, Y.; Tian, Q.; Guo, J.; Xu, C.; Xu, C. GhostNet: More Features from Cheap Operations, 2020, [arXiv:cs.CV/1911.11907].
- Tan, M.; Le, Q. Efficientnetv2: Smaller models and faster training. In Proceedings of the International conference on machine learning. PMLR, 2021, pp. 10096–10106.
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Computation 1997, 9, 1735–1780. [CrossRef]
- Schuster, M.; Paliwal, K. Bidirectional recurrent neural networks. IEEE Transactions on Signal Processing 1997, 45, 2673–2681. [CrossRef]
- Bodepu, D.; Junaid, M.; Madarapu, S.; Sahoo, J.; Ari, S. CRA-Net: Cross reverse attention network for classification of neuro-degenerative diseases based on gait analysis. Biomedical Signal Processing and Control 2025, 108, 107886. [CrossRef]
- Loureiro, J.; Correia, P.L. Using a Skeleton Gait Energy Image for Pathological Gait Classification. In Proceedings of the 2020 15th IEEE International Conference on Automatic Face and Gesture Recognition (FG 2020), 2020, pp. 503–507. [CrossRef]
Figure 1.
Overview of the proposed STAG-Net architecture for pathological gait classification.

Figure 2.
silhouette gait: from right to left and left to right

Figure 3.
Confusion matrix of the proposed STAG-Net framework.

Figure 4.
Mean and standard deviation of temporal attention weights across all subjects for ENV2S-BiLSTM-Attention.
Figure 4.
Mean and standard deviation of temporal attention weights across all subjects for ENV2S-BiLSTM-Attention.

Table 1.
Distribution of gait classes in the Gait-IT dataset.
| Gait class | Number of sequences |
|---|---|
| Normal | 92 |
| Diplegic (Light + Severe) | 184 |
| Hemiplegic (Light + Severe) | 184 |
| Neuropathic (Light + Severe) | 186 |
| Parkinsonian (Light + Severe) | 184 |
Table 2.
Performance comparison of gait classification models.
| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| (%) | (%) | (%) | (%) | |
| GhostNet-LSTM | 90.30 | 91.09 | 91.11 | 91.08 |
| GhostNet-BiLSTM | 90.60 | 91.17 | 91.10 | 91.06 |
| GhostNet-BiLSTM-Attention | 90.84 | 91.74 | 91.76 | 91.63 |
| ENV2S-LSTM | 90.96 | 90.08 | 89.69 | 89.87 |
| ENV2S-BiLSTM | 94.81 | 95.15 | 95.22 | 95.12 |
| STAG-Net | 96.62 | 96.66 | 96.96 | 96.80 |
Table 3.
Performance comparison of gait classification models.
| Model | Accuracy (%) |
|---|---|
| VGG16 | 91.89 |
| VGG19 | 90.47 |
| GC-Net | 90.37 |
| NLN-Net | 97.52 |
| SE-Net | 97.67 |
| CBAM | 98.64 |
| GhostNet | 98.82 |
| CRA-Net | 99.16 |
| STAG-Net | 96.62 |
Table 4.
Results obtained using GAIT-IT for training and GAIT-IST for testing.
| Model | Accuracy | Precision | Recall | F1-Score |
|---|---|---|---|---|
| (%) | (%) | (%) | (%) | |
| GhostNet-LSTM | 76.11 | 79.43 | 77.50 | 75.93 |
| GhostNet-BiLSTM | 77.78 | 80.92 | 79.00 | 79.10 |
| GhostNet-BiLSTM-Attention | 79.16 | 81.24 | 80.24 | 80.31 |
| ENV2S-LSTM | 83.33 | 83.62 | 85.00 | 83.07 |
| ENV2S-BiLSTM | 75.56 | 80.17 | 76.75 | 77.44 |
| STAG-Net | 87.50 | 89.32 | 88.25 | 88.08 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2026 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.