Plant Disease Detection using Convolutional Neural Network

The global rise in population has led to a shortage of raw materials and food supplies. The agricultural sector has become the primary and most vital source to overcome this particular constraint. However, the industry itself is facing the challenge of pests and various crop diseases. Battling this has been the significant focus of the sector for decades. Still, due to the technology gap that existed earlier, there existed a constraint on identifying the diseased crops on a massive scale. Nevertheless, today, with the improvement of technologies such as drones, IoT devices, and higher processing speeds combined with data analysis and machine learning, the problem of identification can be resolved quickly. This paper aims to provide a brief description of existing solutions that have been published and focuses on the more efficient machine learning model based on conventional neural networks (CNN) that we have developed. This machine learning model can be deployed on IoT devices, mobile phones, and drones and cameras that farmers can utilize to identify the diseased crops on a massive scale and take the necessary precautions not to let the disease spread and affect the supply produced. The proposed model using CNN was trained using images from plant village dataset and attained an accuracy of 94.87% in identifying the diseased plants with the help of image processing by OpenCV. Finally, the paper showcases the detailed analysis of the proposed scheme and results obtained by the model.

When plants and crops are suffering from pests it affects the agricultural production of the country.Usually, farmers or experts observe the plants with eye for detection and identification of disease.But this method is often time processing, expensive and inaccurate.Automatic detection using image processing techniques provide fast and accurate results.This paper cares with a replacement approach to the development of disease recognition model, supported leaf image classification, by the utilization of deep convolutional networks.Advances in computer vision present a chance to expand and enhance the practice of precise plant protection and extend the market of computer vision applications within the field of precision agriculture.a completely unique way of training and therefore the methodology used facilitate a fast and straightforward system implementation in practice.All essential steps required for implementing this disease recognition model are fully described throughout the paper, starting from gathering images to make a database, assessed by agricultural experts, a deep learning framework to perform the deep CNN training.This method paper may be a new approach in detecting plant diseases using the deep convolutional neural network trained and finetuned to suit accurately to the database of a plant's leaves that was gathered independently for diverse plant diseases.The advance and novelty of the developed model dwell its simplicity; healthy leaves and background images are in line with other classes, enabling the model to distinguish between diseased leaves and healthy ones or from the environment by using CNN.Plants are the source of food on earth.Infections and diseases in plants are therefore a big threat, while the foremost common diagnosis is primarily performed by examining the plant body for the presence of visual symptoms [1].As an alternative to the traditionally timeconsuming process, different research works plan to find feasible approaches towards protecting plants.In recent years, growth in technology has engendered several alternatives to traditional arduous methods [2].Deep learning techniques are very successful in image classification problems.

