Evaluation of Accelerometric and Cycling Cadence Data for Motion Monitoring

Motion pattern analysis uses a variety of methods to recognise physical activities recorded by wearable sensors, video-cameras, and global navigation satellite systems. This paper presents motion analysis during cycling, using data from a heart rate monitor, accelerometric signals recorded by a navigation system, and the sensors of a mobile phone. Real cycling experiments were recorded in a hilly area with routes of about 12 km long. Signals were analyzed with appropriate computational tools to find the relationships between geographical and physiological data, including the detection of heart rate recovery delay as an indicator of physical and nervous condition. The proposed algorithms utilized methods of signal analysis and extraction of body motion features, which were used to study the correspondence of heart rate, route profile, cycling speed, and cycling cadence, both in the time and frequency domains. Data processing included the use of Kohonen networks and supervised two-layer softmax computational models for the classification of motion patterns. The results obtained point to a mean time of 22.7 s for a 50 % decrease of the heart rate after a heavy load detected by a cadence sensor. Further results point to a close correspondence between the signals recorded by the body worn accelerometers and the speed evaluated from the GNSSs data. The classification of downhill and uphill cycling based upon accelerometric data achieved an accuracy of 93.9 % and 95.0 % for the training and testing data sets, respectively. The proposed methodology suggests that wearable sensors and artificial intelligence methods form efficient tools for motion monitoring in the assessment of the physiological condition during different sports activities including cycling, running, or skiing. These techniques may also be applied to wide ranging applications in rehabilitation and in the diagnostics of neurological disorders.


I. INTRODUCTION
The discipline of motion recognition, using a range of measurement techniques to characterise the motion associated The associate editor coordinating the review of this manuscript and approving it for publication was Li He .
with different of physical activities, is an increasingly important topic. Applications include the assessment of rehabilitation exercises, gait analysis [1]- [4], breathing [5], detection of neurological disorders [6], the effect of cycling on cognitive functions [7], and the evaluation of fitness level in sports disciplines. Measurement techniques include the use of wearable sensors, smartphones, smartwatch-based biometrics [8], and computational intelligent methods for data processing.
Many motion tracking systems [9], [10] make use of global navigation satellite systems (GNSSs). They benefit from the increasing accuracy of GNSSs that are based on the use of new satellite systems, including Galileo [11] and the global positioning system (GPS). These systems may also be used for monitoring cycling routes [12]. Further commonly used sensors include accelerometers [13], [14] inside mobile phones [15], gyrometers, and sensors to monitor the heart rate [16] and further physiological functions. Mobile applications for smartphones can use these sensors, making them a viable alternative to bike computers [17]. Camera systems [18], [19] that use red-green-blue, depth and thermal sensors [20]- [22], and ultrasound systems [23] are very important as well. Associated studies include the assessment of road surface roughness [24] and three-dimensional modelling.
Separate accelerometers or their synchronized systems are used in many different applications, which employ standard or deep learning methods for classification of motion patterns. For example, these methods are used in the diagnosis of motion disorders in neurology and ataxic gait monitoring [25], [26]. Analysis of the sensor placement for the best separation ability is one of the fundamental problems of these studies. In addition, accelerometers have been used to evaluate motion symmetry [14] and to monitor rehabilitation exercises. These sensors are now included in most mobile phones and the possibility to use such wearable sensors enables the monitoring of different sport activities [27].
Appropriate methods of signal and image processing are then applied for information extraction. These methods include signal analysis in both spectral and scale domains, and modern methods that are based on wavelet transforms [28], artificial intelligence using machine learning, dimensionality reduction [29]- [31], classification methods, and deep convolutional neural networks.
The present paper is devoted to the analysis of data recorded during cycling [27], [32]- [35] in real conditions on the route presented in Fig. 1, which is located in a hilly area and is about 12 km long, and visualized in the Matlab environment using its mapping toolbox. Positioning data recorded by the GNSSs are synchronized with the heart rate and accelerometric data. The goal of this study is to show how wearable sensors can be used for post-exercise analysis of cycling-related information to detect the relationship between physiological data, accelerometric signals acquired at the specific body position, and the route profile recorded by the GNSSs. Our mathematical analysis is based on spectrograms using the Kohonen network learning system for data clustering and the two layer neural network for classification of accelerometric signals. Selected results are compared with those evaluated on a home exercise bike [36].
The techniques currently in use for monitoring motion activities are limited by the accuracy of GNSSs and the various motion sensors used, as well as the approach to synchronizing these signals. Extensive research in these areas is leading to significant improvements through the development of new techniques in multimodal data evaluation [37]- [39]. This points both to the rapid evolution of new engineering systems for data acquisition and to modern methods for signal processing, which will enable the application of deep learning, modelling of sophisticated structures, and the application of smart devices and assisted technologies in the future. Fig. 1 presents the geographical data that were acquired by the GNSS and the associated accelerometric signals that were recorded by the mobile phone. The cycling route was located in a hilly area of Moravia close to Vsetin, and included segments with different surface qualities and occasional traffic that contributed to random errors in the recorded signals. The associated route profile with further Garmin and heart rate data are presented in Fig. 2 for a selected cycling experiment.

