Swimming Stroke Analysis and Technique Improvement via Pose Estimation
ABSTRACT
Swimming is a highly technical sport where small adjustments in stroke mechanics can lead to significant performance gains. Machine learning models can be used for the assessment of swimming stroke technique through video-based pose estimation to track key body landmarks and compute critical angles based on the detected key landmarks [1]. The focus is on the angle of the elbow during the pull phase, identifying deviations from the optimal range for effective propulsion [2]. The framework uses these angles to evaluate the inefficiencies in arm positioning by comparing the angles with established criteria, i.e., maintaining an elbow angle between 80-100 degrees during the pull phase leads to optimal swimming performance [3]. It also counts strokes based on significant changes in the elbow angle, identifying the completion of a stroke cycle. Results show that maintaining angles within the recommended range leads to improved propulsion and reduced drag [2]. These findings generate comprehensive post-session reports that offer swimmers actionable feedback for improving their technique. The system is tested against evaluations from coaches and proves to be an effective tool for both training and competition settings, offering an automated, data-driven approach to enhancing swimming performance.
INTRODUCTION.
Swimming is a highly technical sport where minute adjustments in stroke mechanics can lead to significant performance improvements. Freestyle swimming, in particular, requires precise body movements to maximize propulsion and minimize drag [3]. One key aspect of stroke mechanics is the elbow angle during the pull phase. Elbow angle influences both the efficiency and speed of a swimmer [2]. Traditional coaching methods rely on real-time observations by coaches, but recent advancements in computer vision and machine learning have opened new avenues for automated, data-driven technique analysis [1].
Pose estimation technology, particularly using frameworks like MediaPipe, allows for the detection of key body landmarks from video data [1]. By applying machine learning models, these landmarks can be used to assess and improve swimming stroke efficiency. In this study, I use pose estimation to evaluate the elbow angle during freestyle strokes, providing stroke counts and targeted feedback for form improvement. I aim to answer the following research questions: Can machine learning models accurately assess elbow angles during the freestyle stroke? How effective are these models in providing actionable feedback for swimmers? Can stroke counting and angle analysis be used to improve swimming performance?
This paper presents a novel approach to swimming stroke analysis, integrating machine learning with pose estimation technology to provide swimmers and coaches with automated feedback [1]. This paper advances several contributions. First, I develop a framework that leverages pose estimation to track key body landmarks and assess the swimmer’s elbow angle during the pull phase. Second, propose a stroke counting method based on significant changes in the elbow angle, allowing for automated stroke cycle identification. Third, provide an automated reporting system that generates comprehensive, actionable feedback for swimmers, helping them improve their stroke mechanics through data-driven insights.
MATERIALS AND METHODS.
In this section, the data collection and preprocessing methods are first outlined. The key swimming performance metrics are then defined. Lastly, the proposed method, which automatically evaluates swimmer performance through the estimation of these metrics, is presented.
Data collection and preprocessing.
Data collection involved pre-recorded freestyle swimming videos standardized by resolution and frame rate. Using MediaPipe Pose, key body landmarks (shoulder, elbow, wrist) were tracked frame-by-frame [1]. The elbow angle was calculated geometrically [4], while stroke counting relied on significant changes in elbow angle across frames. Optimal elbow angles (80-100 degrees) were established from biomechanical research, serving as benchmarks for generating corrective feedback [2]. Videos with excessive distortion or poor quality were excluded, resulting in a final dataset of approximately 10,000 frames from swimmers of varying skill levels.
To ensure consistency, I standardized the frame resolution and frame rate across all videos. Specifically, each frame was resized to a standard resolution, and all coordinates were transformed into a common scale for accurate comparison. Videos with poor quality, excessive distortion, or missing frames were excluded from the dataset.
The dataset spans a variety of swimmers with three different skill levels – beginner, novice, and proficient – providing a broad sample for analysis. focus on swimmers performing the freestyle stroke, collecting data across different training sessions. Each frame is time-stamped, allowing us to synchronize stroke cycles.
My final dataset consists of 20 video sessions, totaling approximately 10,000 frames. These frames are uniformly distributed across various swimmers and swimming environments. Data cleaning reduced the initial sample by approximately 15%, primarily due to frames with missing key body landmarks or significant underwater distortion.
Key swimming performance metrics.
In this study, I focus on estimating key swimming performance metrics which are critical to freestyle stroke mechanics on the collected dataset. These metrics include elbow angles, stroke counts, and arm positioning feedback. The elbow angle, which is the primary variable of interest, represents the angle at the elbow joint during the pull phase of the freestyle stroke. Stroke counts refer to the total number of strokes taken by each swimmer during the recorded session. Arm positioning feedback is derived from deviations between detected and optimal elbow angles, providing recommendations to adjust arm movements for improved performance.
Table 1. Input variable used in the analysis. | |
Category | Variable |
Stroke Metrics | Elbow angle (degrees) |
Stroke Metrics | Stroke Count |
Feedback | Arm Positioning |
Technique improvement via pose estimation.
Pose Estimation MediaPipe was used for pose estimation to detect key body landmarks in the input video. MediaPipe is a powerful machine learning framework capable of detecting and tracking 33 human body landmarks. The video was first preprocessed to convert each frame from its default color format (BGR) to the RGB format required by MediaPipe. The video was then read frame by frame using OpenCV, with each frame passed through the MediaPipe pose estimation model to identify key landmarks, specifically the shoulder, elbow, and wrist. These landmarks were essential for estimating the swimming performance metrics, as their positions were used to compute relevant metrics such as elbow angles during each stroke cycle.
Performance evaluation.
The key variables that are used for performance evaluation in this research were derived from the pose estimation results:
- Elbow angle: The elbow angle was calculated frame by frame using the geometric coordinates of the shoulder, elbow, and wrist landmarks. For each frame, the angle at the elbow joint was determined based on the arctangent of the vectors formed by these landmarks, using a specific formula as follows. The resulting angle was then normalized to ensure it remained within the range of 0 to 180 degrees. This normalized angle served as the primary metric for evaluating arm movements during the stroke.
\[\theta= |\tan^{-1}(y_{wrist}-y_{elbow},x_{wrist}-x_{elbow})-\tan^{-1}(y_{wrist}-y_{shoulder},x_{wrist}-x_{shoulder})| \tag{1}\]
- Stroke count: Stroke count was determined by detecting significant changes in the elbow angle between successive frames. A stroke was defined as the motion of the arm from a fully extended position (in front of the swimmer) to a position near the swimmer’s torso (end of the pull phase). Stroke detection was implemented by comparing the elbow angle across consecutive frames, and a significant change in the elbow angle, exceeding a predefined threshold of 30 degrees, indicated the completion of a stroke. The stroke count was incremented each time such a transition was detected.
- Feedback on arm positioning: Feedback on arm positioning was generated based on deviations from the optimal elbow angle during the pull phase. The swimmer’s elbow angle was compared against an “optimal” value for freestyle swimming, typically around 90 degrees, with a tolerance of ±10 degrees. If the detected angle fell outside the range of 80-100 degrees, feedback was provided to suggest adjustments to the swimmer’s arm positioning. For example, if the angle was too small, feedback such as “Raise your arm” would be given, and if the angle was too large, the recommendation would be “Lower your arm.” Instead of real-time feedback, the system compiled a detailed report at the end of each video analysis. This report included the total number of strokes counted, a frame-by-frame analysis specifying the elbow angle and feedback for each stroke cycle, and recommendations for adjusting arm position to improve stroke efficiency based on deviations from the optimal angle. The report was generated in plain text format and stored as swimming_report.txt, allowing swimmers and coaches to review the analysis and recommendations post-session to make informed decisions for improving technique.
RESULTS.
Pose Estimation Results.
The pose estimation model plays a critical role in the proposed method, as it directly influences the accuracy of subsequent swimming performance evaluation. The pose estimation model demonstrated high accuracy in detecting elbow angles and counting swim strokes. Quantitatively, the model accurately detected elbow angles in 96% of the analyzed frames. The average elbow angle during the pull phase was 87.5 degrees, with 90% of swimmers maintaining an angle between 80–100 degrees, which aligns with optimal biomechanics for freestyle swimming. Additionally, the stroke counting model achieved an accuracy of 98%, correctly identifying 98 out of 100 swim cycles, compared to an average of 99 strokes counted manually by swimmers.
Qualitatively, feedback generated by the system aligned closely with swimmer performance and self-assessments. Swimmers reported that the feedback was clear and actionable, particularly regarding arm positioning. A heat map (Figure 1) visualizes the distribution of elbow angles across swimmers, highlighting common ranges where adjustments were recommended. Specifically, 40% of swimmers were advised to raise their arms (indicating a smaller-than-optimal elbow angle), while 20% were advised to lower their arms. These results indicate that the pose estimation model provides reliable, consistent measurements and meaningful feedback that swimmers find useful for improving their technique.

