## 5 Conclusions  
This paper examines the development of intrusion detection systems IoT and IIoT networks, with a focus on mitigating attacks. This study explores deep learning, particularly convolutional neural networks (CNNs), as a promising approach for intrusion detection and compares the CNN method's performance with traditional techniques, including decision trees, random forests, support vector machines, and K-nearest neighbors. Utilizing a comprehensive dataset, the research categorizes attacks into three classifications: 2-class, 6-class, and 15-class scenarios. The results indicate that the proposed CNN method achieves superior detection performance for most attacks compared to the other methods based on the selected evaluation criteria. The CNN-based approach demonstrates distinct advantages over traditional machine learning models by autonomously extracting spatial-temporal patterns from raw network traffic, eliminating the need for manual feature engineering. This capability enables precise distinction between complex attack types (e.g., DDoS_HTTP vs. DDoS_UDP), where traditional methods like SVM and random forest struggle due to their reliance on hand-crafted features. While the CNN achieves superior accuracy in multiclass classification (15-class), its true strength lies in detecting subtle, protocol-specific anomalies (e.g., MQTT spoofing, Modbus tampering) through localized correlations in traffic behavior. Challenges such as class imbalance, observed in underrepresented attacks (e.g., XSS), highlight opportunities for future refinements like synthetic oversampling. Nevertheless, the CNN maintains robustness across heterogeneous protocols and edge deployments, underscoring its adaptability to dynamic IoT/IIoT environments. These results underscore its superiority in balancing accuracy, speed, and adaptability, addressing critical gaps in existing rule-based and traditional ML-based IDS solutions. Future research could explore combining CNNs with other techniques to enhance speed without compromising accuracy and further improve classification accuracy by addressing misclassifications among similar attack types. Future work will focus on cross-dataset benchmarking to validate generalizability and hybrid architectures (e.g., CNN + random forest) to balance accuracy with computational efficiency. Additionally, real-time deployment on edge devices will be explored to assess practical viability in industrial settings. These steps aim to refine the model's adaptability while addressing the diverse security needs of IoT/IIoT networks. Conceptualization, A.A.S. and J.G. ; Data curation, A.A.S. and F.M. ; Formal analysis, A.A.S. and J.G. ; Funding acquisition, J.G. ; Investigation, A.A.S., F.M. and J.G. ; Methodology, A.A.S., F.M. and J.G. ; Software, A.A.S., F.M. and J.G. ; Supervision, J.G. ; Validation, A.A.S., F.M. and J.G. ; Visualization, A.A.S., F.M. and J.G. ; Writing--original draft, A.A.S. ; Writing--review and editing, A.A.S., F.M. and J.G. All authors have read and agreed to the published version of the manuscript. This research was partially supported by Grant PID2022-136476 OB-I00 funded by MICIU/AEI/10.13039/501100011033/FEDER EU, ERDF/EU, and Gobierno de Aragon (reference group T31_20R). The dataset Edge-IIoTset used in this study is publicly available on Kaggle at [[https://www.kaggle.com/datasets/sibasispradhan/edge-iitost-dataset](https://www.kaggle.com/datasets/sibasispradhan/edge-iitost-dataset)]([https://www.kaggle.com/datasets/sibasispradhan/edge-iitost-dataset](https://www.kaggle.com/datasets/sibasispradhan/edge-iitost-dataset)) (accessed on 19 March 2025). The authors declare no conflicts of interest. The following abbreviations are used in this manuscript: