Wearable device for swim assessment: a new ecologic approach for communication and analysis

This paper describes a wearable system for the assessment of swim performance focusing on the description of the system and especially on the novel method for data transmission in water, and the algorithm used for extracting some parameters for the qualitative assessment of the performance. We placed a 3-axes Inertial Measurement Unit (IMU) on the athlete’s back in a specific swimsuit, which also allows for recording 1-lead ECG. The system and the algorithm have been tested on 13 trials with 10 subjects comparing the results with data extracted from video recording. The system demonstrated able and reliable to measure time and kinematic parameters of swimming.


INTRODUCTION
The definition of the term "Swim" reported in many dictionary is: "A coordinated series of movements, made by men or animal, so that they can move on the water surface and underwater".The definition is focused on "coordinated movements"; this coordination is essential for increase the performances optimizing the energy expenditure.The two most important physical principles to swim faster and more efficiently are a) the reduction of water resistance improving body balance and body rotation, b) the increase of the propelling force by improving the arm strokes and hence the stroke efficiency [1] .Technique and coordination are strategic and even minimal changes could result in significant performance modification.It is evident how the evaluation of this coordination of movements is paramount for the coach in order to select and differentiate the best training based on the athlete characteristics.At now, all these evaluations are accomplished by means of qualitative analysis of direct visualization by the coach, or post-analyzed video.Both these two methods lack for precision because they are based on qualitative analysis of the athletic gesture.However, thanks to the use of wearable, the assessment of gestures and movements by means of Inertial Measurement Unit (IMU) is very suitable for this kind of monitoring and evaluation.The use of accelerometers and gyroscopes in sports monitoring has been validated in numerous studies covering different disciplines [2].This work describes a system for monitoring a swimmer by means of an IMU based wearable device through a sensorized swimsuit.This work particularly shows the algorithms developed for the data processing and features extraction and a novel method for communicating data from the inside of the water.

MATERIALS AND METHODS
Four parts compose the developed system: 1.The sensorized swimsuit; 2. A wearable device; 3. Matlab ® algorithm;

The android App
This system is only for research in order to find the best reliable wireless protocol and algorithm.The final product will consist only of two parts: the sensorized swimsuit with the device (with embedded algorithms) and the mobile application.

The sensorized swimsuit
The smart swimsuit has been built starting from a standard woman top swimsuit.A pocket has been sewn between the two blades in order to lock the wearable device.The pocket is the same texture of the swimsuit; with this arrangement the costume always keeps the same elasticity.Two textile silver patches have been stitched in the front part of the costume on the bottom elastic band.These patches are the two ECG electrodes.The signal is conduced form the electrodes to the device by means of conductive yarn and snap buttons.The two electrodes are located as far as possible in order to maximize the signal and reduce the noise and artifacts inserted by the presence of water.

The wearable device
The wearable device is a small electronic circuit based on Arduino Micro [3].The sensor is the IMU breakout LSM9DS0 by Sparkfun [4]; a single component which include a 3-axis accelerometer, 3-axis gyroscope and a 3D magnetometer.The circuit is a dual mode data-logger; the device can record all the data from the IMU with a sample rate of 25Hz on a removable SD-card, or transmit the processed data to an external mobile device like an Android tablet.Currently our device allows only for data logger, while the transmission of the parameters has been developed only to study the possibility to use Bluetooth TM 4 LE technology for this application.The BLE (Bluetooth TM 4 Low Energy) is very suitable in this case because it has the possibility to automatically reconnect to the server (the smartphone or tablet).In this way, all the parameters directly processed by the wearable device embedded algorithm, can be transmitted out from the swimming pool to the coach; in the case that water prevent the transmission, the data are still processed and only transmitted when the device is reconnected and a stable communication channel is present.The device mounts a BLE121LR by Bluegiga, a Bluetooth TM 4 LE dongle for long-range (up to 450 meters) communication; this module allows for a reliable communication channel.We avoid using a more standard LF communication channel because the final application has to work with mobile technology, and the BLE is almost a standard.

The Matlab ® algorithm
In this work, the aim was to extract some interesting features only from the 3D accelerometer data given by the device.To comprehend which features can help the trainer and the athlete to analyze the sportive gesture, the biomechanics of the movement has been studied and the state of art of these specific issues has been examined [5,6,7,8].Figure 1 shows the algorithm scheme.The algorithm, developed in Matlab ® , is applied as post-processing because the scope of this work is to extract features and validate the computational scheme.The algorithm is focused on freestyle as the world's most diffused style.

Figure 1: The algorithm scheme
A first low-pass filter has been introduced to reduce noise's frequencies.The filter is a 64 samples Hamming filter with a cut off frequency of 5 Hz [6].The linear delay is removed applying a zero filtering.The next step of the algorithm is the extraction of the laps.Figure 2 shows the antero-posterior acceleration.As visible there are some peaks, which corresponds to the veer at the end of the pool.The laps have been identified using a peal finder algorithm based on threshold and morphology (the same used by Pan e Tompkins [9] for QRS extraction from ECG signal).
The Y acceleration signal obtained clearly shows (Figure 2) a pseudo-periodical tendency.Each peak represented an arm stroke so that, simply using once again the lap extraction function, and after a filtering stage with a moving average filter with a window of 600ms (15 samples with a sampling frequency of 25 Hz), the algorithm is able not only to extract the number of strokes, but also their amplitude.If we assume that the reference tern of the accelerometer coincides with that fixed of the pool as shown in Figure 2, a positive peak represented a right arm stroke and a negative peak represented a left arm stroke.Since the algorithms can detect the first and the last stroke of a lap, we can also know the duration of the inversion by simply add the difference between the last sample of a lap, the sample representing the last stroke, and the samples of the next lap that represents the first stroke.

