Antonio Villafranca, Maria‐Dolores Cano
This paper delivers three core innovations for Internet of Things (IoT) intrusion detection in sustainable agriculture: (1) a unified preprocessing pipeline integrating StandardScaler, undersampling, SMOTE, Tomek Links, and 10-fold cross-validation, (2) a lightweight, dataset-agnostic DNN architecture (256–128–64–Softmax) achieving ≥97 % accuracy without per-dataset tuning, and (3) a curated benchmark of 18 IoT-IDS datasets including the Farm-Flow greenhouse trace with full metadata. Our model achieved 99.14 % average accuracy across 18 datasets, including 99.25 % precision on BoT-IoT, 99.99 % on CICIDS2017, and perfect 100 % scores on N-BaIoT, Car-Hacking, and CIC-IoT2022, demonstrating robust intrusion detection while maintaining only ∼1.2 M parameters for resource-constrained deployment. Experimental results demonstrate that our Deep Neural Network (DNN) model, through automatic hierarchical feature extraction, outperforms specialized architectures in heterogeneous scenarios while reducing reliance on manual feature engineering. Although Machine Learning (ML)-based methods and distributed approaches offer advantages in privacy and local processing, they face computational constraints and synchronization challenges that limit scalability. These findings confirm the effectiveness and adaptability of the proposed model, establishing it as a reliable and scalable solution for enhancing IoT network security in real-world deployments. Modern greenhouses, dairy farms, and cold-chain facilities, where cyber-attacks threaten water and energy efficiency gains, benefit from this edge-deployable approach that restores security and trustworthiness to smart-agriculture IoT networks.