A. DATA ACQUISITION
The cycling cadence-derived data [40] were used for segmentation of accelerometric and heart rate signals in different route areas.
The GNSS and motion data (time stamps, longitude, latitude, altitude, cycling distance, the speed, and the cycling cadence) were simultaneously recorded by a Garmin fitness watch (Fenix 5S). The heart rate data were acquired by a Garmin chest strap that was connected to a Garmin watch by ANT+ technology. All of the datasets were acquired during 26 cycling experiments in a hilly area on a route that is 12 km long, with an altitude difference of 300 m. Records were subsequently stored to the Garmin Connect website, exported VOLUME 9, 2021 as TCX files, converted to CSV files, and then imported to the MATLAB software for further processing.
Accelerometric data were recorded by the mobile phone in the spine position, which was selected following previous studies [25], [26], which described the higher discriminative abilities of sensors located in the upper half of the body [41], [42] in comparison to other positions. The sampling frequency of the Android mobile phone sensor was 100 Hz during all cycling routes.
All procedures involving human participants were in accordance with the ethical standards of the Institutional research committee and with the 1964 Helsinki Declaration and its later amendments.

B. SIGNAL PROCESSING
The proposed data evaluation method included a preprocessing stage. All sensors recorded both time stamps and observed values, but the sampling rate varied. This is the reason why resampling was necessary. The new sampling period T s was selected as the average sampling period of the observed values and linear interpolation was then applied for their evaluation. In the case of accelerometric signals, the median filtering was applied to remove gross errors from observed sequences.
In the next step, the linear acceleration data without additional gravity components were processed. Their modulus A q (n) was evaluated from the components Ax q (n), Ay q (n), and Az q (n) recorded in three directions by relation A q (n) = Ax q (n) 2 + Ay q (n) 2 + Az q (n) 2 (1) for all values n = 0, 1, 2, · · · , N − 1 in each experiment q = 1, 2, · · · , Q of N values. In this way, the accelerometric values invariant to the rotation of the sensor during observations were evaluated. The processing of multimodal records {d(n)} N −1 n=0 of the accelerometric and heart rate signals was performed by similar numerical methods. After high-pass filtering removed the slowly varying signal components, short-time discrete Fourier transform was applied to detect the time-varying frequency parts.
Each accelerometric signal {d(n)} N −1 n=0 of N samples that was observed during each experiment was processed in time windows TW = 30 s long to evaluate the associated signal spectrum, covering the full frequency range of 0, f s /2 Hz for f s = 1/T s . This method was used to evaluate the spectrogram for each experiment. The accelerometric signal and its spectrogram are presented in Figs. 1(c,d) for a selected cycling experiment.
The following two frequency bands were then selected for evaluation of accelerometric features: for cutoff frequencies f c1 , f c2 , f c3 , f c4 less than f s /2. The relative power p(i, j) in each frequency range r 1 and r 2 was then estimated by the relation where i is the set of indices for the range of frequencies f k ∈ r i , i = 1, 2, and j = 1, 2, · · · , Q for the total number of experiments Q. This method was used to define the pattern matrix P 2,Q . The locations of these features in the 2D domain for a selected experiment are presented in Fig. 3(d). The Kohonen learning rule was then applied during the unsupervised learning process for data clustering to evaluate the network model later used to classify these features. The results of this clustering process with a one-layer neural network for a selected cycling experiment are presented in Figs. 3(c,d). The outputs from two neurons suggest separate signal classes.
The cadence cycling signal was then used to synchronise the separate signals. This approach was based on the assumption that this signal drops to zero on the top of each hill; as presented in Fig. 4(a), which corresponds with the route altitude profile in Fig. 4(b). This simple segmentation process enabled the evaluation of the signal features in each downhill route segment. A polynomial approximation of the signals in these cycling segments was then applied.
The spectrograms of accelerometric signals were then examined to classify the motion patterns using the selected neural network model. The supervised learning process was applied to classify the frequency components in time windows of the selected length. Time synchronisation of the signals and GNSS data enabled to the expected target values for the model's construction to be specified.
Results obtained after the chosen number of training epochs were then evaluated by the receiver operating characteristic (ROC). The machine learning process finds the number of true-negative (TN), false-positive (FP), true-positive (TP) and false-negative (FN) values in the negative set (class 1: downhill cycling) and positive set (class 2: uphill cycling). The associated performance metrics can then be used to evaluate: • The true positive rate (TPR, sensitivity), the true negative rate (TNR, specificity), the false negative rate (FNR), and the false positive rate (FPR) • The negative predictive value (NPV), the positive predictive value (PPV, precision), and the accuracy (ACC) The confusion matrices of the training and testing sets were then used as measures of the generalisation abilities of the classification model.

III. RESULTS
Analysis of the cycling experiments includes 26 cycling routes and 933 segments in the same hilly area which are all about 12 km long, as presented in Fig. 1. All of the evaluations were done in the MATLAB 2021a computational system. All of the longitude and latitude positioning data recorded during each cycling experiment by the satellite navigation network were projected into the geographical environment with the associated visualisation using the following MATLAB commands:    5 presents the polynomial approximation of the fifth order applied to the heart rate and the speed during a selected cycling experiment in two route segments, with their initial points specified by the first and the second peak of the cycling VOLUME 9, 2021 route. Complete results for all experiments are presented in Fig. 6. Starting times are defined by the cadence signal and the length of the downhill cycling is projected from the altitude GPS signal. For a selected experiment, the heart rate, the speed, and the relative accelerometric power in the frequency band of 30, 40 Hz are emphasised in individual subplots.

IV. DISCUSSION
The signals presented in Fig. 6 were used to evaluate the correspondence between selected signals and to eliminate any experiments with gross errors. The processing of each experiment included the polynomial approximation to each record and the evaluation of the delay between separate signals for a 50 % decrease of the heart rate after the cadence change. The difference between these peak values outside the given range excluded 9.9 % of experiments. A summary of all of the results is presented in Table 1, with similar results in both segments. The mean delay of the heart rate change and TABLE 1. Comparison of delays and standard deviations (STD) of selected variables recorded during cycling for two selected cycling segments and the set of cycling routes for heart rate vs speed (HRS), power vs speed (PWS), heart rate vs power (HRPW), and heart rate vs cadence change (HRC).
acceleration change was 20.6 s in the given conditions. The relative accelerometric power was evaluated in the frequency band of 30, 40 Hz and 933 time windows 30 s long were used for the following classification.
Results indicate an average value of 22.7 s for the heart rate to decrease by 50 % between its highest and lowest value resulting from the cadence change. This result corresponds with experiments on the exercise bike [25] for a healthy person. The heart rate recovery delay is considered to be an indicator of physical and nervous condition [43].  Figure 7 presents the results of the classification of the spectral features of the accelerometric data into two classes (class 1: downhill cycling, class 2: uphill cycling) using the two layer neural network with 10 elements in the first layer for the whole set of cycling experiments. The features were defined as the relative mean power in selected frequency ranges (F1 : 10, 15 Hz and F2 : 30, 40 Hz). The optimisation process was applied for a standard neural network with 10 neurons in the first layer that included the sigmoidal transfer function and 2 elements in the second softmax layer. Figure 7 also presents the centers of gravity of the individual classes and c-multiples of standard deviations for c = 0.2, 0.5, 1.
The confusion matrix for the training and testing sets is presented in Table 2. The accuracy achieved was 93.9 % and 95.0 % for the training and testing sets, respectively.
The supplementary material includes the animation of signals recorded during a selected cycling segment and their processing.

