Next Article in Journal
A Survey of Dummy-Based Location Privacy Protection Techniques for Location-Based Services
Next Article in Special Issue
A Novel Segmentation Scheme with Multi-Probability Threshold for Human Activity Recognition Using Wearable Sensors
Previous Article in Journal
An Automated Machine Learning Approach for Real-Time Fault Detection and Diagnosis
Previous Article in Special Issue
Predicting Activity Duration in Smart Sensing Environments Using Synthetic Data and Partial Least Squares Regression: The Case of Dementia Patients
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Cadence Detection in Road Cycling Using Saddle Tube Motion and Machine Learning

by
Bernhard Hollaus
1,*,
Jasper C. Volmer
2 and
Thomas Fleischmann
1
1
Department of Medical, Health & Sports Engineering, Management Center Innsbruck, 6020 Innsbruck, Austria
2
Department of Mechatronics, Management Center Innsbruck, 6020 Innsbruck, Austria
*
Author to whom correspondence should be addressed.
Sensors 2022, 22(16), 6140; https://doi.org/10.3390/s22166140
Submission received: 7 July 2022 / Revised: 11 August 2022 / Accepted: 15 August 2022 / Published: 17 August 2022
(This article belongs to the Special Issue Human Activity Recognition in Smart Sensing Environment)

Abstract

:
Most commercial cadence-measurement systems in road cycling are strictly limited in their function to the measurement of cadence. Other relevant signals, such as roll angle, inclination or a round kick evaluation, cannot be measured with them. This work proposes an alternative cadence-measurement system with less of the mentioned restrictions, without the need for distinct cadence-measurement apparatus attached to the pedal and shaft of the road bicycle. The proposed design applies an inertial measurement unit (IMU) to the seating pole of the bike. In an experiment, the motion data were gathered. A total of four different road cyclists participated in this study to collect different datasets for neural network training and evaluation. In total, over 10 h of road cycling data were recorded and used to train the neural network. The network’s aim was to detect each revolution of the crank within the data. The evaluation of the data has shown that using pure accelerometer data from all three axes led to the best result in combination with the proposed network architecture. A working proof of concept was achieved with an accuracy of approximately 95% on test data. As the proof of concept can also be seen as a new method for measuring cadence, the method was compared with the ground truth. Comparing the ground truth and the predicted cadence, it can be stated that for the relevant range of 50 rpm and above, the prediction over-predicts the cadence with approximately 0.9 rpm with a standard deviation of 2.05 rpm. The results indicate that the proposed design is fully functioning and can be seen as an alternative method to detect the cadence of a road cyclist.

1. Introduction

In road cycling, cadence is a metric of high interest [1,2]. Over recent decades, this metric has been studied widely to relate it to cycling performance and efficiency [3,4,5,6]. The state-of-the-art approach [7] in most studies and in commercial cadence-measurement systems uses a Hall-effect sensor [8,9] in combination with a permanent magnet. The Hall-effect sensor is mounted on the bike frame and produces a voltage signal that is proportional to the strength of the magnetic field it is in. A permanent magnet is fixed on the crank or the pedal in such a way that during a whole revolution of the crank, the magnet triggers the sensor only once. This way, the revolutions of the crank can be counted and hence the cadence calculated.
Although this setup is simple and widely used, a drawback exists. This approach is strictly limited to measuring cadence. Other relevant variables such as speed, crank angle, roll and pitch angle, power and torque output or round kick evaluation cannot be measured, though all of them affect the cadence. More advanced measurement systems can measure the power and torque output [10,11,12,13] with strain gauges in addition to cadence. The use of devices based on this method comes with high costs in comparison to the Hall-effect sensor system. Alternatively, cadence can be measured with inertial measurement units. These so-called IMUs detect linear acceleration in multiple directions using accelerometers. In addition, they employ gyroscopes to measure rotational acceleration. For an overview of IMU technologies and applications, see [14]. Companies such as Wahoo or Saris provide IMU-based speed and cadence-measurement systems. These systems also serve as cadence sensors in the studies of Matyja et al. and Gallagher et al. [15,16]. The positioning of the sensors on the bike is strictly limited to the crank arm or the wheel hub for the given products. This position, however, places some restrictions on the sensor that is used. The positioning of a smartwatch or a smartphone on the crank arm, which would make the extra sensor obsolete, is not reasonable. For that reason, a new position of the IMU on the bike is of interest. The new position should allow cadence detection and enable the possibility of using a smart device.
In parallel, cycling has become increasingly digital over recent decades. Not only has training become more digital with the increase in popularity of direct-drive trainers and platforms such as Zwift, but also performance measurements have become more digital, and with it, more advanced. For example, the introduction of wearables to a broad group of athletes have allowed performance metrics, such as VO2max, heart rate, SpO2 and many more, to become widely accessible [17,18,19]. Another device that has aided the digitalisation of cycling is the IMU. It has been used in a variety of studies to assess for example cycling performance. Evans et al. worked on an efficient saddle position for triathlon using an IMU-based system [20]. Marin-Perianu et al. and Maio et al. both worked on estimating cyclists’ lower limb positions using IMUs [21,22]. Several studies have measured surface roughness while cycling with an IMU-based system [23,24,25]. Most notably, Ref. [23] mentions that the pedalling signal is filtered from the data to analyse the vibrations caused by the road using independent component analysis (ICA), yet it is not actively analysed. To the authors’ best knowledge, current literature does not show how to measure the pedalling signal or cadence using an IMU in positions other than the pedals, crank arm or wheel hub.
As cadence is a measure of high interest and IMUs are presently ubiquitous in sports, this work presents a working prototype and a proof of concept of a cadence-measurement system for road cycling based on an inertial measurement unit, where the IMU is mounted on a less exposed position on the bike. The goal of this work is therefore to show that an IMU mounted in such a position is still capable of measuring cadence. It is emphasized that, to our best knowledge, this has neither been attempted nor successfully proven before. To determine the cadence from the IMU signal, a machine-learning approach is taken, hence the cadence-measurement method is called IMU-ML method in this paper.
The rest of this paper is structured as follows: first, the method for collecting data is shown. Then, the analysis of the data using neural networks is explained. Finally, the performance of the neural network is analysed, and the IMU-ML method is compared to the ground truth.

