International Engineering Publisher
Serving Researchers Since 2012

Research and Application of Some Machine Learning Models for Plant Disease Recognition from Images

DOI : 10.17577/IJERTV15IS080358
Download Full-Text PDF Cite this Publication

Text Only Version

Research and Application of Some Machine Learning Models for Plant Disease Recognition from Images

Anh Pham The

Information Technology faculty Hanoi University of Industry Hanoi, Vietnam

Abstract – Diagnosing crop diseases is a complex challenge due to the diversity of disease types and their varying manifestations on plants. To address this issue, this research applies artificial intelligence, focusing on transfer learning methods that combine Convolutional Neural Networks (CNNs) with machine learning algorithmssuch as SVM and K-NNto identify and classify diseases via images. Experimental results demonstrate that these hybrid models improve classification accuracy and training efficiency compared to standalone models. Additionally, the research team developed a mobile application to assist growers in disease detection and crop care, while also fostering connectivity among farm owners, agricultural experts, and suppliers of crop protection products and agricultural inputs, thereby contributing to the adoption of artificial intelligence and digital transformation in agriculture.

Keywords: Agriculture, Transfer learning, Neural Network, Feature extractor, SVM.

  1. INTRODUCTION

    Agriculture has always been a spearhead of Vietnam's economy, making substantial contributions by ensuring food security and exporting agricultural products to international markets. Consequently, crop diseases need to be detected promptly and dealt with thoroughly in order to eliminate food safety and hygiene issues as well as avoid adverse effects on agricultural production. Diseased plants usually show clear symptoms or lesions on leaves, stems, and fruit. However, leaves are typically the primary basis for identifying the disease a plant is suffering from. In most cases, when growers want to be certain about a plant disease, they need to hire agricultural and forestry experts for assistancean approach that can be costly and time-consuming, depending on geographic location and the grower's available funding. Moreover, inexperienced growers who misjudge the condition of a diseased plant and use pesticides indiscriminately, or use low-quality products, can cause a range of consequences: reduced produce quality, unnecessary economic losses, and environmental pollution. To address these challenges, applying artificial intelligence while leveraging the rapid growth of smartphones and their advanced features (high- definition cameras, powerful processors, etc.) to create a mobile agricultural and forestry expert has become essential.

    The process of solving this problem begins with collecting and pre-processing experimental datasets related to crop diseases,

    with particular focus on common diseases that pose significant challenges for recognition and treatment. Next comes researching and applying artificial intelligence techniques to recognize and classify diseases. The classification system model consists of two main components:

    • Feature Extractor model: features are the important and unique attributes of an image. Feature extraction must be performed using an appropriate algorithm to achieve the best results at the classification stage. The Convolutional Neural Network (CNN) is a representative choice for this task, capable of filtering noise, reducing image dimensionality, and automatically learning to extract complex features through multiple filters during training.

    • Classifier model: After feature extraction, machine learning techniques grounded in rigorous mathematical foundations are applied to build a classifier for crop diseases. This study focuses on two algorithmsKNN and SVMfor constructing the classification model.

    The remainder of this paper is structured as follows: Section 2 introduces the proposed models for solving the problem. In Section 3, we present some experimental results as well as the demo system that was built, and finally, Section 4 is devoted to drawing some conclusions.

  2. PROPOSED MODELS

    1. CONVOLUTIONAL NEURAL NETWORK (CNN) MODEL

      The effectiveness of a CNN model mainly depends on the network's architecture. In this section, we introduce a convolutional neural network architecture used as a feature extractor. The goal is to use a network that is not overly complex, yet sufficient for feature extraction and reducing the image's dimensionality. The proposed model (Figure 1) consists of 5 main blocks with 5 convolutional layers. The number of filters proposed for these convolutional layers are 32, 64, 128, 256, and 512, respectively.

      Figure 1. The proposed convolutional neural network model

    2. SVM MODEL

      In this section, we briefly introduce the SVM model. Consider the binary classification problem. Given a training dataset of n samples:

      X = {(x1, y1), (x2, y2), …, (xn, yn)} R n×(d+1),

      where xi is a vector in the space Rd and yi {1,1} is the set of class labels. A hyperplane separating the set X into two regions has the form:

      w, x + b = 0

      with w Rd and b R. The goal of SVM training is to find a hyperplane that separates the set X best, in the sense that the margin of the hyperplane is maximized. To find such a pair (w, b), the SVM model must solve a quadratic linear programming problem. For further details of the model, see [1, 2, 4].

    3. DSVM TRANSFER LEARNING MODEL

      This model is a combination of the artificial neural network CNN and SVM; however, the training processes of CNN and SVM are separated. In this combination, the CNN model acts as a feature extractor tasked with filtering noise, extracting features, and reducing the dimensionality of the input image data. The feature vector obtained from this model is treated as the input for the multi-class SVM model. This combination is expected to leverage the strengths of both models: CNN performs feature extraction on images very effectively, while SVM achieves good classification accuracy if the input data is effectively pre-processed.

      To use the neural network proposed in Figure 1 for the DSVM transfer learning model, the CNN network is first trained through its full set of steps. The subsequent process is carried out as follows: each input image is passed through the CNN network trained above, but with the last 2 layers removed. The output of the network is then stored as a 512-dimensional feature vector. In the next phase, this feature vector is forwarded to an SVM model that uses a one-vs-one multi- class classification strategy, and serves as this model's input. Figure 2 below more intuitively illustrates the DSVM model.

      Figure 2. The DSVM transfer learning model

    4. DKNN TRANSFER LEARNING MODEL

      The application of the K-NN algorithm in a classification problem is to determine the k objects in the training dataset that are closest to the object to be classified. To determine the nearest objects, the K-NN algorithm calculates the distance between two objects x and y using a suitable distance metric. Typically, the Euclidean distance can be used as follows:

      d(x, y) = ( (x y)² )

      where x, y are data samples and n is the dimensionality of x and y.

      Similar to the DSVM model presented above, we propose the hybrid DKNN learning model. In this model, the CNN model is also used as a feature extractor for the input image data; however, the KNN algorithm is applied in place of SVM to perform the classification.

  3. SOME EXPERIMENTAL RESULTS

    The research team conducted experiments on the models using the Google Colab environment with the Python programming language. Google Colab supports the Tesla T4 GPU for 12 continuous hours of use, which helps speed up the model training process. The team used a 5-fold cross-validation procedure to compute the average result of each model on each training dataset, in order to obtain the most reliable classification results.

    First, the convolutional neural network proposed above was trained and used for classification on the datasets. The recognition results of this network are considered the results of the standalone CNN model and are used for comparison with the DSVM transfer learning model. The parameters for the DSVM model were determined as follows: the regularization parameter C was selected from the set {10¹, 1, 10}. The kernel function used is the Gaussian Kernel, or Radial Basis Function (RBF), with the parameter selected from the set

    {10, 10, 10, 10³, 10², 10¹}. For the K-NN model, the

    parameter K was selected within the range [1, 40] for experimentation.

    1. EXPERIMENTAL DATA

      The experiments were conducted on 2 crop disease datasets. The HDN_Disease dataset was collected by our own team, while the other dataset, PlantVillage [3], was collected via the Internet. Details of the datasets are shown in Table 1 below.

      Table 1. Experimental data

    2. EXPERIMENTAL RESULTS

      To test the stability and convergence speed of the CNN model proposed above, we tested this model on the PlantVillage dataset; for dataset details, see [3]. Figure 3 and Figure 4 respectively show the classification accuracy and loss function value across training epochs.

      Figure 3 (left): Accuracy | Figure 4 (right): Loss

      The results show that the training process was stable, with no sudden drops in accuracy occurring after 40 epochs on the PlantVillage dataset.

      Next are the experimental results of the CNN, DSVM, and DKNN models on the Accuracy metric. The detailed figures are shown in Tables 2 and 3 below.

      Table 2. Classification accuracy of the models on the Accuracy metric

      Table 3. Training time and classification time of the models

      It can be seen that: the proposed CNN model ensures good classification accuracy, achieving over 95% accuracy on the PlantVillage test set and over 84% on the HDN_Disease test set.

      The DKNN model achieved relatively good experimental results on both datasets, reaching a classification accuracy greater than 96%, outperforming CNN on both test datasets.

      Finally, the DSVM model demonstrated the best classification ability, achieving an accuracy greater than 97% on all datasets, surpassing the results obtained by the other models.

      All three models had acceptable training and classification times. Among them, DKNN showed the fastest execution ability, with both training time and classification time far better than those of the other models.

    3. CROP DISEASE DIAGNOSIS SYSTEM

      With the goal of building a mobile application whose main function is to recognize crop diseases from image data received from users, and from there provide solutions as well as important information related to plant diseases, with a friendly, refined, and easy-to-use user interface that has the potential to develop into a commercial mobile application in the future, we decided to research and use two frameworks: Flutter and Flask. Some interface images are presented in the figures below.

      The pilot system uses the DSVM transfer learning model introduced above and can handle 16 diseases belonging to 8 different plant types.

  4. CONCLUSION

