Pesticides and Diseases in Fruits

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)

IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

IoT- Deep Learning based Prediction of


Amount of Pesticides and Diseases in Fruits
D. Devi1 , Akshaya Anand2 , Dr. S.Sophia 3 , M. Karpagam4 , S. Maheswari 5
1,2,3,4
Department of Electronics and Communication Engineering,
5
Department of Electrical and Electronics Engineering,
1,2,3,4
Sri Krishna College of Engineering and Technology, Coimbatore
5
Kongu Engineering College, Perundurai
1 2
devi@skcet.ac.in, akshayaa1199@gmail.com

I. INTRODUCTION
Abstract— The use of pesticides, steroids and fertilizers
has tremendously increased the negative effects caused Pesticides play a major role in the production of fruits
to the people in terms of health. Harmful pesticides and vegetables. Mainly pesticides are used to flourish
enter into the human body through fruits and the growth of fruits, but there is a level of safe
vegetables, so an optimal solution is needed to recognize consumption of pesticides . There are many methods
the disease and the pesticides in the fruits the common by which the pesticides could be detected. A
man is consuming. Hardware and a software design are hardware and software simulation using IoT and
done to obtain an accurate and a real time output. In Deep Learning (Deep IoT) has been done in this
this paper, a prototype of the system is developed with paper to improve the efficiency and accuracy. An IoT
the use of four sensors, (temperature, gas, pH and (Internet of Things) [1] system mainly consists of
moisture), Arduino microcontroller and a Wi-Fi module sensors/devices that have to be connected to the
to get the information about the presence of pesticides. Cloud with the help of an internet connectivity. Once
The maximum level of pesticides that is accepted legally the data reaches the Cloud, the processing is done
to be consumed by animals and humans is given by and an alert is given to the required person.
MRL. If a fruit is detected to belong in a range above or
below the MRL then it is said to contain pesticides. The disease identification part of this proposed
Through IoT, the pesticide content and the values method is done with the help of the Deep Learning
obtained from each sensors are stored in the Cloud and Convolutional Neural Network algorithm is
server MATLAB ThikS peak. Coming to the software chosen to perform the Deep Learning. CNN
design, CNN and S VM algorithms are chosen and the algorithm (Convolutional Neural Network) is a deep
image of the fruit is diagnosed by them. Two algorithms learning algorithm that involves pre-processing the
are mainly used to compare the accuracy produced by input test image, use feature extraction by allowing
both and to select the most accurate between the two. the input image to go through a set of 8 layers.
Deep Learning process is performed on the image of the Contrast to CNN, SVM algorithm is also performed
fruit and the disease affected in the fruit is identified on the same input image. The SVM classifies the data
and later stored in the Cloud server. The information with the help of a kernel and here, Radial Basis
about the disease in fruits and the pesticide value in Function (RBF) is used. The sole reason behind the
fruits, the harmful effect caused by it, are sent to the use of SVM algorithm is to compare the accuracy and
cloud, which is then processed and sent to the complexity of the training process in obtaining the
application present in the consumer’s smart phone output. The accuracy of the output obtained from
which is developed in HTML5, thereby a real time both the algorithms are compared and the most
regular monitoring is possible. accurate data between the two is sent to the server.

Keywords— Pesticides, Fruits, Deep Learning, IoT, Here a basic application is developed in HTML5
which is used to access and display the information
CNN
regarding the disease and pesticides from the
MATLAB ThinkSpeak Cloud server.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 848

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 14:51:50 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

II. EXISTING METHODS of such pesticides depends on the range of pH value.


