The adoption of Internet of Things (IoT) technologies has significantly enhanced precision farming by enabling continuous environmental monitoring and data-driven agricultural management. However, the increasing reliance on distributed sensor networks introduces critical challenges, including sensor faults, data anomalies, and cyber-physical security threats, which can undermine system reliability and decision accuracy. This study proposes an IoT-driven anomaly detection framework for smart agriculture that integrates a Convolutional Neural Network (CNN) optimized using a hybrid Particle Swarm Optimization and Genetic Algorithm (PSO–GA). The CNN learns complex spatio-temporal patterns from multivariate sensor data, while the PSO–GA strategy automatically tunes CNN hyperparameters to improve detection accuracy and model stability. To enhance adaptability under dynamic agricultural conditions, the proposed framework incorporates an online learning mechanism that incrementally updates the CNN model using newly arriving sensor data, enabling continuous adaptation to environmental changes and concept drift without full model retraining. Experiments conducted on a publicly available smart agriculture dataset demonstrate that the proposed CNN–PSO–GA framework achieves an accuracy of 74%, precision of 74%, recall of 100%, and an F1-score of 85%, outperforming baseline methods such as One-Class Support Vector Machine and Isolation Forest, particularly in reducing missed anomaly events. The results confirm the robustness, adaptability, and reliability of the proposed approach. Overall, the framework provides a practical and scalable solution for enhancing security, resilience, and operational effectiveness in precision farming systems.
Umar et al. (Sat,) studied this question.