2. Methods

To provide a proof of concept for the IMU-based cadence-measurement system of road bikes, it is necessary to gather data from both the IMU on the saddle tube and the state-of-the-art approach with a Hall-effect sensor and a permanent magnet. First, a sensor platform was chosen, configured and programmed to be used as data logger during the experimental bike rides. After the data were gathered using this platform, an algorithm had to be developed that takes the IMU data as input and calculates the corresponding cadence as output, according to the ground truth of the Hall-effect sensor. To make the methods section concise, we split it into a hardware/firmware experiment and software.

2.1. Hardware/Firmware

At the beginning of the data-gathering stage, a data logger was developed that records the IMU data and the Hall-effect sensor data in a synchronized fashion with a sufficiently high sampling rate. At the same time, the data logger had to be lightweight, programmable and small. In other sports such as tennis and American football, the requirements are similar. Based on the paper by [26,27], the sensor platform for this work has been chosen. Nevertheless, adaption to hardware and firmware had to be made for the specific needs in the experiment.
The sensor platform in this work is based on the SensorTile [28], which contains the IMU. Figure 1 shows the sensor platform with marked components and the connection to the Hall-effect sensor [29]. The SensorTile module is soldered to the SensorTile Cradle board, which provides power via the battery and the micro-SD card slot to the microcontroller system. To measure the cadence with the standard state-of-the-art approach, the signal of the Hall-effect sensor has been processed as well. As it is an analog signal, it is connected to the internal analog-to-digital converter (ADC) of the microcontroller. The sensors in Table 1 are connected to the MCU via the SensorTile module PCB.
The setup and mounting of the hardware was undertaken according to Figure 2 for all cyclists and bikes during the experiment.
The measured data were stored in a *.csv file on the attached micro-SD card. The given experimental setup enabled the recording of the following data
  • Time since startup in ms (T),
  • Accelerometer X axis in mg (AccX),
  • Accelerometer Y axis in mg (AccY),
  • Accelerometer Z axis in mg (AccZ),
  • Gyroscope X axis in m   s 1 (GyroX),
  • Gyroscope Y axis in m   s 1 (GyroY),
  • Gyroscope Z axis in m   s 1 (GyroZ),
  • Magnetometer X axis in mG (MagX),
  • Magnetometer Y axis in mG (MagY),
  • Magnetometer Z axis in mG (MagZ),
  • Air pressure in mbar (P),
  • Hall Effect as raw ADC 12-bit value (Hall)
Based on the hardware setup, the firmware had to fit the needs of the experiment. The firmware on the microcontroller is based on the STSW-STLKT01-DataLog example [30] provided by STMicroelectronics. It is based on FreeRTOS (free real-time operating system) and works with two threads—one used to collect and sample the data and the other one to store it on the micro-SD card. The thread responsible for data sampling is set to a higher priority. The scheduling between the two threads is undertaken as in the example project of STMicroelectronics.
Based on the example, further adaption of the firmware was necessary. The initialization routine was rewritten so the timer of the data logger was able to sample with up to 1 kHz. Although the authors expected the cadence in the range of several Hz maximum, a high sampling rate presents possibilities at the data-processing stage. The Hall-effect sensor used the internal 12-bit ADC, which had to be configured in the initialization routine. In addition, the IMU and the pressure sensor required a specific configuration, which was covered in the initialization routine. During this routine, the sensors were set as listed in Table 2.
With the adaptions in the initialization routine done, the recording and saving of each sample on the SD card was slightly altered as well. All sensors were recorded and saved with a comprehensive time stamp in a *.csv file. Since threading was used, the time between samples was not constant, but never exceeded 20 ms. The aforementioned pressure sensor was initialized, recorded, and saved, but, due to non-reliable measurement results, no longer considered for the final dataset.
From a firmware sequence perspective, the initialization routine is triggered directly after the data logger is switched on. After initialization, the data logger automatically starts collecting data if a micro-SD card is available. The recording stops automatically after a defined time span, which was chosen to be one hour for the experiment.

2.2. Experiment

With the data logger ready, an experiment was carried out to gather data. All participants were instructed to use a trigger routine at the beginning of each ride. To ensure that the final dataset consists of the activity of road cycling only, the start of the bike ride had to be marked within the gathered data of the experiment. To do so, the magnet excites the Hall-effect sensor for at least five seconds, just by putting the crank arm in the respective position. This enables a defined trimming of the data as a saturated signal from the Hall-effect sensor for at least five seconds does not occur during a normal ride with a road bicycle.
As the goal was to provide a proof of concept, the group of participants, chosen to do experiments, was small. In total, four road cyclists comprising males and females with an age ranging from 23 to 57 made a total of 13 rides leading to 642 min of data. All participants were instructed to ride any route they want. No restrictions were imposed on the routes ridden. However, in practice, virtually all rides were performed in the vicinity of the city of Innsbruck. Therefore, participants encountered relatively good-quality asphalt roads and significant height differences leading to a varied cadence dataset. Before the experiment took place, it was approved by the ethics committee of the MCI. All participants signed a consent form.

2.3. Data Preparation

After the data-gathering stage, an algorithm had to be developed so the cadence could be derived based on the IMU data. The authors chose a supervised machine-learning approach as found in many other sport-related studies such as [26,27,31], due to their good performance. To this end, the individual pedal strikes that the Hall-effect sensor detects were used as the ground truth. As the Hall-effect sensor and the IMU sensor are processed on the same hardware, the timesteps are synchronized. This, in turn, provides labels (pedal strikes) for the IMU data-streams at every given time, and avoids the need for manual labelling.
As a first step, the raw data had to be processed to become a suitable dataset for the network. This was undertaken with a Python script programmed and run inside Jupiter Notebook [32]. The script took care of importing the raw data, trimming, reshaping and normalizing it. Data were also checked for whether they suited the requirements for a neural network development. An analysis of the Hall-effect sensor signal showed that it rarely is greater than 0. Indeed, the normalized Hall-effect sensor only outputs 1 when the pedal passes the sensor. This leads to a mean value of the signal over all rides of close to 0. In addition, the data also showed a variety of timesteps between samples. Two measures have been taken to avoid further problems with the gathered data.
To overcome the timestep issue, all sensor signals have been resampled to 50 Hz by calculating the mean value of all given values for the respective signals within 20 ms windows. This way, a constant sampling rate was achieved based on signals that had no constant sampling time, but were recorded so at least one value was recorded in each 20 ms window.
To avoid a highly unbalanced dataset and reduce the noise in the signal, the Hall-effect sensor signal was adjusted. The Hall-effect sensor signal was processed with the peakfinder function from the Python library scipy [33] to extract the peaks created by the permanent magnet on the crank. After the peaks were identified, a convolution of a 260 ms wide impulse was undertaken, so each original peak in the pedal stroke signal became a 260 ms wide impulse with an amplitude of 1. Therefore, the resulting signal is either 0 or 1. After this adaption, the mean value of the pedal stroke signal was approximately 0.22, so the optimizer is forced to consider the impulses in its training to achieve accuracies for the prediction better than 78%. If the signal’s value is considered to be a label, it can be said that 22% of all labels are of Class 1, and 78% are of Class 0.
For training, validation, and testing the network, the data were split into training (70%), validation (15%), and test (15%) datasets.

2.4. Network Architecture

As the data were processed and split to suit the training process of a neural network, a network was designed, developed, validated and tested in a second step. A common approach for time series classification is the so-called convolutional neural network (CNN, [34]) with a long short-term memory (LSTM, [35]) approach [36,37,38]. The authors chose to use this approach to provide proof of concept. The purpose of this network is to generate a pedal stroke pattern comparable to the values provided by the preprocessed Hall-effect sensor signal. Therefore, the IMU data are the network’s input, and the pedal stroke signal represents the output.
Figure 3 shows the final structure of the used network, containing two convolutional layers followed by an LSTM layer. Primarily, convolutional layers are used as feature extraction layers. The development of the features over time is interpreted by the LSTM. Dense layers are used to combine either input signals, to create a wider spectrum of possibilities for the convolutional layers, or to summarize the outputs of the LSTM to one output. As can be seen in Figure 3, only three input signals (acceleration in X, Y, and Z) were considered for the final network from the 11 available. The question marks in Figure 3 symbolise the unknown batch size at the creation of the neural network. This means that the network can accept any number of samples in a given dataset. The rectified linear unit (ReLU) [39] was the commonly used activation function for all layers, except for the last dense layer, which used a sigmoid activation function. This structure led to 110,209 trainable parameters. During the training stage, the Adam optimizer [40] was used with mean squared error (MSE) as a loss function, which was computed as
MSE = 1 n i = 1 n p i p i ^ 2 ,
with n the number of data points, p i the processed pedal stroke signal from the Hall-effect sensor (ground truth), and p i ^ the predicted pedal stroke signal from the network. In addition to the MSE, a binary accuracy was computed as the ratio between the number of correct predictions to the total number of predictions. To this end, the continuous prediction produced by the network is mapped to a binary output using a threshold value of 0.5, i.e., any value above this threshold is mapped to 1 and any value below is mapped to 0.
Neural networks are well known to show poor generalization behaviour when trained incorrectly. This effect is termed overfitting, and must be prevented. Several methods exist; see [41] for an overview. We opt for an approach that terminates the network training before it converges, based on validation performance [42,43]. This so-called ’early stopping’ was implemented via a callback that tracks the minimal validation loss with a patience of one epoch.
Since the goal is to develop a working prototype and a proof of concept of a cadence-measurement system for road cycling based on an inertial measurement unit in a less exposed position on the bike, the last step had to be the comparison of the ground truth with the IMU-ML system. To do so, the cadence is calculated in the same way for both systems using
c = n u m p / 60 ,
with c as cadence and n u m p as number of peaks, with a moving window approach.

3. Results

