## 3 ENN
### Architectures of Models
#### 3.3.4 Autoencoder-Convolutional Neural Network (Autoencoder-CNN)  
The Autoencoder component of the model is crucial for reshaping input data, preparing it for enhanced classification in the subsequent CNN layers. Starting with an input layer that processes the entire feature set individually, the Autoencoder's Encoder block reduces dimensionality through a dense layer with ReLU activation, capturing essential patterns while filtering out less relevant information. This compression emphasizes key characteristics in the data, effectively highlighting meaningful patterns. The Decoder block then reconstructs this compressed data back to the original feature space via a layer with linear activation, retaining significant features and reducing noise. This reshaping results in a refined dataset that optimally represents the underlying data patterns. Compiled using the Adam optimizer and mean squared error loss function, the Autoencoder minimizes reconstruction error, enhancing the dataset's suitability for further classification. The output of the Autoencoder serves as the input for the CNN component, where additional feature extraction and classification take place. The proposed model architecture combines CNN \begin{table}
\begin{tabular}{l l l} \hline \hline
**Parameter** & **Binary Classifier** & **Multi-Class Classifier** \\ \hline Batch size & 128 & 128 \\ \hline \multirow{3}{*}{Learning rate} & Scheduled: Initial = 0.0003, & Scheduled: Initial = 0.0003, \\  & Factor = 0.9, Decay Steps = 10,000 & Factor = 0.9, Decay Steps = 10,000 \\  & (Exponential Decay) & (Exponential Decay) \\ \hline Optimizer & Adam & Adam \\ \hline Loss function & Binary cross-entropy & Categorical cross-entropy \\ \hline Metric & Accuracy & Accuracy \\ \hline \hline \end{tabular}
\end{table} 
Table 20: DNN model hyperparameters. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dataset** & **Block** & **Layers** & **Layer Size** & **Activation** \\ \hline \hline \multirow{2}{*}{CICIDS2017} & \multirow{2}{*}{Input block} & Input layer & 69 & ReLU \\ \hline NF-BoT-IoT-v2 & \multirow{2}{*}{Input block} & Input layer & 28 & ReLU \\ \hline \multirow{6}{*}{Shared structure} & \multirow{2}{*}{Hidden block 1} & Dense layer & 1024 & - \\ \cline{3-5}  & & Dropout layer & 0.0000001 & - \\ \cline{3-5}  & & Dense layer & 768 & ReLU \\ \cline{3-5}  & & Batch normalization & - & - \\ \cline{3-5}  & & Dropout layer & 0.0000001 & - \\ \cline{3-5}  & & Batch normalization & - & - \\ \cline{3-5}  & & Batch normalization & - & - \\ \hline \multirow{2}{*}{CICIDS2017} & \multirow{2}{*}{Output block} & Output layer & 14 & Softmax \\ \hline NF-BoT-IoT-v2 & \multirow{2}{*}{Output block} & Output layer & 4 & Softmax \\ \hline \hline \end{tabular}
\end{table} 
Table 19: DNN model layers for multi-class classification. and MLP to address both binary and multi-class classification tasks in a structured sequence of feature extraction and classification layers. The CNN component starts with an input layer designed to process sequential data in a one-dimensional format. This is followed by an initial CNN block that includes convolution operations with ReLU activation, followed by batch normalization, max pooling, and dropout layers, tailored for binary classification. For multi-class classification, an initial CNN block with convolution operations, followed by batch normalization, ReLU activation, max pooling, and dropout layers is used. This combination refines key features while preventing overfitting and is repeated in subsequent CNN layers with varying kernel sizes and pool sizes, enabling the model to capture diverse patterns and relationships within the input data. The different kernel sizes allow the model to detect features at multiple scales along the sequence, while the varying pool sizes facilitate downsampling and reduce the sequence's spatial dimensions, enhancing the model's ability to generalize across different input features. After passing through the CNN layers, the output is flattened and processed through an MLP block.