Green Leaf Disease Detection using CNN

DOI : 10.17577/IJERTCONV9IS15003

Download Full-Text PDF Cite this Publication

Text Only Version

Green Leaf Disease Detection using CNN

Nagaveni B. Nimbal1

1Assistant Professor, Dept. of CSE

Amruta Institute of Engineering and Management Sciences, Bidadi, Karnataka, India-562109

Anushree S2

2UG Scholar, Dept. of CSE

Amruta Institute of Engineering and Management Sciences,

Bidadi, Karnataka, India-562109

Madhu K V2

2UG Scholar, Dept. of CSE

Amruta Institute of Engineering and Management Sciences,

Bidadi, Karnataka, India-562109

G R Sahana2

2UG Scholar, Dept. of CSE

Amruta Institute of Engineering and Management Science, Bidadi, Karnataka, India-562109

Soundarya R2

2UG Scholar, Dept. of CSE

Amruta Institute of Engineering and Management Sciences,

Bidadi, Karnataka, India-562109

Abstract:- Sun flower is one of the important oil seed crops and potentially fit in agricultural system and oil production sector of India. Sunflower crop gets damaged by the impact of various diseases, insects and nematodes resulting in wide range of loss in production. Disease detection is possible through naked eye observation, but this method is unsuccessful when one has to monitor the large farms. As a solution to this problem, we developed and present a system for segmentation and classification of Sunflower leaf images. This paper presents surveys conducted on different diseases classification techniques that can be used for sunflower leaf disease detection. Segmentation of Sunflower leaf images, which is an important aspect for disease classification, is done by using CNN algorithm. A variety of neuron-wise and layer-wise visualization methods were applied and trained using a CNN, with a publicly available plant disease given image dataset. So, it is observed that neural networks can capture the colors and textures of regions specific to respective diseases. Satisfactory results have been given by the experiments done on leaf images.

Keywords:-Deep Learning, Artificial Intelligence, Convolutional Neural Network, K-means


    India is notable for its generation of horticulture. The majority of the masses depends upon horticulture. Farmers have a variety of cultivation options in the field. These crops are still cultivated in a technical manner for the best harvest and the highest quality of production. Thus, the yield can be increased and the use of technology can improve quality. The primary occupation in India is agriculture. India ranks second in the agricultural output worldwide. Here in India, farmers cultivate a great diversity of crops. Various factors such as climatic conditions, soil conditions, various disease, etc. affect the production of the crops. The existing method for plants disease detection is simply naked eye observation which requires more man labor, properly equipped laboratories, expensive devices, etc. And improper disease detection may lead to inexperienced pesticide usage that can

    cause development of long term resistance of the pathogens, reducing the ability of the crop to fight back. The plant disease detection can be done by observing the spot on the leaves of the affected plant. The method we are adopting to detect plant diseases is using Convolution neural network (CNN). Because of industrialization and globalization ideas the field is confronting obstacles. Over that the mindfulness and the need of the development should be imparted in the brains of the more youthful age. Presently multi days innovation assumes essential job in every one of the fields yet till today we are utilizing some old procedures in horticulture. Recognizing plant ailment wrongly prompts colossal loss of yield, time, cash and nature of item. Recognizing the state of plant assumes a vital job for fruitful development. In former times ID is done physically by the accomplished individuals yet due to the significant number of natural changes the forecast is getting to be extreme. So we can utilize picture handling procedures for recognizable proof of plant malady. By and large we can watch the side effects of ailment on leafs, stems, blossoms and so forth so here we use leafs for distinguishing proof of sickness influenced plants. We have mainly focused on three diseases in sunflower causing devastating yield losses in most of the years. These are Bacterial Spots, Mildew and Rust. The system will give more accurate results for the detection of these diseases using the CNN.


    In recent years researchers has proposed vivid techniques, some of them are studied and reviewed as discussed below:

    Dheeb Al Bashish et al. [2010] proposed K-means based segmentation and ANN to detect five prevalent diseases in leaves i.e. early scorch, late scorch, Cottony mold, Ashen mold, and tiny whiteness in the images of leaves taken from

    Al-Ghor area in Jordan. The experimental results show accuracy in identification of diseases of around 93%.

    The author Sowmya et al., [2017] presents a system for early and accurate detection of plant diseases using diverse image processing techniques. According to the author, farmers face great difficulties in changing from one disease control method to another. As naked- eye observation to detect and classify diseases is very expensive various plant diseases pose a great threat to the agricultural sector by reducing the life of the plants. There are three steps where first is capturing the images, then filtering and last segmentation using median filtering method. After segmentation features are extracted for classification of diseases.

    Nitesh Agrawal, Jyoti Singhai,[2017] multi-class SVM is used as a classifier and for feature extraction the RGB signals are converted into LGB form. In image pre-processing resizing, enhancing and smoothening of image is carried out to save the memory and reduce the processing time. For image Segmentation K- means clustering is carried out. Maximum 90% accuracy was obtained in testing the Black rot.

    Harshal Waghmare, Radha Kokare [2016] 120 images are taken directly from farms through mobile camera. Accuracy between different methods like SVM, BPN and fuzzy is compared and then SVM is used. In image preprocessing the image is resized to 226 x 226. RGB images are converted to HSV color space. Background subtraction is carried out to remove unwanted background in the image and to focus on leaf section. The average accuracy obtained is 89.3%.

    Hulya Yalcin, have used CNN model to recognize and classify phenological stages of different types of plants based on the visual data i.e. images which are captured every half an hour by the mounted cameras. Pre- trained Alex Net architecture is used in order to classify. The maximum accuracy obtained is 87.14% for Pepper which is more as compared to other traditional Machine Learning Approach.