To recap, the IMU-ML network described in the previous section is used to predict a pedal stroke signal comparable to that of the Hall-effect sensor based on the IMU data. To show the performance of the IMU-ML, this section compares its performance to the ground truth recorded with the Hall-effect sensor. First, the performance of the neural network is shown in Table 3.
The performance shows that the accuracy is high for both the training validation and test set. Therefore, overfitting was prevented due to the early stopping callback. At the same time, the accuracy does not directly reflect if the IMU-ML method performs well as a cadence-measurement system. Table 3 just shows that the pedal stroke signal can be predicted quite well. Figure 4 gives an example of the pedal stroke signal as predicted. It can be seen that the network output corresponds well with the sensor signal. In addition, the grey dashed line indicates the binary threshold as used in the binary accuracy metric.
The calculation of the cadence using (2) and the pedal stroke signal needs to be applied on both the ground truth signal and the predicted signal. Figure 5 shows the comparison of the calculated cadence of the ground truth and the IMU-ML method.
The cadence signals that are shown in Figure 5 come from the test dataset. The initial goal of providing a proof of concept is directly supported due to a very close estimation of the ground truth cadence with the IMU-ML method. For better visibility and a better analysis, two Bland–Altmann diagrams show the comparison in more detail. See Figure 6a,b for a more detailed comparison of the two methods.
All the given values in this paragraph are in comparison to the ground truth method. The overall performance of the IMU-ML method for predicting c comes with a mean over-prediction of 1.95 rpm and a standard deviation of 5.05 rpm considering the whole range of the dataset. Considering only the most relevant range of 50 rpm and above, the IMU-ML method predicts c with approximately 0.9 rpm too high on average with a standard deviation 2.05 rpm.

4. Discussion

A major limitation of the experiment, and therefore also for the results, lies in the limited number of participants. With only four participants, the collected dataset is not as comprehensive as it should be for a commercial system. Nevertheless, the goal was to create a proof of concept. The goal was met, as it can be argued that the cadence could be retained from the IMU data with sufficient accuracy. The method can be applied to a wider dataset, resulting in a similar or even better performance.
The participants in the study were not restricted in their cycling routes. The result was that all the participants chose a route on asphalt. Therefore, it must be said that the trained network may perform worse on other surfaces, as the motion of a cyclist and the bike will change.
In the network-development process, the input signals to the network were determined. The question was which signal contained information on cadence and to what extent. Based on an initial assumption that accelerations and spin rates have the biggest correlation to the cadence signal (see Appendix A for a singular value decomposition of the data), an ablation study focused on these signals as single inputs and as combined inputs. Table 4 shows their performance for validation and testing.
It can be argued that spin rate and acceleration correlate well with the cadence signal. The combination of both sensor signals as input to the network also achieves high accuracy, but has the drawback of a much higher number of trainable parameters. For that reason, it was not further developed, as the performance of the accelerometer alone was already sufficiently accurate to support the initial goal to provide a proof of concept.
The structure of the network as given in Figure 3 might not be optimal. Additionally, accuracy as a performance metric on an unbalanced dataset with a binary label can be considered improvable. Additionally, with the concept of hyper-parameter optimization, the network structure could be optimized. Using the F1 score as a performance metric or binary, cross entropy as a loss function might lead to better results. As the goal was to provide the proof of concept for the IMU-ML method and not the development of an optimal neural network, this was not in the scope of the article.
The IMU-ML method performs well in the range of 50 rpm and above, as shown in Figure 6b. As this range is strongly represented in the dataset, it is only a logical result. For a better performance in the whole range, more versatile data must be gathered.
Figure 6a shows some outliers that were mainly overpredicted. These outliers show that the network is not able to process all the IMU data in a reasonable way. The reason for these outliers might lie in the split of the training, validation and test dataset. It is possible that the motion patterns that were mispredicted, have not been part of the training and validation dataset. Therefore, the network does not perform well when predicting the cadence for some of these motion patterns. This is also true for new IMU data of other cyclists compared to the ones that participated in the experiment.

5. Conclusions

The present work has described the development of a cadence-measurement system. This system is based on an IMU combined with a CNN-LSTM network. The novelty of this work is two-fold. First, the IMU is mounted behind the seat post as opposed to in an exposed position on the crank. Second, to our best knowledge, deducting cadence from an IMU signal using a CNN-LSTM network has not been shown before. All results considered, it can be stated that the initial goal of the study was met. The IMU-ML method is sufficiently accurate to state the principle functioning of this proposed cadence-measurement tool. For the entire dataset, the method over-predicts the cadence with 1.95 ± 5.05 rpm. However, when only considering the most relevant range of 50 rpm and above, the method is more accurate with an over-prediction of 0.9 ± 2.05 rpm.
The method shown could be extended to use IMUs present in devices such as smartphones or smartwatches. This is supported by the fact that this method does not require the IMU to be mounted on the crank. In addition, an IMU could be integrated into a bike component such as a saddle or a handlebar.
The authors believe that the IMU signal contains far more information than just cadence. It is not unlikely that further cycling metrics could be deducted with a similar approach. Hence, we suggest further research should focus on identifying such performance metrics and show their correlation to cycling efficiency and skill level. At the same time, the IMU-ML method must be further developed, and further research must be done considering the robustness of the cadence prediction. This is possible by including more cyclists on various routes and terrains covering a wide range of scenarios and cadence range.

Author Contributions

