Formal Verification and Deep Learning for Smart Farming: A Robust Framework for Cotton Crop Monitoring

Authors

DOI:

https://doi.org/10.21015/vtse.v14i2.2401

Abstract

Cotton, a critical global cash crop, faces significant challenges in disease detection due to wetland conditions and climate-change inconsistency. This work presents a Cotton Crop Disease Detection Model that integrates an EfficientNet--Convolutional Neural Network (CNN) architecture with the Temporal Logic of Actions (TLA+) for formal verification. The proposed model ensures accurate disease classification while providing formal verification for correctness, reliability, and availability. The EfficientNet--CNN demonstrates robust performance in identifying multiple disease conditions, including aphids, armyworms, and bacterial blight, achieving an overall weighted accuracy of 94%, with macro-average scores of 0.94 for precision, recall, and F1-score. Class-specific performance shows an F1-score of 97% for armyworms and 96% for powdery mildew. The TLA+ formal verification validates the model's compliance with disease-monitoring requirements, ensuring correctness, reliability, and availability in real-world industrial applications. This integrated framework enhances cotton crop disease detection and supports sustainable, technology-driven agricultural practices.

References

[1] M. Khan and C. A. Damalas, "Farmers' knowledge about common pests and pesticide safety in conventional cotton production in Pakistan," Crop Protection, vol. 77, pp. 45–51, 2015.

[2] M. N. Sattar, A. Kvarnheden, M. Saeed, and R. W. Briddon, "Cotton leaf curl disease—an emerging threat to cotton production worldwide," Journal of General Virology, vol. 94, no. 4, pp. 695–710, 2013.

[3] A. Ghaffar, M. Habib ur Rahman, H. R. Ali, G. Haider, S. Ahmad, S. Fahad, and S. Ahmad, "Modern concepts and techniques for better cotton production," in Cotton Production and Uses: Agronomy, Crop Protection, and Postharvest Technologies, 2020, pp. 589–628.

[4] M. H. U. Rahman, I. Ahmad, A. Ghaffar, G. Haider, A. Ahmad, B. Ahmad, et al., "Climate resilient cotton production system: a case study in Pakistan," in Cotton Production and Uses: Agronomy, Crop Protection, and Postharvest Technologies, 2020, pp. 447–484.

[5] P. S. Shera, V. Kumar, and V. Jindal, "Sucking pests of cotton," in Sucking Pests of Crops, 2020, pp. 249–284.

[6] B. Kariyanna and M. Sowjanya, "Unravelling the use of artificial intelligence in management of insect pests," Smart Agricultural Technology, p. 100517, 2024.

[7] A. Rehman, T. Saba, M. Kashif, S. M. Fati, S. A. Bahaj, and H. Chaudhry, "A revisit of internet of things technologies for monitoring and control strategies in smart agriculture," Agronomy, vol. 12, no. 1, p. 127, 2022.

[8] S. A. Dristy, A. R. Dhar, and M. T. Uddin, "Sustainable practices for cotton production in Bangladesh: economic and environmental perspectives," Discover Agriculture, vol. 2, no. 1, pp. 1–18, 2024.

[9] S. I. Hassan, M. M. Alam, U. Illahi, M. A. Al Ghamdi, S. H. Almotiri, and M. M. Su'ud, "A systematic review on monitoring and advanced control strategies in smart agriculture," IEEE Access, vol. 9, pp. 32517–32548, 2021.

[10] T. Domingues, T. Brandão, and J. C. Ferreira, "Machine learning for detection and prediction of crop diseases and pests: a comprehensive survey," Agriculture, vol. 12, no. 9, p. 1350, 2022.

[11] R. Manavalan, "Towards intelligent approaches for cotton diseases detection: a review," Computers and Electronics in Agriculture, vol. 200, p. 107255, 2022.

[12] P. Bishshash, A. S. Nirob, H. Shikder, A. H. Sarower, T. Bhuiyan, and S. R. H. Noori, "A comprehensive cotton leaf disease dataset for enhanced detection and classification," Data in Brief, vol. 57, p. 110913, 2024.

[13] J. K. Dhaliwal, D. Panday, D. Saha, J. Lee, S. Jagadamma, S. Schaeffer, and A. Mengistu, "Predicting and interpreting cotton yield and its determinants under long-term conservation management practices using machine learning," Computers and Electronics in Agriculture, vol. 199, p. 107107, 2022.

[14] S. Kumar, R. Ratan, and J. V. Desai, "Cotton disease detection using TensorFlow machine learning technique," Advances in Multimedia, vol. 2022, no. 1, p. 1812025, 2022.

[15] V. Manurkar, S. Kulkarni, S. Rokade, and R. Mirajkar, "Cotton plant disease prediction and remedy recommendation system," in 2024 ASU International Conference in Emerging Technologies for Sustainability and Intelligent Systems (ICETSIS), 2024, pp. 1616–1620.