Figure 2: Reference tern and 3-axis accelerometer signals
Since we know how many samples we have in each lap and the sample frequency, the lap time and the time per stroke can be calculated.Knowing the amplitude of the peaks in X axes for each stroke, the algorithm gives the possibility to compute an asymmetry index for the strokes.The use of asymmetry index and time per stroke allow for computing stroke variability with the aim to know if the swimmer has as regular stroke pattern as possible.All these data also allow for making estimation of speed and body orientation, which can also be a suitable index for amateur swimmers.The parameters extracted by the algorithm allow for computing SWOLF index [10].The SWOLF is the only quantitative index used today.It is an index derived from combining the terms swimming and golf because, in golf, the less is the score the better is the performance.It considers the sum of the number of strokes and the time the athlete takes to swim a pool length.It is considered an indirect measure of swim efficiency.SWOLF is not an index that can be compared among swimmers but it is more meaningful in comparing different training session of the same individual.Table 1 shows all the swimming data obtained by the accelerometer signal processing.

Data transmission test
One of the most important features of sport monitoring system is the "real-time"; the coach can dynamically read the performance of the athlete during the training and instantly intervenes giving recommendations in order to optimize the workout.The real-time feature in sport monitoring is necessarily related to the use of wireless technology.This is a big issue when this technology has to be used in water environment.There are some swim trackers with heart-rate belt, which communicate with a sport-watch wireless by means of a low frequency (5-15 KHz) signal [11].This system works only at a maximum distance of 50-80 cm and in not suitable for realtime monitoring of the coach on the poolside.Moreover these frequencies need for specific antenna and electronic circuit, which does not make it suitable for use with mobile devices like tablet and smartphone.For this reason we developed an ad-hoc android application to test the possibility to use Bluetooth TM 4 LE technology.The application, once the acquisition is started, downloads the accelerometer data and plots them on the display.The communication in set up in order to automatically reconnect when the wearable Bluetooth TM device was disconnected as unreachable (both for distance, both for water electromagnetic isolation).In this way, when the device attached to the back is underwater and the communication is interrupted, the device stores the data and, when is reconnected, restarts the data transmission.The test has been done transmitting a series of number form 1 to 1024 with a frequency of 5 Hz (10 byte per seconds).

ALGORITHM VALIDATION
In order to validate the algorithm, the system and the algorithm have been tested on 13 trials with 10 subjects (24-60 years old aged, 3 females and 7 males).The tests have been performed at the pool of "Pratogrande" in Garlate (Lecco -Italy) on an ex-professional swimmer, and at the "Seven Infinity pool in Gorgonzola (Milan -Italy) on amateur swimmer.Amateur and ex-professional swimmer have been involved in order to evaluate the algorithms also when the style and the coordination of the gesture is not optimal.
The test consists in a minimum set of six swimming pool lengths (three full pools) swum crawl.During the tests the athletes wear the swimsuit with the wearable device recording the IMU data.All the data from the IMU was recorded but only accelerometer data has been studied in order to minimize the cost for future development of a device with only one accelerometer.This works focuses on in water transmission problem and algorithm; ECG was already studied in our previous work [12] and for this reason hasn't been included in the analysis.The swimmer has been also video-recorded with the aim to compare the data extracted by the algorithm with the data obtained by means of videos.The ad-hoc cart shown in figure 3 has been used to mount two Go Pro Hero 3 cameras, one above and the other below the water surface.A third camera has been mounted on a tripod and placed at the poolside filming all the pool length.Using the Matlab ® software designed on purpose, the strokes extracted by the algorithm were verified observing if they were real strokes or other movement.The sensitivity of the algorithm for stroke detection results 95.83%.This error is due to the extreme variability of the stroke gesture; in many case it is difficult to establish a rule to include/exclude peaks in strokes count.The difficulty is very high near to the turn; some athletes do some strange movements to trim and prepare themselves to the veer.To avoid errorS in this phase, the algorithm includeS a refractoriness period in witch the peaks are not counted as strokes.At the same time, few stroke peaks were lost because were integrate in the higher peaks related to the rotation during the veer.The use of refractoriness period allows for reducing the error but it can't totally eliminate it due to the lost of peaks in the turn.
The algorithm has no problem in the recognition of laps number.Thus in each session the turn is correctly detected the laps number; for this reason the error is zero.
Figure 4 shows the detection algorithm's mean error for inversion duration.The mean value is under 0.5 seconds; this is due to errors in number of stroke detection algorithm, which inevitably affects the computed inversion duration.This fact can be solved using the other two sensors included in the IMU (gyroscope and magnetometer).Gyroscope can be used to construct gyrocompasses, which integrate/complete the magnetometer, with the aim to study the efficiency of the inversion in terms not only of duration, but also in terms of inclination angles, speed and boost.

CONCLUSION
This work aims to quantifying the swimming gesture.The analysis here presented has been done only on crawl and application to other swim styles (butterfly, breaststroke, backstroke) is in progress.Results show that a single accelerometer can be used for monitoring performance of swimmer, but the use of an integrated IMU with gyroscope and magnetometer could increase the sensitivity and reliability of the system.The system could be used with mobile device (smartphone and tablet) thanks to the capability of Bluetooth TM 4 LE which can automatically reconnect to the server device and restart the data communication.Future developments will concern the realization of microcontroller embedded algorithm for all the swim style, and an ad-hoc communication protocol in order to shrink the transmitted data and optimize the band of the selected communication standard.

Figure 3 :
Figure 3: The ad-hoc cart for camera mounting

Figure 4 :
Figure 4: Inversion duration detection algorithm mean errors