Introduction: -
The problem of efficient disease protection is closely associated with the problems of sustainable agriculture Inexperienced pesticide usage can cause the event of long-term resistance of the pathogens, severely reducing the power to fight back.Timely and accurate diagnosis of plant diseases is one among the pillars of precision agriculture.It is crucial to stop unnecessary waste of monetary and other resources, thus achieving healthier production during this changing environment, appropriate and timely disease identification including early prevention has never been more important.There are several ways to detect plant pathologies.Some diseases do not have any visible symptoms, or the effect becomes noticeable too late to act, and in those situations, a classy analysis is obligatory.However, most diseases generate some quite manifestation within the visible spectrum, therefore the eye examination of a trained professional is that the prime technique adopted in practice for disease detection.To achieve accurate disease diagnostics a plant pathologist should possess good observation skills in order that one can identify characteristic symptoms.Variations in symptoms indicated by diseased plants may lead to an unsuitable diagnosis since unprofessional gardeners and hobbyists could have more difficulties determining it than knowledgeable plant pathologist.an automatic system designed to assist identify plant diseases by the plant's appearance and visual symptoms might be of great help to amateurs within the gardening process and trained professionals as a confirmation system in disease diagnostics [3].Advances in computer vision present a chance to expand and enhance the practice of detailed plant safety and extend the market of computer vision applications within the field of precision agriculture [4].Exploiting common digital image processing techniques like color analysis and thresholding were used with the aim of detection and classification of plant diseases.In machine learning and science, ANN [5] is an informationprocessing paradigm that was inspired by the way biological nervous systems, like the brain, process information.Neural networks or connectionist systems are a computational approach used in computing and other research disciplines, which is predicated on a large collection of neural units (artificial neurons), loosely mimicking the way a biological brain solves problems with large clusters of biological neurons connected by axons.Each neural unit relates to many others, and links are often enforcing or inhibitory in their effect on the activation state of connected neural units.Each individual neural unit may have a summation function which mixes the values of all its inputs together.There could also be a function or limiting function on each connection and on the unit itself, such the signal must surpass the limit before propagating to other neurons.These systems are self-learning and trained, instead of explicitly programmed, and excel in areas where the answer or feature detection is difficult to express during a traditional computer virus.Neural networks typically consist of multiple layers or a cube design, and therefore the signal path traverses from front to back.Back propagation is that the use of forward stimulation to reset weights on the "front" neural units and this is often sometimes wiped-out combination with training where the right result's known.More modern networks are a touch freer flowing in terms of stimulation and inhibition with connections interacting during a far more chaotic and sophisticated fashion.Dynamic neural networks are the foremost advanced, therein they dynamically can, supported rules, form new connections and even new neural units while disabling others.The goal of the neural network is to unravel problems within the same way that the human brain would, although several neural networks are more abstract.Modern neural network projects typically work with a couple of thousand to a couple of million neural units and many connections, which are still several orders of magnitude less complex than the human brain and closer to the computing power of a worm.New brain research often stimulates new patterns in neural networks.One new approach is using connections which span much further and link processing layers rather than always being localized to adjacent neurons.Other research being explored with the various sorts of signal over time that axons propagate, like Deep Learning, interpolates greater complexity than a set of Boolean variables being simply on or off.Their inputs also a take on any value between 0 and 1.Also, the neuron has weights for each input and an overall bias.The weights are real numbers expressing importance of the respective inputs to the output.The bias is used for controlling how easy the neuron is going to output 1.For a neuron with big bias, it is easy to output 1, but when the bias is very negative then it is difficult to output 1.

Materials And Methods:-Dataset:
The Dataset was taken from Kaggle of Plant Village dataset existing online as such the code was also inscribed on the online kernel of Kaggle for well computation and study of training loss and validation.