[16] I. Attri, L. K. Awasthi, and T. P. Sharma, "Machine learning in agriculture: a review of crop management applications," Multimedia Tools and Applications, vol. 83, no. 5, pp. 12875–12915, 2024.

[17] R. M. Saleem, R. Kazmi, I. S. Bajwa, A. Ashraf, S. Ramzan, and W. Anwar, "IoT-based cotton whitefly prediction using deep learning," Scientific Programming, vol. 2021, no. 1, p. 8824601, 2021.

[18] P. Tanwar, R. Shah, J. Shah, and U. Lokhande, "Cotton price prediction and cotton disease detection using machine learning," in Intelligent Data Communication Technologies and Internet of Things: Proceedings of ICICI 2021, 2022, pp. 115–128.

[19] M. R. Latif, M. A. Khan, M. Y. Javed, H. Masood, U. Tariq, Y. Nam, and S. Kadry, "Cotton leaf diseases recognition using deep learning and genetic algorithm," Computers, Materials & Continua, vol. 69, no. 3, 2021.

[20] G. Harshitha, S. Kumar, S. Rani, and A. Jain, "Cotton disease detection based on deep learning techniques," in 4th Smart Cities Symposium (SCS 2021), vol. 2021, 2021, pp. 496–501.

[21] W. Shakeel, M. Ahmad, and N. Mahmood, "Early detection of cercospora cotton plant disease by using machine learning," 2020.

[22] R. Gao, Z. Dong, Y. Wang, Z. Cui, M. Ye, B. Dong, et al., "Intelligent cotton pest and disease detection," 2024.

[23] M. S. Memon, P. Kumar, and R. Iqbal, "Meta deep learn leaf disease identification model for cotton crop," Computers, 2022.

[24] P. K. Yadav, J. A. Thomasson, R. Hardin, S. W. Searcy, U. Braga-Neto, S. C. Popescu, et al., "Detecting volunteer cotton plants in a corn field with deep learning on UAV remote-sensing imagery," 2023.

[25] K. Paul Joshua, S. A. Alex, M. Mageswari, and R. Jothilakshmi, "Enhanced conditional self-attention generative adversarial network for detecting cotton plant disease in IoT-enabled crop management," 2024.

[26] A. I. Jajja, A. Abbas, H. A. Khattak, G. Niedbała, A. Khalid, H. T. Rauf, and S. Kujawa, "Compact convolutional transformer (CCT)-based approach for whitefly attack detection in cotton crops," 2022.

[27] U. Dewangan, R. H. Talwekar, and S. Bera, "A systematic review on cotton plant disease detection and classification," 2023.

[28] G. Mohyuddin, M. A. Khan, A. Haseeb, S. Mahpara, M. Waseem, and A. M. Saleh, "Evaluation of machine learning approaches for precision farming in smart agriculture system: a comprehensive review," IEEE Access, vol. 12, pp. 60155–60184, 2024.

[29] S. P. Sreeja, V. Asha, B. Saju, P. P. Chandrakantbhai, P. Prabhasan, and A. Prasad, "Cotton plant disease detection using deep learning," 2022.

[30] H. Kim and D. Kim, "Deep-learning-based strawberry leaf pest classification for sustainable smart farms," Sustainability, 2023.

[31] P. C. Reddy, R. M. S. Chandra, P. Vadiraj, M. A. Reddy, T. R. Mahesh, and G. S. Madhuri, "Detection of plant leaf-based diseases using machine learning approach," 2021.

[32] S. Kinger, A. Tagalpallewar, R. R. George, K. Hambarde, and P. Sonawane, "Deep learning based cotton leaf disease detection," 2022.

[33] K. N. G. N. Téhia, S. Malo, A. Kouamé, M. Kouakou, K. K. N. Bini, and O. G. Ochou, "Towards an ontology-based cotton pest management system in Côte d'Ivoire," 2022.

[34] R. Karmakar and B. B. Sarkar, "A prototype modeling of smart irrigation system using Event-B," SN Computer Science, 2021.

[35] L. Lamport, Specifying Systems: The TLA+ Language and Tools for Hardware and Software Engineers. Addison-Wesley, 2002.

[36] J. Woodcock, P. G. Larsen, J. Bicarregui, and J. Fitzgerald, "Formal methods: practice and experience," ACM Computing Surveys, vol. 41, no. 4, pp. 1–36, 2009.

[37] D. Cousineau, D. Doligez, L. Lamport, S. Merz, D. Ricketts, and H. Vanzetto, "TLA+ proofs," in FM 2012: Formal Methods, Springer, 2012.

[38] E. M. Clarke Jr., O. Grumberg, D. Kroening, D. Peled, and H. Veith, Model Checking, 2nd ed. MIT Press, 2018.

