Rice Leaf Diagnosis using Efficient Convolutional Neural Network

DOI : 10.17577/ICCIDT2K23-101

Download Full-Text PDF Cite this Publication

Text Only Version

Rice Leaf Diagnosis using Efficient Convolutional Neural Network


Afsana Asharaf, Ananthan, Anush A, Gayathri S Kartha Department of Computer Science Engineering TKM Institute of Technology

Kollam, India finalprojectgroupone@gmail.com


Department of Computer Science Engineering TKM Institute of Technology

Kollam, India ansias@tkmit.ac.in

AbstractPlant diseases, specifically those affecting rice leaves, are a critical concern for farmers. This poses a challenge in meeting the food demands of an expanding human population. The impact of rice diseases is felt by the agricultural sector, resulting in production and economic losses, and affecting the livelihoods of farmers who rely on farming. Unfortunately, this has led to a rise in farmer suicides due to the hardships experienced. Identifying specific plant diseases is vital in developing targeted control procedures. Rice leaf disease is a persistent and widespread challenge for farmers, which calls for innovative and effective solutions. To address this issue, a novel approach is proposed that employs a convolutional neural network (CNN) model to detect three major rice diseases, namely bacterial blight, leaf smut, and brown spot disease. The proposed methodology comprises Otsu segmentation to identify regions of interest in rice leaf images, followed by feature extraction using the histogram of oriented gradients (HOG) algorithm. The extracted features are then used for classification, leveraging both support vector machine (SVM) and CNN models. When comparing the SVM and HOG model with the HOG and CNN model, it was found that the HOG and CNN approach demonstrated better accuracy. The HOG and CNN approach achieved an outstanding classification rate of 96%.

