Front-Crawl Instantaneous Velocity Estimation Using a Wearable Inertial Measurement Unit

Monitoring the performance is a crucial task for elite sports during both training and competition. Velocity is the key parameter of performance in swimming, but swimming performance evaluation remains immature due to the complexities of measurements in water. The purpose of this study is to use a single inertial measurement unit (IMU) to estimate front crawl velocity. Thirty swimmers, equipped with an IMU on the sacrum, each performed four different velocity trials of 25 m in ascending order. A tethered speedometer was used as the velocity measurement reference. Deployment of biomechanical constraints of front crawl locomotion and change detection framework on acceleration signal paved the way for a drift-free integration of forward acceleration using IMU to estimate the swimmers velocity. A difference of 0.6 ± 5.4 cm·s−1 on mean cycle velocity and an RMS difference of 11.3 cm·s−1 in instantaneous velocity estimation were observed between IMU and the reference. The most important contribution of the study is a new practical tool for objective evaluation of swimming performance. A single body-worn IMU provides timely feedback for coaches and sport scientists without any complicated setup or restraining the swimmer's natural technique.


Introduction
The advent of new technologies has changed the perception of athletic achievement. In swimming, the narrow gap between record holders, points to the growing importance of devising new tools to assess self-improvement and optimize the training process. However, the biomechanical analysis of swimming remains inadequately explored due to complications of kinematics measurements in water.
To date, the most common practice for performance monitoring in swimming is using video-based systems. A video sequence is captured and post-processed through digitization [1,2]. The main downside of such systems is being excessively time consuming and problematic to fully automate. The application of this class of methods can be severely restricted by factors such as light refraction in water or bubbles generated around the swimmers' bodies [3]. Recently a markerless 3D analysis method was proposed [4] based on extraction of a swimmer's silhouette. This method reduced the video processing time, while still being sensitive to different lighting condition that leads to misidentification of features [5].
The second category of techniques uses tethered monitoring. An early version of such a system was developed by Craig et al. [6]. Velocity is directly measured by a cord attached to the swimmer. The cord is tethered to a poolside shaft-encoder [7,8]. Although this system is considered as reference to assess swimming velocity, the device disturbs the swimmers' technique and measures the velocity only in the forward direction. Moreover, the system requires a resisting force to tighten the cord during the decelerations of swimmer for an accurate measurement. Hence, this force is constantly applied to the swimmer.
During the past two decades inertial measurement units (IMUs) have been proven to be powerful tools in human movement analysis [9]. First and foremost the portability of IMUs made them a viable system in daily life measurements, contrary to most other measurement systems which are restricted to laboratory conditions. Besides, the technological developments in microelectromechanical systems (MEMS) have made IMUs a low cost option compared to in-laboratory settings. The application of IMUs for sport analysis is a new trend in sport biomechanics [10][11][12]. A considerable number of studies have been conducted on the application of IMUs in the swimming context. Chronologically, Ohgi et al. [13] were probably the first to use a wrist-worn IMU to detect front crawl and breast stroke swimming phases automatically. A sacrum mounted 3D accelerometer was used by Davey et al. [14] to automatically extract simple metrics such as lap time and stroke rate. An IMU comprising a 3D accelerometer, 2D gyroscope and RF transceiver was used by Le Sage et al. [15] to characterize swimming strokes in real time. However, none of aforementioned works involved kinematic measurements using IMUs. Recently, Stamm et al. [16] published a method using a 3D accelerometer on the lower back to measure the front crawl velocity. However, a single 3D accelerometer generally is not capable of measuring the orientation of the body during dynamic movement. Consequently, the effect of lateral and vertical acceleration of swimmer's body cannot be removed from acceleration in the forward direction of swimming, therefore, calculating the integral of the acceleration signal in [16] to evaluate the velocity can be misleading. Besides, it is well known that the accuracy of IMU-based systems in velocity measurement rapidly degrades over time due to inherent sensor noises [17]. Hence special considerations are needed for a reliable assessment of velocity.
Considering the velocity as the most intuitive metric of swimmers' performance, this study aimed to propose a new method to measure swimming velocity in front crawl, using a single body-worn inertial sensor. We hypothesize that the swimmer's instantaneous velocity can be estimated accurately from IMU measurements when the average velocity of the swimmer over the trial is known. Drift-free integration of acceleration was certified in this study by assuming some simple locomotion constraints of the front crawl. Experimental protocols and statistical tools are introduced to assess the validity of the cycle and instantaneous velocity estimation method.

Participants and Protocol
Eleven elite and nineteen recreational swimmers took part in this study. Their attributes are shown in Table 1. Each participant was informed of the procedures and risks associated with study participation and gave written informed consent prior to participation. This study was performed in accordance with the Declaration of Helsinki and was approved by the Ethics Committee of the Faculty of Biology and Medicine, University of Lausanne (protocol #87/10).
Each swimmer performed consecutive 25 m front-crawl trials in four different increasing velocity trials from 70% to 100% of their best personal 100 m timing recorded one month before the measurement. In case the performance time was different more than ±5% from the targeted time, the swimmer repeated the trial. They were asked to position in the water at the edge of the pool for starts.

Data Acquisition and Calibration
The swimmers were equipped with one waterproofed inertial sensor (Physilog ® , BioAGM, La Tour-de-Peilz, Switzerland) including a 3D accelerometer (±11 g) and a 3D gyroscope (±900 °/s) and embedded data logger recording at 500 Hz. The sensor was worn on the sacrum inside the pocket of a custom designed swimming suit with a Velcro closing as shown in Figure 1. According to the feedback from swimmers, by wearing the sensor attachment in our study they did not feel the IMU imposed a noticeable drag during their training. The sensor was calibrated for offset, scale and non-orthogonality using in-field calibration procedure [18].
As reference system, a tethered apparatus (SpeedRT ® , ApLab, Rome, Italy) [8] was attached to the waist of swimmers just beneath the lower end of the sensor with a belt. The system calculates the velocity by measuring the cord displacement through time at 100 Hz recording. The resistance applied to keep the cord tight is adjustable via a clutch on the pulley compartment of the apparatus. In our measurement, the resistance was set to 500 g [19]. Since the tethered reference is installed on the starting block above the swimming level, the SpeedRT ® cord is not parallel to the direction of swimming and imposes the parallax problem [15]. By knowing the cord displacement at each time instant and the fact that the reference pulley was positioned 72 ± 1 cm above still pool water level, we calculated the instantaneous velocity measured by the reference in the swimming direction.

Estimation of Swimming Orientation Using IMU
Instantaneous velocity is estimated by integrating the forward acceleration signal in the global frame (GF: X, Y, Z) ( Figure 1). Among the axes of GF the Z is assumed to be vertically upward and Y in parallel with the longitudinal edge of the pool. The acceleration in GF can be calculated from the acceleration measured in sensor frame (SF: x, y, z) by considering the orientation of SF relative to GF at each time sample. The following paragraphs describe the required steps. Figure 1. The inertial sensor with water proofing box and its placement. The global frame (GF: X, Y, Z) and the sensor frame (SF: x, y, z) and relative quaternion SF GF t q  that represents sensor frame data in the global frame is also shown.
By starting the trials from a relatively motionless posture in water, the initial sacrum acceleration a a a    has a magnitude equal to the gravity. Using quaternion based algebra to represent the orientation, the initial quaternion which aligns the z axis to Z, is given by: where, ||.|| represents Euclidian norm, θ 0 is the initial inclination and u 0 represents the horizontal axis around which the rotation is done. Supposing that azimuth angle at start of trial is null, θ 0 and u 0 can be calculated as in Equation (2) and Equation (3), respectively: where × represents the normal cross product. At each time step t, the orientation of SF relative to GF, SF GF t q  is updated using the previous orientation by integrating the angular velocity ,, where f is sampling frequency and  indicates quaternion multiplication.
The time integration in Equation (4) suffers from an accumulative drift [17] due to gyroscopic noise. In order to reduce the effect of this drift we applied a dynamic biomechanical constraint, namely considering the swimmer sacrum rolls in average about forward direction Y. Therefore, for the data samples from cycle k to k + 1 (denoted by k C and C k+1 respectively), the principal component of angular velocity in GF (represented by ) should be aligned to Y. This can be mathematically written as: Any deviation from the conditions of Equation (5) was assumed to be the effect of the orientation drift. Figure 2 shows the deviation of one cycle from this condition. The amplitude of the drifted angle is given by Equation (6): Accordingly the rotation axis is presented as in Equation (7): So if we suppose that the drift is linearly increased through one cycle with n data points, for the t th sample we can compute the corrective quaternion as in Equation (8): Therefore, the corrected orientation of SF relative to GF, , k SF GF tC q  can be calculated from Equation (9): The instantaneous forward acceleration in global frame can be calculated according to Equation (10), where shows the gravity vector:

Instantaneous and Cycle Velocity Estimation
The instantaneous velocity V t can be obtained by trapezoidal integration of a Y t . Nevertheless, this operation is not drift-free and results in a slow gradual trend in the cycle mean velocity . This velocity drift should be discriminated from the actual change originating from body action which accompanies a change in acceleration amplitude. Therefore, the forward acceleration a Y t is divided into segments where the range of acceleration remains within the same interval. Subsequently, at each segment we filter out the velocity drift.
We used the geometric moving average (GMA) change detection algorithm [21] for a Y t segmentation. The algorithm is based on recursive estimation of signal variance and detecting if the variance change exceeds a predefined threshold. The threshold was selected empirically as 20% of the a Y t variance. Much smaller thresholds end up to detection of spurious signal segments while higher thresholds cannot recognize any changes of swimming regime. Figure 3(a) illustrates the result of this segmentation.
For velocity drift removal, we assumed the average trend of V t peaks within each segment is quasi-constant due to the steady regime of swimming. Therefore, at each segment, cycle minimum and maximum peaks of V t were extracted and a shape preserving spline [22] was fitted to these peaks [23].
De-trending was done by subtracting the average of upper and lower trend curves from the original velocity curve. Figure 3(b) depicts the extraction of the trend pattern. The instantaneous velocity curve then will be corrected for trial mean velocity by assuming that the average velocity of the trial is known from length of the pool and the duration of each trial. Finally, was estimated as the mean value of V t for each cycle C k . The algorithm development phase was completed by using the data of only 10 swimmers and then our algorithm was applied to the entire data set (30 swimmers).

Statistical Analysis
A twofold validation of the proposed velocity estimation method is presented in this section. In the first step, we provided the statistics to assess the cycle mean velocity estimated using our system ( ). To this end, the mean (accuracy) and standard deviation (precision) of the difference between measured by SpeedRT system and obtained from IMU, , was calculated for different trials of each subject. Spearman's rank correlation was also used to verify the association between the two systems. Agreement between the two systems in measurement was assessed by use of Bland-Altman plot [24] and normalized pairwise variability index (nPVI) [25] as calculated by Equation (11) (11) where N is the total number of studied cycles. The Bland-Altman plot was inspected with correlation exploration for existence of heteroscedasticity [26].
In the second step we investigated the efficiency of our method in measuring the instantaneous velocity. The root mean squared (RMS), maximum and corresponding relative error of instantaneous velocity was calculated. As these calculations require similar time sampling of proposed and reference systems, the instantaneous velocity curve calculated by our method was downsampled to 100 Hz prior to error calculations. Besides, an indirect measure of accuracy of our system in instantaneous velocity measurement was provided by assessment of intra-cyclic velocity variation (IVV). In fact, the concurrent validity of our method was assessed by investigating IVV of the two groups of swimmers (Elite and Recreational), estimated by the two systems. IVV is computed as in Equation (12): (12) where represents cycle frequency, C is the number of cycles in the trial and n is the number of trial samples [27]. We performed a three-way repeated ANOVA (significance level of p < 0.01) to examine the effect of trial, group and measurement device on IVV.

Results and Discussion
We have proposed a new wearable system and dedicated algorithms to measure front crawl velocity and described its validation procedure against a reference tethered device. Figure 4 illustrates a typical result of the instantaneous velocity obtained with our method and the reference system. A total number of N = 1,448 cycles were compared between the two systems.  Table 2 summarizes the comparison between the two systems for all four different ranges of mean velocity (as measured by the reference and IMU). The results demonstrate that the proposed system is capable of measuring front-crawl velocity with acceptable accuracy (below 1.1 cm· s −1 ) and precision (below 5.8 cm· s −1 ) suggesting that our method can be reliably used for cycle mean velocity measurements. This accurate estimation of stroke cycle velocity was possible thanks to: (i) sensor orientation drift removal in GF using the principal component of swimming kinematics; (ii) velocity drift removal by introducing an appropriate segmentation of forward acceleration and by a spline shape modeling of the drift at each segment after integration of acceleration. The two systems differed by 3.5% in assessment of variations as presented by nPVI in Table 2. The nPVI values in Table 2 shows that the difference in variability assessment of between the two systems in four ranges of velocity is less than 3.9%. This result as well as high correlation between the two systems confirms that our method detects the changes similar to the reference and supports the validity of our estimation.  Limits of agreement (dot lines) are located at mean difference ±1.96 standard deviation of the difference.
The Bland-Altman plot showed the 95% limits of agreement lower than 10.8 cm· s −1 between the two systems in assessment as depicted in Figure 5, where no significant difference and no heteroscedasticity (correlation = 0.03) were found. This finding, implies uniform performance of the method throughout the studied range of . It is noteworthy that by using the prior information about pool length to correct the velocity profile an error of 10.4 ± 39.7 cm is observed in estimating the sacrum's displacement. This error was expected since the sacrum does not necessarily travel a complete length of the swimming pool.
As regards validation of instantaneous velocity, an RMS difference of 11.3 cm· s −1 was observed that is comparable to the precision of the reference system. The maximum instantaneous error was 18.2 cm· s −1 that corresponds to a relative error of 9.7%. One source of the difference between the velocity estimated by our method and the velocity measured by the reference is a small artifact due to the non-rigidness of the swimming suit. Nevertheless, the custom designed swimming suit used to fix the sensor did not allow the sensor to move drastically and kept the artifact within a tolerable range. Moreover, during high accelerations when the artifact is more pronounced, the random bias of accelerometer is less significant (higher signal to noise ratio) which leads to acceptable results [28].
Indirect validation of instantaneous velocity by IVV in Table 3 through four different velocity ranges and the two different groups of participants, suggests that the IMU can be used for the study of instantaneous velocity variations. Indeed, our system, in accordance with the reference, showed a significant difference (p < 0.01, p < 0.001) to discriminate elite and recreational group based on IVV values (in different ranges of velocity). The reference showed an IVV change from 13.7% to 17.5% for the elite group and from 19.6% to 23.3% for the recreational group. Our method in accordance with the reference, showed significantly lower IVV values for elite swimmers ( Table 3) that is consistent with previous studies [7,29]. Table 3. Comparison of intra-cyclic velocity variation (IVV) between the two systems for elite and recreational groups in different trials. a p < 0.01 and b p < 0.001: significant difference between IVV of the two groups for the same measurement system. * p < 0.001: significant difference between the two systems in IVV assessment.

Group
Number Another observation from Table 3 is that the IMU tends to underestimate the IVV as presented by positive error values. However, the ANOVA shows that the small systematic difference between the two systems is not affected by group factor (p > 0.3). In a nutshell, using IMU the same systematic error can be seen for different groups of swimmers and can be compensated.
The ability of the inertial sensor to distinguish the variability of the movement of the subjects with different performance levels propounds the application of the inertial system in the study of swimming velocity. The capacity of our system to detect IVV changes also provides important evidence that our velocity drift removal method does not cancel out the velocity variations. Indeed, different swimming trial regimes were recognized based on changes of acceleration magnitude. These regimes are treated separately to mitigate the effect of the velocity drift and thereof variation of velocity signal was well maintained.
Signal segmentation using GMA is the core of drift removal in our method. Therefore, investigating the effect of changing the segmentation threshold in GMA can be illustrative of the method's robustness. To this end, the threshold in the GMA algorithm was shifted 5%. The effect of this change on the estimation is shown in Table 4. It can be seen that a decrement of 5% in the threshold led to a bigger error in the estimated velocity than equal increment. The small threshold caused many spurious segments on the a Y t signal which resulted in excessive localized correction on the velocity pattern; on the contrary, since during 25 m laps the actual acceleration profile of the swimmers does not change frequently, the higher threshold did not notably cut down on the algorithm performance. Our dataset includes only one type of initial condition (swimming starts from a relatively motionless posture in water followed by a wall push) that is a subset of possible initial conditions in swimming. However, the study of other initial condition was not feasible within the scope of our experiment for practical reasons. Since the tethered reference only measures the velocity in forward direction of swimming, comparison of the multi lap data with turns between the IMU and the tethered device was not realizable. Although diving from the start block was a possibility, we avoided it for two practical considerations. Firstly, during the diving period calculation of the parallax effect on the velocity measured by the tethered reference is not possible. Secondly, avoiding the dives we could collect more stroke cycles which augments the statistical power of our study.
The algorithm we proposed in this paper, despite providing timely results, should not be misinterpreted as being real time. The data stream of one complete lap serves as the input of our algorithm since the correction is performed per lap. For a near real-time implementation of our method a crucial step is to determine the cycle mean velocity without using prior information about pool length.

Conclusions
The proposed method presents a reliable IMU-based system that can be practically used to measure the swimming velocity as the most intuitive metric of the athlete's performance. The system is user-centric meaning that several athletes can wear their own sensor at a time without interfering with the other athletes' measurements. Development of such a tool can help coaches pinpoint the strengths and weaknesses of the athletes during workout sessions and design an optimal personal training plan for athletes to improve their performance.
Accurate measurement of swimming velocity allowed the assessment of intra-cycle variability, an important determinant of swimming efficiency. Analysis of swimming velocity along with other parameters such as coordination [11] and energy expenditure can shed a new light on the biomechanics of locomotion in water. Further studies towards developing signal processing techniques for accurate assessment of velocity in the other swimming strokes are required. Estimation of cycle mean velocity independent of pool length information is also an interesting open problem in the future perspective of the study.