V. CONCLUSION
This paper has presented the use of selected wearable sensors and appropriate computational method for the assessment of physical activities and motion monitoring during cycling in real conditions. Positioning data recorded by the GNSS system, heart rate data, cycling cadence-derived data, and accelerometric data recorded by a sensor in the mobile phone were used to detect a number of motion patterns. Using the event data records, the paper helps cyclists to analyse cyclingrelated information.
A new methodology is presented in which cycling cadence and time stamps are used, allowing accurate segmentation and synchronization of signals recorded by different wearable sensors. The paper moreover presents results which indicate the heart rate recovery delay after a cadence change, with motion patterns successfully derived from accelerometric signals in real conditions. The results suggest that cycling cadence, accelerometric, and heart rate data can be used to evaluate and recognise motion patterns during cycling in different route conditions. The observed mean delay of the change of the heart rate that was related to the change of the mean power of the accelerometric signal in the highfrequency band was 20.6 s for the given set of experiments in real conditions and hilly route areas.
The proposed methodology was based on the Kohonen learning rule and a softmax neural network structure. One of the main practical benefits arising from this research is the improved accuracy which can be achieved through the combined use of communication systems, wearable sensors, and new computational techniques. Improved accuracy in the measurement methodology contributes to a better understanding of rehabilitation processes and improves the early diagnostics of motion disorders in neurology. Results on motion monitoring will contribute to the better understanding of rehabilitation processes and early diagnostics on motion disorders in neurology. Our future work will be devoted to the use of more sophisticated models and a deep learning strategy. Applications will be developed using a similar methodology to characterise motion in different sports activities including running and skiing with a modified approach to the synchronization of signals from different sensors. Particular attention also will be paid to medical applications where advances may be expected in the detection of neurological disorders, ataxic gate monitoring, and rehabilitation, through motion pattern analysis.
HANA CHARVÁTOVÁ received the Ph.D. degree in chemistry and materials technology from the Faculty of Technology, TBU, Zlín, in 2007, for the technology of macromolecular substances. She is currently associated with the Centre for Security, Information and Advanced Technologies (CEBIA-Tech), Faculty of Applied Informatics, TBU. Her research interests include modeling manufacturing processes of natural and synthetic polymers, analysis of thermal processes in building technology, studies of sensor systems and wireless communication, signal processing for motion monitoring, and modeling of engineering and information systems. She is oriented towards computational and visualization methods in thermographics, spatial modeling, and engineering.  JONATHAN HURNDALL SMITH received the Ph.D. degree from the Department of Engineering, Cambridge University, in 1990. He has held teaching positions with Czech Technical University, London South Bank University, and the International University, Ho Chi Minh. He is a member of the Institute of Physics (InstP) and Chartered Physicist (CPhys). He is currently the Director of Bellford Consultancy Services and conducts consultancy activities in fiber-optic networks. His research interests include numerical and computational methods of multidimensional signal processing, functional transforms, telecommunications, cyber-physical systems, and applications in vibration analysis, photovoltaic energy production, submarine networks, and optical systems modeling.