[39] E. M. Clarke, T. A. Henzinger, H. Veith, and R. Bloem, Eds., Handbook of Model Checking, 1st ed. Springer International Publishing, 2018.

[40] E. M. Clarke, T. A. Henzinger, and H. Veith, "Introduction to model checking," in Handbook of Model Checking, 1st ed. Springer International Publishing, 2018.

[41] C. Baier and J.-P. Katoen, Principles of Model Checking (Representation and Mind Series). MIT Press, 2008.

[42] E. M. Clarke, O. Grumberg, and D. A. Peled, Model Checking. Cambridge, MA, USA: MIT Press, 1999.

[43] J.-P. Katoen, "Concepts, algorithms, and tools for model checking," Arbeitsberichte des Instituts für Mathematische Maschinen und Datenverarbeitung, 1999.

[44] E. M. Clarke, E. A. Emerson, S. Jha, and A. P. Sistla, "Symmetry reductions in model checking," in Computer Aided Verification (CAV), Springer, 1998.

[45] E. M. Clarke, R. Enders, T. Filkorn, and S. Jha, "Exploiting symmetries in temporal logic model checking," Formal Methods in System Design, vol. 9, pp. 77–104, 1996.

[46] E. M. Clarke, E. A. Emerson, and A. P. Sistla, "Automatic verification of finite-state concurrent systems using temporal logic specifications," ACM TOPLAS, vol. 8, no. 2, pp. 244–263, 1986.

[47] E. A. Emerson, "Temporal and modal logic," in Handbook of Theoretical Computer Science (Vol. B), J. van Leeuwen, Ed. Cambridge, MA, USA: MIT Press, 1990.

[48] A. Valmari, "A stubborn attack on state explosion," Formal Methods in System Design, vol. 1, no. 4, pp. 297–322, Dec. 1992.

[49] M. Vardi and P. Wolper, "An automata-theoretic approach to automatic program verification (preliminary report)," in Proc. LICS, 1986.

[50] O. Kupferman, M. Y. Vardi, and P. Wolper, "An automata-theoretic approach to branching-time model checking," Journal of the ACM, vol. 47, no. 2, pp. 312–360, 2000.

[51] R. Gerth, R. Kuiper, D. Peled, and W. Penczek, "A partial order approach to branching time logic model checking," in Proc. ISTCS, 1995.

[52] I. Banerjee, Y. Ling, M. C. Chen, S. A. Hasan, C. P. Langlotz, N. Moradzadeh, et al., "Comparative effectiveness of convolutional neural network (CNN) and recurrent neural network (RNN) architectures for radiology text-report classification," 2019.

[53] Dhamur, "Cotton plant disease [Data set]," Kaggle, 2023.

[54] A. Gulli and S. Pal, Deep Learning with Keras. Packt Publishing Ltd., 2017.

[55] F. Ertam and G. Aydın, "Data classification with deep learning using TensorFlow," in 2017 International Conference on Computer Science and Engineering (UBMK), 2017.

[56] Z. Ali, A. Muhammad, N. Lee, M. Waqar, and S. W. Lee, "Artificial intelligence for sustainable agriculture: a comprehensive review," 2025.

[57] M. A. Alloghani, "AI for sustainable agriculture: a systematic review," in Artificial Intelligence and Sustainability, 2023.

[58] S. Karim, K. Hussain, M. B. Alvi, M. A. Rahu, M. A. Kaloi, and H. Haleem, "Artificial intelligence in sustainable agriculture," 2025.

[59] F. K. Shaikh, S. Karim, S. Zeadally, and J. Nebhen, "Recent trends in internet-of-things-enabled sensor technologies for smart agriculture," 2022.

[60] A. A. AlZubi and K. Galyna, "Artificial intelligence and internet of things for sustainable farming and smart agriculture," 2023.

[61] F. Assimakopoulos, C. Vassilakis, D. Margaris, K. Kotis, and D. Spiliotopoulos, "AI and related technologies in the fields of smart agriculture: a review," Information, vol. 16, no. 2, p. 100, 2025.

[62] M. B. Riipa, S. Saha, J. Ferdousmou, R. Khatoon, N. Mohammad, M. Hossain, M. Kamruzzaman, and R. Hasan, "AI-driven smart agriculture: optimizing crop yield and sustainability in the US," in 2025 5th International Conference on Electrical, Computer and Energy Technologies (ICECET), 2025, pp. 1–6.

[63] S. S. Shinde, G. M. Kale, S. L. Nalbalwar, and S. B. Deosarkar, "AI for sustainable agriculture: smart farming solutions," in 2024 Third International Conference on Artificial Intelligence, Computational Electronics and Communication System (AICECS), 2024, pp. 1–6.

[64] H. Mishra and D. Mishra, "AI for data-driven decision-making in smart agriculture: from field to farm management," in Artificial Intelligence Techniques in Smart Agriculture, 2024, pp. 173–193.