Conceptualization, B.H.; methodology, B.H.; software, T.F., B.H.; validation, B.H., T.F.; formal analysis, B.H.; investigation, T.F., B.H.; resources, B.H.; data curation, T.F.; writing—original draft preparation, B.H., T.F.; writing—review and editing, B.H., J.C.V.; visualization, J.C.V., B.H.; supervision, B.H.; project administration, B.H.; funding acquisition, B.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding, but was funded within the department of Medical, Health and Sports Engineering at MCI.

Institutional Review Board Statement

The study was conducted according to the guidelines of the Declaration of Helsinki, and approved by the Ethics Committee of the Management Center Innsbruck (2021-03EthicsAssessmentReview_Fleischmann, 11 March 2021).

Informed Consent Statement

Informed consent was obtained from all subjects involved in the study.

Data Availability Statement

Data is available from the authors.

Acknowledgments

The authors would like to thank every enabler and supporter of this work. Additionally, the authors want to gratefully acknowledge the support and participation of the following group of students and colleagues: Florian Reiss, Alexander Hörbst, Andreas Mehrle.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
ADCanalog digital converter
CNNconvolutional neural network
e.g.exempli gratia
etc.et cetera
i.e.id est
ICAindependent component analysis
IMUinertial measurement unit
LSTMlong short time memory
MCIManagement Center Innsbruck
MCUmicrocontroller unit
MLmachine learning
PCBprinted circuit board
ReLurectified linear unit

Appendix A. Singular Value Decomposition of the IMU Data

To gain a better insight into the recorded data, a singular value decomposition (SVD) was performed. To this end, the m × n matrix M was filled with the re-centered measurement data. That is to say, we subtracted the mean of each column to re-center it around the origin such that the rows m represent the data points at different time instances t m and the columns n contain the IMU variables:
M = A c c X t 1 A c c Y t 1 A c c Z t 1 G y r o X t 1 G y r o Y t 1 G y r o Z t 1 M a g X t 1 M a g Y t 1 M a g Z t 1 A c c X t 2 A c c Y t 2 A c c Z t 2 G y r o X t 2 G y r o Y t 2 G y r o Z t 2 M a g X t 2 M a g Y t 2 M a g Z t 2 A c c X t m A c c Y t m A c c Z t m G y r o X t m G y r o Y t m G y r o Z t m M a g X t m M a g Y t m M a g Z t m
The matrix M was then decomposed as
M = U Σ V T ,
using SVD. As m n , the full matrices U and Σ are too large to print. The 9 × 9 matrix V is still comprehensible and reads
V = 0.01 0.09 0.99 0.09 0.07 0.01 0.00 0.00 0.00 0.03 0.22 0.08 0.11 0.96 0.01 0.05 0.01 0.00 0.03 0.97 0.07 0.04 0.22 0.00 0.01 0.00 0.01 0.00 0.00 0.00 0.00 0.03 0.00 0.76 0.65 0.05 0.00 0.01 0.00 0.00 0.00 0.01 0.06 0.14 0.99 0.00 0.00 0.00 0.01 0.04 0.02 0.65 0.74 0.15 1.00 0.02 0.02 0.02 0.03 0.06 0.00 0.00 0.00 0.05 0.01 0.02 0.30 0.02 0.95 0.01 0.01 0.01 0.04 0.02 0.10 0.94 0.10 0.30 0.01 0.00 0.01
where the extreme values per column have been marked in bold. The definition of the SVD implies that the matrix M can be written as
M = i = 1 i = n σ i u i v i T ,
where σ i are the singular values of M, u i are the columns of U and v i are the columns of V. As most of the columns in (A3) contain a value close to 1 or 1 , it can be concluded that the principal directions align closely with the original columns of M. As an example, the product u 1 v 1 T will yield a matrix with all entries close to zero except for those in the 7th column, which corresponds to the magnetometer x axis signal MagX. For completeness, the singular values of M and the corresponding signals based on V are listed in Table A1.
Table A1. Singular values of the re-centered data matrix M in (A1) with the corresponding signals based on the columns of V.
Table A1. Singular values of the re-centered data matrix M in (A1) with the corresponding signals based on the columns of V.
ComponentSingular ValueCorresponding Signal
σ 1 71.36MagX
σ 2 39.85AccZ
σ 3 34.26AccX
σ 4 31.00MagZ
σ 5 26.95AccY
σ 6 8.33MagY
σ 7 5.09GyroX/GyroZ
σ 8 3.26GyroZ/GyroX
σ 9 2.10GyroY
To conclude, it should be mentioned that the singular values in essence show which signals contain the largest variation. However, this does not mean that the signals with the largest variation also have the most predictive value. Hence, the ablation study was performed as shown in the discussion.