Keywords Rice leaf, Otsu segmentation, HOG, SVM, Efficientnet B5 (CNN Model)


    Rice is one of the most important cereal crops in the world, providing a significant source of food for millions of people. It is a staple food in many countries, particularly in Asia, where it is consumed daily by billions of people. Rice plants are generally hardy and can grow in a range of conditions, but they are also susceptible to various diseases that can significantly impact their yield and quality.

    Rice diseases can be caused by a variety of factors, including fungi, bacteria, viruses, and pests. Some of the most common rice diseases include Brown spot, bacterial leaf blight, and leaf smut. These diseases can cause significant damage to rice crops, leading to reduced yields and economic losses for farmers.

    Bacterial blight is a plant disease caused by various species of bacteria. These bacteria infect the plant tissue, leading to

    symptoms such as leaf spots, wilting, and stem cankers. The disease can affect a wide range of crops, including rice, soybeans, cotton, and fruit trees. Bacterial blight is usually spread through contaminated seeds or infected plant debris. The bacteria can also be transmitted by insects, rain splashes, or human activities, such as pruning or harvesting.

    Brown spot is a fungal disease that affects various crops, including rice, soybeans, and corn. It is caused by the fungus Bipolaris oryzae (formerly known as Helminthosporium oryzae) and leads to characteristic brown spots on the leaves, stems, and grains of infected plants.

    The disease is typically spread through contaminated seeds, crop debris, or windblown spores. It thrives in warm, humid environments and can cause significant yield losses if left untreated.

    To manage brown spots, farmers can adopt several strategies, including planting disease-resistant varieties, practicing crop rotation, and using appropriate fertilization and irrigation practices. Fungicides can also be applied to control the disease, but their use should be carefully timed and targeted to minimize the risk of developing resistance.

    Leaf smut is a fungal disease that affects a variety of grasses, including corn, sorghum, and sugarcane. It is caused by the fungus Sporisorium reilianum and results in characteristic black, elongated lesions on the leaves of infected plants

    The disease is usually spread through infected seeds or windblown spores. It can also be transmitted by insects or by cultural practices, such as tillage or irrigation.

    To manage leaf smut, farmers can adopt several strategies, including planting disease-resistant varieties, using clean seeds, and practicing crop rotation. Fungicides can also be applied to control the disease, but their use should be carefully timed and targeted to minimize the risk of developing resistance.

    The use of the software for rice leaf disease detection offers a cost-effective and accurate alternative to manual inspection. The software can analyze large amounts of data quickly,

    accurately, and consistently. It can detect diseases in the early stages, preventing significant yield losses and reducing the need for costly control measures. The efficiency of software- based detection frees up time for researchers to focus on other aspects of their work. Overall, the use of software for rice leaf disease detection can lead to better crop management, higher yields, and improved food security.


    Ahmed et al. presented a rice leaf disease detection system using machine learning approaches where three of the most common rice plant diseases namely leaf smut, bacterial leaf blight, and brown spot diseases are detected [1]. Clear images of affected rice leaves with white backgrounds were used as the input. After necessary pre-processing, the dataset was trained on a range of different machine learning algorithms including that of KNN(K-Nearest Neighbor), J48(Decision Tree), Naive Bayes, and Logistic Regression. Decision tree algorithm.

    Samah et al., has used a deep learning approach to detect disease in watermelon plants. The convolutional neural network VGG-16 architecture was used to recognize plant diseases and give farmers the tools they need to quickly treat afflicted plants. The final results demonstrated a significant advancement over the earlier studies.[5].

    Ghosal et al ., have developed deep learning approach on rice disease dataset that have been collected. Using the pre-trained VGG-16 model (Trained on the huge ImageNet data) and using Transfer Learning fully connected layers have been finetuned so that it was able to accommodate the dataset[3].

    Xu et al. analyzed the application of image processing technology in the field of agriculture. Firstly, the application of image processing technology in the agricultural field was analyzed [7]. Secondly, in order to highlight the application effect of image processing technology in the agricultural field, image processing technology, and traditional machine recognition technology were applied to crop pest detection, and analyzes their effects.

    The convolutional neural network algorithm (CNN) is one of the algorithms in deep learning has been triumphantly invoked for solving computer vision problems like image classification, object segmentation, image analysis, etc. In the work, Krishnamoorthy et al., used InceptionResNetV2 a type of CNN model utilized with transfer learning approach for recognizing diseases in rice leaf images[6]. The parameters of the proposed model is optimized for the classification task and obtained a good accuracy

    Suj Radha et al., Identified leaf diseases following the steps like loading the image, contrast enhancement, converting from RGB to HSI, extraction of features, and then using SVM []. Major image processing methods used for the identification of leaf diseases are k-means clustering, and SVM was summarized. This approach significantly supports the accurate detection of leaf disease.

    As farmers in any country do not have much knowledge about rice leaf disease, they cannot diagnose rice leaf disease properly. Thats why they cannot take proper care of rice leaves. It has been observed that YOLOv5 exhibit the better result compared to others. As a result of the continual advancement of object detection technology, YOLO family algorithms can be used to build rice leaf disease monitoring systems. Ershadul et al., have annotated 1500 collected data sets and proposed a rice leaf disease classification and detection method based on YOLOv5 deep learning and then trained and evaluated the model [2].

    By this comparative analysis from different papers the use of machine learning techniques is very high and it majorly focuses on three different diseases leaf blight, brown spot, and leaf smut diseases.


    Data that obtained from the UCI machine learning repository and from Kaggle. The dataset contains 3 classes of each disease and 1 class of a healthy dataset

    1. Image Pre-Processing

      Resizing images to a specified dimension is a ubiquitous preprocessing step in computer vision. The size of the images in the dataset is firstly resized into[1600*1200] for processing further.

    2. Segmentation

      Image segmentation is a computational technique that facilitates the division of a digital image into multiple segments, where each of the segments is uniquely characterized by a set of pixels that collectively form a region that is distinctly different from the other regions. The segmentation of an image is commonly achieved through the creation of a mask or labeled image, which involves the assignment of an exclusive and explicit label to every single pixel within a given segment.

      The preeminent advantage of utilizing image segmentation as a method of processing digital images is the capacity to selectively process and analyze specific segments of the image, rather than the entire image itself. This feature is especially valuable when computational resources are limited or when a researcher is only interested in particular regions of an image. Therefore, image segmentation enables researchers to conduct a more targeted and focused analysis of digital image. So the image segmentation method here we use is Otsus segmentation.

      Otsu's segmentation is a widely utilized technique in the field of image processing that enables the partitioning of an image into two distinct segments based on a threshold of grayscale intensity. This approach, developed by the distinguished scientist Nobuyuki Otsu, relies on the principle of optimizing the inter-class variance and minimizing the intra-class variance, thereby effectively segmenting the image into foreground and background segments.

      To implement the algorithm, one must first determine the frequency distribution of pixel intensities in the image, represented by a histogram. The optimal threshold value is then determined by maximizing the ratio of inter-class variance to intra-class variance, thereby producing a segmentation result that separates the foreground, containing the object of interest, from the background. The aim of Otsu's method is to find the optimal threshold value that minimizes the intra-class variance while maximizing the inter-class variance. The equation used to calculate the optimal threshold value is given by:

      w^2(t)=0(t)0^2(t)+1(t)1^2(t) (1)

      where $\sigma_w^2(t)$ is the intra-class variance at threshold

      $t$, $\omega_0(t)$ and $\omega_1(t)$ are the probabilities of finding a pixel in the background and foreground classes, respectively, at threshold $t$, and $\sigma_0^2(t)$ and

      $\sigma_1^2(t)$ are the variances of the background and foreground classes, respectively, at threshold $t$. The optimal threshold value is chosen as the value that maximizes the inter-class variance, which can be calculated as:

      b^2(t)=T^2w^2(t) (2)

      Where $\sigma_T^2$ is the total variance of the image. Once the optimal threshold value is determined, the image is thresholded by assigning all pixels with intensities below the threshold to the background class and all pixels with intensities above the threshold to the foreground class.

      Otsu's segmentation algorithm has found broad applications in image thresholding, segmentation, and object recognition, especially in situations where the foreground and background intensity distributions are significantly different, or when a clear bimodal distribution is present in the histogram of pixel intensities.

    3. Feature Descriptor

      Feature extraction is a crucial process that involves discerning and extracting pertinent and salient information or features from a given dataset or image in the absence of copying from any external sources. In the domain of image processing, feature extraction entails identifying and extracting specific patterns, structures, or characteristics from an image that can be effectively deployed to differentiate it from other images.

      The fundamental objective of feature extraction is to mitigate the complexity of the data by singling out the most relevant features that can effectively encapsulate the fundamental information from the original dataset. It is vital that the extracted features have a robust correlation with the class labels in the dataset, rendering them highly useful for diverse image analysis tasks such as classification, segmentation, and object detection.

      The process of feature extraction holds significant importance In numerous fields, including image and signal processing, computer vision, natural language processing, and many more. It involves identifying and selecting the most relevant and informative features from a dataset, which can aid in solving a specific problem or task. The extraction of relevant features from a vast amount of data is critical as it helps to reduce the complexity of the data and make it more manageable.

      One of the primary advantages of feature extraction is that it enables the selection of features that are most relevant to a particular task or problem. This results in improved accuracy and efficiency in solving complex problems, such as image recognition or natural language processing. Feature extraction also helps to remove redundant or irrelevant data, which reduces computational resources and speeds up the processing time.

      Another significant advantage of feature extraction is that it can be used to transform high-dimensional data into lower- dimensional data without losing important information. This is particularly important in machine learning, where the number of features can be vast, and reducing the dimensionality of the data can improve the performance of the algorithms. Dimensionality reduction techniques such as principal component analysis (PCA) and linear discriminant analysis (LDA) are commonly used for this purpose.

      Feature extraction also enables the use of different algorithms and models for different tasks. For instance, the extracted features can be used for classification, clustering, and anomaly detection. The extracted features can also be used as input to deep learning algorithms such as convolutional neural networks (CNNs) and recurrent neural networks (RNNs), which can learn complex patterns and relationships within the data. The feature extractor in our proposed system used here is a Histogram of oriented gradients (HOG).

      Histogram of Oriented Gradients (HOG) is an advanced and sophisticated feature extraction technique that has gained wide recognition in the field of computer vision and image processing. The HOG algorithm calculates the gradient orientation and magnitude of each pixel in an image, and then groups adjacent pixels into cells. The resulting histograms of gradient orientations are then normalized to reduce the impact of canges in illumination and contrast and concatenated into a feature vector that can be used for image analysis tasks such as object detection and image segmentation.

      The HOG technique is based on the premise that the distribution of gradient orientations in an image provides a robust and discriminative representation of its local structure. By extracting these features, HOG captures local texture and edge information that can be used to differentiate one image from another.

    4. Classification

      Classification in machine learning refers to the process of training a model to predict the class of new observations based on a set of labeled training data. In other words, it is a supervised learning technique where the model is trained to classify input data into a set of pre-defined classes or categories.

      The goal of classification is to build a model that can accurately predict the class of unseen data based on its features. This requires selecting appropriate features, pre- processing the data, and choosing an appropriate algorithm for the classification task.

      The accuracy of the classification model can be evaluated using various metrics such as accuracy, precision, recall, and F1 score. The choice of evaluation metric depends on the nature of the problem and the cost associated with different types of errors. Here we use two types of classification SVM and Effientnet b5.

      Support Vector Machines (SVMs) are a powerful class of supervised learning algorithms used for classification regression, and outlier detection. They are particularly useful in cases where the number of features is large, and the number of samples is small.

      SVMs work by finding the optimal hyperplane that separates the data into different classes. The hyperplane is selected such that the margin, which is the distance between the hyperplane and the closest data points from each class, is maximized. The points that lie on the margin are called support vectors, and they play a crucial role in determining the hyperplane. One of the advantages of SVM is that it is effective in high- dimensional spaces, where the number of features is much larger than the number of samples. It is also robust to noise and can handle both linearly separable and non-linearly separable data.

      Efficient Net b5 is convolutional neural network (CNN) architecture. It is based on the idea that by scaling up the depth, width, and resolution of a CNN, it is possible to improve its accuracy without significantly increasing its computational cost. The Efficient Net b5 architecture uses a compound scaling method to balance these three dimensions, resulting in a family of models that achieve state-of-the-art performance on a wide range of computer vision tasks, including image classification, object detection, and segmentation.

      The Efficient Net b5 model consists of a series of convolutional layers with different filter sizes and depths, followed by a global average pooling layer and a fully connected layer for classification. It also uses a technique called "swish" activation, which is a non-linear activation function that has been shown to improve the performance of neural networks. The model is trained using stochastic gradient descent with momentum and weight decay and can be finetuned using transfer learning on new datasets. One of the

      main advantages of the Efficient Net b5 model over SVM is its efficiency in terms of both computational cost and memory usage also it has high speed compared to SVM.

    5. Proposed Methodology

    The proposed work is implemented in Python languages. This method compares the accuracy and finds that our system improves the accuracy than the existing one.

    Fig 1 Proposed Model

    The proposed methodology for image classification involves a Series of complex processes that rely on state-of-the-art technologies to achieve optimal results. Firstly, we capture the image using a digital device which is known as image Acquisition. After that we conduct preprocessing on the raw data to ensure that the images are properly formatted and optimized for further analysis. This is a crucial step, as the quality of the data can significantly impact the overall accuracy of the classification model.

    Once the pre-processing is complete, we split the data into training and testing sets to ensure that the model can be trained on a large volume of data and then tested on an independent set to measure its performance. This step allows us to optimize the hyperparameters of the model to achieve the best possible accuracy.

    The next step is to perform object segmentation on the image to isolate the relevant objects of interest from the background. This is achieved by using advanced computer vision techniques that leverage cutting-edge algorithms to precisely locate and segment the objects.

    Once the objects are segmented, we then perform feature extraction using the Histogram of Oriented Gradients (HOG) algorithm. HOG is a powerful feature extraction technique that

    has proven to be highly effective in extracting features from images. The features extracted using HOG are then used as inputs to the classification model.

    In our methodology, we use two different classification models: Support Vector Machines (SVM) and Efficient Net b5. SVM is a popular machine learning algorithm that is widely used in image classification tasks due to its ability to handle large volumes of data and achieve high accuracy. Efficient Net b5, on the other hand, is a state-of-the-art deep learning model that has been specifically designed for image classification tasks.

    To compare the performance of the two models, we conduct an extensive evaluation using various metrics such as accuracy, precision, recall, and F1 score. This enables us to determine which model is better suited for our particular use case.

    In addition, we also compare the performance of HOG and Efficient Net b5 and HOG and SVM to determine which combination of feature extraction and classification models is the most effective. This comparison is crucial as it enables us to select the best combination of techniques to achieve optimal results.

    In conclusion, the proposed methodology for image classification is a complex process that involves multiple stages of pre-processing, segmentation, feature extraction, and classification. By leveraging cutting-edge technologies such as HOG, SVM, and Efficient Net b5, we are able to achieve high accuracy in image classification tasks.

    The comparison of different models and feature extraction techniques allows to select the best combination of techniques for our particular use case, enabling us to achieve

    optimal result.


    The implementation of our project has resulted in an accurate and effective prediction of various diseases, based on uploaded images. Accuracy is the proportion of correct predictions among all predictions made by the model. In the proposed method, our model achieved an accuracy of 96%, which means that it correctly classified 96% of the images. Precision is the proportion of true positive predictions among all positive predictions made by the model. In other words, precision measures the model's ability to avoid false positives. Our model achieved a precision of 0.972, which means that of all the images it classified as positive, 97.2% were actually positive.

    Recall, on the other hand, measures the proportion of true positive predictions among all actual positive cases in the dataset. The recall is a measure of the model's ability to detect all positive cases. Our model achieved a recall of 0.966, which means that of all the positive images in the dataset, 96.6% were correctly classified as positive by the model.

    Overall, it seems that your model performed well with high accuracy, precision, and recall values compared to the existing one.

    Fig 2 Home Page

    Fig 3 Prediction of Diseases

    Fig 4 Performance Analysis

    Fig 5 Pie Chart Analysis