An application is created which displays the pesticide
The amount of pesticides plays a vital role in details, a standard consumable range of them, what
people’s health so its high time to think of the type of pesticide and what happens if one intakes
developing such an optimal solution. Reference [13] those beyond a certain quantity, the negative effects
proposed a method to test the level of pesticides in caused to humans because of this. Instead of using
fruits and vegetables by Gas Chromatography Mass high end sensors, here only with the help of a few
Spectrometry analysis which is more laborious, slow, basic sensors, the type and value of pesticides could
expensive and not readily accessible to everyone. be found. This calls for cost efficiency and easiness.
Through this method, a real time sharing of From the hardware design it is evident that the
information is not possible. Another paper focused on Arduino microcontroller is the heart of the entire
a method [14] with the help of an Arduino and process which controls all the sensors and Wi-Fi
electrochemical oxygen sensor. The pests present in module which later stores the information in the
the fruits and vegetables are detected. The system if MATLAB ThinkSpeak cloud storage. For the easy
exposed to oxygen very frequently, shorter will be access of this data about the pesticide and disease (if
the life time of the oxygen analyzer, which is again a present), an application is build using HTML5 and
huge disadvantage. For the same problem, a system is CSS so a real time viewing is possible.
developed [12] based on acetylcholinesterase (AChE)
biosensor and internet of things (IoT) for pesticide
residues detection and agricultural products
traceability. Reference [11] proposed an approach
that consists of the following three steps, in the first
step RGB to gray conversion, median filtering, edge
detection, and morphological operations are used for
the image segmentation. In the second step shape
approximation techniques are used for feature
extraction, histogram of chain code and density of
pixel widely used for feature extraction from the
segmented image, both feature extraction techniques
are compared and in the third steps images are Fig. 1 Proposed Hardware Design
classified classes. A major disadvantage of edge-
based algorithms is that they can result in noisy,
Arduino UNO
discontinuous edges that require complex post
The reason why Arduino is used is because only four
processing to generate closed boundaries.
sensors are being interfaced and it requires only less
III. PROPOSED SYSTEM than 20 IO pins. The controller senses the value from
the four sensors and calculates the average value of
the first four output values. This value is used to
Hardware Design:
evaluate whether the fruit contains the pesticide or
not.
The hardware system architecture consists of the IoT
part where the four different sensors (Gas, Moisture,
Gas Sensor (MQ135)
pH, Temperature) are used to sense the presence of
Gas sensor is used to sense the presence of
pesticides in the fruits that are available from the
atmospheric gases in and around it. When people
market. The sensed values are then sent to the micro
smell fruits they are exposed to certain amounts of
controller; here Arduino UNO is used as the
chemicals, though they might not be the pesticide
controller. Once the controller gets this data, it is sent
itself. The smell may vary when the fruit is ripe or
to MATLAB ThinkSpeak through the Wi-Fi module
rotten. This does not mean that there is pesticide in it.
ESP8266. A channel is created in ThinkSpeak to
Gas sensor sense for the particular chemicals those
which the controller updates the values through the
are usually present in the fruits.
module. After channel creation the pesticides are
detected by taking the average out of the values sent
Moisture Sensor (DHT11)
from the controller. Those pesticides that belong to a
Moisture sensor is used to detect the water content in
range of pH value of 6-20 are not considered safe for
the fruits. According to a public record, pesticides are
the humans to consume. The maximum residue limit
a main cause of reduced moisture in the fruits. When

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 849

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 14:51:50 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

pesticide content is more in fruits automatically the value and split it into two regions. SVM is based on
digital value of the moisture content reduces linearly. supervised learning, which learns from past input
The average transfer efficiency of pesticides is data and makes the future prediction as output.
approximately 75-80% when subjected to low levels
of moisture.

Temperature Sensor
Temperature is the most significant factor affecting
pesticide toxicity in fruits . To predict whether the
fruit is unhealthy to eat, it is enough to identify it by
measuring the temperature. If the pesticides are too
much, the amount of heat generated in fruits is way
above the certain level. This could easily be detected
by using a temperature sensor.

