Crop diseases significantly affect agricultural productivity and can lead to considerable economic losses when not identified at an early stage. To address this challenge, this paper presents PatraRaksha AI, an offline-enabled intelligent framework designed for crop disease detection and treatment guidance using artificial intelligence. The system employs the YOLOv8 object detection model to analyse uploaded leaf images and classify crop conditions into three categories: Healthy, Powdery Mildew, and Rust. A detection-level weighted-voting mechanism is incorporated to determine the final disease classification based on the model\'s detections. The framework operates locally, enabling disease identification without continuous internet connectivity. In addition to disease detection, it provides information about possible causes and severity, along with multilingual home-remedy recommendations to support farmers in understanding appropriate treatment options. An area-based dosage calculator is also integrated to estimate treatment quantities according to the specified land area. The system uses a FastAPI backend for image processing and prediction handling, while OpenCV and Pillow support image processing and the generation of annotated prediction outputs. By integrating offline disease diagnosis with multilingual and treatment-oriented agricultural assistance, PatraRaksha AI aims to provide an accessible decision-support solution for farmers and promote timely crop-health management. A separately developed illumination enhancement technique is also considered as a proposed extension to improve image visibility under varying lighting conditions, with integration and performance evaluation planned for future work.
Introduction
The text presents PatraRaksha AI, an offline-enabled intelligent crop disease detection and agricultural treatment guidance system developed using Artificial Intelligence (AI), deep learning, and computer vision. Agriculture plays an important role in food security, but crop diseases significantly reduce agricultural productivity and cause economic losses. Traditional disease identification methods depend on manual inspection and farmers' experience, which can make early and accurate detection difficult.
To overcome these challenges, PatraRaksha AI uses the YOLOv8 object detection model to identify three crop conditions: Healthy, Powdery Mildew, and Rust. The system also incorporates a detection-level weighted-voting mechanism to improve the reliability of final disease predictions by considering detected classes and their confidence scores.
The main objectives of the proposed system are to detect crop diseases accurately, provide useful treatment information, and support farmers even in areas with limited internet connectivity.
The system consists of the following major modules:
Image Acquisition: Allows users to upload crop leaf images through the application interface.
Image Preprocessing: Uses Pillow and OpenCV to process images, correct orientation, and prepare them for disease detection.
Disease Detection: Uses a trained YOLOv8 model (best.pt) to identify Healthy, Powdery Mildew, and Rust conditions.
Weighted Voting: Evaluates detected classes and their confidence scores to determine the final disease prediction.
Disease Information: Provides details about possible causes and disease severity.
Multilingual Home Remedies: Offers predefined treatment and home-remedy recommendations in multiple languages.
Area-Based Dosage Calculator: Estimates the required treatment quantity according to the agricultural land area entered by the user.
Image Annotation: Highlights detected regions using bounding boxes and displays prediction information.
Offline Functionality: Performs disease detection and generates recommendations locally without requiring continuous internet connectivity.
The literature survey discusses existing research on YOLO-based plant disease detection, weighted prediction techniques, offline diagnosis applications, multilingual treatment recommendations, and illumination-aware image enhancement. It identifies the need for an integrated agricultural assistance system that combines disease detection with practical treatment guidance.
The proposed system is developed using YOLOv8 for disease detection, FastAPI for backend processing, OpenCV and Pillow for image processing, and Python-based dictionaries for storing treatment recommendations. The backend returns prediction results in JSON format, including disease classification, confidence scores, severity information, possible causes, and recommended remedies.
An additional proposed feature is an illumination-aware image enhancement module using techniques such as CLAHE, adaptive gamma correction, and Retinex-based enhancement. This module aims to improve leaf image visibility under different lighting conditions. Its integration and performance evaluation are planned as further development.
Conclusion
PatraRaksha AI presents an intelligent and offline-enabled framework for crop disease detection and agricultural treatment guidance using deep learning and computer vision. The system employs YOLOv8 to identify crop conditions from leaf images and classify them into three categories: Healthy, Powdery Mildew and Rust. A detection-level weighted-voting mechanism is used to determine the final prediction from the model\'s detection results.
Beyond disease identification, the system provides information about possible causes and disease severity, along with multilingual home-remedy recommendations. The area-based dosage calculator helps estimate treatment quantities according to the land area specified by the user. FastAPI, OpenCV and Pillow support image processing, prediction handling and annotated result generation.
The offline functionality enables the core system operations without requiring continuous internet connectivity, making the framework useful in areas with limited network access. Further evaluation using diverse leaf images and additional disease categories can improve its reliability and practical applicability. Overall, PatraRaksha AI demonstrates the potential of artificial intelligence in providing accessible crop-health monitoring and supporting informed agricultural decisions.
References
[1] Food and Agriculture Organization of the United Nations (FAO), “Climate change fans spread of pests and threatens plants and crops, new FAO study,” June 2, 2021. [Online]. Available: https://www.fao.org/newsroom/detail/Climate-change-fans-spread-of-pests-and-threatens-plants-and-crops-new-fao-study/en
[2] A. Upadhyay, N. S. Chandel, K. P. Singh, S. K. Chakraborty, B. M. Nandede, M. Kumar, A. Subeesh, K. Upendar, A. Salem, and A. Elbeltagi, “Deep learning and computer vision in plant disease detection: A comprehensive review of techniques, models, and trends in precision agriculture,” Artificial Intelligence Review, vol. 58, article 92, 2025. doi: 10.1007/s10462-024-11100-x.
[3] T. Li, L. Zhang, and J. Lin, “Precision agriculture with YOLO-Leaf: Advanced methods for detecting apple leaf diseases,” Frontiers in Plant Science, vol. 15, article 1452502, 2024. doi: 10.3389/fpls.2024.1452502.
[4] R. Polly and E. A. Devi, “Semantic segmentation for plant leaf disease classification and damage detection: A deep learning approach,” Smart Agricultural Technology, vol. 9, article 100526, 2024. doi: 10.1016/j.atech.2024.100526.
[5] C. B. Nwaneto, C. Yinka-Banjo, and O. Ugot, “An object detection solution for early detection of taro leaf blight disease in the West African sub-region,” Franklin Open, vol. 10, Art. no. 100197, Mar. 2025. doi: 10.1016/j.fraope.2024.100197.
[6] M. Muthulakshmi, N. Aishwarya, R. K. Vinesh Kumar, and B. R. T. Rakesh Thoppaen Suresh, “Potato leaf disease detection and classification with weighted ensembling of YOLOv8 variants,” Journal of Phytopathology, vol. 172, no. 6, article e13433, 2024. doi: 10.1111/jph.13433.
[7] C. Suresh, S. Srikaran, T. Senthilkumar, V. Magizhan, and S. Santhosh, “An offline mobile application for plant-disease detection using MobileNetV3 and TensorFlow Lite,” in Proceedings of the 7th International Conference on Computational Vision and Bio Inspired Computing (ICCVBIC), 2026, pp. 1463–1469. doi: 10.1109/ICCVBIC71195.2026.11689067.
[8] N. Haider, J. H. Paik, and K. Alam, “An integrated approach for mulberry leaf disease detection, classification and management based on YOLOv8 and large language model,” Journal of Phytopathology, vol. 174, no. 1, article e70240, 2026. doi: 10.1111/jph.70240.
[9] M. H. Ashraf, F. Jabeen, M. Waqar, and A. Kim, “HFA-Net: Explainable multi-scale deep learning framework for illumination-invariant plant disease diagnosis in precision agriculture,” Sensors, vol. 26, no. 7, article 2067, 2026. doi: 10.3390/s26072067.