In this study, we surveyed and evaluated several machine learning models to support the diagnosis of crop diseases in agriculture. Experimental results show that the proposed transfer learning methods deliver good performance, as reflected in recognition accuracy and execution time, while also demonstrating potential for application under real-world conditions. In addition, the research team built a pilot mobile application using the DSVM model to diagnose crop diseases through images. Initial results show that the system is capable of operating on real data with accuracy that meets requirements. In the future, the system could be expanded by integrating image data collected from drones (flycams), thereby supporting an overall assessment of orchard/garden health conditions and providing remote consulting, monitoring, and disease-management solutions.

REFERENCES

  1. Nguyen M.C., Nguyen V.T., 2016, A Method for Reducing the Number of Support Vectors in Fuzzy Support Vector Machine, Advanced Computational Methods for Knowledge Engineering, Volume 453 of the series Advances in Intelligent Systems and Computing, pp. 17-27.

  2. David. P. Hughes, Marcel Salathe, 2016, An open access repository of images on plant health to enable the development of mobile disease diagnostics, arXiv:1511.08060v2.

  3. Le Thi, H.A., Nguyen, M.C., 2016, Efficient Algorithms for Feature Selection in Multi-class Support Vector Machine, Annals of Operations Research.

  4. S. P. Mohanty, D. P. Hughes, and M. Salathé, Using Deep Learning for Image-Based Plant Disease Detection, Frontiers in Plant Science, vol. 7, 2016, Art. no. 1419, doi: 10.3389/fpls.2016.01419.

  5. D. P. Hughes and M. Salathé, An Open Access Repository of Images on Plant Health to Enable the Development of Mobile Disease Diagnostics through Machine Learning and Crowdsourcing, arXiv preprint arXiv:1511.08060, 2015.

  6. P.-L. St-Charles, G. A. Bilodeau, and R. Bergevin, Convolutional Neural Networks for the Automatic Identification of Plant Diseases, Frontiers in Plant Science, vol. 10, 2019, Art. no. 941, doi: 10.3389/fpls.2019.00941

  7. A. Abade, P. A. Ferreira, and F. B. Vidal, Plant Diseases Recognition on Images Using Convolutional Neural Networks: A Systematic Review, Computers and Electronics in Agriculture, vol. 185, 2021, Art. no. 106125, doi: 10.1016/j.compag.2021.106125.

  8. R. I. Hasan, S. M. Yusuf, and L. Alzubaidi, Review of the State of the Art of Deep Learning for Plant Diseases: A Broad Analysis and Discussion, Plants, vol. 9, no. 10, 2020, Art. no. 1302, doi: 10.3390/plants9101302.

  9. S. Nigam and R. Jain, Plant Disease Identification Using Deep Learning: A Review, The Indian Journal of Agricultural Sciences, vol. 90, no. 2, pp. 249257, 2020, doi: 10.56093/ijas.v90i2.98996.

  10. P. S. Muthukumarana and A. C. Aponso, A Review on Deep Learning Based Image Classification of Plant Diseases, International Journal of Computer Theory and Engineering, vol. 12, no. 5, pp. 118122, 2020, doi: 10.7763/IJCTE.2020.V12.1275.