XEAD-AgriSec: An Explainable Edge Anomaly Detection Framework for Cybersecurity in AI-Powered Agricultural IoT Systems
Abstract
The convergence of generative artificial intelligence (GAI), large language models, and automated vulnerability discovery tools has fundamentally altered the cyber-threat landscape for Internet of Things (IoT) infrastructures in precision agriculture. Adversaries now leverage AI-powered attack generators to craft sophisticated data-injection, spoofing, and denial-of-service attacks againstirrigation sensors and actuators, rendering traditional network-traffic-based intrusion detection systems (IDS) insufficient. This paper proposes XEAD-AgriSec, an eXplainable Edge Anomaly Detection framework that protects the physical sensor layer of agricultural IoT systems through a fog-computing-centric architecture. The fog node serves as the primary inference tier where all trained models, from lightweight DNNs to hybrid LSTM+gradient-boosted tree ensembles, execute high-precision classification with XAI explanations. The architecture is complemented by an eight-bit quantised autoencoder for a microcontroller-class TinyML sensor tier (evaluated via TFLite INT8 quantisation simulation) for pre-screening. The framework integrates SHapley Additive exPlanations (SHAP) and Local Interpretable Model-agnostic Explanations (LIME) to produce agricultural-domain explanations, and a novel CVSS-inspired severity scoring function to prioritise alerts by sensor criticality and crop-cycle risk. We address the critical challenge of limited real-world agricultural security data through a physics-informed synthetic data augmentation pipeline that generates sensor traces preserving autoregressive temporal dynamics and the broad cross-sensor correlation structure, with the fidelity of each property measured and reported. We further explore fine-tuning of the MOMENT time-series foundation model on the irrigation data. Evaluated across three experimental tracks, namely a synthetic-attack benchmark (seven attack classes), direct irrigation training, and foundation-model fine-tuning, the proposed framework achieves 97.87% accuracy and 0.9667 macro-precision on the synthetic-attack benchmark with the hybrid LSTM+LightGBM model, its strongest detector, and 0.8210 macro-precision (0.45 normal-class precision) on the real irrigation dataset with only 4,825 field samples, using the same hybrid LSTM+LightGBM architecture. The microcontroller-class TinyML autoencoder, evaluated via INT8 quantisation simulation, discards roughly 86–87% of normal windows at the sensor node before they reach the fog tier. These results demonstrate that sensor-level anomaly detection with explainability is both feasible and necessary for trustworthy smart-irrigation security in the era of AI-powered cyber threats.