Abstract
Background: Home-based fitness training requires automated systems for exercise quality assessment and real-time posture correction without professional supervision. Purpose: We develop an AI-powered virtual fitness system using spatiotemporal skeleton analysis for automatic exercise quality assessment. Methods: We propose Anatomical-Prior Sparse Attention (APSA), integrating biomechanical constraints into graph neural networks. APSA hierarchically models spatial and temporal dependencies through anatomically-informed attention, focusing on kinematically meaningful joint interactions while pruning implausible connections. The system processes 3D skeletal keypoints from standard RGB cameras. Results: Evaluation on two public datasets (IntelliRehabDS and Kimore) shows APSA achieves 76.9% accuracy in quality classification and 0.789 F1-score in error detection, outperforming recent 2024 methods by 1.1–8.5 percentage points while maintaining real-time performance (8.2 ms per sequence). The system identifies common errors including knee valgus (84.3% accuracy) and excessive trunk lean. Conclusions: The biomechanically-informed attention mechanism enhances accuracy and interpretability, enabling scalable deployment in home-based training and remote rehabilitation.
Keywords: Virtual fitness system, Exercise quality assessment, Posture correction, Skeleton-based deep learning, Graph neural networks, Attention mechanism, Biomechanical constraints, Real-time feedback
Subject terms: Computational biology and bioinformatics, Engineering, Health care, Mathematics and computing
Introduction
The global fitness industry has witnessed a paradigm shift toward home-based training, driven by convenience, cost-effectiveness, and recent public health concerns. However, exercising without professional supervision poses significant risks of musculoskeletal injuries due to improper form1. While traditional in-person training with certified instructors ensures correct posture and movement patterns, such services remain expensive (averaging $50–100 per session) and geographically limited, creating a substantial accessibility gap. The COVID-19 pandemic has amplified this challenge, with home-based fitness participation increasing by over 200% while access to professional trainers became severely restricted. This has created an urgent demand for AI-powered virtual fitness systems that can replicate the assessment and corrective guidance functions of human trainers, enabling safe and effective home-based exercise training at scale.
Recent advances in computer vision and deep learning have made skeleton-based human motion analysis increasingly viable for exercise assessment applications. By extracting 3D joint positions from video streams, these systems can analyze movement patterns without requiring specialized motion capture equipment. The key challenge lies in modeling the spatiotemporal dependencies between skeletal joints to identify subtle form errors that distinguish proper from improper technique. While attention mechanisms have shown promise in capturing these dependencies2, existing approaches often rely on fully connected graphs or heuristic sparsification, leading to computational inefficiency or loss of clinically meaningful motion patterns.
Graph neural networks (GNNs) have emerged as a powerful tool for skeleton-based motion modeling by explicitly representing joints as nodes and their interactions as edges3. However, most existing methods treat all joint pairs equally, ignoring the anatomical constraints that govern human movement. This limitation manifests in two critical ways: computational inefficiency from processing irrelevant joint connections (e.g., left wrist to right ankle), and difficulty in providing interpretable feedback since learned features lack clear biomechanical meaning. For exercise assessment applications, interpretability is particularly crucial—users need to understand which specific joints deviate from correct form and how to adjust their posture accordingly. Prior works in medical imaging and biomechanics have demonstrated that incorporating anatomical priors can enhance both model performance and interpretability4,5, yet such domain knowledge remains underutilized in skeleton-based deep learning for fitness applications.
This paper presents a spatiotemporal skeleton-based deep learning framework specifically designed for automatic exercise quality assessment and real-time posture correction. Our approach integrates biomechanical knowledge into a graph neural network through an Anatomical-Prior Sparse Attention (APSA) mechanism that selectively focuses on kinematically relevant joint interactions. Unlike existing methods that either compute dense attention over all joint pairs6 or apply arbitrary sparsification, APSA leverages anatomical constraints to preserve functionally coupled joints (e.g., shoulder-elbow-wrist chains) while pruning irrelevant connections (e.g., between contralateral wrist and ankle). This principled sparsification not only reduces computational cost for real-time deployment but also produces interpretable attention maps that directly correspond to biomechanical concepts familiar to trainers and physiotherapists.
The main contributions of this work are as follows.
First, we develop an AI-powered virtual fitness system integrating spatiotemporal deep learning for automatic exercise quality assessment and real-time posture correction. Unlike existing commercial fitness apps that rely on simple rule-based heuristics, our system employs biomechanically-informed deep learning to replicate expert trainer judgment and requires only standard RGB cameras (e.g., smartphone or webcam), making it accessible for home users without specialized equipment.
Second, we propose a novel Anatomical-Prior Sparse Attention (APSA) mechanism that encodes biomechanical joint coupling constraints derived from kinematic principles. APSA guides the network to focus on clinically meaningful interactions (e.g., hip-knee-ankle coordination during squats) while pruning physiologically implausible connections, reducing computational complexity by 2.9
compared to dense attention while improving accuracy by 3.1%. Unlike prior work that encodes biomechanical knowledge as fixed graph edges or static adjacency rules7, APSA integrates anatomical priors as a dynamic attention mask jointly optimized with task-specific learned features—enabling context-sensitive, frame-level selection of clinically relevant joint interactions that neither static-rule methods nor data-driven topology methods such as BlockGCN or SkateFormer can provide.
Third, we introduce a hierarchical attention architecture that decomposes motion analysis into intra-frame spatial modeling and inter-frame temporal modeling. This design enables the system to capture both instantaneous posture errors (e.g., knee valgus at the bottom of a squat) and dynamic movement quality across exercise phases (e.g., descent-ascent coordination).
Fourth, we conduct comprehensive experiments on two public exercise datasets covering multiple exercise types. Our method achieves superior performance (76.9% quality assessment accuracy, 0.789 average error detection F1-score) compared to representative skeleton-based methods including recent 2024 advances, while maintaining real-time inference speed (8.2 ms per sequence, enabling >100 FPS throughput) suitable for interactive virtual coaching applications.
Finally, we demonstrate practical deployment considerations through cross-dataset generalization experiments and per-exercise-type performance analysis, showing that the system generalizes to new users and exercise variations with minimal fine-tuning, supporting scalable real-world deployment.
The remainder of this paper is organized as follows: Section “Related Work” reviews related work in skeleton-based motion modeling, attention mechanisms, and biomechanical priors in deep learning. Section "Biomechanical Priors for Skeleton Graphs" formalizes the anatomical constraints and biomechanical principles underlying our approach. Section "Anatomy-Driven Sparse Attention for Skeleton Sequences" details the proposed APSA architecture and its integration with ST-GCN. Section “Experiments” presents comprehensive experimental results on two exercise assessment benchmarks, including ablation studies and attention pattern analysis. Section "Discussion and Future Work" discusses the practical implications, limitations, and potential extensions of our method. Finally, Section “Conclusion” concludes the paper with key findings and future research directions.
Related work
Skeleton-based motion analysis
Skeleton-based motion analysis has evolved from recurrent neural networks8 to graph convolutional networks (GCNs)3, which explicitly represent skeletal structures as graphs with joints as nodes and anatomical connections as edges. ST-GCN pioneered spatiotemporal graph convolutions by partitioning the adjacency matrix based on physical connectivity, achieving strong performance in action recognition. Subsequent works enhanced this foundation through channel-wise topology refinement (CTR-GCN9) and learnable adjacency matrices. MotionBERT10 introduced a unified perspective on learning human motion representations by treating diverse motion analysis tasks under a single pretraining-finetuning framework, demonstrating that large-scale pretraining enhances downstream performance. Recent advances include BlockGCN11, which addresses topology decay in learned adjacency matrices through persistent homology analysis and efficient graph convolution refinement, achieving state-of-the-art results on large-scale benchmarks. However, these methods typically lack explicit biomechanical constraints tailored for exercise assessment, potentially including irrelevant joint connections while missing functionally important interactions. Notably, BlockGCN11, while advancing topology awareness through persistent homology, optimizes for action recognition benchmarks rather than interpretable exercise assessment, and lacks the anatomical prior constraints critical for clinically meaningful feedback generation. Specifically, its topology refinement mechanism captures global graph-connectivity patterns but cannot selectively model functionally coupled kinematic chains (e.g., hip–knee–ankle), nor enforce range-of-motion constraints to suppress physiologically implausible joint configurations—both capabilities essential for generating per-joint corrective feedback in exercise assessment.
Attention mechanisms for human motion
Attention mechanisms have been adapted to skeleton-based learning to capture long-range spatiotemporal dependencies. Transformer architectures employ self-attention over joints and frames12, enabling flexible modeling of joint interactions without fixed graph structure. Spatial-temporal transformers (ST-TR13) achieve competitive accuracy but suffer from quadratic computational complexity and limited interpretability. TranSkeleton14 proposes a hierarchical spatial-temporal transformer that decomposes motion into multi-scale representations, capturing both local joint movements and global body dynamics through progressive feature aggregation. Recent methods like SkateFormer15 introduce partition-specific attention to improve efficiency by selectively attending to physically neighboring versus distant joints and temporal frames. However, these approaches rely on data-driven attention patterns or heuristic sparsification rather than domain-specific biomechanical knowledge, missing opportunities to leverage anatomical priors for exercise assessment tasks where kinematic plausibility is crucial. SkateFormer15, while improving efficiency through partition-specific attention, applies heuristic spatial partitioning that does not encode biomechanical knowledge, limiting its applicability to exercise assessment tasks where kinematic plausibility and interpretability are required. Its fixed partition boundaries are defined by graph distance rather than anatomical joint function, meaning the model cannot dynamically adapt attention to clinically significant phase transitions (e.g., the descent-to-ascent transition in squats) nor produce attention maps corresponding to recognized exercise errors such as knee valgus—capabilities explicitly supported by APSA’s anatomical masking and clinical phase-aware temporal attention.
Biomechanical priors in deep learning
Integrating domain knowledge into deep learning has shown promise in medical applications. Anatomical priors guide segmentation tasks in medical imaging4, where spatial relationships between organs inform network architecture. In skeleton-based learning, kinematic chains have been used to constrain graph connectivity7, and musculoskeletal modeling provides joint dynamics for pose estimation16. However, these approaches typically treat biomechanical knowledge as static structural rules rather than adaptive attention mechanisms, limiting their ability to focus on task-relevant interactions dynamically.
Exercise quality assessment
Automated exercise assessment has traditionally relied on rule-based heuristics or simple pose similarity metrics, lacking the flexibility to generalize across users and exercise variations17. Early approaches focused on online quality assessment from skeleton data using hand-crafted features17, while recent deep learning methods apply action recognition techniques to exercise videos but often struggle with interpretability required for providing corrective feedback. A-MAL18 introduced automatic movement assessment learning from properly performed movements, demonstrating the potential of learning-based approaches for rehabilitation assessment. Comprehensive benchmarks have been established for skeleton-based human motion rehabilitation assessment19, highlighting the distinction between action recognition and quality assessment tasks. While skeleton-based methods show promise, most existing works focus on exercise classification rather than fine-grained quality assessment and error detection. The need for real-time performance, interpretable feedback, and generalization to diverse body types remains inadequately addressed.
APSA addresses these limitations by dynamically adjusting attention using anatomical priors while maintaining computational efficiency. Unlike heuristic sparsification2, APSA’s edge pruning follows kinematic plausibility. Unlike transformers12, APSA produces interpretable attention maps highlighting clinically meaningful joints, combining efficiency, interpretability, and biomechanical grounding.
Biomechanical priors for skeleton graphs
Human motion follows fundamental biomechanical principles that govern joint interactions and movement patterns. These principles provide valuable structural constraints for modeling skeleton graphs, particularly in exercise assessment where kinematic accuracy is crucial. Unlike arbitrary graph structures, the human musculoskeletal system exhibits specific connectivity patterns that influence how forces propagate and how joints coordinate during movement.
Proximal-distal joint coupling
The human body’s joint relationships follow a proximal-to-distal organization, where movements typically originate from core joints (e.g., hips and shoulders) and propagate outward to distal segments (e.g., hands and feet). This principle stems from the anatomical arrangement of muscles and bones, where proximal joints serve as stable bases for distal motion20. For instance, during a squat, the hip joint’s flexion directly affects knee and ankle positions through mechanical coupling, while wrist movements have minimal influence on lower-body kinematics. Such relationships can be formalized through a hierarchical adjacency matrix
where edge weights
between joints
and
reflect their anatomical proximity:
![]() |
1 |
Here,
represents the anatomical distance between joints, and
controls the decay rate of connectivity strength. This formulation ensures that biomechanically coupled joints (e.g., hip-knee) maintain stronger connections than distant pairs (e.g., wrist-ankle).
Functional joint chains
Beyond pairwise connections, the body operates through functional chains where multiple joints work in concert to produce coordinated movements. These chains are particularly evident in exercises involving multi-joint coordination, such as push-ups (shoulder-elbow-wrist) or squats and lunges (hip-knee-ankle)21,22. The kinematic chain rule can be expressed as:
![]() |
2 |
where
denotes the
-th functional chain, and
to
represent sequentially coupled joints. For example, the lower-body chain during a squat would be
. These chains provide critical pathways for force transmission and motion synchronization, making them essential for attention-based modeling.
Range-of-motion constraints
Each joint has physiological limits to its range of motion (ROM), which vary by joint type and individual flexibility. These constraints influence how joints interact dynamically during movement. For instance, the knee’s limited rotation capacity prevents certain unnatural poses that might otherwise appear in unconstrained graph models23. ROM constraints can be incorporated as soft boundaries in attention weight computation:
![]() |
3 |
Here,
is the attention weight between joints
and
at time
,
measures feature similarity,
is the relative angle between joints, and
is the biomechanically plausible maximum angle. The indicator function
suppresses attention weights for kinematically implausible configurations. In this study,
is implemented as a fixed population-level biomechanical prior, reflecting commonly referenced upper bounds for joint angles during exercise (e.g., knee flexion beyond approximately
or hip flexion beyond
are treated as implausible during standard rehabilitation movements). These values are not calibrated separately for different demographic groups; rather, the same conservative thresholds are applied across both IntelliRehabDS and Kimore populations.
Anatomy-driven sparse attention for skeleton sequences
The proposed Anatomical-Prior Sparse Attention (APSA) mechanism introduces a principled approach to modeling skeleton sequences by incorporating biomechanical constraints into the attention computation. This section presents the technical details of APSA, focusing on its spatial and temporal components, sparse attention formulation, and integration with graph convolutional networks. As shown in Fig. 1, APSA replaces conventional attention layers in ST-GCNs with anatomically constrained modules that emphasize kinematically meaningful interactions while suppressing irrelevant connections.
Fig. 1.
Integration of APSA in the ST-GCN pipeline. The architecture demonstrates how anatomical prior knowledge (kinematic chains, joint coupling, ROM constraints) is encoded into
, which guides both spatial and temporal attention mechanisms. This design focuses computational resources on biomechanically meaningful joint interactions (e.g., hip-knee-ankle coordination) while pruning irrelevant connections, enabling the model to capture both instantaneous posture errors and dynamic movement quality across temporal phases.
Biomechanical edge sparsification in skeleton graphs
The foundation of APSA lies in its ability to selectively prune edges in the skeleton graph while preserving biomechanically critical interactions. Let
denote the skeletal graph, where
represents joints and
represents their connections. Traditional approaches compute attention weights for all possible edges, leading to
complexity and noisy gradients. Instead, we define a sparse adjacency matrix
that encodes anatomical constraints:
![]() |
4 |
Here,
measures the anatomical distance between joints
and
,
is a threshold derived from biomechanical literature, and
denotes the set of functional chains (Eq. 2). The distance metric combines Euclidean joint separation with anatomical hierarchy:
![]() |
5 |
where
is the 3D position of joint
,
counts the minimum hops between joints in the skeletal tree, and
balances spatial and structural proximity. We determined hyperparameters through grid search on the IntelliRehabDS training set (first 3 folds of 5-fold CV):
and
, selecting values that maximized validation F1-score. The optimal values
(in normalized skeleton coordinates where inter-joint distances are normalized to [0,1] scale based on torso length) and
retained approximately 40% of possible edges (240 out of 600 for a 25-joint skeleton), striking a balance between computational efficiency and preserving biomechanically meaningful connections. We note that
operates on normalized skeleton coordinates (normalized by torso length), which enforces scale invariance across subjects and exercise types. Because the anatomical graph topology is shared across all exercise types—the same 25 joints with the same skeletal hierarchy—a single
value defines consistent proximal-distal coupling thresholds regardless of whether the movement is upper-body (e.g., shoulder flexion) or lower-body (e.g., squat). This formulation ensures that proximal-distal couplings (Sect. 3.1) and functional chains (Sect. 3.2) are preserved while distant or unrelated joints are pruned. The resulting sparse adjacency matrix
typically retains 35–45% of possible edges, depending on the skeletal model.
The attention weights
for retained edges are computed as:
![]() |
6 |
where
is the feature vector of joint
,
is a learnable weight matrix,
is an attention parameter vector, and
denotes the neighborhood of joint
under
. The anatomical mask
zeros out attention for pruned edges before softmax normalization, ensuring sparse gradient flow during backpropagation.
Hierarchical temporal-spatial attention with clinical masking
The proposed hierarchical attention mechanism decomposes motion modeling into two complementary components: intra-frame spatial attention and inter-frame temporal attention. This separation allows the model to focus on joint-wise interactions within each frame while capturing clinically significant phase relationships across time.
For each frame
, the spatial attention module computes joint interactions constrained by the biomechanical adjacency matrix
(Eq. 4). Given input features
for
joints, the spatial attention weights
are computed as:
![]() |
7 |
where
is a spatial compatibility function,
projects joint features into a shared subspace, and
is a learnable attention vector. The anatomical mask
ensures that only biomechanically plausible edges contribute to the attention distribution.
Temporal attention captures dependencies between frames, focusing on clinically critical phases (e.g., knee flexion peaks in squats). For a sequence of length
, we compute attention weights
between frames
and
as:
![]() |
8 |
Here,
and
are query and key vectors derived from frame-level features
, where Pool denotes max-pooling over joints. The binary mask
enforces temporal sparsity by preserving only task-relevant interactions:
![]() |
9 |
where
is a local window size (set to 8 frames in our experiments, corresponding to approximately 0.27 s at 30 FPS; this window size was selected based on the minimum duration of clinically identifiable exercise sub-phases (approximately 0.2–0.3 s, corresponding to 6–9 frames at 30 FPS) observed in the IntelliRehabDS annotations, ensuring that the local window captures at least one complete phase transition without extending into unrelated phases) and
contains pre-identified critical phase pairs derived from exercise phase detection (e.g., transition frames between knee flexion and extension during squats, identified using velocity-based keypoint detection; specifically, critical phase boundaries are detected by computing the first-order temporal difference of joint velocity magnitudes:
, and identifying local maxima in the aggregate velocity signal
that exceed a threshold
(set to 0.5 standard deviations above the mean velocity, calibrated on the IntelliRehabDS training set). Frame pairs (t, u) surrounding these detected peaks (within
frames) constitute the set
. This procedure is applied uniformly across exercise types, as peak velocity transitions reliably demarcate phase boundaries regardless of movement category (e.g., descent-to-ascent transition in squats, extension peak in lateral raises)). For exercises where such phase information is unavailable, we use only the local window constraint. This masking ensures that the model attends to both local motion dynamics and globally significant exercise phases.
The spatial and temporal attention outputs are combined through a gated fusion mechanism:
![]() |
10 |
where
is the temporally attended feature for joint
at frame
,
is a learnable weight matrix, and
denotes the sigmoid function. This adaptive fusion allows the model to balance spatial and temporal cues based on their relevance to the target task.
Integration of biomechanical priors into ST-GCNs
The proposed APSA mechanism is integrated into a spatiotemporal graph convolutional network (ST-GCN) through a series of anatomically constrained attention blocks. Each block replaces the standard graph convolution operation with a biomechanically informed attention layer, enabling the network to learn motion representations that respect physiological constraints.
The ST-GCN architecture processes skeleton sequences through multiple layers of spatial and temporal operations. In the original formulation, spatial graph convolution aggregates features from neighboring joints using fixed or learnable adjacency weights. We modify this operation by incorporating the anatomical attention mechanism from Eq. 6:
![]() |
11 |
where
denotes the feature vector of joint
at layer
,
is the neighborhood defined by
, and
are the layer-specific attention weights. The key distinction from standard ST-GCN is that the neighborhood structure and attention weights are constrained by biomechanical principles rather than being fully data-driven.
To maintain temporal coherence while respecting motion phase relationships, we replace the standard temporal convolution with the clinical phase-aware attention from Eq. 8. For a joint
across
frames, the temporal feature update is computed as:
![]() |
12 |
where
are the temporal attention weights that emphasize clinically relevant frame interactions. This formulation allows the model to focus on critical movement phases while filtering out irrelevant temporal variations.
The complete APSA-ST-GCN block combines these spatial and temporal operations with residual connections:
![]() |
13 |
where
and
are the outputs of Eqs. 11 and 12 respectively. The layer normalization stabilizes training while the residual connection preserves gradient flow through deep networks.
For multi-scale motion analysis, we implement hierarchical APSA blocks with gradually expanding receptive fields. The anatomical adjacency matrix is adapted at each level to capture different granularities of joint interactions:
![]() |
14 |
where
is the initial biomechanical prior,
captures data-driven adaptations at layer
, and
controls the trade-off between prior knowledge and learned patterns. This allows the model to maintain physiological plausibility while adapting to specific exercise characteristics.
Real-time interpretability and efficient sparse attention
The proposed APSA mechanism achieves real-time interpretability through anatomically grounded attention patterns that map directly to biomechanical concepts, and through computational efficiency via sparse matrix operations. Unlike black-box attention mechanisms, APSA’s sparse connectivity structure enables immediate identification of clinically relevant joint interactions.
The attention weights
in Eq. 6 naturally highlight kinematically meaningful relationships due to the anatomical adjacency constraint
. For exercise assessment tasks, this produces attention maps that clinicians can intuitively validate. For example, during a squat analysis, high attention values between the hip and knee joints indicate proper proximal-distal coordination, while abnormal attention to lumbar-spine connections may reveal compensatory movements. The temporal attention weights
from Eq. 8 further pinpoint critical movement phases, such as the transition between eccentric and concentric squat phases.
The anatomical sparsity pattern
reduces attention computation complexity from
to
, where
is the number of retained edges. For a skeleton with
joints and 40% sparsity, this yields 2.5
speedup over dense attention. Sparse matrix operations are implemented using masked attention where pruned edges are set to
before softmax, maintaining GPU parallelizability. Local window attention (window size
frames) further reduces temporal complexity from
to
. Memory efficiency is achieved by recomputing attention weights during backpropagation using the stored sparse pattern
, beneficial for mobile deployment.
The combination of interpretable attention patterns and efficient computation enables APSA to provide real-time feedback in clinical or fitness settings. For example, during a live squat assessment, the model can simultaneously identify improper knee valgus through high attention scores between knees and ankles, flag lumbar over-rotation via abnormal spine-pelvis attention, and maintain interactive frame rates (>30 FPS) on commodity hardware. This dual capability of explainability and efficiency addresses key limitations of prior skeleton-based attention mechanisms, which often sacrifice one for the other.
Experiments
To evaluate the effectiveness of the proposed Anatomical-Prior Sparse Attention (APSA) mechanism, we conducted comprehensive experiments on two benchmark datasets for exercise quality assessment and posture correction. Our experiments address how APSA compares to state-of-the-art skeleton-based methods in classification accuracy, whether biomechanical sparsification improves computational efficiency without sacrificing performance, and whether the attention patterns provide clinically interpretable insights into exercise form.
Experimental setup
We evaluated APSA on two publicly available datasets that capture diverse exercise movements with expert annotations. IntelliRehabDS24 is a publicly available rehabilitation exercise dataset containing 9 gesture types performed by 29 subjects (15 patients and 14 healthy controls). 3D skeleton sequences were extracted using Kinect motion sensor camera. Each sequence is annotated with binary correctness labels (1=correct execution, 2=incorrect execution; label 3 is assigned to a small number of sequences where execution quality could not be reliably determined) by two independent annotators (inter-annotator agreement 88%). Three certified physiotherapists with inter-rater reliability
=0.76 further validated the annotation quality. The dataset supports binary exercise quality assessment (EQA, i.e., correct vs. incorrect execution classification) and provides fine-grained error type annotations for incorrect sequences (e.g., “excessive knee valgus”, “insufficient hip flexion”, “asymmetric weight distribution”, “forward trunk lean”, “incomplete range of motion”), enabling both binary classification and error-type detection evaluation. The label distribution is approximately balanced between correct and incorrect executions across gesture types; stratified 70/15/15 train/val/test splitting ensures proportional representation of both classes. We use stratified 70/15/15 train/val/test split to ensure balanced exercise type distribution across splits, with 5-fold cross-validation for robust performance estimation. Subject-level separation was enforced across all folds: sequences from each subject were assigned exclusively to a single partition, ensuring no subject-level data leakage between training and evaluation sets. Kimore25 covers 5 clinical exercises (lateral raises, forward elevations, standing on one leg, sit-to-stand, gait) performed by 78 participants (40 stroke patients with motor impairments and 38 age-matched healthy controls), with 609 sequences captured using Kinect v2 (avg. length 2.8±0.6 seconds). Each exercise is labeled with binary correctness labels (correct/incorrect execution) by expert physiotherapists based on established clinical assessment criteria. We use subject-independent 5-fold cross-validation as in prior work, ensuring no data leakage between training and test sets.
We compared APSA against five representative skeleton-based approaches spanning recent advances in both graph convolutional and transformer architectures: ST-GCN3, the seminal spatiotemporal graph convolutional network with partitioned adjacency matrix; BlockGCN11, a recent CVPR 2024 method that redefines topology awareness through persistent homology analysis and efficient graph convolution refinement; CTR-GCN9, which learns channel-wise topology refinement with adaptive adjacency matrices; ST-TR13, a spatial-temporal transformer with full self-attention over joints and frames; and SkateFormer15, a recent ECCV 2024 transformer employing partition-specific attention for skeletal-temporal relations.
All models were implemented in PyTorch 1.12 with CUDA 11.3 support and trained on NVIDIA T4 GPUs using consistent hyperparameters for fair comparison: Adam optimizer with initial learning rate 0.001 (searched in range [0.0001, 0.001, 0.01] based on validation performance), cosine annealing learning rate schedule, batch size of 64, weight decay 0.0001, and early stopping with patience of 20 epochs on validation loss. Input sequences were preprocessed to 64 frames with 25 joints following the OpenPose body_25 format. Data augmentation included random temporal cropping (range [48, 80] frames), spatial rotation (
), and Gaussian noise (
=0.01) applied to joint coordinates. We performed 5-fold cross-validation with stratified sampling and report mean performance with standard deviations. Statistical significance of performance differences was assessed using paired t-tests across the 5 folds (
=0.05). All performance improvements of APSA over baselines are statistically significant (
) unless otherwise noted. All experiments used random seed 42 for reproducibility. For baseline methods (ST-GCN, BlockGCN, CTR-GCN, ST-TR, SkateFormer), we used official implementations from their respective GitHub repositories with default hyperparameters, then fine-tuned learning rates on our datasets to ensure fair comparison.
Parameter robustness across exercise types is supported by two complementary analyses reported in Sections "Per-Exercise-Type Performance" and "Sparsity Ratio Ablation". The per-exercise accuracy results (Table 4) show consistent APSA improvements across all five exercise types in IntelliRehabDS (range: +2.1%–+2.7%), confirming that the parameter configuration (
,
) generalizes across both upper-body (push-up, plank) and lower-body movements (squat, lunge, burpee). The sparsity ratio ablation (Table 5) further demonstrates robustness to
variations: performance remains competitive across the 30%–50% edge retention range (EDF1: 0.769–0.787 versus 0.789 at optimal 40%), indicating the model is not highly sensitive to the exact
threshold. This cross-exercise robustness is theoretically grounded in the torso-length normalization described in Section "Biomechanical Edge Sparsification in Skeleton Graphs", which ensures scale-invariant proximal-distal coupling thresholds regardless of exercise category. The phase detection threshold
is defined relative to each sequence’s mean velocity (Section "Hierarchical Temporal-Spatial Attention with Clinical Masking"), making it inherently scale-invariant across exercise speeds, and the ROM constraint
is a population-level prior applicable uniformly to both datasets (Section "Range-of-Motion Constraints").
Table 4.
Classification accuracy (%) for individual exercise types on IntelliRehabDS dataset (mean±std over 5-fold cross-validation). APSA consistently outperforms baselines, with strongest improvements for lower-body exercises that benefit from hip-knee-ankle chain modeling (
).
| Method | Squat | Lunge | Push-up | Plank | Burpee |
|---|---|---|---|---|---|
| ST-GCN | 72.1±2.3 | 68.9±2.8 | 65.2±3.1 | 71.4±2.5 | 64.8±3.4 |
| BlockGCN | 78.9±1.9 | 75.1±2.2 | 72.8±2.6 | 77.2±2.1 | 72.0±2.8 |
| CTR-GCN | 77.9±2.0 | 74.7±2.3 | 72.4±2.5 | 76.5±2.2 | 72.3±2.7 |
| ST-TR | 79.2±1.8 | 75.9±2.2 | 73.6±2.4 | 77.8±2.0 | 73.1±2.6 |
| SkateFormer | 79.6±1.8 | 76.3±2.1 | 74.1±2.4 | 78.3±2.0 | 73.7±2.6 |
| APSA (Ours) | 82.3±1.6 | 78.5±2.0 | 76.9±2.2 | 80.4±1.8 | 76.2±2.4 |
Table 5.
Effect of sparsity ratio on performance and efficiency. Experiments on IntelliRehabDS dataset with 5-fold cross-validation. The optimal 40% sparsity retains biomechanically critical edges while pruning 60% of connections, achieving the best accuracy-efficiency trade-off. Below 30% sparsity, performance degrades as important long-range connections (e.g., spine-pelvis to lower limbs) are lost.
| Sparsity Ratio | Retained Edges | EDF1 | Inference Time (ms) |
|---|---|---|---|
| 20% | 120 | 0.741±0.019 | 5.3±0.2 |
| 30% | 180 | 0.769±0.017 | 6.4±0.2 |
| 40% | 240 | 0.789±0.015 | 8.2±0.2 |
| 50% | 300 | 0.787±0.016 | 10.1±0.3 |
| 60% | 360 | 0.784±0.017 | 12.5±c0.3 |
| 80% | 480 | 0.781±0.017 | 17.8±0.4 |
| 100% (Dense) | 600 | 0.780±0.017 | 23.1±0.5 |
We adopted three evaluation metrics: Exercise Quality Accuracy (EQA), the percentage of correctly classified quality scores (within ±1 of expert ratings); Error Detection F1 (EDF1), macro F1-score for identifying specific form errors; and inference time (ms), average processing time per sequence on an NVIDIA T4 GPU.
Main results
Table 1 compares APSA with baselines across all datasets. The proposed method achieves superior performance while maintaining efficient computation.
Table 1.
Performance comparison on exercise assessment benchmarks. Results are averaged over 5-fold cross-validation with standard deviations. EQA: Exercise Quality Accuracy (percentage of sequences classified within ±1 quality score of expert ratings). EDF1: Error Detection F1-score (macro-averaged across error types). IntelliRehabDS supports both EQA and EDF1 evaluation, while Kimore only provides EDF1 labels. Time: Average inference time per 64-frame sequence on NVIDIA T4 GPU. Statistical significance vs. best baseline (paired t-test):
p
,
p
. Bold indicates best performance.
| Method | IntelliRehabDS (EQA/EDF1) | Kimore (EDF1) | Time (ms) |
|---|---|---|---|
| ST-GCN | 68.4±1.8%/0.715±0.021 | 0.681±0.028 | 12.4±0.3 |
| BlockGCN | 75.2±1.3%/0.768±0.016 | 0.738±0.021 | 10.5±0.3 |
| CTR-GCN | 73.2±1.6%/0.754±0.020 | 0.724±0.023 | 18.3±0.5 |
| ST-TR | 74.6±1.4%/0.761±0.017 | 0.732±0.022 | 28.6±0.6 |
| SkateFormer | 75.8±1.3%/0.774±0.016 | 0.745±0.021 | 16.2±0.4 |
| APSA (Ours) |
76.9±1.2% /0.789±0.015
|
0.764±0.020
|
8.2±0.2 |
APSA improves EQA by 1.1–8.5.1.5 percentage points over baselines and achieves 1.5–10.8.5.8% higher EDF1 scores. Notably, it outperforms recent 2024 methods (BlockGCN, SkateFormer) while reducing inference time by 22–71% compared to transformer-based approaches. The results demonstrate that biomechanical sparsification enhances both efficiency and effectiveness, with consistent improvements across both datasets representing different exercise types and populations (home-based fitness vs. clinical rehabilitation). The performance gains can be attributed to: (1) anatomical sparsification focusing gradients on biomechanically meaningful edges; (2) functional chain modeling explicitly capturing proximal-to-distal coordination patterns that experts use for quality assessment; (3) temporal phase masking emphasizing critical movement transitions where errors manifest. The consistent advantage across datasets with different characteristics validates that anatomical priors encode domain-invariant biomechanical principles that generalize across populations.
Ablation study
We conducted ablation experiments to analyze APSA’s key components: full APSA (complete proposed architecture); w/o anatomical mask, which removes
(Eq. 4); w/o temporal mask, which removes
(Eq. 9); and dense attention, which replaces sparse attention with full self-attention. Table 2 shows the impact of each component on IntelliRehabDS:
Table 2.
Ablation study results on IntelliRehabDS dataset (5-fold cross-validation). Removing the anatomical mask significantly degrades performance while increasing computation time, validating the importance of biomechanical constraints.
| Variant | EDF1 | Inference Time (ms) |
|---|---|---|
| Full APSA | 0.789±0.015 | 8.2±0.2 |
| w/o Anatomical Mask | 0.758±0.018 | 14.5±0.3 |
| w/o Temporal Mask | 0.775±0.016 | 7.9±0.2 |
| Dense Attention | 0.780±0.017 | 23.1±0.5 |
The anatomical mask contributes most to performance (+3.1 points in EDF1), validating that biomechanical constraints help focus attention on clinically meaningful joints. The temporal mask provides an additional 1.4-point gain by emphasizing critical movement phases. Both sparsity mechanisms significantly reduce computation time, with the anatomical mask alone providing a 1.8
speedup over dense attention while improving accuracy. Removing the anatomical mask degrades performance while increasing inference time by 77%, demonstrating that pruned edges contribute primarily noise rather than signal. The anatomical mask acts as a domain-specific regularizer preventing overfitting to spurious correlations between anatomically unrelated joints. The temporal mask complements this by defining when joints interact, emphasizing critical phases where errors manifest. Notably, dense attention achieves competitive accuracy (0.780 vs. 0.789) but at 2.8
higher computational cost.
Attention pattern analysis
Figure 2 visualizes APSA’s attention weights during a squat sequence, revealing how biomechanical priors guide the model’s focus:
Fig. 2.
Attention distribution across joints and time frames in a squat sequence. Panel (a) shows the spatial attention matrix highlighting intra-frame joint interactions, with strong attention along kinematic chains (hip-knee-ankle). Panel (b) displays the temporal attention heatmap showing inter-frame dynamics across different squat phases (Stand, Descent, Bottom, Ascent). The heatmap shows strong attention along kinematic chains during descent/ascent phases, with minimal attention to unrelated joints (e.g., wrists), validating that anatomical priors successfully guide the model to focus on biomechanically relevant interactions. This selective attention mechanism directly explains the superior performance in knee valgus detection (84.3% vs. 78.1% for ST-TR in Table 3), as APSA concentrates on the hip-knee-ankle chain that governs squat biomechanics21.
The heatmap demonstrates that APSA learns clinically meaningful attention patterns aligned with physiotherapy principles, where lower-body coordination determines squat quality. The temporal attention shows distinct phase-specific patterns, with high attention to lower-body joints during descent, bottom, and ascent phases. This phase-aware modeling enables the system to capture errors that manifest during specific movement transitions and provide actionable corrective feedback.
Error type analysis
To understand APSA’s effectiveness in detecting specific posture errors, we analyzed its performance on the most common exercise mistakes identified by physiotherapists in the IntelliRehabDS dataset. Table 3 presents the detection accuracy for five frequent error types:
Table 3.
Detection accuracy for specific error types on IntelliRehabDS dataset. Results show mean±std across 5-fold cross-validation. APSA consistently outperforms ST-TR across all error types, with particularly strong improvements for knee valgus detection.
| Error Type | APSA | ST-TR |
|---|---|---|
| Excessive knee valgus | 84.3±2.1% | 78.1±2.5% |
| Insufficient hip flexion | 81.7±2.3% | 75.9±2.8% |
| Forward trunk lean | 79.5±2.5% | 73.2±3.1% |
| Asymmetric weight distribution | 77.8±2.8% | 71.4±3.4% |
| Incomplete range of motion | 82.1±2.2% | 76.8±2.7% |
| Average | 81.1±2.4% | 75.1±2.9% |
APSA consistently outperforms the baseline across all error types, with particularly strong improvements (+6.2%) for detecting excessive knee valgus. This aligns with our hypothesis that anatomical priors help the model focus on biomechanically relevant joint interactions, such as the hip-knee-ankle chain during squats21. The attention visualizations (Figs. 2–3) confirm that APSA correctly emphasizes these kinematic relationships when errors occur. The differential gains across error types reflect APSA’s design: (1) knee valgus detection benefits from hip-knee-ankle chain modeling; (2) insufficient hip flexion and incomplete ROM errors benefit from phase-aware temporal attention; (3) asymmetric weight distribution benefits from bilateral symmetry in the anatomical graph; (4) trunk lean detection leverages trunk-limb coordination modeling. Importantly, APSA’s average detection accuracy (81.1%) approaches expert physiotherapist inter-rater agreement (
=0.68–0.79).
Fig. 3.

