An AIoT Based Smart Agricultural System For Pests
An AIoT Based Smart Agricultural System For Pests
Received August 12, 2020, accepted August 25, 2020, date of publication September 18, 2020, date of current version October 13, 2020.
Digital Object Identifier 10.1109/ACCESS.2020.3024891
ABSTRACT In this study, artificial intelligence and image recognition technologies are combined with
environmental sensors and the Internet of Things (IoT) for pest identification. Real-time agricultural
meteorology and pest identification systems on mobile applications are evaluated based on intelligent pest
identification and environmental IoT data. We combined the current mature AIoT technology and deep
learning and applied it to smart agriculture. We used deep learning YOLOv3 for image recognition to obtain
the location of Tessaratoma papillosa and analyze the environmental information from weather stations
through Long Short-Term Memory (LSTM) to predict the occurrence of pests. The experimental results
showed that the pest identification accuracy reached 90%. Precise positioning can effectively reduce the
amount of pesticides used and reduce pesticide damage to the soil. The current research provides the location
of the pest and the extent of the pests to farmers can accurately use pesticide application at a precise time and
place and thus reduce the agricultural workforce required for timely pest control, thus achieving the goal of
smart agriculture. The proposed system notifies farmers of the presence of different pests before they start
multiplying in large numbers. It improves overall agricultural economic value by providing appropriate pest
control methods that decrease crop losses and reduce the environmental damage caused by the excessive
usage of pesticides.
INDEX TERMS Deep learning, YOLOv3, pests and diseases, smart agriculture, unmanned aerial vehicle
(UAV), artificial intelligence (AI), Internet of Things (IoT), the artificial Intelligence of Things (AIoT).
This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/
180750 VOLUME 8, 2020
C.-J. Chen et al.: AIoT Based Smart Agricultural System for Pests Detection
In recent years, image recognition technology has been In summary, supervised learning adds artificial labels to
used to assist with pest recognition for the purpose of control- the input data and uses regression analysis methods to obtain
ling agricultural pest damage and increasing crop production. the predicted results. Unsupervised learning finds suitable
Mary Gladence et al. [3] proposed the use of human-robot patterns from a large amount of data through algorithms and
interaction in the field of artificial intelligence and provided classifies the data automatically.
a reference for pest identification through a combination of
environmental factor information and deep learning to help B. DEEP LEARNING TO IDENTIFY AND CLASSIFY PEST
farmers analyze crop growth trends and prevent pest damage IMAGES
early Deep learning is based on the machine learning framework,
so the training process first involves unsupervised learning
II. RELATED WORKS and clusters the training data set to learn what sort of data
Martin and Moisan [4] established an automated system for will be classified. Supervised learning is then performed to
pest identification. In their system, the camera is placed above label the expected output value of each entry with the feature
a sticky insect trap and automatically captures images of vectors in the training data set given as input and the expected
pests collected by the insect trap each day. The Single Seed classification given as the output. Finally, the loss function is
Descent (SSD) method was used to identify and analyze used to calculate the standard deviation between the expected
the pests in the images. The collected data has been used output and the actual output.
to develop appropriate pest control methods based on the There are two common approaches in deep learning for
identified pest species. Once the SSD model has been trained, pest identification and classification:
the pests identification accuracy reaches 84%, and the pest
1) Miranda et al. [6] used the VGG19 method for image
species classification accuracy reaches 86%.
feature extraction and recognition in the detection
Wang et al. [5] set up a large number of environmental
of 24 types of pests from crop images.
sensors in an apple orchard for the purpose of recording
2) The authors in [7] detected and classified 12 different
the status of the orchard. The YOLOv3 model was used to
pests using several CNN approaches and compared the
identify anthrax on the surface of the apples and analyze the
classification results with machine learning methods
health of the apples. The authors also used the YOLOv3-
such as SVM and Fisher. The classification accuracy
Dense model, which is more suitable for identifying apple
of the machine learning method was 80%, and the
anthracnose.
classification accuracy rate of the CNN method was
In the above work, the YOLOv3 and YOLOv3-Dense mod-
95%.
els were both used to identify apple anthracnose, and the SSD
was successfully used to identify pests.
C. USING IMAGE AUGMENTATION TO INCREASE THE
PESTS TRAINING SAMPLE DATABASE
A. MACHINE LEARNING TO IDENTIFY AND CLASSIFY
PEST IMAGES
Data augmentation methods can be roughly divided into
Geometric Transformation and Photometric Transformation
With the advancement of science and technology, the amount
methods. Ding and Taylor [8] studied the impact of different
of image data is increasing, along with the time required to
data augmentation methods on image recognition rate. Three
classify the image data. Therefore, scholars are studying how
geometric transformations (flipping, rotating, and cropping)
to use machine learning to recognize and classify images.
and three luminosity transformations (color jittering, edge
Machine learning is divided into supervised learning and
enhancement, and fancy principal component analysis). The
unsupervised learning, the main difference being whether or
amplified image samples and the original image samples are
not the machine is able to automatically extract features from
used as training data for training on the CNN model. The
the data structure.
experimental results showed that each amplification method
improves the accuracy of CNN, where the impact of cropping
1) SUPERVISED LEARNING is the most obvious. Therefore, the authors speculate that the
During the machine training process, it is necessary to training samples generated by the cropping method will avoid
provide machines with labeled data. For example, after a the over-fitting of data and improve CNN performance.
machine has seen 1,000 labeled images of apples and oranges, In addition to augmenting the images by geometric and
we can give a test image and asked whether the image con- photometric transformations, it is also possible to transform
tains apples or oranges. the image style through the CycleGAN [9] or transfer the
features of objects to other objects to increase the number
2) UNSUPERVISED LEARNING of training samples. The aforementioned apple anthracnose
There is no need to label the data in advance, and the machine identification research uses the CycleGAN [9] to increase
does not know whether or not the result of its classification the number of training samples and improve the accuracy
is correct during learning. The machine must find the rules of image recognition. Perez and Wang’s research (supple-
from all of the input examples in order to classify on its own. mentary source of literature) have also found that geometric
with the data provided by the user, where the time series
data set is based on the daily maximum temperature, daily
minimum temperature, daily maximum humidity, daily min-
imum humidity, and the number of pests caught per day.
The prediction model used in the network-based decision
support program is built on a mixed regression model, which
is referred to as the Vector Autoregression Moving-Average
with Exogenous Regressors (VARMAX) model with endoge-
nous and exogenous variables. The prediction results are
location-specific and can be used to determine the future risk
level. They can provide recommendations for pest prevention
and control so that farmers and pest managers can take pre-
ventative measures to avoid crop damage due to pests. These
functions can be used to implement the main components of
FIGURE 4. The mathematical representation of LSTM.
the IPM program, including the inspection, identification, and
control of pests in the orchard.
value, and multiplies the probability of the forget gate to
decide whether or not to forget the previously recorded value
F. DEEP LEARNING FOR DATA ANALYSIS
[c’ = g(z)f (zi ) + cf (zf )].
The LSTM (long short-term memory) model is currently
The value of ct−1 is a vector stored in the LSTM memory,
the most commonly used model in RNNs (Recurrent Neural
where the vector input at time t is zt . zt is multiplied by a
Networks) [17]. The flow chart of this model is shown in Fig.
linear conversion function to obtain g(zt ) as an input. zt is
3, which is composed of four main components: the input
multiplied by another linear conversion function to obtain
gate, the output gate, the memory cell, and the forget gate.
I (zt ) to control the input gate. zt is multiplied by another
1) Input Gate: When a feature is given as an input, the linear conversion function to obtain F(zt ) to control the forget
input gate controls whether or not to input the value in gate, and zt is multiplied by a linear conversion to get O(zt )
this iteration. to control the output gate. The LSTM flowchart is shown in
2) Memory Cell: Stores the calculated value to be used in Fig. 5.
the next stage. The value of g(zt ) is multiplied by the value of I (zt ) after
3) Output Gate: Controls whether or not to output the the Sigmoid function. The result is added to the product
estimated value in this iteration. of F(zt ) after the Sigmoid function and ct−1 and stored in
4) Forget Gate: Controls whether or not to clear the mem- the LSTM. The value of O(zt ) after the Sigmoid function
ory, similar to a restart. is multiplied by the stored value to obtain the output value
The mathematical structure of the LSTM model is shown at . The same steps are followed to calculate the value to be
in Fig. 4. The input is represented as g(z), and the input gate stored in the LSTM and the output value from the next input
is f (zi ); the general activation function f uses the sigmoid data zt+1 .
function to determine the probability of turning on the gate.
The probability that the input gate is turned on can be III. METHODS
determined by multiplying g(z) and f (zi ). The memory cell In this study, the pests are identified using artificial intelli-
records the current value of the input, adds the previous input gence; the pest recognition model is trained through deep
TABLE 4. The research results of the number of training samples that are
uneven with the YOLO V3 model, and the number of training samples is
average with the YOLO V3 model.
D. SENSOR DISTRIBUTION
Crop pests thrive in excessively dry, hot environments. In this
FIGURE 13. The actual configuration of the sensors in the field.
research, we combined environmental sensors through a wire-
less environmental sensor transmission platform and a cloud
big data computing server system to collect environmental used to measure six kinds of environmental data, including
data. These data were analyzed to determine the real-time temperature, humidity, light, soil humidity, atmospheric pres-
agricultural meteorology, soil conditions, crop growth, and sure, and altitude.
other relevant information necessary to assist the manage- We use the DS3231 module to calibrate the time on the
ment of an orchard environment. microprocessor. The Raspberry Pi receives the environmental
The research and development of wireless sensor transmis- data from the sensors every hour. It transfers the data to the
sion systems focus on multiple sensors to transmit services Cloud via a wireless network and stores the data in the SD
through a wireless network in real-time and send the data module on the client-side at the same time to avoid data loss
back to the system for analysis. It is one of the essential through failed wireless transmission.
development applications of the IoT in smart agricultural The environmental data are transmitted to the Raspberry
technology. Pi on the server station from the client-side through the
In this study, the sensor modules were evenly arranged in SX1276 Lora module via a wireless network. The Raspberry
an orchard on a hillside according to the wireless transmission Pi uploads the data to the cloud database to provide devel-
sensor characteristics. The environmental data collected by opers with real-time observations of environmental changes,
the sensor modules were aggregated and transmitted to the as well as data retrieval and analysis.
cloud database through a wireless communication protocol To collect the environmental data in the field any time we
for subsequent analysis and calculation. wanted, we set up six sets of sensors and a LORA trans-
Fig. 12. shows a schematic diagram of the transmission mission module on the client-side. The LORA module is
mechanism of the wireless sensing platform in the orchard used to transmit the data to the Raspberry Pi on the server
on a slope. station, which transfers the data to the cloud database through
We obtained 6 evenly distributed sets of environmen- a wireless network to provide query and analysis functions
tal sensing modules in the orchard, as shown in Fig. 13, to the managers in real-time. The architecture is shown in
to observe the proliferation of pests in different environments. Fig. 15.
Fig. 14 shows the designed environmental sensing module. The six sets of client sensors send data to the server sta-
The Arduino Nano was used in a small embedded platform. tion at different times. To ensure the correctness of the data
The four sensors, GY-30, soil, DHT22, and BMP180, were received by the server station, the server station returns an
FIGURE 16. (a) The external module of the environmental sensors (b) The
FIGURE 14. The hardware architecture of the sensor box content. internal module of the environmental sensors.
the cloud to analyze the location of the pest, so the farmers above and continue to experiment to find solutions, hoping
can be informed as to the best time for pesticide spraying with to achieve immediate recognition of pest by drones as soon
the goal of improving pest prevention and management. as possible and establish intelligent agriculture.
V. CONCLUSION REFERENCES
It is difficult to obtain image data of pests since they prefer [1] L. M. Gladence et al., ‘‘Recommender system for home automation using
hiding behind leaves and in the tops of trees. Therefore, IoT and artificial intelligence,’’ J. Ambient Intell. Hum. Comput., 2020, doi:
10.1007/s12652-020-01968-2.
we applied image data augmentation to increase the number [2] S. S. Priya, L. M. Gladance, A. Valarmathi, and J. M. S. Joy, ‘‘Brain tumor
of pest training samples and improve the recognition accuracy detection and disease prediction using CNN algorithm,’’ in Test Engi-
for Tessaratoma papillosa. neering and Management, vol. 82. Oakland, CA, USA: The Mattingley
Publishing Co., Inc., Jan./Feb. 2020, pp. 13376–13381.
In this study, the YOLO series (You Only Look Once, [3] G. L. Mary, C. K. Vakula, M. P. Selvan, and T. Y. S. Sam-Hita, ‘‘A research
YOLO) neural network algorithm was used to identify the on application of human-robot interaction using artificial intelligence,’’ Int.
pests in the input images. The recognition rate was about J. Innov. Technol. Exploring Eng., vol. 8, no. 9, pp. 784–787, 2019.
[4] V. Martin and S. Moisan, ‘‘Early pest detection in Greenhouses,’’ in Proc.
90%. The main target was Tessaratoma papillosa. Drones Int. Conf. Pattern Recognit., 2008, pp. 1–4.
were used to collect images of these pests on fruit trees in [5] K. Wang, S. Zhang, Z. Wang, Z. Liu, and F. Yang, ‘‘Mobile smart device-
an orchard on a slope. A mobile application was used to based vegetable disease and insect pest recognition method,’’ Intell. Autom.
Soft Comput., vol. 19, no. 3, pp. 263–273, Aug. 2013.
collect pest images from the ground at the same time. The [6] J. L. Miranda, B. D. Gerardo, and B. T. Tanguilig, III, ‘‘Pest detection and
pest images were uploaded to the Cloud for image recog- extraction using image processing techniques,’’ Int. J. Comput. Commun.
nition in real-time, and the pest location and distribution Eng., vol. 3, no. 3, pp. 189–192, 2014.
[7] M. D. Gondal and Y. N. Khan, ‘‘Early pest detection from crop using image
were determined for the purpose of pesticide application. The processing and computational intelligence,’’ FAST-NU Res. J., vol. 1,
proposed system is designed to facilitate farmers in advanced no. 1, pp. 59–68, Jan. 2015.
pest control operations. [8] W. Ding and G. Taylor, ‘‘Automatic moth detection from trap images
for pest management,’’ Comput. Electron. Agricult., vol. 123, pp. 17–28,
In this study, a deep-learning image recognition method for Apr. 2016.
Tessaratoma papillosa was proposed that uses the YOLOv3 [9] A. Almahairi, S. Rajeswar, A. Sordoni, P. Bachman, and A. Courville,
model to mark and classify the pests in images and extract the ‘‘Augmented CycleGAN: Learning Many-to-Many mappings from
unpaired data,’’ 2018, arXiv:1802.10151. [Online]. Available:
characteristics of the pests. The pest identification accuracy http://arxiv.org/abs/1802.10151
and model training time are used to determine the most [10] C. Cortes and V. Vapnik, ‘‘Support-vector networks,’’ Mach. Learn.,
suitable model for the application. Also, the data from the vol. 20, no. 3, pp. 273–297, 1995.
[11] F. Faith praise, P. Birch, R. Young, J. Obu, B. Faith praise, and C. Chatwin,
environmental sensors was used to analyze locations prone ‘‘Automatic plant pest detection and recognition using k-means clustering
to the presence of pests. The location and distribution of the algorithm and correspondence filters,’’ Int. J. Adv. Biotechnol. Res., vol. 4,
pests were instantly provided to farmers to provide accurate no. 2, pp. 189–199, 2013.
[12] Z. Liu, J. Gao, G. Yang, H. Zhang, and Y. He, ‘‘Localization and classi-
pesticide application, reduce agricultural pest damage, and fication of paddy field pests using a saliency map and deep convolutional
increase crop quality and yield. neural network,’’ Sci. Rep., vol. 6, no. 1, Apr. 2016.
Since Tessaratoma papillosa mostly grows on the backs [13] S. J. Pan and Q. Yang, ‘‘A survey on transfer learning,’’ IEEE Trans. Knowl.
Data Eng., vol. 22, no. 10, pp. 1345–1359, Oct. 2010.
of leaves and in treetops, it is difficult to collect training [14] A. Krizhevsky, I. Sutskever, and G. E. Hinton, ‘‘ImageNet classification
samples for the purpose of identifying these pests. Further, with deep convolutional neural networks,’’ in Proc. Adv. Neural Inf. Pro-
the inconsistency of outdoor lighting results in low image cess. Syst., 2012, pp. 1097–1105.
[15] K. Simonyan and A. Zisserman, ‘‘Very deep convolutional networks for
recognition accuracy. Therefore, here, an APP installed on large-scale image recognition,’’ 2014, arXiv:1409.1556. [Online]. Avail-
a mobile phone was used to collect images of Tessaratoma able: http://arxiv.org/abs/1409.1556
papillosa that appeared on the back of the leaves in order [16] C. M. Bishop, Pattern Recognition and Machine Learning. New York, NY,
USA: Springer, 2006.
to locate these pests. We plan to apply the Tessaratoma [17] D.-R. Liu, S.-P. Chuang, and H.-Y. Lee, ‘‘Attention-based memory selec-
papillosa identification model to small drones in the future, tion recurrent network for language modeling,’’ 2016, arXiv:1611.08656.
hoping to reduce the human effort for collecting pest image [Online]. Available: http://arxiv.org/abs/1611.08656
YA-YU HUANG was born in Changhua, Taiwan, CHUAN-YU CHANG (Senior Member, IEEE)
in 1997. She received the B.S. degree in com- received the Ph.D. degree in electrical engineering
puter science and information engineering from from National Cheng Kung University, Taiwan,
the National University of Tainan, Tainan, in 2019. in 2000.
She is currently pursuing the master’s degree with He was the Chair with the Department of
the Department of Engineering Science, National Computer Science and Information Engineering,
Cheng Kung University. From 2018 to 2019, she National Yunlin University of Science and Tech-
was a Research Assistant with the Knowledge, nology (YunTech), Taiwan, from 2009 to 2011.
Information and Database System Laboratory. She From 2011 to 2019, he served as the Dean of
is also working on machine learning applied to Research and Development and the Director of
computer vision and image processing in robotics applications. Her research the Incubation Center for Academia-Industry Collaboration and Intellec-
interests include remote sensing applications in agriculture, applications of tual Property, YunTech. He is currently the Deputy General Director of
machine learning in satellite imagery, optical satellite and aerial imagery, and the Service Systems Technology Center, Industrial Technology Research
image processing. Institute (ITRI), Taiwan. He is also a Distinguished Professor with the
Department of Computer Science and Information Engineering, YunTech.
His current research interests include computational intelligence and their
applications to medical image processing, automated optical inspection,
emotion recognition, and pattern recognition. In the above areas, he has more
than 200 publications in journals and conference proceedings.
Dr. Chang is a Fellow of IET and a Life Member of IPPR and TAAI.
He served as the Program Co-Chair of TAAI 2007, CVGIP 2009, 2010–2019
International Workshop on Intelligent Sensors and Smart Environments, and
the Third International Conference on Robot, Vision and Signal Processing
(RVSP 2015). He served as the General Co-Chair of 2012 International
Conference on Information Security and Intelligent Control, 2011–2013
Workshop on Digital Life Technologies, CVGIP 2017, WIC2018, ICS 2018,
and WIC2019. From 2015 to 2017, he was the Chair of the IEEE Signal Pro-
cessing Society Tainan Chapter and the Representative of the Region 10 of
IEEE SPS Chapters Committee. He is also the President of the Taiwan
Association for Web Intelligence Consortium.