pH Sensor
Fig. 2 Design Methodology of Deep Learning
Here pH sensor plays a very important role in
determining whether or not the fruit contains the
pesticide. Also pH values are used to determine the SVM algorithm was used to predict the type of
disease affected in the fruit. Usually a fruit that has diseases affected in the fruit. The kernel used here is
been affected by a disease belongs to a pH value lies Radial Basis Function (RBF). Data can be of any
in the range of 6-20. So it is really easy to conclude dimensions ranging from 1D, 2D, 3D to infinite
the harmful and consumable fruits with the help of dimension. RBF is used to systematically find the
pH value. support vector classifier in infinite dimensions and
overlapping of data could be dealt with. Here soft
ESP8266 margin classifier is used to determine the location of
It is the main link in connecting the controller with threshold that helps in the splitting of data.
MATLAB ThinkSpeak Cloud server. It sends the
average value of the sensor output collected from the RBF Kernel is : ݁ ି ఊሺ௔ି ௕ ሻమ (1)
Arduino microcontroller to the cloud storage which is
later sent to the application. Where a, b are 2 dosage measurements and

SOFTWARE DESIGN ሺܽ െ ܾሻ ଶ ൌ ‫ܾ ݀݊ܽܽ ݊݁݁ݓݐܾ݁ ݁ܿ݊ܽݐݏ݅݀ ݀݁ݎܽݑݍݏ‬

A total of 200 classes consisting of different varieties ߛ ൌ ‫ݏݐ݊݅݋݌ʹ ݂݋ ݁ܿ݊݁ݑ݈݂݊݅ ݄݁ݐ ݏ݈݁ܽܿݏ‬
of fruits with the training set size of nearly 50000
images and test set size of nearly 70000 images with On expansion of (1) మ
݁ି ఊሺ௔ ି௕ሻ ൌ ݁ ିఊ ൫௔మ ା௕మ ିଶ௔௕൯ (2)
an image size of 224x224x3 pixels (per image) were
taken into account for performing the Deep Learning Assume ߛ ൌ ͳൗ
ʹ
process. The Design Methodology of the Deep
Learning is shown in the Figure 2. The input image to
Equation 2 becomes
be experimented is trained and tested through a pre-
processing step where it is compared with nearly
50000 images to identify if the input image is

൫௔ మା௕మ ൯ (3)
݁ିమ Ǥ ݁ ௔௕
affected by any disease. The feature learning is the
step where the CNN algorithm comes into picture Performing McLauren’s Expansion on ݁ ௔௕
with which the entire image set is considered and 8
layers of classification are performed to produce an ଵ ଵ ଵ
݁௔௕ ൌ ͳ ൅ ܾܽ ൅ ሺ ܾܽሻ ଶ ൅ ‫ ڮ‬ሺ ܾܽሻ ஶ (4)
accurate result. ଵ ଶǨ ஶ Ǩ Ǩ

In this software part of the proposed system, two Plugging back (4) into (3) and doing Dot product
main algorithms are used to get an accurate value of gives equation 5 as,
output. SVM (Support Vector Machine) is used here
mainly to separate the data based on the threshold

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 850

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 14:51:50 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

5. The four layers are used for learning some features


