# Reservoir Computing Based Echo State Networks for Ventricular Heart Beat Classification
## 2 Materials and Methods
### The Configuration of the Echo State Network Based Reservoir Computing for Classification  
The main idea of reservoir computing (RC) is based on artificial neural network (ANN) because the nature of functional elements in RC is based on the input weights, biases, and connection weights among the neurons that are similar to ANN. The RC is further divided into two common methods (1) Echo State Networks (ESNs) [32] and (2) liquid state machine (LSMs) [49]. ESNs tend to use sparsely connected sigmoid nodes, whereas LSMs are a network which is made up by spiking neurons in the reservoir model [50]. In this study, the author considered the main type of RC echo state networks (ESNs) to construct an efficient model; for implementation in real-time scenarios, see Figure 6. In our methodology, the author used a cycle-based ESN architecture where the neurons of the reservoirs were connected in a ring form, which is also called non-random links between neurons (see Figure 7).  
The reason behind using the non-random topology was that an ESNs model could easily be implemented in hardware and it also allows low power consumption with efficient processing speed [51]. These advantages encouraged the author to use the ESNs model for ventricular heart beat classification. The activation vector of the echo state network is defined by Equation (3).  
\[\mathbf{s}(\mathbf{n})=g(\mathbf{\vartheta}W^{\text{in}}\mathbf{F}(\mathbf{n})+\mathbf{\alpha}W\mathbf{s} (\mathbf{n}-\mathbf{1}) \tag{3}\]  
Figure 6: Representation of standard ESN (Echo State Networks) architecture.  
Figure 7: Representation of standard proposed cyclic or ring ESN architecture.  
where \(S(\mathbf{n})\epsilon\mathbb{R}^{N_{d}}\), is the activation vector or state in which \(N_{\mathbf{x}}\) represents the number of neurons in the connection weights and \(\mathbf{W^{in}}\epsilon\mathbb{R}^{N_{\mathbf{x}}\mathbf{X}\mathbf{N}_{d}}\) is a random matrix which was typically drawn uniformly from \([-1,1]\) in which \(N_{d}\) represents the dimension of the input vector. In the end, the connection weight matrix was computed based on the connection between neurons in the network and it is represented as \(\mathbf{W}\epsilon\mathbb{R}^{N_{\mathbf{x}}\mathbf{X}\mathbf{N}_{x}}\), whereas \(\mathbf{\vartheta}\) and \(\mathbf{\alpha}\) are the input parameters of connection scaling, \(\mathbf{F}(\mathbf{n})\) represent the input feature vector of heart beats which has dimensionality = 11. The activation function of ESN is also called classic sigmoid function which is shifted to become symmetric near to 0. In general, the ESN state initialized with null state. The linear combination of the \(N_{\mathbf{x}}\) activation \(\mathbf{s}(\mathbf{n})\) or response of the ESN model was calculated according to:  
\[\mathbf{y}(\mathbf{n})=g\big{(}\mathbf{W^{out}}S(\mathbf{n})\big{)} \tag{4}\]  
where \(\mathbf{W^{out}}\epsilon\ \mathbb{R}^{N_{out}\mathbf{X}\mathbf{N}_{x}}\) represent the weight matrix of the connections between ESN neurons and output nodes, \(\mathbf{N_{out}}\) represents the number of readouts. We extend our ESN model to know the bias weight and feedback between the \(\mathbf{y}(\mathbf{n})\) and the reservoirs is defined as:  
\[S(\mathbf{n})=g\Big{(}\mathbf{W^{in}}\ \mathbf{F}(\mathbf{n})+\mathbf{W_{s(n-1)}}+\mathbf{W^{OR}_{y(n-1) }}+\mathbf{W^{bias}}\Big{)} \tag{5}\]