Image Preprocessing and Labelling:
Pre-processing pictures generally includes eliminating low-recurrence foundation commotion, normalizing the power of the individual particles' pictures, eliminating reflections, and veiling segments of pictures.Picture pre-processing is the strategy of improving information Furthermore, the strategy of picture pre-processing included editing of the 693 apparent multitude of pictures physically, making the square around the leaves, to feature the district of intrigue (plant leaves).During the period of gathering the pictures for the dataset, pictures with a more modest goal and measurement not exactly 500 pixels were not considered as substantial pictures for the dataset.In expansion, just the pictures where the locale of intrigue was in higher the goal was set apart as a qualified possibility for the dataset.In that manner, it was guaranteed that pictures contain all the required data for highlight learning.Numerous assets can be found via looking over the Internet, in any case, their significance is frequently problematic.Considering a legitimate concern for affirming the exactness of classes in the dataset, at first assembled by a catchphrases search, horticultural specialists inspected leaf pictures and marked all the pictures with fitting infection abbreviations.As it is known, it is significant to utilize precisely characterized pictures for the preparation and approval dataset.Just in that manner may a fitting and solid identifying model be created.In this stage, copied pictures that were left after the underlying the emphasis of get-together and gathering pictures into classes were eliminated from the dataset.
Neural Network Training :-Preparing the profound convolutional neural organization for taking a picture grouping model from a dataset was proposed.Tensor Flow is an open-source programming library for mathematical calculation utilizing information stream diagrams.Hubs in the diagram speak to numerical tasks, while the diagram edges speak to the multidimensional information exhibits (tensors) imparted between them.The adaptable engineering permits you to convey calculation to at least one CPUs or GPUs in a work area, worker, or on the other hand cell phone with a solitary API.Tensor Flow was initially created by scientists and designers dealing with the Google Brain Group inside Google's Machine Intelligence research association for the motivations behind directing AI and profound neural organizations research, yet the framework is sufficiently general to be material in a wide assortment of different spaces also.In AI, a convolutional neural organization is a sort of feed-forward fake neural organization in which the network design between its neurons is roused by the association of the creature visual cortex.Individual cortical neurons react to improvements in a limited district of room known as the responsive field.The responsive fields of various neurons incompletely cover with the end goal that they tile the visual field.The reaction of an individual neuron to boosts inside its open field can be approximated numerically by a convolution activity.Convolutional networks were propelled by natural cycles and are varieties of multilayer perceptron intended to utilize negligible measures of pre-handling.They have wide applications in picture and video acknowledgment, recommender frameworks and regular language preparing.Convolutional neural organizations (CNNs) comprise of various layers of responsive fields.These are little neuron assortments which cycle parts of the info picture.The yields of these assortments are then tiled so their info districts cover, to get a higher-goal portrayal of the first picture; this is rehashed for each such layer.Tiling permits CNNs to endure interpretation of the information picture.Convolutional organizations may incorporate neighborhood or worldwide pooling layers, which consolidate the yields of neuron bunches.They too comprise of different mixes of convolutional and completely associated layers, with point savvy nonlinearity applied toward the finish of or after each layer.A convolution procedure on little locales of info is acquainted with lessen the quantity of free boundaries and improve speculation.One significant bit of leeway of convolutional networks is the utilization of shared weight in convolutional layers, which implies that a similar channel (loads bank) is utilized for every pixel in the layer; this both lessens memory impression furthermore, improves execution.The layer's boundaries are involved a set of learnable portions which have a little open field yet stretch out through the full profundity of the info volume.Amended Linear Units (Re LU) are utilized an alternative for soaking nonlinearities.This initiation work adaptively learns the boundaries of rectifiers and improves precision at unimportant extra computational expense.In the unique situation of fake neural organizations, the rectifier is an enactment work characterized as:f(x)=max (0, x) where x is the contribution to a neuron.This is otherwise called an incline work what is more, is like half-wave correction in electrical designing.This enactment work was first acquainted with a dynamical organization by Hahn failure et al. in a 2000 paper in Nature with solid organic inspirations what is more, numerical avocations.It has been utilized in convolutional networks more successfully than the generally utilized strategic sigmoid (which is roused by likelihood hypothesis; see strategic relapse) and its more down to earth partner, the exaggerated digression.The rectifier is, starting at 2015, the most famous actuation work for profound neural organizations.Profound CNN with ReLU's trains a few times quicker.This technique is applied to the yield of each convolutional and completely associated layer.Despite the yield, the information standardization is not needed; it is applied after ReLU nonlinearity after the first and second convolutional layer since it lessens top-1 and top-5 mistake rates.In CNN, neurons inside a covered-up layer are fragmented into "include maps."The neurons inside an element map share a similar weight and inclination.The neurons inside the component map look for a similar component.These neurons are exceptional since they are associated with various neurons in the lower layer.So, for the first concealed layer, neurons inside an 694 element guide will be associated with various districts of the info picture.The shrouded layer is portioned into highlight maps where every neuron in an element map searches for a similar component in any case, at various places of the information picture.Essentially, the component map is the aftereffect of applying convolution over a picture.The convolutional layer is the center structure square of a CNN [6].The layer's boundaries comprise of a lot of learnable channels (or pieces), which have a little open field, yet reach out through the full profundity of the information volume.During the forward pass, each channel is convolved over the width and tallness of the input volume, registering the speck item between the sections of the channel also, the info and creating a 2-dimensional actuation guide of that channel.Therefore, the organization learns channels that initiate when it recognizes some sort of highlight at some spatial situation in the info.Stacking the actuation maps for all channels along the profundity measurement structures the full yield volume of the convolution layer.Three hyper parameters control the size of the output volume of the convolutional layer [7]: the depth, stride, and zero-padding.

Depth:
Depth of the yield volume controls the quantity of neurons in the layer that interface with a similar district of the information volume.These neurons will figure out how to initiate for various highlights in the information.For model, if the primary Convolutional Layer accepts the crude picture as info, at that point various neurons along the profundity measurement may initiate in the presence of different arranged edges, or masses of shading.

Stride:
It controls how depth columns around the spatial dimensions (width and height) are allocated.When the stride is 1, a new depth column of neurons is allocated to spatial positions only 1 spatial unit apart.This leads to heavily overlapping receptive fields between the columns, and to large output volumes [8].Conversely, if higher strides are used then the receptive fields will overlap less and the resulting output volume will have smaller dimensions spatially.

Zero Padding:
Zero padding happens as we include a border of pixels each with value zero across the boundaries of the input pictures.This adds sort of a padding of zeros across the outside of the picture, hence the name zero padding.

System Architecture:
System Architecture Diagram: To diagnose the reason for the symptom by using an automatic tool, therefore the image processing system is proposed to develop to automate the identification and classification of the leaf batches into specific disorders.As shown within the figure above the system consists of three main blocks: Image Analyzer, Feature Database and Classifier resp.[9].The processing proposed to try to by these blocks is split into two phases as follows offline Phase: an outsized set of defected images are processed by a picture analyzer for extracting abnormal features.

Flow Chart:
The input test image is developed and pre-processed in the following phase and then it is transformed into array form for difference.The chosen database is appropriately separated and pre-processed and then retitled into suitable folders.The model is well trained using CNN and then classification takes position.The evaluation of the test image and the trained model take position tracked by the display of the result.If there is a flaw or infection in the plant the package displays the disease along with the remedy.

Use Case Diagram:
When we provide a new input image first the module extracts the leaf features.Then it goes through the CNN model.It then compares the features with already trained dataset.Then it goes through dense CNN and therefore the leaf features are extracted separately.Then the module will predict whether the plant leaf is affected by any disease or not.It shows the output from one among the38 classes which are predetermined and trained.Then the output is going to be during a textual format.

Flatten:
In between the convolutional layer and therefore the fully connected layer, there is a 'Flatten' layer.Flattening transforms a two-dimensional matrix of features into a vector which will be fed into a totally connected neural network classifier.

Image Data Generator:
Image Data Generator quickly found out Python generators which will automatically turn image files on disk into batches of preprocessed tensors.

Training Process:
Effective training begins well before a trainer delivers a private training session and continues then training session is complete.Training are often viewed as a process comprised of 5 related stages or activities: assessment, motivation, design, delivery, and evaluation.

Epochs:
An epoch may be a term utilized in machine learning and indicates the amount of passes of the whole training dataset the machine learning algorithm has completed.Datasets are usually grouped into batches (especially when the quantity of knowledge is extremely large).

Validation Process:
Validation is mentioned because the process where a trained model is evaluated with a testing data set.The testing data set may be a separate portion of an equivalent data set from which the training set springs .the most purpose of using the testing data set is to check the generalization ability of a trained model.

Training and Testing Model:
The dataset is preprocessed like Image reshaping, resizing and conversion to an array form.Similar processing is additionally done on the test image.A dataset consisting of about 38 different plant leaf diseases is obtained, out of which any image is often used as a test image for the software.
The train dataset is employed to coach the model (CNN) so that it can identify the test image and therefore the disease it is CNN has different layers that are Dense, Dropout, Activation, Flatten, Convolution2D, and maxpooling2d.After the model is trained successfully, the software can identify the disease if the plant species is contained within the dataset.After successful training and preprocessing, comparison of the test image and trained model takes place to predict the disease.

Experimental Result and Conclusion: -
As it is known that convolutional networks are ready to learn features when trained on larger datasets, results achieved when trained with only original images will not be explored.After fine-tuning the parameters of the network, an overall accuracy of 88% was achieved.Furthermore, the trained model was tested on each class individually.Test was performed on every image from the validation set.As suggested by good practice principles, achieved results should be compared with some other results.additionally, there are still no commercial solutions on the market, except those handling plant species recognition based on the leaf's images.during this paper, an approach of using deep learning method was explored to automatically classify and detect plant diseases from leaf images.the entire procedure was described, respectively, from collecting the pictures used for training and validation to image pre-processing and augmentation and eventually the procedure of coaching the deep CNN and fine-tuning.Different tests were performed to see the performance of newly created model.As the presented method has not been exploited, as far as we all know, in the field of disease recognition, there was no comparison with related results, using the precise technique.Here the test picture we have provided is tomato leaf with Septoria leaf spot.
The output is tomato_septoria_leaf_spot.

Future Work:
Agricultural department wants to automate the detecting the yield crops from eligibility process (real time).To automate this process by show the prediction end in web application or desktop application.To optimize the work to implement in AI environment.The proposed system is based on python and provides an accuracy of around 88%.The accuracy and therefore the speed are often increased by use of Googles GPU for processing.The system is often installed on Drones in order that aerial surveillances of crop fields are often done.
The normalization class comprises raw images and it is fed to the CNN model which comprises dense and weight.The CNN model categorizes and identifies by using the training model.The training model class contains the image dataset.Leaf recognition becomes utilized of the features.