References

  1. Bernard, T.; Vercruyssen, F.; Grego, F.; Hausswirth, C.; Lepers, R.; Vallier, J.M.; Brisswalter, J. Effect of cycling cadence on subsequent 3 km running performance in well trained triathletes. Br. J. Sports Med. 2003, 37, 154–159. [Google Scholar] [CrossRef]
  2. Abbiss, C.R.; Peiffer, J.J.; Laursen, P.B. Optimal cadence selection during cycling: Review article. Int. Sports J. 2009, 10, 1–15. [Google Scholar] [CrossRef]
  3. Brisswalter, J.; Hausswirth, C.; Smith, D.; Vercruyssen, F.; Vallier, J.M. Energetically optimal cadence vs. freely-chosen cadence during cycling: Effect of exercise duration. Int. J. Sports Med. 2000, 21, 60–64. [Google Scholar] [CrossRef] [PubMed]
  4. Marsh, A.P.; Martin, P.E.; Foley, K.O. Effect of cadence, cycling experience, and aerobic power on delta efficiency during cycling. Med. Sci. Sports Exerc. 2000, 32, 1630–1634. [Google Scholar] [CrossRef]
  5. Ansley, L.; Cangley, P. Determinants of “optimal” cadence during cycling. Eur. J. Sport Sci. 2009, 9, 61–85. [Google Scholar] [CrossRef]
  6. Leirdal, S.; Ettema, G. The relationship between cadence, pedalling technique and gross efficiency in cycling. Eur. J. Appl. Physiol. 2011, 111, 2885–2893. [Google Scholar] [CrossRef]
  7. Ueda, T. Measurement Apparatus and Sensor Apparatus. Patent CA2478147A1, 22 February 2005. [Google Scholar]
  8. Popović, R.S. Hall-effect devices. Sens. Actuators 1989, 17, 39–53. [Google Scholar] [CrossRef]
  9. Popovic, R.; Randjelovic, Z.; Manic, D. Integrated Hall-effect magnetic sensors. Sens. Actuators A Phys. 2001, 91, 46–50. [Google Scholar] [CrossRef]
  10. Bertucci, W.; Grappe, F.; Girard, A.; Betik, A.; Rouillon, J.D. Effects on the crank torque profile when changing pedalling cadence in level ground and uphill road cycling. J. Biomech. 2005, 38, 1003–1010. [Google Scholar] [CrossRef]
  11. Bini, R.R.; Hume, P.A.; Cerviri, A. A comparison of cycling SRM crank and strain gauge instrumented pedal measures of peak torque, crank angle at peak torque and power output. Procedia Eng. 2011, 13, 56–61. [Google Scholar] [CrossRef]
  12. Bini, R.R.; Hume, P.A. Assessment of bilateral asymmetry in cycling using a commercial instrumented crank system and instrumented pedals. Int. J. Sports Physiol. Perform. 2014, 9, 876–881. [Google Scholar] [CrossRef] [PubMed]
  13. Dorel, S.; Couturier, A.; Lacour, J.R.; Vandewalle, H.; Hautier, C.; Hug, F. Force-velocity relationship in cycling revisited: Benefit of two-dimensional pedal forces analysis. Med. Sci. Sports Exerc. 2010, 42, 1174–1183. [Google Scholar] [CrossRef] [PubMed]
  14. Ahmad, N.; Ghazilla, R.A.R.; Khairi, N.M.; Kasi, V. Reviews on Various Inertial Measurement Unit (IMU) Sensor Applications. Int. J. Signal Process. Syst. 2013, 1, 256–262. [Google Scholar] [CrossRef]
  15. Matyja, T.; Kubik, A.; Stanik, Z. Possibility to Use Professional Bicycle Computers for the Scientific Evaluation of Electric Bikes: Trajectory, Distance, and Slope Data. Energies 2022, 15, 758. [Google Scholar] [CrossRef]
  16. Gallagher, R.; Damodaran, H.; Werner, W.G.; Powell, W.; Deutsch, J.E. Auditory and visual cueing modulate cycling speed of older adults and persons with Parkinson’s disease in a Virtual Cycling (V-Cycle) system. J. Neuroeng. Rehabil. 2016, 13, 77. [Google Scholar] [CrossRef]
  17. Aroganam, G.; Manivannan, N.; Harrison, D. Review on Wearable Technology Sensors Used in Consumer Sport Applications. Sensors 2019, 19, 1983. [Google Scholar] [CrossRef]
  18. Adesida, Y.; Papi, E.; McGregor, A.H. Exploring the Role of Wearable Technology in Sport Kinematics and Kinetics: A Systematic Review. Sensors 2019, 19, 1597. [Google Scholar] [CrossRef]
  19. Camomilla, V.; Bergamini, E.; Fantozzi, S.; Vannozzi, G. Trends Supporting the In-Field Use of Wearable Inertial Sensors for Sport Performance Evaluation: A Systematic Review. Sensors 2018, 18, 873. [Google Scholar] [CrossRef]
  20. Evans, S.A.; James, D.A.; Rowlands, D.; Lee, J.B. Evaluation of Accelerometer-Derived Data in the Context of Cycling Cadence and Saddle Height Changes in Triathlon. Sensors 2021, 21, 871. [Google Scholar] [CrossRef]
  21. Marin-Perianu, R.; Marin-Perianu, M.; Havinga, P.; Taylor, S.; Begg, R.; Palaniswami, M.; Rouffet, D. A performance analysis of a wireless body-area network monitoring system for professional cycling. Pers. Ubiquitous Comput. 2013, 17, 197–209. [Google Scholar] [CrossRef]
  22. De Freitas Maio, A.J.; Afonso, J.A. Wireless Body Area Network for Cycling Posture Monitoring. In Transactions on Engineering Technologies; Ao, S.I., Yang, G.C., Gelman, L., Eds.; Springer: Singapore, 2016; pp. 503–517. [Google Scholar] [CrossRef]
  23. Kobana, Y.; Takahashi, J.; Kitsunezaki, N.; Tobe, Y.; Lopez, G. Detection of Road Damage using Signals of Smartphone-Embedded Accelerometer while Cycling. In Proceedings of the 2014 International Workshop on Web Intelligence and Smart Sensing; Maret, P., Honda, S., Akerkar, R., Ishikawa, F., Yonezawa, T., Riedel, T., Neumann, M.A., Eds.; ACM: New York, NY, USA, 2014; pp. 1–2. [Google Scholar] [CrossRef]
  24. Litzenberger, S.; Christensen, T.; Hofstätter, O.; Sabo, A. Prediction of Road Surface Quality during Cycling Using Smartphone Accelerometer Data. Proceedings 2018, 2, 217. [Google Scholar] [CrossRef]
  25. Zhang, M.R.; Lucas, J.; Hinton, G.; Ba, J. Lookahead Optimizer: K steps forward, 1 step back. arXiv 2019, arXiv:1907.08610v2. [Google Scholar]
  26. Ganser, A.; Hollaus, B.; Stabinger, S. Classification of Tennis Shots with a Neural Network Approach. Sensors 2021, 21, 5703. [Google Scholar] [CrossRef]
  27. Hollaus, B.; Stabinger, S.; Mehrle, A.; Raschner, C. Using Wearable Sensors and a Convolutional Neural Network for Catch Detection in American Football. Sensors 2020, 20, 6722. [Google Scholar] [CrossRef] [PubMed]
  28. STMicroelectronics. SensorTile Development Kit. 2018. Available online: https://www.st.com/en/evaluation-tools/steval-stlkt01v1.html (accessed on 2 February 2021).
  29. Texas Instruments. DRV5053VA. 2015. Available online: https://www.ti.com/product/DRV5053 (accessed on 2 February 2021).
  30. STMicroelectronics. Embedded Software Samples for SensorTile, Including Sensor Data Streaming via USB and BLE, Data Logging on SD Card, Audio Acquisition and Playback. 2016. Available online: https://www.st.com/en/embedded-software/stsw-stlkt01.html (accessed on 23 February 2021).
  31. Pogson, M.; Verheul, J.; Robinson, M.A.; Vanrenterghem, J.; Lisboa, P. A neural network method to predict task- and step-specific ground reaction force magnitudes from trunk accelerations during running activities. Med. Eng. Phys. 2020, 78, 82–89. [Google Scholar] [CrossRef] [PubMed]
  32. Project Jupyter. Project Jupyter. 2021. Available online: https://jupyter.org/ (accessed on 7 September 2021).
  33. Virtanen, P.; Gommers, R.; Oliphant, T.E.; Haberland, M.; Reddy, T.; Cournapeau, D.; Burovski, E.; Peterson, P.; Weckesser, W.; Bright, J.; et al. SciPy 1.0: Fundamental Algorithms for Scientific Computing in Python. Nat. Methods 2020, 17, 261–272. [Google Scholar] [CrossRef]
  34. Lecun, Y.; Bottou, L.; Bengio, Y.; Haffner, P. Gradient-based learning applied to document recognition. Proc. IEEE 1998, 86, 2278–2324. [Google Scholar] [CrossRef]
  35. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
  36. Acharya, U.R.; Fujita, H.; Oh, S.L.; Hagiwara, Y.; Tan, J.H.; Adam, M. Application of deep convolutional neural network for automated detection of myocardial infarction using ECG signals. Inf. Sci. 2017, 415–416, 190–198. [Google Scholar] [CrossRef]
  37. Karim, F.; Majumdar, S.; Darabi, H.; Chen, S. LSTM Fully Convolutional Networks for Time Series Classification. IEEE Access 2018, 6, 1662–1669. [Google Scholar] [CrossRef]
  38. Cui, Z.; Chen, W.; Chen, Y. Multi-Scale Convolutional Neural Networks for Time Series Classification. arXiv 2016, arXiv:1603.06995v4. [Google Scholar]
  39. Andrew, L.; Maas, A.Y.; Hannun, A.; Ng, Y. Rectifier Nonlinearities Improve Neural Network Acoustic Models. 2013. Available online: https://ai.stanford.edu/~amaas/papers/relu_hybrid_icml2013_final.pdf (accessed on 16 November 2021).
  40. Kingma, D.P.; Ba, J. Adam: A Method for Stochastic Optimization. arXiv 2014, arXiv:1412.6980. [Google Scholar] [CrossRef]
  41. Ying, X. An Overview of Overfitting and its Solutions. J. Phys. Conf. Ser. 2019, 1168, 022022. [Google Scholar] [CrossRef]
  42. Finnoff, W.; Hergert, F.; Zimmermann, H.G. Improving model selection by nonconvergent methods. Neural Netw. 1993, 6, 771–783. [Google Scholar] [CrossRef]
  43. Prechelt, L. Early Stopping—But When? In Neural Networks: Tricks of the Trade; Montavon, G., Orr, G.B., Müller, K.R., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2012; Volume 7700, pp. 53–67. [Google Scholar] [CrossRef]