Rice is one of the most important crops and a staple food for millions of people worldwide. However, it is prone to various diseases that can significantly reduce its yield and quality. Traditional methods of detecting and diagnosing rice diseases are time-consuming, expensive, and require trained experts. Therefore, there is a need to develop efficient and accurate methods for rice disease detection that can aid in the timely diagnosis and management of the diseases.

our project aimed to develop an efficient and accurate object detection system using image processing and machine learning techniques. We proposed a methodology that involved preprocessing the data, performing object segmentation, feature extraction using HOG, and classification using SVM and Efficient Net b5 models. We also compared the performance of HOG and SVM and HOG and Efficient Net b5 to determine the best approach for object detection. The results of our project showed that the proposed methodology achieved high accuracy and efficiency in detecting objects in images. Both SVM and Efficient Net b5 models performed well in classification, with Efficient Net b5 achieving slightly better results. However, the combination of HOG and SVM was found to be the most efficient approach in terms of computation time and accuracy.

Our study also highlighted the importance of pre-processing techniques, such as image resizing and normalization, in improving the performance of the object detection system. Moreover, the use of object segmentation helped to reduce the impact of background noise and clutter in the images.

In conclusion, our project demonstrates the potential of machine learning and image processing techniques in developing robust and efficient object detection systems. The proposed methodology can be further improved by exploring other feature extraction and classification techniques and by incorporating deep learning models. Overall, our project contributes to the growing field of computer vision and has practical applications in areas such as autonomous driving, surveillance systems, and medical imaging.


