Researchers at the intersection of computer vision and sports analytics have developed a novel deep learning framework designed to identify specific tennis strokes from single video frames with high precision. Published in Discover Computing, the study introduces the Hybrid CoaT-PAF architecture, a pose-guided cross-scale attentional transformer that integrates spatial and contextual fusion to distinguish between visually similar athletic movements. The model achieved an overall accuracy of 96.28% on a balanced dataset of four tennis stroke classes, outperforming conventional convolutional neural network and transformer baselines. This approach addresses a persistent challenge in sports action recognition, where subtle differences in body pose and racket position often obscure the boundaries between distinct stroke categories.
The primary difficulty in recognizing tennis strokes from static images lies in the fine-grained nature of the visual differences between actions. Forehands, backhands, serves, and ready positions often share similar backgrounds, court markings, and general player silhouettes. The study notes that discriminative cues are frequently confined to small regions involving the wrist, arm, and racket, which can be easily overwhelmed by global visual information in standard models. To overcome this, the proposed framework utilizes a Pose-Aware Feed-Forward Network, or P-FFN, which modulates feature learning within the transformer blocks to emphasize pose-sensitive structures without relying on external skeletal coordinate inputs.
The architecture is built upon a hybrid convolutional and transformer design, specifically extending the CoaT framework. It begins with a shallow convolutional stem that captures low-level textures and boundaries, followed by multi-scale patch embeddings. This dual-scale approach allows the network to process fine-grained details of the racket and limbs alongside broader representations of the player’s overall body configuration. By projecting the convolutional features into two distinct spatial resolutions, the model can adaptively balance the need for local precision and global contextual understanding, a critical requirement for distinguishing strokes that differ only in minor postural adjustments.
Central to the model’s performance is the Cross-Scale Gating Mechanism, which dynamically determines the relative contribution of fine-scale and coarse-scale features for each input image. Rather than assigning fixed importance to specific resolutions, this mechanism uses a learnable gate to coordinate information across spatial hierarchies. This is further enhanced by a Dual-Branch Spatial–Contextual Fusion module that processes localized pose-related cues and global contextual information through separate branches before combining them via cross-branch attention. This design reduces ambiguity between visually similar stroke classes by ensuring that local action regions are interpreted in relation to the overall player posture.
The study evaluated the proposed framework on the Tennis Player Actions Dataset, which consists of 2,000 images evenly distributed across four classes: serve, forehand, backhand, and ready position. Each class contained 500 images, which were split into a 70% training set and a 30% testing set. The dataset includes variations in player pose, racket orientation, lighting, and camera position, providing a realistic range of visual conditions for frame-based recognition. Preprocessing involved downsampling images to 224 by 224 pixels and applying standard ImageNet normalization, along with data augmentation techniques such as random horizontal flipping, rotation, and intensity jittering to improve model robustness.
Performance comparisons were conducted against three baseline models: Inception-v4, a simple five-layer CNN, and BiFormer, a bi-level routing transformer. The proposed Hybrid CoaT-PAF model demonstrated superior performance across all major metrics. While Inception-v4 achieved an accuracy of 80.20% and the simple CNN reached 85.20%, the BiFormer baseline performed better with 91.30% accuracy. The proposed model significantly outperformed these baselines, achieving 96.28% accuracy, 94.92% precision, 96.62% recall, and an F1-score of 95.01%. The results were further validated through seven-fold cross-validation, which yielded a consistent accuracy of 96.08%, confirming that the performance improvements were not merely an artifact of a specific data partition.
To ensure the model’s decisions are transparent and reliable, the researchers employed a multi-level explainability strategy using Grad-CAM, LIME, and SHAP. These interpretability tools revealed that the model consistently attends to biomechanically meaningful regions, such as the racket, wrist, and shoulder, rather than irrelevant background elements. The Grad-CAM focus ratio, which measures the percentage of activation coinciding with annotated player regions, reached 91.42% for the proposed model, significantly higher than the baselines. Additionally, the SHAP relevance score of 93.58% indicated that the model relies heavily on semantically meaningful features, providing a quantitative basis for its interpretability and reducing the risk of spurious correlations.
Ablation studies were conducted to determine the specific contribution of each architectural component to the overall performance. The baseline CoaT model achieved 90.82% accuracy, which improved to 92.46% with the addition of the convolutional stem and 94.22% with multi-scale embeddings. The introduction of the P-FFN raised accuracy to 95.01%, and the Cross-Scale Gating Mechanism further increased it to 95.99%. The leave-one-out analysis confirmed that removing any of the key modules, including the Spatial–Contextual Fusion, resulted in a measurable drop in performance. This demonstrates that the high accuracy is derived from the complementary interaction of pose-sensitive refinement, multi-scale learning, and contextual fusion, rather than a single isolated component.
Computational efficiency was also a key consideration in the design of the Hybrid CoaT-PAF framework. The model contains 24.8 million trainable parameters and requires 5.2 GFLOPs for inference, which is lower than the 42.7 million parameters and 8.4 GFLOPs required by Inception-v4. In terms of latency, the proposed model achieved an inference time of 6.9 milliseconds per frame, translating to a theoretical throughput of approximately 144.93 frames per second. This is faster than the baselines, including BiFormer, which operated at 8.1 milliseconds per frame. The lower memory footprint of 5.2 GB compared to 7.1 GB for Inception-v4 suggests that the architecture is suitable for real-time applications in sports analysis systems, where minimal delay is essential for practical deployment.
Despite the strong results, the study acknowledges several limitations that must be considered when interpreting the findings. The evaluation was limited to a small number of baseline architectures and a dataset of 2,000 images, which is relatively small compared to the vast variation seen in competitive tennis. The model does not explicitly model temporal dependencies or motion trajectories over a sequence of frames, focusing instead on static, frame-based recognition. The authors note that while key frames contain critical discriminative information, the dynamics between stroke phases may also provide valuable cues. Future work will involve testing the framework on larger, multi-source datasets with greater diversity in players, court surfaces, and camera viewpoints to better assess its generalization potential in real-world environments.
The research contributes to the growing field of intelligent sports analytics by demonstrating that hybrid transformer architectures can effectively handle fine-grained action recognition tasks. By integrating pose-aware modulation and cross-scale fusion, the model provides a robust solution for distinguishing subtle athletic movements that challenge traditional deep learning approaches. The high level of interpretability achieved through Grad-CAM and SHAP analysis further enhances the model’s utility for coaches and analysts who need to understand the basis for automated decisions. This work highlights the potential of explainable AI in sports technology, offering a transparent and accurate tool for performance analysis and automated video analytics.
The availability of the dataset and code for this study facilitates reproducibility and further research in the field. The dataset is freely accessible, and the implementation is available through public repositories, allowing other researchers to build upon this work. As sports analytics continues to evolve, the integration of advanced transformer models with explainable AI techniques is likely to play an increasingly important role in understanding and optimizing athletic performance. The findings from this study provide a solid foundation for future developments in frame-based action recognition, particularly in domains where visual differences between categories are subtle and context-dependent.
Subject of Research: Development of a pose-guided cross-scale attentional transformer for frame-based tennis stroke recognition
Article Title: Pose-guided cross-scale attentional transformer learning with spatial–contextual fusion for explainable frame-based tennis stroke recognition
Article References: Ren, J. (2026). Pose-guided cross-scale attentional transformer learning with spatial–contextual fusion for explainable frame-based tennis stroke recognition. Discover Computing, 29(1), Article 829. https://doi.org/10.1007/s10791-026-10677-x
Image Credits: AI Generated
DOI: 10.1007/s10791-026-10677-x
Keywords: tennis stroke recognition, transformer architecture, computer vision, sports analytics, explainable AI, cross-scale attention, deep learning, action recognition, Pose-guided, cross-scale, attentional, transformer
News Source: Cassandra Pierce. (November 10, 2026). Transformer Model Achieves 96.28% Accuracy in Tennis Stroke Recognition. Scienmag.



