# COVID-19 Outbreak Prediction with Machine Learning
## 2 Materials and Methods
### Machine Learning (ML)
#### 2.2.1 Multi-Layered Perceptron (MLP)  
The Artificial Neural Network (ANN) is an idea inspired by the biological nervous system, which processes information in the same way as the brain. The key element of this idea is the new structure of the information processing system [77; 78; 79]. The system is made up of several highly interconnected processing elements called neurons that work together to solve a problem [79; 80]. ANNs, like humans, learn by example. The neural network is set up during a learning process to perform specific tasks, such as identifying patterns and categorizing information. In biological systems, learning is regulated by the synaptic connections between nerves. This method is also used in neural networks [81]. By processing experimental data, ANNs transfer knowledge or a law behind the data to the network structure, which is called learning. Basically, learning ability is the most important feature of such a smart system. A learning system is more flexible and easier to plan, so it can better respond to new issues and changes in processes [82].  
In ANNs, with the help of programming knowledge, a data structure is designed that can act like a neuron. This data structure is called a node [83; 84]. In this structure, the network between these nodes is trained by applying an educational algorithm to it. In this memory or neural network, the nodes have two active states (on or off) and one inactive state (off or 0), and each edge (synapse or connection between nodes) has a weight. Positive weights stimulate or activate the next inactive node, and negative weights inactivate or inhibit the next connected node (if active) [79; 85]. In the ANN architecture, for the neural cell \(c\), the input \(b_{p}\) enters the cell from the previous cell \(p\) (Equation (19)). \(w_{pc}\) is the weight of the input \(b_{p}\) with respect to cell \(c\) and \(a_{c}\) is the sum of the multiplications of the inputs and their weights [86]:  
\[a_{c}=\sum_{i=1}w_{pc}b_{pc} \tag{19}\]  
\begin{table}
\begin{tabular}{c c c c} \hline \hline  & **Inputs** & **Input Number** & **Output** \\ \hline Scenario 1 & \(x_{t-1}\), \(x_{t-2}\), \(x_{t-1}\), and \(x_{t-21}\) & Four inputs & \(x_{t}\) (outbreak) \\ Scenario 2 & \(x_{t-1}\), \(x_{t-2}\), \(x_{t-3}\), \(x_{t-4}\), and \(x_{t-5}\) & Five inputs & \(x_{t}\) (outbreak) \\ \hline \hline \end{tabular}
\end{table}
Table 2: Input and output variables for training ML methods by time-series data.  
A non-linear function \(\theta_{c}\) is applied to \(a_{c}\). Accordingly, \(b_{c}\) can be calculated as Equation (20) [85]:  
\[b_{c}=\theta_{c}(a_{c}) \tag{20}\]  
Similarly, \(w_{cn}\) is the weight of the \(b_{cn}\) which is the output of \(c\) to \(n\). \(W\) is the collection of all of the weights of the neural network in a set. For input \(x\) and output \(y\), \(h_{av}(x)\) is the output of the neural network. The main goal is to learn these weights to reduce the error values between \(y\) and \(h_{av}(x)\). That is, the goal is to minimize the cost function \(Q(W)\), Equation (21) [86]:  
\[Q(W)=\frac{1}{2}\sum_{i=1}^{n}{(y_{i}-o_{i})^{2}} \tag{21}\]  
In the present research, one of the frequently used types of ANN called the MLP [77] was employed to predict the outbreak. The MLP was trained using a dataset related to both scenarios. For the training of the network, 8, 12, and 16 inner neurons were tried to achieve the best response. Results were evaluated by root mean square error (RMSE) and correlation coefficient to reduce the cost function value. Figure 5 presents the architecture of the MLP.