# Ensemble-Based Deep Learning Models for Enhancing IoT Intrusion Detection
## 5 Experimental Evaluation
### Result and Discussion  
The research introduces a methodology that assesses hard-voting and soft-voting ensemble techniques. These two approaches use three different deep learning algorithms: CNN, GRU, and LSTM, as outlined in Table 4.  
The study conducted individual evaluations for each of the three classifiers to emphasize the variations in performance among these classifiers and showcase the enhancements achieved through the ensemble model in terms of accuracy. For a more comprehensive understanding of the processes undertaken. Figure 6 describes the steps involved. Python version 3.8 was employed to create the algorithms, and we utilized the sci-kit to learn the framework in conjunction with the imblearn framework to develop the proposed algorithms. The imblearn framework was particularly useful for handling resampling tasks on the imbalanced dataset. The study evaluates the accuracy of each algorithm introduced in Table 5, as well as the ensemble methods (hard and soft voting), using the accuracy metric. The accuracy metric is calculated as the number of correctly classified data instances by each algorithm divided by the total samples in the dataset. The study conducted individual evaluations for each of the algorithms to determine their accuracy and showcase the enhancements achieved through the ensemble model in terms of accuracy. Valuable insights can be gleaned based on the findings depicted in Figure 7 and detailed in Table 5. The ensemble algorithms' performance metrics show great promise in contrast to the individual classifiers. To be more specific, the hard voting model demonstrated superior accuracy across various dataset variations, including the initial dataset, oversampled dataset, and under-sampled dataset, when compared to the standalone classifiers on the same datasets. Furthermore, the soft voting model outperformed the individual classifiers in both the initial and under-sampled datasets. Notably, when working with the oversampled dataset, the hard voting ensemble model achieved the highest accuracy, whereas the GRU algorithm implementation observed the lowest accuracy. In Table 6, we compare the top-performing outcomes from our examination of ensemble deep learning classifiers with those of traditional deep learning techniques. The CNN-LSTM and CNN-GRU models emerge as the frontrunners, as indicated in the table. These models achieved remarkable accuracies of 99.7% and 99.6%, respectively, along with corresponding outstanding F1 scores of 0.998 and 0.997. The LSTM-only model follows closely, boasting an overall accuracy of 95.4% and an F1-score of 0.923. The CNN-only model follows with an accuracy of 94.7% and an F1-score of 0.858. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Methodology** & **Classifier 1** & **Classifier 2** & **Classifier 3** \\ \hline Hard voting & CNN & GRU & LSTM \\ Soft voting & CNN & GRU & LSTM \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hard voting and soft voting ensemble techniques. These findings imply that when employing static-based features for IoT intrusion detection, ensemble deep learning models have the potential to surpass the capabilities of conventional deep learning classifiers. Our research includes a thorough evaluation of two ensemble models, and we have meticulously compared their experimental results with the current state-of-the-art approaches. As depicted in Table 7, our novel methodology demonstrates its effectiveness when contrasted with the existing state-of-the-art methods. Specifically, when applied to the NSL-KDD dataset, our approach not only outperforms its competitors but also attains the highest level of accuracy among all tested methodologies.