GitHub repository: srideepkar/A-Deep-Learning-Approach-for-Detection-and-Classification-of-Plant-Leaf-Disease
Primary language: Jupyter Notebook
Created: 2020-06-13T05:32:53Z
Description: Diseases in the leaves of plants are very crucial issue in this day and due to which yield of high-quality crops gets devasted, and the longevity of the plant hampers. And also, it is very difficult to understand the current condition of the leaf with the naked eye. Which results in the reduction of yield of high-quality crops. To overcome this problem, we planned to use machine learning based approach to segment, to select every small part of the leaf and detect the disease, also to analyse the quality. The main vision of the paper is to detect all possible diseases of the leaves of the plant by applying Neural Network for classify the disease based on the colour changes in comparison to the analytical available data set, providing the best fit output. In this proposed work, Apple plant leaf dataset used which contain 1910 images of healthy and unhealthy leaves. These leaves are pre-processed first through some steps. In this pre-processing convert the RGB image with the help of BGR2GRAY function available on open cv library then GaussianBlur function is used to remove the additional noises and smoothing of the edges of the leaves which helped to detect the main object or leaf more accurately from the image in future. After smoothing threshold function is applied for removing the unnecessary background from the image especially thresh_torezo_inv from cv2 library used for this work it helped to convert the unnecessary background into a single colour and focus on the main object i.e. leaf. After thresholding Erode and Dilate functions are applied for more cleaner image. Then with the help of FindContours() function from cv2 library helped to find four extreme points of the desired object i.e. leaf and crop the image according to the extreme points. Then the images are resized into 240, 240px size, it is necessary all the images are in same size for the best result output. Then each image is transformed to an n-dimensional array and appended into a list.  After this pre-processing the data set is splitted into 3 different parts, i.e. training, validation and testing. 1337 images are used for training i.e. training part contains 1337 images, 287 images are used for validation and 286 images are used for testing. After splitting the dataset, the main convolutional neural network model is constructed. In the convolutional neural network model one input layer used and two hidden layers used and one out put layer used. In the hidden layer 32 nodes each are used with normal weight initialization and ReLu function for Activation. And in the output layer 1 node is used and sigmoid function for activation. On the compilation of the model stochastic gradient descent used for optimizing with a learning rate 0.05 and loss being calculated using categorical_crossentropy. After compilation of the model it is fitted into the training dataset with batch size of 32 and 10 epochs.