In the proposed system we use the CNN algorithm for the plant leaf disease detection because by using the CNN we can achieve the maximum accuracy if the dataset is good. In this proposed system we capture the image by using the raspberry pi with the camera module and then process it and get the prediction whether leaf is diseased or not and the name of the disease. Here dataset is taken and the data is preprocessed before training and then the data is trained. Here the images of the diseased plants are in separate folder because we can easily train the model and predict the model if it is in this type and the trained data is separated into two ways: one for validation and another for verification that is into training and testing data that to in the 80:20 ratio. After the data is trained amodel is generated and then we use the raspberry pi to capture the picture of the image and then we use the CNN algorithm and the given trained model for the prediction of disease. We can achieve the 90 percent accuracy by this CNN.


      We can reduce the attack of pests by using proper pesticides and remedies .We can reduce the size of the images by proper size reduction techniques and see to it that the quality is not

      compromised to a great extent. We can expand the projects of the earlier mentioned authors such that the remedy to the disease is also shown by the system. The main objective is to identify the plant diseases using image processing. It also, after identification of the disease, suggests the name of pesticide to be used. It also identifies the insects and pests responsible for epidemic. Apart from these parallel objectives, this drone is very time saving. The budget of the model is quite high for low scale farming purposes but will be value for money in large scale farming. It completes each of the process sequentially and hence achieving each of the output.

      Thus the main objectives are:

      1. To design such system that can detect crop disease and pest accurately.

      2. Create database of insecticides for respective pest and disease.

      3. To provide remedy for the disease that is detected.


Artificial neural networks are motivated by the learning capabilities of the human brain which consists of neurons interconnected by synapses. ANNs are not suitable for images because these networks lead to over-fitting due to size of image. The major difference between a traditional Artificial Neural Network (ANN) and CNN is that only the last layer is connected to every other neuron as shown in Fig.4 Convolutional neural networks use images directly as input. Instead of handcrafted features, convolutional neural networks are used to automatically learn a hierarchy of features which can then be used for classification purposes. This is accomplished by successively convolving the input image with learned filters to build up a hierarchy of feature maps. The hierarchical approach allows learning more complex, as well as translation and distortion invariant, features in higher layers.

