Heart Rate Prediction Based on Cycling Cadence Using Feedforward Neural Network Kusprasapta Mutijarsa School of Electrical Engineering and Information Technology Bandung Institute of Technology Bandung, Indonesia soni@stei.itb.ac.id Muhammad Ichwan, Dina Budhi Utami Information Technology National Institute of Technology Bandung, Indonesia ichwan@itenas.ac.id, dinabudhi@itenas.ac.id Abstract It is important to monitor heart rate during cycling. By monitoring heart rate during cycling, cyclists can control the cycling session such as cycling cadence to determine the intensity of exercise. By controlling the intensity of cycling, cyclists can avoid the risks of over training and heart attack. Exercise intensity can be measured by heart rate of cyclist. The heart rate can be measured by wearable sensor. But there are data that are not recorded by the sensor at a regular time for example, one second, two seconds, etc. So we need a prediction model of heart rate to complete the missing data. The purpose of this study is to create a predictive model for heart rate based on cycling cadence using Feedforward Neural Network. The inputs are heart rate (HRt) and cadence (cadt) on the second. The output is the predictive value of heart rate on the next second (HRt+1). Feedforward Neural Network is used as a mathematical model of the relationship between heart rate and cycling cadence. The prediction model was trained using 00 data of cyclist number 1 in a cycling session. The test data use dataset of 6 cyclists. Experiments show that the prediction model generates the predictive value of heart rate that is close to the value of heart rate measured by the sensor. The error of training data is 2.43 while the average error of test data is 3.02. Keywords Prediction, heart rate, cycling, Feedforward Neural Network, cadence. I. INTRODUCTION Exercise intensity is used to measure the level of exercise. The intensity of exercise is an important factor to improve the performance of cyclists. If the exercise intensity is too low, then performance will not increase. If the intensity is too high, then it may lead to over training or heart attack [1]. Exercise intensity can be measured by heart rate of cyclist. Heart rate has an important role to detect and prevent over training [2]. Therefore, it is important to monitor heart rate during cycling. By monitoring heart rate during cycling, cyclists can control the cycling events such as the cycling cadence to avoid the risks of over training and heart attack while cycling. The heart rate can be measured by wearable sensor. But there are data that are not recorded by the sensor at a regular time for example, one second, two seconds, etc. So we need a prediction model of heart rate to complete the missing data. The purpose of this research is to create a predictive model based on the cycling cadence using Feedforward Neural Network. The Feedforward neural network is used as a mathematical model of the relationship between heart rate and cycling cadence. There are several studies on the prediction of heart rate, which are heart rate prediction based on physical activity [3] - [7], heart rate prediction during exercise using PID controllers [8], heart rate prediction during cycling based on the duration of cycling and weight training [9]. In heart rate prediction based on physical activity [3] [7], the value of physical activity from the accelerometer is used to determine the predictive value of heart rate, while cadence is used to determine the predictive value of heart rate in this study. Both these studies used artificial neural network, but the inputs are different. At the beginning of the study on the prediction of heart rate, the heart rate value on the next second is predicted based on heart rate and cadence on the second. So the results of this study will be used for further research on the multi time heart rate prediction. In this study, the inputs are the value of heart rate (HR t ) and the cycling cadence (cad t ) on the second. While the output is the predictive value of heart rate on the next second (HR t+1 ). The proposed method is Feedforward Neural Network. This paper is presented in four sections in which the next section describes the design of predictive models and methods. In the third section describes the experimental specifications and the test results of predictive models using some sample data. Section 4 presents conclusion and discussion. II. METHOD A. Heart Rate Prediction Model In this study, we investigate the relationship between heart rate and cycling cadence. Heart rate value (HR t ) is measured by the wearable heart rate sensor, while the cycling cadence (cad t ) measured by cadence sensor. Both value at a second is used as the input of the neural network. The output of the neural network is the predictive value of heart rate in the next second (HR t + 1 ). To measure the degree of accuracy of the prediction, then we calculated error value (e t + 1 ) of the predictive value of heart rate at the next second (HR' t + 1 ) and the value of heart rate measurement at the next second (HR t + 1 ) by a heart rate sensor. Block diagram of system can be seen in fig. 1.
Heart Rate HR(t) Cad(t) Cadance Fig. 1 The block diagram of system Neural Network HR (t+1) HR(t+1) e(t+1) B. Feed Forward Neural Network Feedforward Neural Network (FFNN) is a neural network in which the relationship between the information signals moves only in one direction from input to output [11]. FFNN not generate feedback, which means that the output of each layer will not affect other neurons in the same layer. In this study, FFNN is used for modeling the relationship between heart rate and cycling cadence. We used multilayer Perceptron (MLP) for neural network architecture which consists three layers. There are an input layer, one hidden layer and an output layer. 3 layers are selected based on research conducted by Ming Yuchi et al which the topic is a heart rate prediction based on physical activity [3]. In this study, the value of heart rate and cycling cadence at on the second are used as input, so that there are two neurons in the input layer. Then, there are 333 neurons in the hidden layer. Selection of the number of hidden layers based on test and trial. We used a neuron in the output layer. Output is the predictive value of heart rate in the next second (HR t + 1 ). The architecture of neural networks in this study can be seen in fig. 2. W 333,1 = weight of first input neuron to the 333 th hidden W 333,2 = weight of the second input neuron to the 333 th hidden Nh 1 = the first hidden b 1 = bias of the first hidden Nh 333 = the 333 th hidden b 333 = bias of the 333 th hidden W 1 = weight of the first hidden neuron to the output W 333 = weight of the 333 th hidden neuron to the output y = the output b y = bias of the output = value of the heart rate at t+1. HR t+1 Based on neural network architecture, the value of HR t + 1 is the sum of all multiplication of the input and the weight for each layer neural network as in equation 1..,., (1) Where: HR t = heart rate values at t. Cad t = cycling cadence at t. W n,1 = weight of the first input neuron to the n th hidden W n,2 = weight of the second input neuron to the n th hidden b n = bias of the n th hidden W n = weight of the n th hidden neuron to the output b y = bias of the output neuron = value of the heart rate at t+1. HR t+1 Fig. 2 Neural network architectures Where: HR t = heart rate values at t. Cad t = cycling cadence at t. X 1 = the first input X 2 = the second input W 1,1 = weight of the first input neuron to the first hidden W 1,2 = weight of the second input neuron to the first hidden III. EXPERIMENT A. Experiment Specifications The increasing of using smart phones and wearable sensors allows many cyclists use a variety of sports-based smartphone applications such as Strava, Garmin Connect, and others. The function of the application is to monitor the results of measurement by the sensor. The results of measurement can be exported in the form of XML and then analyzed. This study uses the dataset which is used by other researchers in the field of sport [13-15]. This dataset is downloaded via the link http://www.iztok-jr-fister.eu/static/css/datasets/sport2.zip. The dataset contains data of 9 cyclists extracted from wearable sensor. Data exported from Garmin Connect or Strava. Each dataset contains GPS location, elevation, duration, distance, heart rate, cadence, and some data containing power information. We tried to make general predictive models of heart rate. Therefore, in this study, we trained the models using data from a cyclist and then test to some other cyclists. In the training, we used 00 data of cyclist number 1 at a cycling session. In the testing, we used data of cyclist number 1 when the cycling session is different from the cycling session of training data.
Then, we tested prediction model using data of other cyclists which are cyclist number 3, 4, 5, 7, 8, and 9. In the dataset, data of cyclist numbers 2 and 6 does not have cycling cadence information. B. Experiment Results Comparison of heart rate measurement and heart rate prediction can be seen in fig. 3 to 10 with only displays data for each dataset. Fig. 3 illustrates the comparison of heart rate measurement and predictions of 00 training data (data cyclist number 1 in a cycling session). Fig. 4 illustrates a comparison of heart rate measurement and predictions of 2162 data cycling of cyclist number 1 which the cycling session differs from the cycling session of training data. Fig. 5 illustrates the comparison of heart rate measurement and predictions from 9 data of cyclists number 3 on a cycling session. Further fig. 6, fig. 7, fig. 8, fig. 9, and fig. 10 illustrates a comparison of heart rate measurement and predictions of data cyclist numbers 4, 5, 7, 8, and 9 at a cycling session with the amount of data each dataset can be seen in table 1. Fig. 3 to 10 shows that the value of heart rate predictions are close to the value of heart rate measurement by a heart rate sensor. Fig. 4 shows that although we only train model using data of cyclist number 1 in a cycling session, the prediction model can predict heart rate of cyclist number 1 when the cycling session is different from the cycling session of training data. Fig. 5 to 10 shows that although we only train model using data on cyclist number 1, the prediction can predict heart rate of other cyclists with the production values are close to the heart rate measurement by a heart rate sensor. From these results, it can be seen that the cycling cadence effect on heart rate. Performance Feedforward Neural Network in the prediction of heart rate is measured by calculating the mean absolute error (MAE) of each data set. The MAE value of each dataset can be seen in table 1. MAE value of training data is 2.43 and the average MAE of test data is 3.02. The MAE value of this research is smaller than MAE value of research on heart rate prediction based on physical activity [3]. Fig. 4 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 1 145 135 115 105 95 85 70 60 Test set of cyclist number 1 Train set of cycist nunber 3 Fig. 5 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 3 Train set of cyclist number 4 Train Set 115 135 105 95 85 75 65 Fig. 6 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 4 Fig. 3 Performance of Feedforward Neural Network in predict heart rate of training set
Train set of cyclist number 5 Train set of cyclist number 9 160 150 Waktu (detik) Fig. 7 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 5 Fig. 10 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 9 70 Train set of cyclist number 7 Fig. 8 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 7 Table 1 Mean absolute error (MAE) of the prediction error Dataset Cyclist Amount data MAE Train sets 1 00 2.43 1 2162 2.69 3 9 2.20 4 3118 3.05 Test sets 5 664 4.06 7 816 1.14 8 20 3.26 9 8991 4.72 Average 3.02 160 60 Train set of cyclist number 8 Fig. 9 Performance of Feedforward Neural Network of heart rate prediction on test set of cyclist number 8 IV. CONCLUSION AND DISCUSSION Based on the experiment, the heart rate on the second (HR t+1 ) can be predicted from heart rate (HR t ) and cycling cadence (cad t ) on the second. Feedforward Neural Network is used for modeling heart rate prediction. The prediction model was trained using 00 data of cyclist number 1 at a cycling session. The test data use dataset of 6 cyclists. Experiments show that the prediction model generates predictive values of heart rate are close to the value of heart rate measurement by a heart rate sensor. In this study, we use dataset which have not personal cyclist information such as age, gender, and level of health. Additionally dataset have not information about the type of wearable sensors used. Therefore, it needs further research regarding these factors. Another further research is the multi time heart rate prediction to predict heart rate in the long term. The prediction model of heart rate has the potential to be used in a variety of research in the field of health and sports such as prediction of heart attack, an indication of over training, and artificial personal trainer.
REFERENCES [1] Kuiers, H. and izer, H. Overtraining in elite athletes in Sport Medicine, Vol. 6, pp. 79-92, 1988. [2] Jeundrup A. and Van Diemen A. Heart rate monitoring during training and competition in cyclists in Journal of Sport Sciences, Vol. 6(3), pp. 91-99, May 1998 [3] M. Yuchi and J. Jo. Heart Rate Prediction Based on Physical Activity Using Feedforward Neural Network, in International Conference on Hybrid Information Technology, pp. 344-350, 2008. [4] F. Xiao, M. Yuchi, M. Y. Ding, J. Jo and W. G. Hou. A Research of Physical Activities Influence of Heart Rate Using Feedforward Neural Network in International Symposium on Neural Network, pp. 1089-1096, 2009 [5] F. Xiao, M. Yuchi, M. Y. Ding, J. Jo and J. H. Kim. A Multi-step Heart Rate Prediction Method based on Physical Activity using Adams- Bashforth Technique in IEEE International Symposium on Computational Intelligence in Robotics and Automation, pp. 355-359, 2009. [6] F. Xiao, Y. M. Chen, M. Yuchi, M. Y. Ding and J. Jo. Heart Rate Prediction Model Based on Physical Activities using Evolutionary Neural Network in Fourth International Conference on Genetic and Evolutionary Computing pp. 198-201,2010. [7] F. Xiao, M. Yuchi, M. Y. Ding and J. Jo. A Research of Heart Rate Prediction Model based on Evolutionary Neural Network in Intelligent Computation and Bio-Medical Instrumentation, pp. 304-307, 2011. [8] A. C. Koenig, L. Somaini, M. Pulfer, T. Holenstein, X. Omlin, M. Wieser and R. Riener. Model-Based Heart Rate Prediction during Lokomat Walking in 31 st Annual International Conference of the IEEE EMBS, pp. 1758-1761, 2009. [9] A. Le, T. Jaitner, F. Tobias, and L. Litz. A Dynamic Heart Rate Prediction Model for Training Optimization in Cycling in Proceedings of 7 th ISEA Conference, pp. 1-6, 2008. [10] M. T. Hagan, H. B. Demuth, and M. H. Beale. Neural Network Design. Boston: MA, PWS Publishing, 1996. [11] Russell, S.J. and Norvig, P. Artificial Intelligence: Modern Approach (3 rd Edition). New Jersey: Prentice hall, Englewood, 2010. [12] S. Haykin. Neural Network A Comprehensive Foundation. New York: Macmillan College Publication, 1994. [13] Iztok Jr. Fister, Dusan Fister, Iztok Fister, and Simon Fong. Data mining in sporting activities cerated by sports tracrs in Computational and Business Intelligence (ISCBI) 2013 IEEE International Sysmposium, pp. 88-91, 2013. [14] S. Rauter, I. Jr. Fister, and I. Fister. A collection of sport activity files data analysis and data mining in Technical report 0210, University of Ljubljana and University of Maribor, 2015. [15] S. Rauter, I. Jr. Fister, and I. Fister. A collection of sport activity files data analysis and data mining 2016a in Technical report 0210, University of Ljubljana and University of Maribor, 2016.