# Optimized MLP-CNN Model to Enhance Detecting DDoS Attacks in SDN Environment
## 4 Proposed Model
### Mlp  
MLP is a type of artificial neural network that serves as a foundational building block for DL models. MLPs are a class of feedforward neural networks, meaning that information flows in one direction, from the input layer to the output layer. They are widely used for various ML tasks, including classification, regression, and feature learning. Let us explore the structure, components, and workings of an MLP in more detail [32, 33]. An MLP consists of multiple layers of interconnected neurons, and three main types of layers characterize its structure:  
* Input Layer: This is the network's first layer, receiving the raw input data. Each neuron in the input layer corresponds to a feature or variable in the dataset, making it a fundamental representation of the data's dimensions.
* Hidden Layers: MLPs can have one or more hidden layers between the input and output layers. These layers are called \"hidden\" because they are not directly connected to the outside world (i.e., input or output). Neurons in hidden layers take the weighted sum of inputs from the previous layer, apply an activation function, and pass the result to the next layer. The number of hidden layers and the number of neurons in each layer are hyperparameters that can be adjusted to optimize the model's performance.
* Output Layer: The final layer produces the model's output or prediction. The structure of this layer depends on the problem the MLP is designed to solve. For example, in binary classification, there may be a single neuron with a sigmoid activation function, while in multiclass classification, there might be multiple neurons, each representing a class and using a softmax activation function.  
Each neuron in an MLP performs the following operations:  
For each neuron in a layer (except the input layer), the input is a weighted sum of the outputs from the previous layer. This weighted sum is often referred to as the \"activation\" of the neuron. Mathematically, the weighted sum \(z_{j}^{(l)}\) of neuron \(j\) in layer \(l\) can be expressed as  
\[z_{j}^{(l)}=\sum_{i}w_{ij}^{(l)}a_{i}^{(l-1)}+b_{j}^{(l)} \tag{13}\]  
_where_  
\(z_{j}^{(l)}\) is the activation of neuron \(j\) in layer \(l\).  
\(w_{ij}^{(l)}\) is the weight of the connection between neuron \(i\) in layer \(l-1\) and neuron \(j\) in layer \(l\).  
\(a_{i}^{(l-1)}\) is the output of neuron \(i\) in layer \(l-1\).  
\(b_{j}^{(l)}\) is the bias of neuron \(j\) in layer \(l\).  
The weighted sum is passed through a nonlinear activation function to introduce nonlinearity into the model. Common activation functions include the sigmoid function, Rectified Linear Unit (ReLU), and the hyperbolic tangent function (tanh). The output of one layer becomes the input for the next layer:  
\[a_{j}^{(l)}=f(z_{j}^{(l)}) \tag{14}\]where \(a_{j}^{(l)}\) is the output of neuron \(j\) in layer \(l\) and \(f\) is the activation function.  
Feedforward Propagation  
During the feedforward process, the activations are computed for each neuron by applying the activation function to the weighted sum. The output of one layer becomes the input for the next layer, propagating information from the input layer to the output layer:  
\[a_{j}^{(l)}=f\left(\sum_{i}w_{ij}^{(l)}a_{i}^{(l-1)}+b_{j}^{(l)}\right) \tag{15}\]