[65] K. Kumari, A. Mirzakhani Nafchi, S. Mirzaee, and A. Abdalla, "AI-driven future farming: achieving climate-smart and sustainable agriculture," AgriEngineering, vol. 7, no. 3, p. 89, 2025.

[66] T. Miller, G. Mikiciuk, I. Durlik, M. Mikiciuk, A. Łobodzińska, and M. Śnieg, "The IoT and AI in agriculture: the time is now—a systematic review of smart sensing technologies," Sensors, vol. 25, no. 12, p. 3583, 2025.

[67] S. K. Swarnkar, L. Dewangan, O. Dewangan, T. M. Prajapati, and F. Rabbi, "AI-enabled crop health monitoring and nutrient management in smart agriculture," in 2023 6th International Conference on Contemporary Computing and Informatics (IC3I), vol. 6, 2023, pp. 2679–2683.

[68] N. Ahmed and N. Shakoor, "Advancing agriculture through IoT, big data, and AI: a review of smart technologies enabling sustainability," Smart Agricultural Technology, vol. 10, p. 100848, 2025.

[69] S. Qazi, B. A. Khawaja, and Q. U. Farooq, "IoT-equipped and AI-enabled next generation smart agriculture: a critical review, current challenges and future trends," IEEE Access, vol. 10, pp. 21219–21235, 2022.

[70] A. A. Mana, A. Allouhi, A. Hamrani, S. Rehman, I. El Jamaoui, and K. Jayachandran, "Sustainable AI-based production agriculture: exploring AI applications and implications in agricultural practices," Smart Agricultural Technology, vol. 7, p. 100416, 2024.

[71] M. Hussain, S. M. Ali, M. A. Rahu, N. A. Tunio, and A. F. Chandio, "IoT-enabled machine learning framework for precision agriculture: achieving near-perfect crop yield prediction in Pakistan's diverse agro-climatic zones," VAWKUM Transactions on Computer Sciences, vol. 13, no. 2, pp. 263–275, 2025.

[72] Z. Y. Yang, W. K. Xia, H. Q. Chu, W. H. Su, R. F. Wang, and H. Wang, "A comprehensive review of deep learning applications in cotton industry: from field monitoring to smart processing," Plants, vol. 14, no. 10, p. 1481, 2025.

[73] G. Mohyuddin, M. A. Khan, A. Haseeb, S. Mahpara, M. Waseem, and A. M. Saleh, "Evaluation of machine learning approaches for precision farming in smart agriculture system: a comprehensive review," IEEE Access, vol. 12, pp. 60155–60184, 2024.

[74] S. P. Sudha and J. B. Loret, "A review on machine learning-based precision agriculture techniques for crop farming monitoring with IoT," Discover Environment, vol. 4, no. 1, p. 10, 2026.

[75] K. Singh, M. Yadav, D. Barak, S. Bansal, and F. Moreira, "Machine-learning-based frameworks for reliable and sustainable crop forecasting," Sustainability, vol. 17, no. 10, p. 4711, 2025.

[76] K. R. Ahmed and S. C. Sarkar, "Machine learning applications in modern agriculture: advancing precision farming through intelligent systems," in Artificial Intelligence and Data Sciences for Precision Agriculture, 2026, pp. 233–255.

[77] L. Rupa, P. Borugadda, K. Lavanya, and V. Nadella, "Advancements in smart farming: using internet of things and artificial intelligence, machine learning, deep learning," in Harnessing AI to Reshape the Future of Agriculture, 2026, pp. 123–137.

[78] C. Jiang, X. Guo, Y. Li, N. Lai, L. Peng, and Q. Geng, "Multimodal deep learning models in precision agriculture: cotton yield prediction based on unmanned aerial vehicle imagery and meteorological data," Agronomy, vol. 15, no. 5, p. 1217, 2025.

[79] S. M. Shawon, I. A. Adan, M. Moniruzzaman, O. H. Sinan, M. J. Abed, M. Al Qwaid, M. T. Sarker, and H. B. A. Karim, "Federated learning approaches in precision agriculture: a systematic review of current trends, challenges and opportunities," IEEE Access, 2026.

[80] N. R. Sawant, A. Kumar, S. Pant, and K. Kotecha, "An IoT-driven machine learning system for real-time smart crop recommendation and optimization in precision agriculture," Discover Artificial Intelligence, 2026.

Downloads

Published

2026-06-26

How to Cite

Rehman, A., Akhtar, N., Talal, M., Imran, N., & Hameed, S. (2026). Formal Verification and Deep Learning for Smart Farming: A Robust Framework for Cotton Crop Monitoring. VFAST Transactions on Software Engineering, 14(2), 343–361. https://doi.org/10.21015/vtse.v14i2.2401

Issue

Section

Articles