A Convolutional Neural Network (CNN) has four Types of layers as follows:

  1. Convolutional Layer (CONV)

  2. Rectified Linear Unit Layer (ReLu)

  3. Pooling Layer (POOL)

  4. Fully-Connected Layer (FC)

    Fig.4: CNN Layers


        Convolution is the first layer which is used to extract features from an input image. It preserves the relationship between

        pixels by learning image features using small squares of input data. The Layer contains N filters which are small in size (for example [3×3] as in Fig 4.2. These 3×3 filters are convoluted with the input image matrix by sliding the filter slide through the width and height of the image. Firstly, the feature matrix is multiplied pixel by pixel with the selected square from the image. Then the values are added and finally divided by the total number of pixels (in our example it is 9 due to 3×3 filter size). The obtained value is inserted in a new matrix. This process helps to reduce the image without loss of any feature.

        Fig.4.1: 3*3 Filter matrix


    In ReLu layer the pixels which are not necessary are deactivated and only the important pixels are kept. From Conv layer we get positive as well as negative pixel values. The positive pixels are important for the further finding of features and the negative values are of less importance. The ReLu layer either converts the pixel to 0 or 1. If the value of pixel is negative then it is converted to 0 and for any value greater than 0 it retains the same value.

    Fig.4.3: Max Pooling Layer


        Multiple Layers are stacked of Convolution, ReLu and Pooling according to the architecture. The number of layers to be stacked varies as per use of the predefined architectures like Google Le Net, Alex Net etc. The output obtained is the minimized matrix of the input image.

        Fig.4.4: Layer stacking


    The Fully Connected Layer in CNN has neurons that are fully connected to all the neurons of the previous layer. Multiple FC layers are stacked as per the architecture used. It is often the last layer used in CNN which is responsible to predict the output or the label of the input class. Different activation functions are used like SOFTMAX which is used to classify multi-class problems. Hence, it has an output dimension of [1x1xM] where M is the number of classes or labels used for classification.

    Fig.4.2: ReLu


        The Pooling layer does a simple job of down sampling or compressing the dimensions of the input image. A stride is selected which can be 2×2 or 5×5 etc. After the selection of stride it is applied to the dimension matrix obtained from the Conv Layer. Maximum value is taken from each stride and stored in a new matrix. Depending on the stride Pooling is of two types Max Pooling and Minimum Pooling. When the stride is large such Pooling is known as Max Pooling whereas small stride is known as Minimum Pooling. For example, if the input is [64*64*12] and if a stride of 2×2 is applied then after down sampling the output will be [32*32*12].

  5. SYSTEM OVERVIEW General explanation:

      1. The input test image is acquired and preprocessed in the next stage and then it is converted into array form for Comparison.

      2. The selected database is properly segregated and preprocessed and then renamed into proper folders.

      3. The model is properly trained using CNN and then classification takes place.

      4. The comparison of the test image and the trained model take place followed by the display of the result.

      5. If there is a defect or disease in the plant the software displays the disease along with the remedy.

        Fig.5.1: Flow chart for Disease Detection


        In our system processing starts with Data collection, through some the pre-processing, feature extractor steps to be allowed and then finally detect the diseases from image.

        Fig.6.1: System processing

          1. DATA COLLECTION:

            Dataset contains images with several diseases in many different plants. In this System we consider some of the sunflower leaves. Diseased leaves, healthy leaves all of them were collected for those above crops from different sources like images download from Internet, or simply taking pictures using any camera devices or any else.


            The task of automatically generating description words for a picture is a key component in various image search and retrieval applications. But in this system, we manually annotate the areas of every image containing the disease with a bounding box and class. Some diseases might look similar depending on its infection status.

          3. IMAGE ANALYSIS:

            Our system main goal is to detect and recognize the class disease in the image. We need to accurately detect the object, as well as identify the class to which it belongs. We extend the idea of object detection framework to adapt it with different feature extractors that detect diseases in the image.


            There are some conditions that should be taken into consideration when choosing a Feature Extractor, such as the type of layers, as a higher number of parameters increases the

            complexity of the system and directly influences the speed, and results of the system. Although each network has been designed with specific characteristics, all share the same goal, which is to increase accuracy while reducing computational complexity. In this system each object detector to be merged with some of the feature extractor.

          5. REMEDY:

        After the disease is successfully predicted with a good accuracy level, the corresponding remedy for the disease present is displayed that can be taken as a cure.


The proposed system was developed taking in mind the benefits of the farmers and agricultural sector .The developed system can detect disease in plant and also provide the remedy that can be taken against the disease. By proper knowledge of the disease and the remedy can be taken for improving the health of the plant .The proposed system is based on python and gives an accuracy of around 78%. The accuracy and the speed can be increased by use of CNN algorithm.


  1. Harshal Waghmare, Radha Kokare, Detection and Classification of Diseases of Grape Plant Using Opposite Colour Local Binary Pattern Feature and Machine Learning for Automated Decision Support System, 2016 3rd International Conference on Signal Processing and Integrated Networks (SPIN)

  2. Hulya Yalcin, Plant Phenology Recognition using Deep Learning: Deep-Pheno.

  3. Emanuel Cortes, Plant Disease Classification Using Convolutional Networks and Generative Adversial Networks.

  4. I.Gogul, V.Sathiesh Kumar, Flower Species Recognition System using Convolutional Neural Networks and Transfer Learning, 2017 4th International Conference on Signal Processing, Communications and Networking (ICSCN -2017), March 16 18, 2017, Chennai, INDIA.

  5. S. Sankaran, A. Mishra, R. Ehsani, and C. Davis, A review of advanced techniques for detecting plant diseases, Computers and Electronics in Agriculture, vol. 72, no. 1, pp. 113, 2010.

  6. P. R. Reddy, S. N. Divya, and R. Vijayalakshmi, Plant disease detection techniquetoola theoretical approach, International Journal of Innovative Technology and Research, pp. 9193, 2015.

  7. A.-K. Mahlein, T. Rumpf, P. Welke et al., Development of spectral indices for detecting and identifying plant diseases, Remote Sensing of Environment, vol. 128, pp. 2130, 2013

  8. Dong Pixia and Wang Xiangdong, Recognition of Greenhouse Cucumber Disease Based on Image Processing Technology, Open Journal of Applied Sciences, vol. 3, pp. 27-3, Mar. 2013.

  9. S. Arivazhagan, R. Newlin Shebiah, S. Ananthi and S. Vishnu Varthini, Detection of unhealthy region of plant leaves and classification of plant leaf diseases using texture features, Commission Internationale du Genie Rural(CIGR) journal, vol. 15, no. 1, pp. 211-217, 2013.

  10. Sachin D. Khirade and A. B. Patil. Plant Disease Detection Using Image Processing. International Conference on Computing Communication Control and Automation (ICCUBEA), 2015 International Conference on, pp. 768-771. IEEE, 2015.

Leave a Reply