‫ۇ‬ ‫ۊ‬ from the images using feature extraction.
ቌ ͳǡ ඨ ͳ ܽǡ ඨ ͳ ܽଶ ǡ ǥ ඨ ͳ ܽஶ ቍ Ǥ ‫ͳۈ‬ǡ ඩ ͳ ܾǡ ඨ ͳ ܾଶ ǡ ǥ ඨ ͳ  ܾஶ ‫ۋ‬
ͳǨ ʹǨ λǨ ͳǨ ʹǨ λǨ 6. Initially, the convolution layer is used for
‫ۉ‬ ‫ی‬ convolving the every position of image with a
feature/filter.
ܶ௣ ܶ௣ 7. The test image of 224x224x3 pixels and the filters
ܲൌ ǡܴ ൌ
ܶ௣ ൅ ‫ܨ‬௣ ܶ௣ ൅ ‫ܨ‬ே are lined up. Every portion of test image is then
filtered out and its mapped later.
™Š‡”‡ൌ’”‡…‹•‹‘ǡൌ”‡…ƒŽŽǡ ’ ൌ…‘””‡…–†‡–‡…–‹‘ǡ  ’ൌ™”‘‰†‡–‡…–‹‘ǡ  ൌˆƒŽ•‡‡‰ƒ–‹˜‡•
8. The ReLU Layer (Rectified Linear Unit), also
called Activating function activates if the input
This proves that the kernel chosen in this proposed crosses a considered value of input threshold, and the
system, RBF kernel, supports the classification in output is considered to be Active HIGH, else the
infinite dimensions. output is zero.
9. ReLU layer step has been done to remove all the
Coming to the CNN algorithm, initially, a 224x224x3 negative layers and replace it with zeros. If this layer
sized image is taken into consideration. The total is not done, then the positive and negative values
number of weights in the first hidden layer is cancel each other, giving the output as zero.
1605632. Here CNN is preferred over the fully 10. In the Pooling Layer, a step-by-step reduction of
connected layers as one has to deal with a huge the size of the images is made basically reducing the
amount of parameters and large amounts of neurons size of the image into any size. In this proposed
are required, which may lead to over-fitting. The system 5 pooling layers are used, where at each layer
CNN algorithm is divided into many sub layers the size is reduced as 224x224x32, 128x128x64,
through which it compares the image. The classifier 64x64x128, 32x32x256, and 16x16x256.
used is GoogLeNet. GoogLeNet is a convolutional 11. To get a very accurate output, the output has to
neural network classifier having 22-23 deep layers. go through the above four layers several times.
GoogLeNet provides a precision of 96.2% of ResNet 12. The fully connected layer is where the actual
with R-FCN. The deep learning toolbox used in this classification begins. Finally, the filtered and
proposed system is supported only in the MATLAB shrinked images are put into one list. And this list
2019 version. There are many types of classifiers helps us find the percentage of pesticides present in
available like GoogLeNet, AlexaNet, etc, Here the fruit.
GoogLeNet is preferred as less than 5000 images are
tested. There are several layers in CNN. As Here a comparison of SVM and CNN algorithms has
GoogLeNet has been used, only 8 layers out of 144 been done. With the SVM algorithm, the diseases
layers are being considered. were detected correctly, but the affected percentage
of the fruit is not mentioned using SVM. When
To view the output a basic application is built using incorporated with a huge number of data sets, the
HTML5, where the information about the pesticides disease with the percentage value was observed. The
and disease is accessed from the Cloud server of only disadvantage of CNN over SVM is the training
MATLAB ThinkSpeak. A channel is created in the time it took. After obtaining the data, both these
server which is then routed to the application. Both algorithms are performed to compare the accuracy
the hardware and software output is displayed in the between the two with is later stored in the server
mobile application.
IV. PERFORMANCE METRICS
ALGORITHM :
The performance metrics are determined by the
1. Install the Deep Learning toolbox and MATLAB accuracy, precision, and recall. A single proposed
2019. system is experimented with different procedures to
2. Gather a large amount of data sets required for the compare the difference in accuracy caused by both
training and testing of images. the algorithms. Here, the better algorithm is identified
3. Design a network flow graph to train and test the based on some aspects like training time, accuracy,
features and model. disease identification and set up time. Comparing to
4. Here a transfer learning approach is done by fine the existing methods, the performance of the
tuning a predefined model, the GoogLeNet. hardware and software design are multifold.

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 851

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 14:51:50 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

T able.1. DISEASES AND T HE AFFECT ED FRUIT S

Diseases American Anthracnose Apple Apple Apple Banana Banana Black Rot Bitter Rot Brown Citrus
Brown Blotch Scab scar skin freckle Sigatoka Rot Canker
Rot viriod
Affected

