OPEN ACCESS International Journal of Advances in Artificial Intelligence and Machine Learning Vol 3 No 1 . https://doi. org/10. 58723/ijaaiml. Research Article Plant Disease Detection Using Image Processing and Machine Learning Received: May 17, 2025 Publish: March 03, 2026 Accepted: January 28, 2026 Revised: December 02, 2025 Ranga Swamy Sirisati*. Sravya. Sruthi. Nandhu. Navya Sree. Dyah Ayu Irawati Abstract: Background: Plant diseases continue to threaten agricultural productivity worldwide, causing significant reductions in crop yield and quality. Traditional visual inspection by farmers or experts is often slow, subjective, and unreliable, especially across large plantation areas. With the increasing availability of digital imaging technologies, automated detection through image processing and machine learning presents a promising alternative. Aims: This study aims to develop an enhanced plant disease detection framework using image processing combined with machine learning algorithms, particularly Support Vector Machine (SVM) and Convolutional Neural Networks (CNN). Methods: A dataset of 54,306 leaf images from the PlantVillage collection was used to train and test the models. Preprocessing steps included resizing, noise removal, background segmentation, and feature extraction. CNNs were trained for end-to-end classification, while SVM operated on manually extracted features. A 10-fold cross-validation procedure was employed to ensure robustness. Fine-tuning strategies and comparative experiments were implemented to evaluate performance consistency across dataset variants. Result: The system demonstrated strong capability in early disease detection, achieving 97% accuracy for healthy leaves and moderate performance . %) for certain diseased classes due to visual similarity and image noise. Background segmentation improved focus on disease features, while grayscale images reduced reliance on color cues but lowered classification accuracy. Conclusion: The findings confirm that machine learning, particularly CNN-based models, can significantly enhance plant disease diagnosis and support timely agricultural decision-making. Future improvements will explore advanced deep learning architectures, expanded datasets, multimodal imaging, and IoT integration for real-time field Keywords: CNN. Image Processing. Machine Learning. Plant Disease. SVM. INTRODUCTION Plant diseases represent one of the most persistent challenges in global agriculture, contributing to severe crop losses, reduced productivity, and compromised food quality (Singh et al. , 2. In many developing regions, the economic implications of plant infections are substantial, especially for small-scale farmers whose livelihoods depend on consistent harvest yields. Traditional plant disease diagnosis relies heavily on manual inspection by agricultural experts, a process that is not only labor-intensive but also subjective and prone (Thomas Environmental factors such as lighting, weather, and time of observation further complicate early and accurate identification, often delaying intervention and exacerbating crop damage (Nyawose et al. , 2025. Pacal et al. , 2. Despite advancements in agricultural extension services, many regions still lack access to trained plant pathologists or diagnostic infrastructures (Ullah et al. Farmers often depend on their own judgment or informal advice, leading to delayed or incorrect treatment decisions (Rust et al. , 2. This gap underscores a pressing need for scalable, automated systems that deliver timely, reliable plant disease With the proliferation of mobile phones and digital imaging tools, image-based diagnostic systems have emerged as a promising alternative, offering accessibility and ease of use across both rural and commercial farming contexts (Wang et al. , 2. Figure 1 shows the leaf image examples. Publisher Note: CV Media Inti Teknologi stays neutral with regard to jurisdictional claims in published maps and institutional Copyright A20xx by the author. Licensee CV Media Inti Teknologi. Indonesia. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution-ShareAlike (CCBY-SA)license . ttps://creativecommons. org/licenses/bysa/4. 0/). International Journal of Advances in Artificial Intelligence and Machine Learning Figure 1. Leaf image Recent years have witnessed significant progress in image processing and machine learning for plant disease identification (Sakka et al. , 2025. Shoaib et al. , 2. Convolutional Neural Networks (CNN. , in particular, have demonstrated high capability in learning complex visual patterns across diverse agricultural datasets (G. et al. , 2021. Tugrul et al. , 2. Several studies have shown that deep learning models outperform conventional machine learning algorithms such as SVM or KNN in classifying disease symptoms from leaf For example, transfer-learning based CNN models have been successfully applied to tomato leaf diseases, maize leaf infections, and a variety of fungal and bacterial conditions (S. Hassan et al. , 2. These models benefit from hierarchical feature extraction, enabling them to detect subtle textural and color variations indicative of early infection stages. The proposed system incorporates both SVM and CNN classifiers to evaluate the strengths and weaknesses of traditional and deep learning techniques. While SVM relies on manually engineered features such as color histograms, texture descriptors, and vein patterns. CNNs automatically learn discriminative features through convolutional layers. This comparative perspective provides valuable insights into the suitability of algorithms for different dataset conditions and informs the design of efficient, scalable disease detection The dataset used in this research comprises 54,306 leaf images from the PlantVillage dataset, spanning 15 crop disease combinations (Tairu, 2. This dataset is widely recognized for its diversity and balanced class distribution, making it suitable for benchmarking plant disease detection algorithms. To simulate real-world variability, the dataset was processed into three versions: . original images with natural background elements, . grayscale images to assess color dependency, and . background-segmented images to reduce noise and enhance relevant features. This multitier dataset strategy enables comprehensive analysis of feature sensitivity across classification models. However, despite their effectiveness, existing approaches still face limitations. A common challenge is the dependency on dataset quality models often struggle to generalize when trained on images that vary significantly in background noise, lighting conditions, or disease severity (Abayomi-alli et al. , 2. Another notable issue is performance imbalance: many models achieve high accuracy for healthy classes but significantly lower accuracy for diseased categories due to visual similarity among symptoms, such as fungal spots and viral discoloration (Ngugi et al. , 2. Additionally, the computational cost of deep learning models restricts deployment in resource-constrained environments such as mobile phones, limiting accessibility for farmers (Nawaz et al. , 2. The experiment setup includes extensive preprocessing steps, such as resizing to uniform dimensions, noise reduction via filtering, and background segmentation. CNN models were trained in TensorFlow using transfer learning and fine-tuning to accommodate limited data variation (Yandoma et al. , 2. Meanwhile. SVM classifiers were trained on extracted features to evaluate performance under low-complexity settings (Prince et , 2. A 10-fold cross-validation strategy was implemented for all models to ensure reliability and to minimize overfitting. Performance metrics such as accuracy, precision, recall. F1-score, and confusion matrices were used to assess comparative strengths (Lu et al. , 2. To address these gaps, the present study proposes an integrated image processing and machine learning framework that combines classical methods such as segmentation and handcrafted feature extraction with modern deep learning architectures. This hybrid approach aims to enhance robustness across varying conditions and reduce dependency on pristine datasets. By comparing original, grayscale, and backgroundsegmented datasets, the study examines how preprocessing impacts classification performance and explores how segmentation can remove environmental noise and highlight disease-specific features. Through this systematic experimental design, the study seeks to identify preprocessing and modeling conditions that yield optimal disease classification performance. Special attention is given to performance gaps between healthy and diseased categories, as such imbalances highlight areas where model refinement is necessary. International Journal of Advances in Artificial Intelligence and Machine Learning Additionally, the study evaluates the computational efficiency of different approaches, an important factor for real-time or field-deployable disease diagnosis diagnostic apps that can help farmers make data-driven decisions and enhance crop health outcomes can build on these findings. The development of a precise, dependable, and computationally effective framework for automated plant disease identification is the ultimate objective of this project. The study offers the agricultural technology community both methodological insights and useful solutions by fusing cutting-edge machine learning algorithms with sophisticated image processing Future research into multimodal imaging. IoT-enabled disease monitoring, and mobile-based MATERIAL AND METHOD 1 Data Collection and Dataset Preparation Plant and disease names are keywords that may be used to get images from the Internet. All of the pictures may then be categorized into several groups, as shown in Figure 2. Figure 2. Image Acquisition The leaf in Figure 2 shows clear signs of abnormality, indicating that it is not in a healthy condition. Instead of displaying a consistent green color, the surface contains reddish-brown patches and uneven discoloration. These irregular patterns suggest that the leaf is under stress, either from disease-causing pathogens or from environmental factors affecting its normal growth (Ray. Healthy leaves typically maintain a uniform color and texture, but the variations seen here indicate that the plant tissue is damaged or beginning to deteriorate (Yao et al. , 2. The reddish and brownish areas are common visual symptoms of several plant diseases, particularly fungal infections such as leaf spot or early blight (Terensan et al. , 2. These diseases often begin with small lesions that spread outward as the infection progresses, creating patchy, uneven coloration. In some cases, discoloration may also be associated with nutrient deficiencies or physiological stress, which disrupts chlorophyll production and leads to lighter or yellowish leaf sections (Zhu et al. , 2. Figure 3 shows the dataset collected during the process, which consists of 54,306 leaf images. Figure 3. Sample Images of the dataset International Journal of Advances in Artificial Intelligence and Machine Learning 1 Image Preprocessing and Labelling At this point, the classifier's performance will be assessed using the test set used to identify whether a leaf is healthy or sick, along with the name of the condition. Fine-Tuning: Fine-tuning increases forecast accuracy by making minor adjustments to optimize the The model most suited to identifying plant diseases will be produced by experimentally modifying its parameters. The dataset's images may vary in resolution, quality, and As a result, the photos must be pre-processed. for example, photos smaller than 500 pixels or of lower resolution will not be included in the dataset. The rest will be resized to 256 y 256 to reduce training time. Dataset Training & Testing The datasets are split into training and test sets at 70%:30 %. In this step, a deep convolutional neural network will be trained to produce a model for picture classification. accommodate our different categories . , we will use and adapt the CaffeNet architecture. Rectified Linear Units (ReLU) will thereafter be used in place of saturating nonlinearities (E. Hassan, 2. This activation function will improve accuracy by adaptively learning the rectifier's parameters at a negligible additional processing cost. 2 Data Preprocessing Steps 1 Image Preprocessing Image pre-processing consists of a few steps, as illustrated in Figure 4. Figure 4. Image Preprocessing step The diagram in Figure 4 illustrates a complete imageprocessing pipeline for extracting meaningful features from a plant leaf for disease detection. First, the original image is converted to grayscale to simplify the visual data while retaining important structural patterns. Then, a Gaussian filtering filter is used to reduce noise and remove minor imperfections that could affect segmentation accuracy (Y. Li et al. , 2. Shape features are derived from the refined leaf silhouette, enabling the system to capture geometric attributes, including contour, structure, and leaf outline The gray-level co-occurrence matrix (GLCM) is used to extract texture features. Texture patterns such as contrast, smoothness, and homogeneity are important indicators of disease symptoms that alter the leaf surface. After smoothing. OtsuAos thresholding is used to automatically separate the leaf from the background by generating a binary mask. This step ensures that only the leaf region is retained for further analysis. The resulting binary image is refined using morphological transformations to remove minor imperfections, such as holes and stray pixels. To isolate the leaf more effectively, a bitwise AND operation is applied to the original image and the processed mask, removing unwanted background regions and highlighting only the Once the image is cleaned and segmented, the workflow branches into separate feature-extraction In addition, color features are extracted by converting the segmented leaf to the HSV color space, enabling the system to detect shifts in hue, saturation, and brightness that often signal infection, chlorosis, or necrosis. Together, these shape, texture, and color features form a rich, comprehensive representation of the leafAos condition, enabling machine learning models to classify plant diseases with greater accuracy and reliability. 2 Training A Diagnosis Classifier There are several options for the type of model to train on this data. Convolutional neural networks (CNN. and International Journal of Advances in Artificial Intelligence and Machine Learning prototype-based techniques have been successfully employed in earlier work. Due to the limited size of our dataset, we are unable to use CNNs in this case. Thus, prototype-based Learning Vector Quantization (LVQ) was the method we chose. 4 Validation We execute a 10-fold cross validation on every model we train, averaging the results across the folds. We use 200 estimators for the Extra Trees method. C = 1 for the linear SVC, and K = 15 for the KNN algorithm. utilize the standard settings found in the online GMLVQ toolbox for the GMLVQ algorithm . For the spectral data, more care was required. 3 Prototype-Based Classification Methods Learning Vector Quantization (LVQ), the most basic prototype-based classification method, was first presented by Kohonen . Since then, a number of variations have been proposed in the literature, all of which attempt to improve convergence or positive generalization . , . A collection of M prototype vectors wj OO RN that contain labels c. OO . ,2,. C} such that W = . j,c. }M j=1 describe a specific classification job in LVQ. For each class, the system may be configured with one or more prototype One prototype vector per class was taken into consideration for this experiment. 3 Architecture Of Plant Disease Detection The presented architecture outlines a systematic approach to identifying plant diseases from leaf images using advanced computational techniques. Additionally, the system provides actionable recommendations, such as fertilizer usage, to help farmers address the diagnosed This architecture represents a robust solution for enhancing precision farming by leveraging the power of artificial intelligence and automation, as shown in Figure 5. Figure 5. Plant Disease Detection Architecture 1 Image Preprocessing CNNs are excellent at spotting intricate patterns in visual data because they were created especially for image-based tasks. CNNs automatically learn the features from the input images using a sequence of convolutional and pooling layers, in contrast to SVM, which depends on manually derived features. Once the image is uploaded, it undergoes preprocessing to make it suitable for further analysis. This step involves various techniques to enhance the image and remove unnecessary elements. Preprocessing begins with resizing the image to maintain a uniform size across all samples. To eliminate unwanted distortion, such as spots or blurring caused by environmental factors, a Gaussian filter or median filter is used. 5 Fertilizer Recommendation Once the classification is complete, the system provides recommendations for fertilizers or treatments if the leaf is diagnosed as diseased. This step translates the diagnostic results into actionable insights for the user. For example, if the system identifies a fungal infection, it might recommend a specific fungicide or suggest organic treatments. Similarly, for nutrient deficiencies, it could propose the use of particular fertilizers to restore the plantAos health. 2 Feature Extraction The goal is to convert the visual information in the image into measurable attributes for classification. this stage, characteristics including color, vein patterns, texture, and form are examined. 3 Support Vector Machine (SVM) Algorithm When it comes to binary classification problems. SVM excels in identifying the ideal border . that divides the data into two groups. In this context. SVM uses the extracted leaf features to determine whether it belongs to the "healthy" or "diseased" class. 4 Convolutional Algorithm Neural Network 1 Experiment Setup System Specifications Our developed algorithm was executed on a highperformance machine with the following specifications: an IntelA Core i7-9700K processor running at 3. GHz. The machine is equipped with 16 GB of RAM, (CNN) International Journal of Advances in Artificial Intelligence and Machine Learning which provides ample capacity for processing and analyzing plant diseases. CNNs. After the initial stage of image collection and preprocessing. TensorFlow is used to standardize, scale, and enhance the dataset to improve model System Software Backend systems, built with frameworks like Flask or Django, connect trained models to user-facing applications, while databases such as SQLite or PostgreSQL store image data and results. RESULT AND DISCUSSION 1 Results TensorFlow The balanced dataset Comparison TensorFlow is very important for plant disease detection because it enables the analysis of plant photos and disease diagnosis using deep learning models, especially Our project analyzes 54,306 plant leaf images from the PlantVillage dataset, comprising 15 crop-disease classes, as shown in Figure 6. Figure 6. The balanced dataset comparison Three datasets original, grayscale, and backgroundsegmented were used to compare model performance. Segmentation highlighted disease-specific features by removing biases. Grayscale tested reliance on color, while the original preserved complete visual data. Training Results To ensure convergence, training was conducted for 50 epochs using early stopping. During the training process, the accuracy and loss of the model are shown in Figure 7. Figure 7. Model Loss and Accuracy The first graph in Figure 7 shows the model loss for both the training and test data over 50 epochs. Loss measures how far the modelAos predictions are from the correct At the beginning, the loss on both the training and test sets is very high, which is normal since the model is just starting to learn. As training continues, the training loss decreases smoothly and approaches zero, indicating the model is learning well from the training The test loss also decreases overall, but it fluctuates more because the test data is different from what the model sees during training. These ups and downs suggest normal variation and also indicate the model is not severely overfitting. The accuracy of the model on the training and test sets over the same 50 epochs is shown in the second graph. The number of correct predictions generated by the model is called accuracy. Initially, the accuracy is low because the model is learning patterns from the dataset, but then it increases rapidly for both the training and test International Journal of Advances in Artificial Intelligence and Machine Learning data sets. After some time, the training accuracy approaches perfection, indicating that the model has learned the training data well. In addition, the test accuracy remains high. Since the more difficult test samples were never seen during training, this is to be The model reached stable convergence, according to the learning curves from the training phase. The test accuracy fluctuated between 93% and 96% before settling, while the training accuracy approached nearperfect values. These findings imply that the model successfully learns from the training data while continuing to perform well on untested samples, exhibiting great generalization and little overfitting. Natural variability among the various disease classifications, some of which have more difficult visual characteristics, is reflected in the variations in test loss and accuracy. These two graphs demonstrate the model's overall effectiveness in learning. Over time, the accuracy rises and the loss falls, both of which are indicators of effective training. The model generalizes well to new images since test accuracy stays high despite the test curves' typical variations reflecting real-world variation. The classification report uses important measures like precision, recall. F1-score, and support to characterize the model's performance across all 15 illness categories. These measurements provide a thorough understanding of the model's advantages and possible disadvantages, especially when it comes to differentiating visually identical diseases or spotting minute differences in The model has great reliability in real-world plant disease detection tasks, with an overall test accuracy of roughly 9596%. This makes it appropriate for practical agricultural applications where early and precise diagnosis is crucial. The results are displayed in Table 1. The classification report This section's classification report offers a thorough assessment of how well the model uses machine learning and deep learning approaches to identify plant diseases from leaf photos. In all, 54,306 photos of both healthy and damaged leaves from various plant species were used in this investigation. 30% of the dataset . ,292 photo. was set aside specifically for testing, and the remaining 70% was utilized for model training and validation in order to guarantee a trustworthy evaluation of the model's capacity for generalization. Table 1. The Classification Report Class Precision Recall F1-Score Support Pepper Bell Bacterial_spot Pepper Bell healthy Potato Early blight Potato Late blight Potato healthy Tomato Bacterial spot Tomato Early blight Tomato Late blight Tomato Leaf Mold Tomato Septoria leaf spot Tomato Spider mites Tomato Target Spot Tomato Tomato mosaic virus Tomato YellowLeafCurl Virus Tomato healthy 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 1,086 Accuracy model achieves near-perfect accuracy on the training set, the test accuracy stabilizes between 93% and 96%, indicating strong but not flawless generalization an expected outcome in complex, multi-class classification tasks such as plant disease detection, as shown in Table The updated overall metrics provide a comprehensive summary of the modelAos performance, integrating insights drawn directly from the observed learning curves during training and evaluation. By analyzing both training and test behavior across multiple epochs, the metrics presented here offer a realistic, data-driven assessment of how well the model generalizes to unseen The learning curves demonstrate that while the International Journal of Advances in Artificial Intelligence and Machine Learning Table 2. The Overall Metrics Metric Value Overall Accuracy Macro Precision Macro Recall Macro F1-score Weighted Avg F1-score Confusion Matrix the paradigm. For instance, a large number of false negatives (FN) means the model is missing sick plants, whereas a high number of false positives (FP) suggests the model is incorrectly categorizing healthy plants as Key performance indicators like accuracy, precision, recall, and F1-score are computed using the confusion These measurements offer a thorough comprehension of the advantages and disadvantages of Figure 8. Confusion Matrix The confusion matrix in Figure 8 shows the performance of the plant disease classification algorithm across 15 disease categories using about 1,086 test samples per Each row represents the actual class, while each column represents the expected class. The diagonal values highlighted in darker green indicate correctly classified samples, while the lighter portions indicate incorrectly classified samples. A strong diagonal pattern, which accurately predicts the majority of data in each group, indicates that the model is performing well. Some classes exhibit slightly higher misclassification rates than others. For instance, diseases that share similar visual symptoms such as fungal infections that cause identical spotting or discoloration may result in a few additional errors. However, these mistakes are few in number and do not significantly affect the system's overall performance. Categories like Tomato mosaic virus and Tomato healthy yield strong results, with very The darker green blocks along the diagonal indicate that the model correctly classified over 1,000 samples per class, yielding accuracy rates of 95%-98% for each disease category. This aligns with the modelAos overall test accuracy of approximately 95Ae96%, as indicated previously from the learning curves. The few offdiagonal values reflect mistakes in which the model misinterpreted one disease as another. These misclassifications are minimal and dispersed, suggesting the model does not consistently confuse any specific pair of classes. Overall, the confusion matrix demonstrates that the model is highly effective at distinguishing among the 15 plant disease classes. The strong diagonal dominance indicates that the system generalizes well to unseen data and supports reliable disease detection in practical agricultural applications. The distribution of errors also provides useful insight into which leaf diseases the model finds more challenging, offering guidance for future dataset expansion or model refinement. 2 Discussion