[1]. Kawcher Ahmed, Tasmia Rahman Shahidi, Syed Md. Irfanul Alam and Sifat Momen, Rice Leaf Disease Detection Using Machine Learning Techniques, 2019 International Conference on Sustainable Technologies for Industry 4.0 (STI), 24-25 December,


[2]. Md Ershadul Haque, Ashikur Rahman, Iftekhar Junaeid, Samiul Ul Hoque and Manoranjan Paul Rice Leaf Disease Classification and Detection Using YOLOv5",2022

[3]. Shreya Ghosal , Kamal Sarkar , Rice Leaf Diseases Classification Using CNN With Transfer Learning,2020 IEEE Conference Calcutta

[4]. Suja Radha, Leaf Disease Detection Using Image Processing, International Conference on Computing Communication Control and Automation (ICCUBEA), 768- 771.

[5]. Samah Alhazmi, Different Stages of Watermelon Diseases Detection Using Optimized CNN(2020) In book: Soft Computing: Theories and Applications (pp.121-133)

[6]. N. Krishnamoorthy, L. Prasad, . . . C. K.-E., and undefined 2021, Rice leaf diseases prediction using deep neural networks with transfer learning, Elsevier, Accessed: Oct. 02, 2021.

[7]. Nan Xu, Image processing technology in agriculture, the 2nd International Conference on Computing and Data Science (CONF- CDS 2021) Journal of Physics: Conference Series 1881, 8,265-