Acquisition/Extraction of Image
Acquisition of images is the step in which the image of the leaf is taken as input. The image can be captured using any camera device with focus on the leaf of the plant. While getting the image, the person should make sure that the leaf and its features are clearly visible in the image.
It is preferable that the farmer should take a multiple image of the same leaf, so that they can verify the outcome by uploading the same picture of the leaf with different angles.
Once, the acquisition of the image can be uploaded into the system.
The aim of preprocessing is to enhance image information that removes unwanted distortions and improves some essential image features for further processing. Preprocessing is the second step of leaf disease detection. It is made sure that the image captured is clear for feature extraction.
The preprocessing of the image could also be done on the existing dataset to artificially expand the size of a training dataset by creating modified versions of images in the dataset. The Keras deep learning neural network library provides the capability to fit models using image data augmentation via the ImageDataGenerator class.
The ImageDataGenerator class provides different functionalities such as horizontal and vertical shift, horizontal and vertical flip, random rotation, random brightness and random zoom.
This is possibly the most integral module of the system. In the feature extraction, features are extracted that can be used to determine the meaning of a given sample. This step is done with the help of Convolution Neural Network (CNN). Features such as yellow spots, rust, black dots which are an anomaly on the leaf can be found out by CNN.
When an image is uploaded and fed into the model, it is converted into a pixelated matrix which denotes its RGB numerical value of each pixel. In our case, the image would be converted into a 227X227 matrix.
The key feature of any Convolution Neural Network are its filters. The filter in CNN is a randomly generated set of multipliers which target the individual pixel values of the image. They selected each individual pixel and multiply themselves with the corresponding values of pixels. This step is done with every pixel in the image except the bordering pixels since they do not have a perfect set of neighboring pixels.
The outcome of the above operation generates a matrix which is has its total dimension reduced from the original since we did not consider the bordering pixels, for e.g. and the image with (227X227) when multiplied 96 filters with will be reduced to (55X55) pixels.
After the above step is carried out, the newly generated matrix goes through the process of MaxPooling2D in which the output matrix is divided into groups in accordance to the pool_size parameter. The maximum pixel value of each such group is selected and a new matrix is formed. This newly generated matrix is an enhanced version of the original image and would highlight the features clearly.
When the model is in the training process, on every epoch it would generate a new set of randomly generated filtered, and then it would make a prediction, if it turns out to be wrong the model will change the filter values, this process is repeated in favorably to the accuracy i.e. the model would repeat this until it achieves a higher accuracy.
Once the model is completed trained it then optimizes this filters to use them on the uploaded image once it has to make a new prediction.
In this step, the extracted features from the previous module are compared with the diseases present in the model. The model has a dictionary of trained images of leafs along with their respective labels. The model using the information acquired during the process of training which can be used to make a prediction.
Once the features are compared with the learned information, the model used those features to make a prediction accordingly. The model then makes a prediction in accordance to the label assigned to it while the training process was carried out. This label can then be reassigned to the original name of the outcome.
In the last step, the final output which is the detected disease is displayed. The whole process is quick and therefore would save a lot of time. Upon knowing the disease, the farmer can quickly act on the remedies to cure the infected leaf and therefore preventing the further spread of the disease.