Abstract
With the increasing awareness of fitness, yoga has become a popular exercise for improving physical and mental health. To assist practitioners through automated systems, this paper proposes a method that addresses low accuracy in current yoga pose recognition by integrating a multi-head attention mechanism and ensemble learning. Firstly, the Mixup algorithm is used to enhance yoga movement images. Subsequently, convolutional features are extracted using ResNet101 and VGGNet19 transfer learning models. Finally, the extracted features are combined and stacked using a multi-head attention mechanism. Experimental results demonstrate that the proposed method achieves a training accuracy of 100%, a validation accuracy of 89.94%, a testing accuracy of 93.79%, and a detection speed of 297 frames per second. This method demonstrates high stability and robustness, providing a technological foundation for intelligent recognition of yoga poses.
Introduction
The surge in yoga's popularity has led many practitioners to rely on self-learning or remote videos, which lack the corrective feedback of a live instructor. Automated pose recognition systems could bridge this gap; however, they face significant hurdles. Subtle differences between similar poses make classification difficult, and environmental noise such as lighting variations or background occlusions often lead to false positives. Furthermore, there is a persistent trade-off between accuracy and real-time processing speed. This research introduces a high-performance system that fuses deep learning architectures using an ensemble "stacking" strategy and a multi-head attention mechanism to provide a technological foundation for intelligent yoga pose recognition.
Methodology
The proposed architecture follows a multi-stage pipeline designed for both robustness and inference efficiency.
Data Augmentation and Preprocessing
To combat overfitting and improve generalization, the Mixup algorithm is employed. This technique creates synthetic training samples by performing a linear interpolation of two random images and their corresponding labels. This results in a smoother decision boundary and a more diverse training set, helping the model generalize to unseen real-world data.
Feature Extraction via Transfer Learning
Instead of training from scratch, the system leverages pre-trained ResNet101 and VGGNet19 models. ResNet101 utilizes residual connections to handle deep feature hierarchies without gradient degradation, while VGGNet19 uses stacked small convolution kernels to capture fine-grained spatial details.
Ensemble Stacking and Multi-head Attention
The core innovation lies in the fusion of features. Extracted features from both models are stacked and passed through a multi-head attention mechanism. This allows the model to "attend" to different parts of the pose simultaneously—for example, focusing one head on limb extension and another on torso alignment—before final classification. The attention mechanism acts as an intelligent filter, weighing which features from which model are most relevant for a specific pose.
Loss Function
During training, the authors replaced standard cross-entropy with a Soft Target Cross-Entropy loss function. This uses probability distributions rather than one-hot labels, resulting in a smoother loss landscape and better model stability.
Experimental Results
The study utilized two primary data sources covering seven common yoga poses: Bridge, Cobra, Downward Dog, Mountain, Tree, Triangle, and Warrior. A general open-source dataset was used for training, while a self-built evaluation dataset tested the model's performance on "unseen" real-world data.
Performance Metrics
The proposed model significantly outperformed standalone versions of its constituent networks:
- Accuracy: The model achieved 100% training accuracy, 89.94% validation accuracy, and 93.79% testing accuracy.
- Inference Speed: It maintained a detection speed of 297 FPS, which is well above the threshold required for smooth real-time video processing.
- Ablation Study: Comparison results showed that the integration of multi-head attention and transfer learning provided a massive boost; for instance, standalone ResNet101 without transfer learning achieved only ~52% accuracy.
Discussion and Conclusion
The results demonstrate that ResNet and VGGNet have complementary strengths: ResNet captures global structure effectively, while VGGNet excels at local textures. Stacking them provides a more holistic view of the pose. Despite using an ensemble of two large networks, the model is highly optimized, suggesting that the bottleneck in pose recognition is not necessarily network depth, but how features are fused.
While the current model is limited to seven poses, future work will focus on expanding the dataset to include a wider variety of asanas and exploring 3D pose estimation or temporal data to capture the "flow" of movements. Overall, this method provides a stable and robust foundation for intelligent fitness coaching.
Summary updated