Skip to main content

Leaf Disease Detection using ML and IOT

Page 1

8

V

http://doi.org/10.22214/ijraset.2020.5276

May 2020


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com

Leaf Disease Detection using ML and IOT Areeba Afaq1, Jibran Mukhtar2, Prof Vanishree K3 1, 2, 3

Department of Information Science and Engineering, RV College of Engineering, Bengaluru

Abstract: Agriculture is a major source of income for a very large population in India and a lot of people depend upon it both for livelihood and consumption of the produce obtained. Therefore, it is a very important sector. Diseases are a major threat to the crops. Diseases destroy the crop and thus reduce the yield and also the quality of the crops thereby decreasing the profits. The use of technology in the area of agriculture will reduce manual labor and increase the accuracy by decreasing the amount of error. The systems developed earlier have just been able to detect diseases of leaves, this system will use image processing and classifiers which include SVM, KNN and Random Forest to detect the diseases achieving an accuracies of up to 97% and then additionally a corresponding pesticide spray system based on Arduino UNO board, relay switches and pumps will spray pesticides according to the disease detected. Keywords: ML, IoT, Disease Detection, KNN, SVM, Random Forest. I. INTRODUCTION With India’s economy greatly depends upon its agricultural sector. A famer has a lot of pressure from sowing the seeds, monitoring the field and then selling the produce. Today’s farmer is caught up between debts he is not able to pay, the decrease in the quantity and quality of crop due to the various factors like quality of seeds, environmental factors like weather changes, droughts, floods, spread of diseases which are all variable add on to it. Previously farmers have been depending on traditional knowledge for identifying the diseases in their crops and that is often not very accurate and also a time consuming practice. A lot of technologies ranging from image processing to deep learning, MATLAB etc. with varying accuracy have been used in this field. Thus to detect the diseases accurately and to diagnose the plants a system which combines the power of image processing, machine learning and IOT is proposed. The usage of artificial intelligence in the field of agriculture will prove to be beneficial as it will reduce manual error and save time. The farmer can now draw conclusions backed up by precise and timely results driven by technologies which include image processing, machine learning, microcontrollers and an integrated development environment. The automation of the spraying of pesticides corresponding to the disease detected will improve accuracy bringing in profits and enhancing the yield. The plants will be monitored by using sensors and a real time analysis will be available on the cloud platform. The pumps will help to spray the pesticides and water based on the data from the sensors. Work has been carried out previously on the existing leaf disease detection models based on various technologies and algorithms used for classification and also on the bots for spraying of pesticide, pertaining to different types of crops. Different available tools and technologies have been considered and the best of the available tools and technologies are chosen to develop the project. In this paper [1], Intelligent autonomous Farming for plant disease detection using Image processing, a moving Agrobot is deployed on the farm premises to take the images of the leaves which are latter processed on the system, to be able to detect diseases from them. The images are transmitted using a RF wireless technology. A software called Matlab is used to find the plant disease after processing it and the signals are send back to the Agrobot on field to spray the pesticides.In this system [2], Design and development of Agrobot for pesticide Spraying using grading System, is based on a robot which is kept on the field to be monitored remotely. This reduces the manual work required to crop supervision. A camera mounted on the robot captures the images of the crop then it undergoes a lot of preprocessing which includes his conversion, noise removal, segmentation etc. Then the plant is diagnosed by spraying the pesticides after the disease is found by the robot. In the paper[3], Pesticide Spraying Agricultural Robot, an agricultural robot is made using an Arduino Uno board which has two motors connected to it for the movement of the robot. The images of chili plants are captured and subjected to feature extraction and segmentation and finally classified. This Arduino board controls the movement of the robot using a Bluetooth module and the spray of pesticides is based on the kind of disease the plant has by giving instructions from an application on the user’s cell phone. The whole process can also be live streamed using the Raspberry Pi. The camera used here is industrial and MATLAB is used for processing of the chili plant images. In the paper [4], Open CV based leaf disease identification of Mango Leaves, a system specifically developed for the Indian Mango plant. The image of the mango leaves is taken and processing techniques like histogram equalization and median filter, binarization and EFA are applied. Infected clusters of the mango leaf mages are chosen using K-means clustering based on

©IJRASET: All Rights are Reserved

1704


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com least difference. The leaf images are classified by the SVM algorithm using the open cv libraries of python and Matlab software. A comparison of the same is made with RGB images and HSI images. In paper [5], Automatic Detection and Classification of Plant Disease through Image Processing, uses feature extraction techniques like calculating a GCLM matrix to process tomato leaves. The paper is based on the usage a color space transformation of the images and then using the K-means clustering technique the images are segmented. A neural network takes in these extracted features to detect the disease. II. METHODOLOGY A. Pre-Processing Module Fig.1 below portrays a module describing the pre-processing module. First the image which has to be in a digital form and has to be classified is obtained through the camera. The image to be processed is read through the tools of the libraries and then it is resized. During image processing the RGB image is transformed into a grey scale image using python libraries. Then the image is also converted to HSV where in hue levels are of the range 0-179, saturation is 0-255, and value is also 0-255. The next step is image segmentation where in the tomato leaf image is divided so that it can be better understood. The mean shift algorithm is used to segment the image which falls under the clustering type of image segmentation. A feature space matrix is constructed whose dimensions are taken base on the different values taken. This algorithm uses the sliding window method for converging to the center of maximum dense area. The region with maximum density is converged by use of the method called sliding window. It the following are the steps to be followed: 1) Mean shift vector is initialized 2) Density estimation window is slid by M(x) 3) Mean shift vector is calculated after shift that is M(x). 4) Keep repeating till convergence of regions.