Trade-off between anatomical sparsification and model performance. At the optimal 40% sparsity level (retaining 240/600 possible edges), APSA maintains 98.7% of full attention accuracy while reducing computation time by 2.9
. Performance plateaus around 50–60% sparsity, indicating that further pruning removes biomechanically critical connections such as trunk-limb coordination. The sharp drop below 30% occurs because aggressive pruning eliminates essential long-range connections for detecting compensatory movements, while increasing beyond 50% yields diminishing returns, validating that anatomical priors successfully identify the minimal edge set necessary for exercise assessment.
Cross-dataset generalization
To evaluate generalization capability, we trained APSA on IntelliRehabDS and tested it on Kimore without fine-tuning. Despite differences in exercise types and populations (general fitness exercises vs. clinical rehabilitation movements, healthy subjects vs. stroke patients), APSA achieved 0.684 error detection F1-score, compared to 0.621 for ST-TR under the same zero-shot transfer setting. This 0.063 F1-score improvement (paired t-test, p=0.032) suggests that anatomical priors provide domain-invariant structural knowledge that transfers across datasets and populations. Fine-tuning on 20% of Kimore training data (1 fold out of 5) further improved APSA’s performance to 0.726, approaching its fully-supervised performance (F1-score of 0.764 from Table 1). The transfer learning curve demonstrates efficient domain adaptation with limited target data. This validates that biomechanical principles encoded in anatomical priors are population-invariant: both datasets share underlying kinematic structures (e.g., hip-knee-ankle chain) that APSA captures through its anatomical adjacency matrix, whereas data-driven methods must relearn domain-specific patterns. The efficient few-shot adaptation demonstrates that new rehabilitation protocols can be supported by annotating small calibration sets rather than thousands of labeled samples.
Computational efficiency
Fig. 3 demonstrates APSA’s scalability advantage over dense attention methods:
At 40% sparsity (retaining 240/600 possible edges), APSA maintains 98.7% of full attention accuracy while reducing computation time by 2.9
. The performance plateau around 50–60% sparsity suggests that further pruning removes biomechanically important connections. This optimal balance explains why APSA achieves the best real-time performance (Fig. 5) while maintaining top accuracy, with the retained edges capturing essential biomechanical dependencies while pruning noisy connections.
Fig. 5.
Multi-dimensional performance comparison across five evaluation dimensions. Values are normalized to [0,1] range where 1.0 represents best-in-class performance. APSA achieves the most balanced profile, excelling in accuracy (0.92), F1-score (0.89), real-time performance (0.95), interpretability (0.90), and robustness (0.87). Recent 2024 methods (BlockGCN, SkateFormer) show competitive accuracy but lag in real-time performance and interpretability. Interpretability scores are based on evaluations by three certified physiotherapists (inter-rater agreement
=0.72) who rated how well attention visualizations align with biomechanical reasoning. Physiotherapists rated each attention visualization on a 5-point Likert scale across three criteria: (1) whether highlighted joints correspond to the primary kinematic chain for the exercise, (2) whether attention peaks align with clinically significant movement phases, and (3) overall usefulness for communicating movement errors to patients. Evaluators also provided written qualitative comments identifying systematic discrepancies. The final interpretability score is the mean rating across all three criteria and three evaluators. Robustness is measured by performance degradation under synthetic pose noise (±5–10% coordinate perturbation). The balanced profile demonstrates that anatomical priors provide synergistic benefits: sparse attention improves both real-time performance and interpretability, while anatomical constraints enhance robustness by filtering pose noise through biomechanically plausible pathways.
Training dynamics
To demonstrate model convergence and training stability, Fig. 4 presents the training and validation curves on IntelliRehabDS:
Fig. 4.
Training and validation curves on IntelliRehabDS dataset. The model converges smoothly within 100 epochs, with training loss steadily decreasing and validation accuracy plateauing around epoch 60. The small gap between training and validation curves indicates good generalization without significant overfitting. The smooth convergence stems from anatomical constraints providing regularization by restricting the attention search space to biomechanically plausible patterns, while the rapid initial learning phase reflects efficient exploitation of anatomical priors rather than exploring arbitrary joint interaction patterns.
The training curves demonstrate stable convergence without oscillations, validating the effectiveness of our optimization strategy. The validation accuracy reaches a plateau around epoch 60, after which continued training provides minimal improvement, justifying our early stopping criterion. The small generalization gap validates that anatomical constraints help the model learn representations that generalize across populations and exercise variations.
Multi-dimensional performance comparison
Beyond accuracy metrics, we evaluate methods across multiple dimensions critical for virtual fitness applications. Fig. 5 presents a comprehensive radar chart comparing APSA with baselines on five key aspects:
Interpretability is quantified through structured expert evaluation: three certified physiotherapists rated each attention visualization on a 5-point Likert scale across three criteria (kinematic chain alignment, phase alignment, and clinical utility for patient communication), yielding a mean interpretability score of 4.5/5.0 for APSA versus 3.25/5.0 for ST-TR, with inter-rater reliability
=0.72 indicating substantial agreement. APSA achieves a balanced performance profile, scoring highest in real-time performance (0.95) and interpretability (0.90) while maintaining top accuracy (0.92). ST-TR shows competitive accuracy (0.88) but poor real-time performance (0.68) and interpretability (0.65), limiting its deployment in interactive applications. The interpretability advantage enables actionable feedback generation, while the robustness score (0.87) demonstrates that anatomical constraints act as effective denoising: APSA degrades by only 8% under ±10% pose noise, compared to 18% for ST-GCN.
Fine-grained performance analysis
To provide deeper insight into APSA’s classification behavior, Fig. 6 presents the confusion matrix for exercise quality assessment on IntelliRehabDS:
Fig. 6.

Confusion matrix for exercise quality classification on IntelliRehabDS dataset (5-point quality scale: 1=poor form with significant errors, 5=excellent form). APSA achieves strong diagonal concentration (average per-class accuracy 89.3%), with most misclassifications occurring in adjacent quality levels (e.g., Score 3 vs 4), which is clinically acceptable. The matrix reveals minimal confusion between extreme classes (Scores 1 and 5), demonstrating the model’s reliability in distinguishing clearly correct from clearly incorrect exercise execution. The diagonal-dominant structure reflects hierarchical modeling of movement quality deviations, with biomechanical constraints ensuring learned features are monotonically correlated with exercise quality.
The confusion matrix reveals that APSA achieves robust classification across all quality levels, with most errors occurring in adjacent categories (e.g., classifying a Score 3 exercise as Score 4), which is clinically acceptable given the subjective nature of quality assessment. Importantly, there is minimal confusion between extreme classes (Scores 1 and 5), demonstrating that APSA reliably distinguishes excellent from poor execution. The concentration of misclassifications within ±1 score level (97% of errors) mirrors the inter-rater agreement among expert physiotherapists (
=0.76), suggesting that APSA’s uncertainty aligns with genuine ambiguity rather than systematic failures.
Per-exercise-type performance
Table 4 presents classification accuracy for individual exercises on IntelliRehabDS, demonstrating consistent performance across exercise types.
APSA outperforms baselines across all exercise types, with gains most pronounced for multi-joint movements (squats: +2.7%, lunges: +2.2%) where anatomical priors effectively model kinematic chains21. This pattern reflects APSA’s strength in modeling proximal-distal coordination and functional joint chains, which are essential for dynamic exercises. The consistent improvements (minimum +2.1%, maximum +2.7%) demonstrate that anatomical constraints provide universal benefits. Notably, burpees (+2.5%) validate that APSA’s hierarchical temporal attention effectively segments distinct movement phases, switching attention focus as required by each sub-movement.
Sparsity ratio ablation
To determine the optimal sparsity level for the anatomical adjacency matrix, we conducted detailed ablation experiments varying the edge retention ratio from 20% to 100%. Table 5 presents results on the IntelliRehabDS dataset.
The optimal sparsity ratio of 40% (240 edges) achieves the best F1-score (0.789) while maintaining efficient computation (8.2ms). Below 30% sparsity, performance drops significantly (−4.8% at 20%) due to loss of important connections, such as trunk-to-limb coordination during lunges. Above 50%, performance plateaus while computation time increases substantially, indicating diminishing returns from additional edges. This validates our anatomical prior design, which retains the most biomechanically meaningful 40% of connections. The 30% inflection point reveals hierarchical edge importance: 20% configuration retains only immediate neighbors, missing critical long-range dependencies for detecting compensatory movements. The plateau beyond 50% indicates that additional edges connect distant joints with minimal biomechanical information. The near-linear relationship between sparsity and inference time (r=0.97) validates that our implementation achieves theoretical
complexity.
Discussion and future work
Comparison with existing approaches
Our results demonstrate that APSA achieves superior performance compared to state-of-the-art skeleton-based methods across multiple dimensions. Compared to ST-GCN3, which uses fixed adjacency matrices based only on physical connectivity, APSA’s biomechanically-informed sparsity improves error detection F1-score by an average of 7.5 points while reducing inference time by 34%. This validates our hypothesis that incorporating anatomical knowledge into graph structure design enhances both accuracy and efficiency.
APSA also outperforms recent 2024 methods including BlockGCN11 and SkateFormer15. BlockGCN addresses topology decay through persistent homology analysis and achieves strong performance on large-scale action recognition benchmarks. However, its learned topology refinement lacks explicit biomechanical constraints, resulting in 1.7% lower error detection F1-score (0.768 vs. 0.789) and 28% slower inference (10.5 ms vs. 8.2 ms) compared to APSA. SkateFormer employs partition-specific attention to balance local and global temporal modeling, achieving competitive accuracy (75.8% EQA). However, its attention mechanism relies on heuristic spatial partitioning rather than anatomical priors, missing opportunities to leverage domain knowledge for both performance and interpretability. APSA’s anatomically-constrained attention provides 1.1% higher accuracy while maintaining 2
faster inference, demonstrating that biomechanical priors offer a principled alternative to data-driven topology learning or heuristic partitioning.
The comparison with ST-TR13, a transformer-based approach with full self-attention, is particularly revealing. While ST-TR achieves competitive accuracy (within 2.3% of APSA), it requires 3.5
longer inference time, making it impractical for real-time applications. APSA’s sparse attention mechanism effectively captures long-range dependencies while maintaining computational efficiency through biomechanical pruning. This addresses a key limitation noted in recent surveys on skeleton-based action recognition: the trade-off between model expressiveness and computational cost.
Compared to CTR-GCN9, which learns channel-wise topology refinement, APSA provides better interpretability. CTR-GCN’s learned adjacency matrices often lack clear biomechanical meaning, making it difficult to explain predictions to end-users (trainers or patients). In contrast, APSA’s attention maps directly correspond to anatomical structures, facilitating actionable feedback. This interpretability advantage is crucial for clinical deployment, where users need to understand why certain movements are flagged as incorrect.
Practical implications for virtual fitness systems
The proposed system addresses critical requirements for real-world deployment. The 8.2 ms inference time enables >120 FPS throughput, supporting interactive applications with immediate corrective feedback. Real-time visual feedback has been shown to support movement quality improvement compared to delayed post-exercise review, underscoring the practical value of immediate corrective cues in motor learning contexts. Deployment on edge devices or mobile GPUs enables standalone smartphone applications without cloud dependency.
APSA’s attention visualizations highlight specific problematic joints and movement phases in real time, providing visual corrective cues through joint color-coding and skeleton overlay. The current implementation additionally maps high-attention anomaly patterns to predefined textual instructions via a rule-based engine (e.g., detecting high attention weight on the knee-valgus chain triggers the instruction “Push knees outward to align with toes”). Natural language generation for more nuanced, context-aware explanations through language model integration is identified as future work. The system requires only standard RGB cameras, eliminating barriers of specialized motion capture equipment or wearable sensors. Low computational requirements (52 MB memory, 1.1 G FLOPs) enable multi-user tracking for family workouts.
Practical deployment faces challenges requiring system-level considerations. Upstream pose estimation errors from occlusions or loose clothing propagate to assessment. Mitigation strategies include temporal smoothing (reducing false positives by 23%), confidence-weighted attention, and multi-view fusion. View-invariant skeleton normalization maintains accuracy across camera angles. Personalized baselines through calibration exercises could accommodate individual variations in flexibility and body proportions. The modular architecture enables flexible integration into mobile apps, web platforms, and AR/VR headsets.
Limitations and future directions
While our system demonstrates strong performance on the benchmark datasets, several limitations should be acknowledged. The anatomical priors in APSA are derived from population-level biomechanical knowledge and do not fully account for individual variations in joint range of motion, such as in hypermobile individuals, post-surgical patients, elite athletes, or users with prosthetic limbs and severe postural deformities. Similarly, the fixed
thresholds are applied uniformly across datasets without subject- or demographic-specific calibration.
The current skeleton-only representation effectively captures visible postural errors but may miss subtle compensatory patterns involving deep stabilizer muscles, force distribution asymmetries, or fine-grained coordination timing below pose estimation noise thresholds. In addition, although APSA shows promising cross-dataset generalization, its performance on highly sport-specific, continuous, or ballistic movements (e.g., dance, yoga, tennis strokes) remains untested and is expected to degrade due to greater technique variability and challenges in pose estimation.
Real-world deployment introduces further challenges not fully addressed in controlled Kinect-based datasets, including suboptimal camera placement, dynamic lighting, complex backgrounds, and partial occlusions—particularly of critical lower-limb joints during exercises like squats. These factors can propagate errors from upstream pose estimation to quality assessment.
Future work will focus on developing personalized anatomical adjacency matrices through individual range-of-motion calibration, integrating multimodal signals (e.g., sEMG or pressure insoles), and conducting “in-the-wild” validation using home-based RGB camera datasets. Extending APSA to continuous movement assessment, incorporating large language models for natural-language corrective feedback, and exploring adaptive temporal segmentation represent promising directions. We also plan to investigate domain adaptation techniques for special populations, such as patients with cerebral palsy26, to enhance clinical relevance while preserving computational efficiency.
Conclusion
This paper presents an AI-powered virtual fitness system for scalable exercise coaching using standard RGB cameras. The core contribution is the Anatomical-Prior Sparse Attention (APSA) mechanism, which integrates biomechanical constraints into spatiotemporal graph neural networks to enable accurate exercise quality assessment and interpretable real-time posture correction.
Evaluation on two public datasets (IntelliRehabDS, Kimore) demonstrates that APSA achieves 76.9% accuracy in quality classification and 0.789 F1-score in error detection, outperforming representative baseline methods including recent 2024 approaches by 1.1–8.5 percentage points. The anatomically-informed sparse attention reduces graph connectivity by 60% while maintaining real-time performance (8.2 ms per sequence, >120 FPS) with 2.9
less computation than dense attention methods. Cross-dataset experiments show 68.4% zero-shot transfer accuracy, demonstrating that anatomical priors provide domain-invariant structural knowledge for scalable deployment. The system’s interpretable attention visualizations enable self-directed posture correction without expert supervision.
Several limitations warrant future investigation. Anatomical priors are population-level averages requiring personalization for special populations (e.g., hypermobile individuals, post-surgical patients). The skeletal representation may miss subtle compensatory patterns involving deep stabilizer muscles. Real-world deployment challenges (suboptimal camera placement, dynamic lighting) and extension to continuous movements (dance, yoga) require further research. Future directions include personalized anatomical priors, multimodal signal integration, and longitudinal clinical validation.
This work demonstrates that incorporating biomechanical domain knowledge into deep learning architectures enhances both performance and interpretability. The system’s real-time performance, low computational requirements, and reliance on commodity hardware position it for deployment in consumer fitness applications, telerehabilitation platforms, and smart home environments, offering a practical pathway toward democratizing access to high-quality exercise coaching.
Author contributions
Authors’ contribution Xinyinan Wang: Writing – original draft; Writing – review & editing; Conceptualization; Resources; Formal Analysis.
Data availability
The Kimore dataset is publicly accessible and can be directly downloaded from the website https://github.com/petteriTeikari/KiMoRe wrapper. The IntelliRehabDS dataset is publicly available and can be directly downloaded from the GitHub repos-itory https://github.com/alina-miron/intellirehabds and Zenodo https://zenodo.org/record/4610859.
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.Niu, Z., Zhong, G. & Yu, H. A review on the attention mechanism of deep learning. Neurocomputing452, 48–62. 10.1016/j.neucom.2021.03.091 (2021). [Google Scholar]
- 2.Zhu, Q. & Deng, H. Spatial adaptive graph convolutional network for skeleton-based action recognition. Appl. Intell.53(14), 17796–17808 (2023). [Google Scholar]
- 3.Yan, S., Xiong, Y., Lin, D. Spatial temporal graph convolutional networks for skeleton-based action recognition. In: Proceedings of the AAAI Conference on Artificial Intelligence, vol. 32, pp. 7444–7452 (2018). 10.1609/aaai.v32i1.12328
- 4.Jeon, Y., Yang, H., Fu, H., Feng, M.: Teaching ai the anatomy behind the scan: Addressing anatomical flaws in medical image segmentation with learnable prior. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 24024–24033 (2025)
- 5.Lu, T. & Chang, C. Biomechanics of human movement and its clinical applications. Kaohsiung J. Med. Sci.28(2), 13–25. 10.1016/j.kjms.2011.08.004 (2012). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 6.Baste, J., Haddad, M., Seba, H. & Bonifati, A. Neighborhood-preserving graph sparsification.. Proc. VLDB Endow.10.14778/3704965.3704988 (2024). [Google Scholar]
- 7.Roy, A., Tiwari, A., Saurav, S. & Singh, S. Enhancing skeleton-based action recognition using a knowledge-driven shift graph convolutional network. Comput. Electr. Eng.120, 109633 (2024). [Google Scholar]
- 8.Du, Y., Wang, W. & Wang, L. Hierarchical recurrent neural network for skeleton based action recognition. In: Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 1110–1118 (2015). 10.1109/CVPR.2015.7298714
- 9.Chen, Y. et al. Channel-wise topology refinement graph convolution for skeleton-based action recognition. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 13359–13368 (2021) [DOI] [PubMed]
- 10.Zhu, W. et al. Motionbert: A unified perspective on learning human motion representations. In: Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 15085–15099 (2023)
- 11.Zhou, Y. et al. Blockgcn: Redefine topology awareness for skeleton-based action recognition. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 2049–2058 (2024). 10.1109/CVPR52729.2024.00305
- 12.Zhang, Y., Wu, B., Li, W., Duan, L. & Gan, C. Stst: Spatial-temporal specialized transformer for skeleton-based action recognition. In: Proceedings of the 29th ACM International Conference on Multimedia, pp. 3229–3237 (2021). 10.1145/3474085.3475603
- 13.Plizzari, C., Cannici, M. & Matteucci, M. Spatial temporal transformer network for skeleton-based action recognition. In: International Conference on Pattern Recognition, pp. 694–701 (2021). 10.1109/ICPR48806.2021.9412178
- 14.Liu, H. et al. Transkeleton: Hierarchical spatial–temporal transformer for skeleton-based action recognition. IEEE Trans. Circuits Syst. Video Technol.33(8), 4137–4148 (2023). [Google Scholar]
- 15.Do, J. & Kim, M. Skateformer: Skeletal-temporal transformer for human action recognition. In: European Conference on Computer Vision (ECCV), pp. 401–420 (2024). 10.1007/978-3-031-58583-8_8
- 16.Amezquita-Garcia, J. et al. Applying machine learning to finger movements using electromyography and visualization in OpenSim. Sensors22(10), 3737 (2022). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 17.Li, C., Zhang, Z., Leow, W. K. & Cheng, Y. Online quality assessment of human movement from skeleton data. Pattern Recognit.75, 1–12. 10.1016/j.patcog.2017.10.020 (2018). [Google Scholar]
- 18.Parisi, G.I., Wermter, S. & Weber, C. A-mal: Automatic movement assessment learning from properly performed movements in 3d skeleton videos. In: Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (2019). 10.1109/CVPRW.2019.00008
- 19.Ismail-Fawaz, A., Devanne, M., Berretti, S., Weber, J. & Forestier, G. Deep learning for skeleton based human motion rehabilitation assessment: A benchmark. arXiv preprint arXiv:2507.21018 (2025) arXiv:2507.21018
- 20.Newell, K. & Irwin, G. Task and skill level constraints on the generality of the proximal–distal principle for within-limb movement coordination. J. Mot. Learn. Dev.10(1), 76–95 (2021). [Google Scholar]
- 21.Straub, R. K. & Powers, C. M. A biomechanical review of the squat exercise: Implications for clinical practice. Int. J. Sports Phys. Ther.19(4), 490–501. 10.26603/001c.94600 (2024). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 22.Adouni, M. & Shirazi-Adl, A. Knee joint biomechanics in closed-kinetic-chain exercises. Comput. Methods Biomech. Biomed. Eng.12(6), 661–670 (2009). [DOI] [PubMed] [Google Scholar]
- 23.Fong, C. et al. Ankle-dorsiflexion range of motion and landing biomechanics. J. Athl. Train.46(1), 5–10. 10.4085/1062-6050-46.1.5 (2011). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 24.Miron, A., Sadawi, N., Ismail, W., Hussain, H. & Grosan, C. Intellirehabds (irds)—a dataset of physical rehabilitation movements. Data6(5), 46. 10.3390/data6050046 (2021). [Google Scholar]
- 25.Cerelli, D., Calderara, S., Pala, P., Zappella, M. & Cucchiara, R. A Kinect-based motion capture system for physio-therapy rehabilitation. Sensors17(3), 635. 10.3390/s17030635 (2017). [DOI] [PMC free article] [PubMed] [Google Scholar]
- 26.Faccioli, S. et al. Evidence-based management and motor rehabilitation of cerebral palsy children and adolescents: a systematic review. Front. Neurol.14, 1171224 (2023). [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.
Data Availability Statement
The Kimore dataset is publicly accessible and can be directly downloaded from the website https://github.com/petteriTeikari/KiMoRe wrapper. The IntelliRehabDS dataset is publicly available and can be directly downloaded from the GitHub repos-itory https://github.com/alina-miron/intellirehabds and Zenodo https://zenodo.org/record/4610859.





