Figure 1. The hardware block diagram with the SensorTile module (A) which contains the IMU, the SensorTile Cradle board in top (B) and bottom view (C) [28] and the Hall-effect sensor (D) [29]. The connecting cable between Hall-effect sensor and SensorTile module has the supply voltage in red, the ground in black, the analogous Hall-effect sensor output in violet, and a spare wire in green.
Figure 1. The hardware block diagram with the SensorTile module (A) which contains the IMU, the SensorTile Cradle board in top (B) and bottom view (C) [28] and the Hall-effect sensor (D) [29]. The connecting cable between Hall-effect sensor and SensorTile module has the supply voltage in red, the ground in black, the analogous Hall-effect sensor output in violet, and a spare wire in green.
Sensors 22 06140 g001
Figure 2. The experimental setup for the measurement of the motion data and the cadence signal. The IMU is fixed to the saddle tube with the given orientation. The Hall-effect sensor is fixed on the frame opposite the permanent magnet on the crank arm.
Figure 2. The experimental setup for the measurement of the motion data and the cadence signal. The IMU is fixed to the saddle tube with the given orientation. The Hall-effect sensor is fixed on the frame opposite the permanent magnet on the crank arm.
Sensors 22 06140 g002
Figure 3. Structure of the neural network model, with layer types and sizes as indicated. N b a t c h symbolises the variable dimension based on the number of batches.
Figure 3. Structure of the neural network model, with layer types and sizes as indicated. N b a t c h symbolises the variable dimension based on the number of batches.
Sensors 22 06140 g003
Figure 4. Pedal stroke signal from the Hall-effect sensor after pre-processing versus the output signal predicted by the network. The binary threshold indicates the threshold used to decide if the network output is mapped to 0 or 1.
Figure 4. Pedal stroke signal from the Hall-effect sensor after pre-processing versus the output signal predicted by the network. The binary threshold indicates the threshold used to decide if the network output is mapped to 0 or 1.
Sensors 22 06140 g004
Figure 5. Neural network evaluation: true cadence as measured with the Hall-effect sensor versus predicted cadence from the network. (a) Comparison for a large section from the test dataset. (b) Comparison for a zoomed section from the test dataset.
Figure 5. Neural network evaluation: true cadence as measured with the Hall-effect sensor versus predicted cadence from the network. (a) Comparison for a large section from the test dataset. (b) Comparison for a zoomed section from the test dataset.
Sensors 22 06140 g005
Figure 6. Bland–Altmann diagrams for the comparison of the IMU-ML method with the Hall-effect sensor used as ground truth. (a) Comparison for the entire cadence range in the dataset. (b) Comparison for 50 rpm and above.
Figure 6. Bland–Altmann diagrams for the comparison of the IMU-ML method with the Hall-effect sensor used as ground truth. (a) Comparison for the entire cadence range in the dataset. (b) Comparison for 50 rpm and above.
Sensors 22 06140 g006
Table 1. IMU and sensors connected to the SensorTile module and their main characteristics.
Table 1. IMU and sensors connected to the SensorTile module and their main characteristics.
DeviceDescriptionInterfacesZero-Level Offset
STM32L476JGARM Cortex-M4
32-bit microcontroller
I2C, SPI,
UART, ADC, etc.
-
LSM6DSM3D accelerometer (up to ±16 g), 3D gyroscope (up to ±2000   s 1 )I2C, SPI±40 mg,
±2   s 1
LSM303AGR3D accelerometer (not used),
3D magnetometer (up to ±50 G)
I2C, SPI±40 mg,
±60 mG
LPS22HBpressure sensor (up to 1260 hPa absolute pressure range)I2C, SPI0.0075 hPa (RMS)
DRV5053VAanalog bipolar Hall-effect sensor (−90 mV/mT sensitivity)analog1.02 V (typical)
Table 2. Sensor devices and their settings as configured in the initialization routine prior to the start of a measurement.
Table 2. Sensor devices and their settings as configured in the initialization routine prior to the start of a measurement.
DeviceSensorSetting
LSM6DSMAccelerometer ± 2 g
LSM6DSMLGyroscope ± 2000   s 1
LSM303AGRMagnetometer ± 50 Gauss
LPS22HBBarometer260 hPa to 1260 hPa absolute pressure range
DRV5053VAHall effectProvides raw 12-bit unsigned ADC values
Table 3. Neural network evaluation showing the loss (MSE) and accuracy (Binary) for the final network for the training, validation, and test datasets.
Table 3. Neural network evaluation showing the loss (MSE) and accuracy (Binary) for the final network for the training, validation, and test datasets.
LossAccuracyVal_lossVal_acc.Test_lossTest_acc.
0.05250.92910.05510.92640.03670.9506
Table 4. Neural network evaluation showing the loss (MSE) and accuracy (Binary) for network using various sensors as input for the training, validation and test datasets.
Table 4. Neural network evaluation showing the loss (MSE) and accuracy (Binary) for network using various sensors as input for the training, validation and test datasets.
Input SensorValidation LossValidation AccuracyTest LossTest Accuracy
Accelerometer0.05510.92640.03670.9506
Gyroscope0.38050.87310.35610.8859
Accel. and Gyro.0.28600.89020.28170.8910
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Hollaus, B.; Volmer, J.C.; Fleischmann, T. Cadence Detection in Road Cycling Using Saddle Tube Motion and Machine Learning. Sensors 2022, 22, 6140. https://doi.org/10.3390/s22166140

AMA Style

Hollaus B, Volmer JC, Fleischmann T. Cadence Detection in Road Cycling Using Saddle Tube Motion and Machine Learning. Sensors. 2022; 22(16):6140. https://doi.org/10.3390/s22166140

Chicago/Turabian Style

Hollaus, Bernhard, Jasper C. Volmer, and Thomas Fleischmann. 2022. "Cadence Detection in Road Cycling Using Saddle Tube Motion and Machine Learning" Sensors 22, no. 16: 6140. https://doi.org/10.3390/s22166140

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop