# A Neural Network Model for Estimating the Heart Rate Response to Constant Intensity Exercises
## 2 Materials and Methods
### Neural Network Modelling  
The block diagram of the NN model applied in this study is displayed in Figure 2. It consists of four pairs of NNs; each pair corresponds to an exercise set and its subsequent recovery at the specific velocity shown in the second column of Table 1. The NN architecture implemented for each block of Figure 2 is the MLP, which is a common choice for similar applications [16]. The input layer consists of one neuron, its input being the value of the beat-to-beat time interval, denoted as \(tb_{\rm i}\), \(I=I_{\rm ex}\),..., \(IV_{\rm ex}\) or \(I_{\rm rec}\),..., \(IV_{\rm rec}\), whereas the output layer comprises a single neuron that sums the weighted outputs of the last hidden layer and produces the HR, i.e., \(hr_{\rm i}\). The specific structure of the MLP-NN applied for set (I)\({}_{\rm ex}\), i.e., for \(I=I_{\rm ex}\), is shown in Figure 3; the circles denote the neurons in each layer. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Set** & \(\mathbf{v}\) **(km/h)** & **Duration (s)** \\ \hline (I)\({}_{\rm ex}\) & 13.4 & 431 \\ (I)\({}_{\rm rec}\) & 0 & 600 \\ (II)\({}_{\rm ex}\) & 14.4 & 401 \\ (II)\({}_{\rm rec}\) & 0 & 600 \\ (III)\({}_{\rm ex}\) & 15.7 & 366 \\ (III)\({}_{\rm rec}\) & 0 & 600 \\ (IV)\({}_{\rm ex}\) & 17.0 & 338 \\ (IV)\({}_{\rm rec}\) & 0 & 600 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Velocity and duration of each exercise set (the subscripts “ex” and “rec” refer to the exercise and recovery set, respectively). Figure 1: Set (II) of HR time series data. The appropriate number of hidden layers and the number of hidden neurons in each layer have been determined by applying a trial-and-error process. Both parameters are depicted in the second and third column of Table 2, respectively, for each exercise set. For example, the MLP-NN shown in Figure 3 consists of two hidden layers; the first one comprises 25 neurons, whereas the second one includes 15 hidden neurons. A logistic sigmoid activation function, given by \(f(x)=1/(1+e^{-x})\), has been considered for all hidden layers, whereas a linear activation function has been selected for the neuron of the output layer [20, 21, 22, 23, 24]. The symbol \(w_{g,h}^{j}\) (Figure 3) stands for the synaptic weight between the \(g\)th and the \(h\)th neuron, whereas the superscript \(j=1\), \(2\), \(3\) denotes the layer. The synaptic weights are adjustable parameters; at first, they are initialized and during training they are iteratively updated until the end of the training process. After training, their values remain constant [22, 23, 24]. Simulations have been performed in MATLAB environment, where the NN toolbox has been used [25]. The first step into the estimation of the HR is taken by training the NNs. The four sets of HR data, collected as described in the previous \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Set** & **Hidden Layers** & **Number of Neurons** & \(\textit{MSE}_{tr}\) & \(\textit{M}\) \\ \hline (I)\({}_{\text{ex}}\) & 2 & \(25\times 15\) & 0.892 & 605 \\ (I)\({}_{\text{rec}}\) & 3 & \(50\times 30\times 20\) & 3.854 & 412 \\ (II)\({}_{\text{ex}}\) & 2 & \(15\times 5\) & 1.364 & 581 \\ (II)\({}_{\text{rec}}\) & 2 & \(60\times 20\) & 1.694 & 462 \\ (III)\({}_{\text{ex}}\) & 2 & \(15\times 10\) & 1.278 & 587 \\ (III)\({}_{\text{rec}}\) & 2 & \(65\times 25\) & 3.946 & 496 \\ (IV)\({}_{\text{ex}}\) & 2 & \(15\times 5\) & 1.997 & 539 \\ (IV)\({}_{\text{rec}}\) & 3 & \(50\times 30\times 20\) & 5.273 & 471 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: MLP-NN parameters, \(\textit{MSE}_{tr}\) and \(\textit{M}\) for each exercise set. Figure 3: Structure of the proposed MLP-NN for set (I)\({}_{\text{ex}}\); the circles denote the neurons. Figure 2: Block diagram of the proposed NN model. train the NNs. Although the data corresponds to one level of cardiovascular condition, it includes the response to various exercise intensities. Thus, the NNs were trained successfully to a sufficient number of cardiovascular stress levels and the corresponding ways of recovery.