Research Article

An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer

Number: 10 July 22, 2026

An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer

Abstract

Smart agriculture increasingly depends on Internet of Things (IoT) devices, networked sensors, cloud platforms, and data-driven decision systems. These technologies improve agricultural productivity and monitoring, but they also expand the attack surface of farm cyber-physical systems. This study proposes a benchmark-based explainable machine learning framework for intrusion detection in smart agriculture. The empirical evaluation focuses on the detection and explainability components of the framework, using a consolidated NSL-KDD dataset created by merging CSV-formatted versions corresponding to KDDTrain+.TXT and KDDTest+.TXT and then applying a stratified 80/20 train-test split. After binary target construction, the dataset contains 77,053 normal records and 71,463 attack records. Random Forest and XGBoost models were trained and evaluated for binary intrusion detection. Random Forest achieved an accuracy of 0.9958 and an AUC of 0.9998, while XGBoost achieved an accuracy of 0.9959 and an AUC of 0.9999 under the custom experimental design. SHAP and LIME were used to interpret global feature contributions and local prediction behavior. The strongest signals included traffic-volume variables, service indicators, login-related variables, and host-based traffic statistics. These high values are interpreted cautiously because the study uses a merged and resampled benchmark setting rather than canonical NSL-KDD validation or real agricultural IoT traffic. The generative AI communication component is framed as a future user-centered extension rather than an empirically evaluated contribution. The study contributes a transparent and reproducible benchmark framework that can support future domain-specific validation in smart agriculture cybersecurity.

Keywords

Supporting Institution

This research was supported by the National Center for the Study of Blockchain and FinTech at Morgan State University. Additional support was provided in part by the National Science Foundation under Grant DMS-2235451 and the Simons Foundation under Grant MPS-NITMB-00005320 to the NSF-Simons National Institute for Theory and Mathematics in Biology.

Ethical Statement

This article does not contain any studies with human participants or animals performed by any of the authors. Institutional ethical approval and informed consent were not required as all data utilized in this research consists of simulated, publicly available benchmark network traffic.

Thanks

This work was enriched through the first author's participation in the workshop 'MetaMath: Modeling the Mathematical Sciences Community Using Mathematics, Statistics, and Data Science,' organized by the American Institute of Mathematics and hosted at the California Institute of Technology, December 8-12, 2025. Part of this research was conducted while the first author was a visiting scholar at the Institute for Mathematical and Statistical Innovation (IMSI) at the University of Chicago, which is supported by the National Science Foundation under Grant No. DMS-2425650. The authors also gratefully acknowledge the support of the National Center for the Study of Blockchain and FinTech at Morgan State University. Finally, the authors express their sincere gratitude to the editors and anonymous reviewers of the Journal of AI for their invaluable, professional, and constructive guidance. Their insightful comments and recommendations significantly enhanced the quality of this manuscript. We are deeply appreciative of the time and effort they dedicated to our work.

References

  1. Aldhyani, T. H. H., & Alkahtani, H. (2023). Cyber security for detecting distributed denial of service attacks in Agriculture 4.0: Deep learning model. Mathematics, 11(1), Article 233. https://doi.org/10.3390/math11010233
  2. Barredo Arrieta, A., Diaz-Rodriguez, N., Del Ser, J., Bennetot, A., Tabik, S., Barbado, A., Garcia, S., Gil-Lopez, S., Molina, D., Benjamins, R., Chatila, R., & Herrera, F. (2020). Explainable artificial intelligence (XAI): Concepts, taxonomies, opportunities and challenges. Information Fusion, 58, 82-115. https://doi.org/10.1016/j.inffus.2019.12.012
  3. Breiman, L. (2001). Random forests. Machine Learning, 45(1), 5-32. https://doi.org/10.1023/A:1010933404324
  4. Chen, T., & Guestrin, C. (2016). XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 785-794). https://doi.org/10.1145/2939672.2939785
  5. Cybersecurity and Infrastructure Security Agency. (n.d.-a). Food and agriculture sector. U.S. Department of Homeland Security. Retrieved April 1, 2026, from https://www.cisa.gov/topics/critical-infrastructure-security-and-resilience/critical-infrastructure-sectors/food-and-agriculture-sector
  6. Cybersecurity and Infrastructure Security Agency. (n.d.-b). Food and agriculture cybersecurity checklist and resources. U.S. Department of Homeland Security. Retrieved April 1, 2026, from https://www.cisa.gov/resources-tools/resources/food-and-agriculture-cybersecurity-checklist-and-resources
  7. Demestichas, K., Peppes, N., Alexakis, T., & Adamopoulou, E. (2020). Survey on security threats in agricultural IoT and smart farming. Sensors, 20(22), Article 6458. https://doi.org/10.3390/s20226458
  8. Dhanabal, L., & Shantharajah, S. P. (2015). A study on NSL-KDD dataset for intrusion detection system based on classification algorithms. International Journal of Advanced Research in Computer and Communication Engineering, 4(6), 446-452.

Details

Primary Language

English

Subjects

Supervised Learning, Natural Language Processing

Journal Section

Research Article

Publication Date

July 22, 2026

Submission Date

May 13, 2026

Acceptance Date

July 14, 2026

Published in Issue

Year 2026 Number: 10

APA
Gao, S., Gao, W., Eyob, E., & Jin, J. H. (2026). An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer. Journal of AI, 10, 202-216. https://izlik.org/JA56XH88EZ
AMA
1.Gao S, Gao W, Eyob E, Jin JH. An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer. Journal of AI. 2026;(10):202-216. https://izlik.org/JA56XH88EZ
Chicago
Gao, Shanzhen, Weizheng Gao, Ephrem Eyob, and Ju Hyeong Jin. 2026. “An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer”. Journal of AI, nos. 10: 202-16. https://izlik.org/JA56XH88EZ.
EndNote
Gao S, Gao W, Eyob E, Jin JH (July 1, 2026) An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer. Journal of AI 10 202–216.
IEEE
[1]S. Gao, W. Gao, E. Eyob, and J. H. Jin, “An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer”, Journal of AI, no. 10, pp. 202–216, July 2026, [Online]. Available: https://izlik.org/JA56XH88EZ
ISNAD
Gao, Shanzhen - Gao, Weizheng - Eyob, Ephrem - Jin, Ju Hyeong. “An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer”. Journal of AI. 10 (July 1, 2026): 202-216. https://izlik.org/JA56XH88EZ.
JAMA
1.Gao S, Gao W, Eyob E, Jin JH. An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer. Journal of AI. 2026;:202–216.
MLA
Gao, Shanzhen, et al. “An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer”. Journal of AI, no. 10, July 2026, pp. 202-16, https://izlik.org/JA56XH88EZ.
Vancouver
1.Shanzhen Gao, Weizheng Gao, Ephrem Eyob, Ju Hyeong Jin. An Explainable Machine Learning Framework for Cybersecurity in Smart Agriculture: Intrusion Detection, XAI, and a Conceptual Generative AI Communication Layer. Journal of AI [Internet]. 2026 Jul. 1;(10):202-16. Available from: https://izlik.org/JA56XH88EZ

Journal of AI
is indexed and abstracted by
WoS Research Commons, DOAJ, OpenAIRE, ERIHPLUS, Google Scholar, Harvard Hollis, Scilit, ROAD

Publisher
Izmir Academy Publishing
www.izmirakademi.org

Although the scope of our journal is related to artificial intelligence studies, the abbreviation "AI" in the name of the journal is derived from "Academy Izmir".