Fig.1 Flowchart depicting data flow for Pre-Processing Module In feature extraction reduces the data set and evaluates only those features which aid in results and processing both so as to save both resources and time. The shape descriptor used here is Hu Moments used to quantify and represent the shape of an object Harlick texture quantifies an image using its textures. Color histogram quantifies the RGB values of an image. All this is achieved using the libraries and functions of open cv. If the image processing is complete the processed while with the extracted features is saved for the next process of classification

ŠIJRASET: All Rights are Reserved

1705


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com B. Classification Process Module Fig.2 portrays a module describing how the classification of the tomato leaf images is done into four diseases namely Leaf curl, Fusarium Wilt, Grey Mildew and Bacterial Blight. The models selection is done through K-fold Cross validation technique which takes into account models like NaĂŻve Bayes, KNN, Random Forest, CART, Logistic Regression, Linear Discriminant Analysis and SVM with K=10. The data set which is processed is taken and divided into training and test data. The test data is kept aside and training data is fed to the classifier. Three classification models namely SVM, Random Forest and KNN which show better accuracies are used to train the model.One of the classifier used is SVM a supervised classifier which is fed with leaf images for classification into four types of tomato leaf diseases. Depending upon the type of disease data the leaf gets classified. The global features calculated from the tomato leaves are stored in the form of array and used by the classifiers. Random Forest Classifier is a classification algorithm which uses results from various sub decision trees and combines those to produce the result. K nearest neighbor algorithm is used to find the class label of a new data point based on the similarity of its features to a particular class which have been divided already. The value of k is important for accuracy. These are re- evaluated from time to time for any corrections. These are re- evaluated from time to time for any corrections. After an optimized model is build the model is tested with the test data. These three models which have the most accurate results are saved in the output folder and used for the prediction of diseases.

Fig.2 Flowchart depicting flow inside Classification Process

ŠIJRASET: All Rights are Reserved

1706


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com C. Spraying Process Module Fig.3 below portrays a module which helps in the actual spraying of the pesticides it includes software as well as hardware components. First all the ports and peripherals are started by switching on the power. The leaves for which the disease has to predict are captured through the camera and then subjected to processing after the processing is done, they are classified with the selected model for prediction of whether the leaf has any disease or is healthy. If the leaf has any of the four diseases namely Bacterial Blight, Grey Mildew, Fusarium Wilt and Leaf curl this data is send to the controller which is basically an Arduino UNO board. The pesticide spraying module is controlled using a microcontroller board called Arduino UNO. The six pins out of the 14 digital input/output pins are for pwm outputs, six analog inputs, 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. It is simply connected to the system with a USB cable. It can also be powered with a AC-to-DC adapter or battery to get started.

Fig.3 Flowchart depicting flow inside Spraying Process An integrated development environment is used to send programmable code to the controller board. Option Arduino Uno from the Tools > Board menu has to be selected (based on the microcontroller on your board). The ATmega328 on the Arduino Uno comes preprogrammed with a boot loader that provides for uploading code without the use of an external hardware programmer. Communications are based on the stk500 protocol. The UNOs digital pins can used for serial communication using the serial library. Once the controller receives the input from the PC and the sensors it sends signals to the valves and the pumps which have the pesticides and water in them to regulate their flow according to the corresponding disease detected.

ŠIJRASET: All Rights are Reserved

1707


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com III. RESULTS The work requires a system having Intel i5 or i7 core processor & 4GB or 8GB RAM compatible for importing sklearn models of Python 3.7, camera, arduino UNO, soil moisture Sensor, pesticide tank, relay switches and water controller (Pump). The major objectives of this paper are: A. B. C. D.

To classify diseases into four types Bacterial Blight, Fusarium Wilt, Grey Mildew and Leaf Curl. To compare different machine learning classification algorithms to obtain the most accurate model. To automatically spray pesticides corresponding to the disease detected. To monitor other essential sensor data significant to the crop growth.

Fig. 4 shows the results from the image processing module at different stages of the processing. The labels get encoded the three ones are the results from the three classifiers showing that the disease is Fusarium Wilt.

Fig.4 Stages of the processed tomato leaf image with Fusarium Wilt Features like color, shape and texture from the test images of a leaf were successfully extracted using feature extraction methods like Hu Moments, Harlick Texture features and color histogram. The system successfully used an Image Segmentation method called Mean Shift Clustering to detect the patches in the leaf. The classifying algorithm successfully classified the diseases using different classifiers that were trained from the labeled dataset. All the used classifiers used have an accuracy upwards 90%. The Random Forest Classifier achieves and accuracy of 97.9% followed by SVM with an accuracy of 96.5% and KNN with 96% as shown in Fig. 5. A GUI for the prediction is also developed for ease of use as shown in Fig. 6 and Fig. 7. The Arduino board was programmed by employing Arduino IDE using C programming language to signal a specific valve when a particular disease is detected.

ŠIJRASET: All Rights are Reserved

1708


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com The paper overcomes the shortcomings of the present existing system by fully automating the pesticide spray thus saving the farmer a lot of time and work. Further, the accuracies were greatly improved by comparison for accuracy first and then using three most accurate classification models for prediction of the leaf disease

Fig.5 Comparison of accuracies using K-fold cross validation. Although this system developed is an enhanced version of some of the present systems in use for recognizing and treating diseases, it definitely has some limitations. The dataset used has only four diseases and can detect diseases for tomato plants only. Another limitation is with respect to accuracy of the detection of disease. Though the accuracy is very good, as three algorithms are compared but machine learning models can never be hundred percent accurate and only are probable results are achieved. So, an improvement in accuracy can be acquired using different models or by usage of neural networks or by changing parameters such as training and testing size of data set, or even by using better image processing.

Fig.6 GUI for predicting the leaf disease.

ŠIJRASET: All Rights are Reserved

1709


International Journal for Research in Applied Science & Engineering Technology (IJRASET) ISSN: 2321-9653; IC Value: 45.98; SJ Impact Factor: 7.429 Volume 8 Issue V May 2020- Available at www.ijraset.com

Fig.7 GUI for predicting the leaf disease. IV. CONCLUSIONS The designed system is used to detect four types of leaf diseases namely Bacterial Blight, Leaf Curl Fusarium Wilt and Grey Mildew and spray the corresponding pesticides using an IOT and ML based technologies. The automated detection system was developed according to the design. This system collects data from the sensors to monitor the field condition such as soil moisture and sprays the required amount of water and pesticides on the tomato plants for improvement in yields. The system is designed using an advanced processor-based Laptop which is integrated with machine learning model. The machine learning model with image processing is trained with feature extraction, segmentation using Mean Shift Algorithm and classification of disease using SVM classifier. The information about the disease of the plant is passed to a controller called Arduino which in turn sprays the necessary pesticides to the plants based on disease detected in the tomato plant. The sensor data is valuable for monitoring the field and is send to the cloud for analytics. Since the exact name of the leaf disease is known and the data is monitored on the thingspeak platform it eliminates the need of extra labor to monitor the crops. The farmer now has more accurate results and thus by applying the pesticides in time can save them from being destroyed. The developed system will largely contribute to growth of agriculture sector, increasing profits for the farmer. However there is always scope for improvement and therefore a major future enhancement would be in regards to accuracy. The accuracy obtained in this project for varied data-set is noteworthy. Also, it leads to the fact that different leaf diseases can be effortlessly recognized using these classification algorithms. Therefore, for further research, the data set can invariably increase by adding multiple diseases and plants from all over the globe. The second future enhancement would be to move the proposed system to the production stage. The pesticide control system needs to be scaled to serve the actual users of this system which are farmers without any performance issues. The system needs to be scaled in order to be used by large number of farmers. A full-featured smart phone application can be prepared using the algorithm and pre-trained dataset. This application can be used by the farmers to detect the leaf diseases and spray corresponding pesticides. The module can thus be developed to suggest solutions in future to the diseases which are detected. V. ACKNOWLEDGEMENT We are indebted to our guide Prof Vanishree K., Assistant Professor, Dept. of ISE, R.V College of Engineering for the constant guidelines, suggestion and support throughout the span of the work of this paper. REFERENCES [1] [2] [3] [4] [5] [6]

D. A. Shaikh , GhoraleAkshay G , Chaudhari Prashant , Kale Parmeshwar L-Intelligent Autonomous Farming Robot with Plant Disease Detection using Image Processing, International Journal of Advanced Research in Computer and Communication Engineering Vol. 5, Issue 4, April 2016 Yu S. Lagad and S. Karmore, "Design and development of Agrobot for pesticide spraying using grading system," 2017 International conference of Electronics, Communication and Aerospace Technology (ICECA), Coimbatore, 2017, pp. 279-283. f Arjun Prakash R, Bharathi G B,Manasa V and Gayathri S India. Pesticide Spraying Agricultural Robot International Research Journal of Power and Engineering Vol.3(2),pp. 056-060, November, 2017) Jayaprakash Sethupathy 1, Veni S -OpenCV Based Disease Identification of Mango Leaves International Journal of Engineering and Technology (IJET) Vol 8 No 5 Oct-Nov 2016 Niket Amoda ,Bharat Jadhav, Smeeta Naikwadi -Detection and classification of plant diseases by image processing, International journal of engineering research and technology. G. A., Pa -Leaf Disease Detection and Classification Using Neural Networks V. Ramya, M. Anthuvan Lydia,International Journal of Advanced Research in Computer and Communication Engineering Vol. 5, Issue 11, November 2016.

ŠIJRASET: All Rights are Reserved

1710


Turn static files into dynamic content formats.

Create a flipbook