Table 1 is a small table containing the most common diseases present in fruits. Similar to these images nearly 50000
training image sets and 20000 test image tests are being used to train and test the input image.

T ABLE.2.PARAMET ERS MEASURED USING IOT


Figure 3. Shows the application output, developed in
HTML5 captured from the smartphone to which the
DEVICE MRL AFFECT ED O/P data is sent at real time. The precision and recall
VALUES value for the detection of this pesticide is 0.78 and
T emperature sensor 20-39.7 33.3 0.86
Moisture Sensor 800-1023 390
Gas Sensor 200-530 95
pH Sensor 4-5.5 11.1

Table 2 shows the different parameters considered for


the measurement of pesticides in fruits. For this case,
3 out of 4 sensors has proved that the fruit contains
pesticides, hence it is concluded that the fruit is
affected.

T ABLE.3. PEST ICIDES IDENT IFIED USING IOT


pH RANGE PEST ICIDES Fig. 3 Mobile Application Output
6.0-6.9 Mancozeb, Phosalone, Endosulfan
7.0-7.9 Urea, Carbyl, Chlorothalonil
8.0-8.9 Imidian
9.0-9.9 Imidacloprid, Oxydemeton
10.0-20.0 Pendimethalin, Chlorpyrifos

Table 3 shows some of the common pesticides that


has a pH value ranging from 6-20. The pesticides
belonging to this range of pH values are most
commonly observed in fruits .

V. RESULT AND OUTPUT Fig. 4. CNN Output

For the experiment, a fruit was considered and the In figure 4. Given images are the examples of the
sensors were used to identify the pesticide content fruits that are affected by the diseases displayed
present in the selected fruit. The necessary details above the fruits. The affected selected fruits shows
about the disease, the harm caused by overdose of the similarity with four different diseases, out of which
same and the sensor output values were displayed in Black Rot being the most accurate as it produced an
the application. By comparing the SVM and CNN accuracy rate of 99.9%. Hence it is concluded that the
algorithms, IoT, SVM and CNN produced an selected fruit is affected with Black Rot disease.
accuracy rate of 90%, 85.6% and 89% respectively.
From the Deep Learning, the selected fruit is
VI. CONCLUSION
diagnosed to have been affected with Black Rot as
the fruit and the test image matches 99.9%.
This paper offers the most optimal solution removing
the layoffs in the existing solutions like cost,

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 852

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 14:51:50 UTC from IEEE Xplore. Restrictions apply.
Proceedings of the International Conference on Smart Electronics and Communication (ICOSEC 2020)
IEEE Xplore Part Number: CFP20V90-ART; ISBN: 978-1-7281-5461-9

accuracy, and complexity. In terms of efficiency both And Internet Of T hings” School of Agriculture and Food
the pesticide content and the identification of the Engineering, P.R. China.
[13] Mustapha F. A. Jallow, Dawood G. Awadh, Mohammed S.
disease is done in this paper while either of the Albaho, Vimala Y. Devi, and Nisar Ahmad”Monitoring Of
former or later is performed in the existing methods.. Pesticide Residue In Commonly Used Fruits And Vegetables In
The proposed system as a whole is simple, accurate Kuwait”Int J Environ Res Public Health. 2017 Aug; 14(8):833,
doi:10.3390/ijerph 14080833
and real time, making it the best solution among all [14] Kaviyashree.M, Nikitha.R, Vijayalakshmi.”IoT based solution
other existing ones. On experimenting, it was found for monitoring of pollution through pesticide in fresh fruits and
that CNN gave comparatively better results than vegetable available in market”.International Journal of Scientific &
SVM. The output of CNN had high accuracy, but the Engineering Research Volume 10, Issue 3, March-2019 760 ISSN
2229-5518
training and testing time it took was 6.5 minutes [15] Vijayakumar, T ., and Mr R. Vinothkanna. "Mellowness
more than SVM. Detection of Dragon Fruit Using Deep Learning Strategy." Journal
of Innovative Image Processing (JIIP) 2, no. 01 (2020): 35-43.
VII. REFERENCES

