## 3 Proposed Approach
### Class Weights
#### 3.3.3 Deep Neural Network (DNN)
(i) Binary Classification  
The architecture detailed in Table 24 presents the structure of the DNN model specifically designed for binary classification, with tailored configurations for the NF-UNSW-NB15-v2 and CICIDS2017 datasets. The input layer block begins by processing 25 features for the NF-UNSW-NB15-v2 dataset and 69 features for the CICIDS2017 dataset, and a dense layer with 1024 neurons, where the ReLU activation function is applied to introduce non-linearity and enhance the model's ability to learn complex representations from the data. The first hidden block includes a dropout layer with a very low dropout rate to mitigate overfitting, followed by a dense layer with 768 neurons. The dense layer is equipped with a ReLU activation function to introduce non-linearity, enhancing the model's ability to learn complex patterns. Batch normalization is applied after the dense layer to stabilize the learning process by normalizing the outputs, ensuring more effective and consistent training. The second hidden block contains another dropout layer and batch normalization, further refining the learning dynamics. Ultimately, the architecture concludes with an output layer featuring a single neuron activated by the sigmoid function. This configuration is meticulously crafted to enhance the model's effectiveness in binary classification tasks across both datasets. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Block** & **Layers** & **Layer Size** & **Activation** \\ \hline NF-UNSW-NB15-v2 & Input block & Input layer & 25 & ReLU \\ \hline CICIDS2017 & Input block & Input layer & 69 & ReLU \\ \hline \multirow{6}{*}{Shared Structure} & \multirow{6}{*}{Hidden block 1} & Dense layer & 1024 & - \\ \cline{2-5}  & & Dropout layer & 0.0000001 & ReLU \\ \cline{1-1} \cline{2-5}  & & Dense layer & 768 & - \\ \cline{1-1} \cline{2-5}  & & Batch normalization & - & - \\ \cline{1-1} \cline{2-5}  & & Dropout layer & 0.0000001 & - \\ \cline{1-1} \cline{2-5}  & & Batch normalization & - & - \\ \cline{1-1} \cline{2-5}  & & Output block & Output layer & 1 & Sigmoid \\ \hline \hline \end{tabular}
\end{table} 
Table 24: DNN model layers for binary classification. (ii) Multi-Class Classification  
The structure outlined in Table 25 describes the architecture of the DNN model designed for multi-class classification, with specific configurations for the NF-UNSW-NB15-v2 and CICIDS2017 datasets. The input layer block begins by processing 27 features for the NF-UNSW-NB15-v2 dataset and 35 features for the CICIDS2017 dataset, and a dense layer with 1024 neurons, where the ReLU activation function is applied to introduce non-linearity and enhance the model's ability to learn complex representations from the data. The first hidden block incorporates a dropout layer with a minimal dropout rate to mitigate overfitting. This is followed by a dense layer containing 768 neurons, which is augmented with ReLU activation to introduce non-linearity. Batch normalization is applied after the dense layer to stabilize the learning process by normalizing the output, ensuring more effective and faster training. The second hidden block contains another dropout layer and batch normalization, further refining the learning dynamics. The architecture concludes with an output layer for each dataset. The NF-UNSW-NB15-v2 dataset's output layer consists of 10 neurons, while the CICIDS2017 dataset's output layer has 15 neurons. Both output layers are activated by a softmax function, generating class probabilities across their respective categories. This design enables the model to effectively handle multi-class classification tasks across both datasets with precision. (iii) Hyperparameter Configuration for the DNN Model  
The hyperparameters for the DNN models, detailed in Table 26, are tailored to accommodate both binary and multi-class classification tasks. Each classifier utilizes a consistent batch size of 128 and employs the Adam optimizer for efficient training.