Figure 2 above shows the pose estimation model applied to a swimmer performing a freestyle stroke. Key landmarks (shoulder, elbow, and wrist) are tracked, and the elbow angle is calculated based on the geometric relationship between these points. The calculated angle is overlaid on the swimmer’s arm, illustrating the model’s method for analyzing arm movement during the pull phase.

Variable Correlation.
I analyzed the correlations between various factors influencing swimming stroke efficiency, including elbow angles, stroke counts, and arm positioning feedback. The correlations displayed were calculated using the Pearson correlation coefficient, which measures the linear relationship between two continuous variables. The dataset consisted of swimming performance metrics from 50 different swimmers, including elbow angles, stroke counts, time per lap, and feedback scores. Prior to analysis, the data was preprocessed to standardize variables and handle any missing values. The Pearson correlation coefficient (r) was computed using the formula.
\[r\ =\ \frac{\sum{\left(X_i-\bar{X}\right)\left(Y_i-\bar{Y}\right)}}{\sqrt{\sum\left(X_i-\bar{X}\right)^2}\bullet\sqrt{\sum\left(Y_i-\bar{Y}\right)^2}}\tag{2}\]
where Xi and Yi represent individual data points, and X̄ and Ȳ are the means of the respective variables. The resulting correlation coefficients, ranging from -1 (perfect negative correlation) to 1 (perfect positive correlation), were organized into a correlation matrix. This matrix was visualized as a heatmap, with red indicating strong positive correlations, blue indicating strong negative correlations, and lighter shades representing weaker correlations.
The heat map (Figure 2) illustrates the correlation analysis results. I found that the elbow angle during the pull phase was strongly correlated with stroke efficiency, with an optimal angle (80-100 degrees) showing the highest correlation to performance. Similarly, stroke count was inversely correlated with time per lap, indicating that fewer, more efficient strokes led to faster lap times.
Interestingly, underwater distortion negatively impacted elbow angle detection, particularly in frames where the swimmer’s arm was submerged. This is evident from the weaker correlation between elbow angle consistency and stroke efficiency in underwater frames compared to above-water frames.
DISCUSSION.
This research demonstrates that machine learning models, combined with pose estimation technology, can effectively analyze swimming strokes and provide actionable feedback to improve technique. By focusing on the elbow angle during the pull phase of the freestyle stroke, my system provides swimmers with specific insights into their form, allowing for targeted adjustments. The system’s ability to detect stroke counts and calculate elbow angles with high accuracy suggests that it can serve as a valuable tool for both swimmers and coaches.
The results of the analysis show that swimmers who maintain an elbow angle within the optimal range (80-100 degrees) exhibit more efficient stroke mechanics, leading to improved propulsion and reduced drag. Swimmers with elbow angles consistently outside this range receive feedback aimed at improving form, such as recommendations to adjust arm positioning.
One key advantage of this system is its scalability and non-intrusive nature. Traditional coaching methods rely heavily on real-time observation, which may not capture all the subtleties of stroke mechanics. In contrast, my system allows for post-session analysis through video data, providing comprehensive feedback on every stroke. This approach offers the potential to enhance training efficiency by giving swimmers detailed reports that they can review and apply during future training sessions.
Furthermore, the stroke counting functionality proved accurate, aligning closely with manual counts performed by coaches. This consistency further demonstrates the system’s reliability and reinforces its potential for integration into daily training routines.
Overall, the integration of machine learning and pose estimation presents a novel and effective method for analyzing swimming technique. With further development and refinement, this approach could revolutionize the way swimmers and coaches approach performance analysis, making high-level technique optimization accessible to a broader audience.
CONCLUSION.
In conclusion, I developed an automated system that uses pose estimation to analyze swimming strokes and provide feedback on form. My results show that maintaining an elbow angle between 80-100 degrees during the pull phase is critical for maximizing propulsion. The stroke counting model was highly accurate, and the feedback generated was consistent with expert evaluations. This research offers a promising new approach to swimming stroke analysis, using machine learning to deliver data-driven insights for performance improvement.
ACKNOWLEDGMENTS.
Thank you to An Zhao from University College London and to Lumiere Education for facilitating the collaboration.
REFERENCES
- 1. Cao, T. Simon, S. Wei, Y. Sheikh, OpenPose: Realtime multi-person 2D pose estimation using part affinity fields. IEEE Trans. Pattern Anal. Mach. Intell. 39, 7291–7299 (2017).
- V. Gourgoulis, P. Aggeloussis, A. Kasimatis, I. Vezos, D. Boli, K. Mavromatis, The effect of leg kick on sprint front crawl swimming. J. Sports Sci. 32, 278–289 (2014).
- A. McCabe, J. Trevathan, Artificial intelligence in sports prediction. J. Inf. Technol. 5, 1194–1197 (2008).
- A. Toshev, C. Szegedy, DeepPose: Human pose estimation via deep neural networks. IEEE Trans. Pattern Anal. Mach. Intell. 36, 1653–1660 (2014)
Posted by buchanle on Thursday, June 19, 2025 in May 2025.
Tags: Pose Estimation, Stroke Analysis, Swimming, Video Analysis