[1] Anna Gloria Sabatini, Gian Luigi Marcazzan, Simona


Benedetti , Saverio Mannino, “Electronic nose and neural network
use for the classification of honey”, INRA/DIB-AGIB/EDP
Sciences, 2004
[2] Eduard Llobet, Jesus Brezmes, Ma. Luisa Lopez Fructuoso ,
Xavier Vilanova, InmaculadaRecasens, Jorge Orts,GuillermoSaiz,
and Xavier Correig, “ Evaluation of an electronic nose to assess
fruit ripeness”. IEEE Sensor Journal, Vol. 5, No. 1, February, pp.
97-109, 2005
[3] Eri Ando, Takahiro Arakawa, Xin Wang, KumikoMiyajima,
Shuhei T akeuchi, Hiroyuki Kudo, Hirokazu Saito, Mitsuo
T akahashi, T omoyoMitani, and Kohji Mitsubayashi,
“Chemiluminescent visualization for evaluation of gaseous ethanol
distribution during pear maturation”,IEEE Sensor Journal ,
Volume 13, Issue 8, August 2013.
[4] Fauzan Khairi Che Harun, Andik MarwintanJumadi, Asrul
Humaimi Mahmood, “Carbon black polymer composite gas sensor
for electronic nose, International Journal of Scientific &
Engineering Research, ISSN 2229-5518 , Volume 2, Issue 11,
November 2011.
[5] Khan A. M, Syeda Erfana Zohora, A.K.Srivastava, Nisar
Hunde wale, “ Electronic Noses Application to Food Analysis
Using Metal Oxide Sensors: A Review”, International Journal of
Soft Computing and Engineering (IJSCE) ISSN: 2231 -2307,
Volume 3, Issue 5, November 2013.
[6] Kazimierz Brudzewski, Stanislaw Osowski, Senior Member,
IEEE, and Anna Dwulit “Recognition of Coffee Using Differential
Electronic Nose”, IEEE T ransactions On Instrumentation And
Measurement, Vol. 61, NO. 6, June 2012.
[7] M.J. Harren, Simona.M.Cristescu, JulienMandon, Denis
Arslanov, Je ro me De Pessemier, Christian Hermans and Frans,
“Current methods for detecting ethylene in plants”, Published by
Oxford University Press on behalf of the Annals of Botany
Company,2012.
[8] Shakya, Subarna. "Analysis of Artificial Intelligence based
Image Classification T echniques." Journal of Innovative Image
Processing (JIIP) 2, no. 01 (2020): 44-54.
[9] Wilson. D. and Manuela Baietto.” Electronic-Nose
Applications for Fruit Identification, Ripeness and Quality
Grading”, Sensors, 15,899-931; doi:10.3390/s150100899, ISSN
1424 8220, 2015.
[10] Seema ,A. Kumar ,G.S. Gill.”Automatic Fruit Grading and
Classification System Using Computer Vision: A Review”
doi:10.1109/ICACCE-2015.
[11] Swati Dewliya,Pratibha Singh ”Detection and classification
for apple fruit diseases using support vector machine and chain
code” International Research Journal of Engineering and
T echnology (IRJET ) e-ISSN: 2395-005
[12] Guo Zhao1, Yemin Guo1, Xia Sun, Xiangyou Wang.” A
System For Pesticide Residues Detection And Agricultural
Products T raceability Based On Acetylcholinesterase Biosensor

978-1-7281-5461-9/20/$31.00 ©2020 IEEE 853

Authorized licensed use limited to: Auckland University of Technology. Downloaded on October 11,2020 at 14:51:50 UTC from IEEE Xplore. Restrictions apply.

You might also like