You are on page 1of 4

2022 3rd International Conference on Computer Vision, Image and Deep Learning & International Conference on Computer

Engineering and Applications (CVIDL & ICCEA)

Application research of plant leaf pests and diseases


base on unsupervised learning
2022 3rd International Conference on Computer Vision, Image and Deep Learning & International Conference on Computer Engineering and Applications (CVIDL & ICCEA) | 978-1-6654-5911-2/22/$31.00 ©2022 IEEE | DOI: 10.1109/CVIDLICCEA56201.2022.9824321

Mingjing Pei* Min Kong


School of Information Engineering, West Anhui University School of Information Engineering, West Anhui University
Lu,an, China Lu,an, China
363375362@qq.com mkong@wxc.edu.cn

Maosheng Fu Xiancun Zhou


School of Information Engineering, West Anhui University School of Information Engineering, West Anhui University
Lu,an, China Lu,an, China
49593838@qq.com Zhouxc106@163.com

Zusong Li Jieru Xu
School of Information Engineering, West Anhui University School of Information Engineering, West Anhui University
Lu,an, China Lu,an, China
67202167@qq.com 9182783@qq.com
Abstract—In agricultural productivity, detecting plant pests exist, however, the synthesized samples are still a long way
and diseases is extremely crucial. This research studies images of from being accurate[3][4]. Another way is to extract features
plant leaf pests and diseases from an unsupervised perspective to from a large number of normal samples and then identify
solve the problem that existing plant leaf disease datasets are whether they are normal or abnormal by distance[5][6],
difficult to acquire and include few types of diseases, and they however, the accuracy is low[7]. We employ image restoration
cannot find the defective parts of leaves. This paper utilizes the to detect abnormalities in images in this paper, which is more
idea of image restoration and uses a deep learning correlation effective and has good generality, by contextualizing and
model to detect and localize the abnormal regions of plant leaves.
restoring mask regions[8][9][10].
The experimental results show that the img_AUCROC and
pixel_AUCROC level anomaly detection and localization achieve The main contributions of this paper are as follows:
good results, which bring influence and reference to other peers.
First, the detection of abnormal regions of plant leaves is by
Keywords- plant leaf pests and diseases; unsupervised learning; unsupervised method, which saves a lot of labor and does not
anomaly detection require labeled data.

I. INTRODUCTION Second, the restoration of mask regions is performed by the


idea of image restoration.
Plant disease target detection is the application of computer
vision technology to detect plant disease infested areas and their II. RELATED WORK
specific positions in complicated natural settings[1], which is Reconstruction-based anomaly detection locates the
required for accurate categorization and identification of plant anomalous region by compressing the original image first, then
diseases, as well as assessment of disease damage severity. It's recovering it, and finally by comparing the before and after
also required for correct plant disease categorization and images. Common ones such as self-encoder, GAN, etc. This
diagnosis, as well as disease damage assessment and accurate model usually has poor recovery in terms of detailsbut has
location of disease regions[2]. The key to early diagnosis and better performance in generalizing to other datasets. The
intelligent disease monitoring is the accurate detection and literature [11]developed a multi-scale area feature generator
identification of plant diseases. It is the foundation of accurate that uses a pre-trained neural network to extract image features
pest treatment and information management, as well as the key and then reconstructs the feature map at the feature level. The
to early illness detection and intelligent monitoring. model employs the transforming architecture to reconstruct the
The majority of plant pests and diseases are currently image by masking a patch area of the image and then
detected using supervised methods, but this method necessitates reconstructing it by surrounding it with that region in
the collection of a huge number of pest and disease data, as well literature[12].
as a significant amount of people to label the data, both of which Embedding-based anomaly detection is to determine
are time-consuming and labor-intensive. We apply an whether an image is abnormal by the distance between the
unsupervised method in this research to consider the image features of a large number of normal samples and the
identification of abnormal areas on plant pest and disease leaves, features of the test sample images. The literature [13]divides the
and we simply need a significant number of normal sample data image into many small patches, maps the patches to a centroid
without labeling. Existing methods based on the self-supervised attachment through the network during training, and calculates
approach to identify normal samples from abnormal samples by the anomaly score based on the distance from the patches to the
synthesizing aberrant samples and training a binary classifier centroid during testing. According to the literature [14],

978-1-6654-5911-2/22/$31.00 ©2022 IEEE

817

Authorized licensed use limited to: NYSS'S Yeshwantrao Chavan College of Engineering. Downloaded on February 03,2023 at 10:17:27 UTC from IEEE Xplore. Restrictions apply.
anomaly scores are calculated using feature extraction from To train the autoencoder, three loss functions were used for
normal sample images, Gaussian modeling of feature vectors in the experiments, namely L2 loss, a multi-scale gradient seismic
the feature layer, and probability distribution of test sample similarity (MSGMS) loss, and structured similarity index
feature vectors. (SSIM) loss, the formula is shown below.
Self-supervised learning is aim to develop a task by
ourselves, which is equivalent to a supervised signal, and then L   G LG   S LS  L2 (1)
help the model learn useful features for the downstream task. H W
1
The literature [15] proposes extracting a random patch of the
image and pasting it at any location on the image to create an Ls(I , Ir)
NP
1  SSIM ( I , I )
i 1 j 1
r (i , j ) (2)
anomalous sample, which can then be identified by a binary
classification network before moving on to the downstream task.
III. METHOD
LG I , Ir  
1 4 1 H l WL
 1  GMS I 1, Irl (i, j )
4 l 1 Nl i 1 j 1
  (3)

In this paper, we use a framework based on the idea of 2g( I )g( Ir )  c


image based reconstruction for anomaly detection of plant leaf GMS ( I , Ir) 2 2 (4)
pest and disease regions[8]. The flow chart of the overall g ( I )  g ( Ir)  c
framework is shown in Figure 1.
s and g are the hyper parameter, I r stands for image
restoration, c is a constants.

IV. EXPERIMENTS
A. Dateset
We used a set of sample plant leaf datasets that we had on
hand. Our collection of plant leaf samples was used in the
experiment. Normal samples and three types of faulty samples
are grouped into four categories in the plant leaf dataset. There
are more than 100 samples in normal and ten faulty samples in
the other, and the relevant samples are depicted in figure 2. The
first row displays normal samples, gray spot disease leaf are
Figure 1 Flow chart of the overall framework of method
exhibited in the second row, the third row reveals brown spot
disease, and the last depicts human-damaged leaves.
To begin, the image is divided into several little patches by
the size of k , which can be 2, 4, 8, 16, or other numbers.
Second, the image is masked into patches and repeated n times
to produce n masked images, the intersection of the masked
patches in these n "stump maps" is empty, i.e., each patch is
guaranteed to be masked, and the image is then rebuilt in the
next procedure. Following that, it is reassembled in post-
processing. Finally, the reconstruction network receives the n
masked images for reconstruction.
The size of the region being discarded during inference
affects the accuracy of region reconstruction. Because anomaly
detection relies on reconstructing non-anomalous regions as
accurately as feasible, performance may be influenced by the Figure 2 Plant leaf dataset
size of the region used, k , as well as the size of the anomaly
B. Results
being reconstructed. If k is substantially greater than the
anomaly, precise repair reconstruction is necessary. The repair To detect the abnormal region of the leaf, the experiments
network can use the surrounding area to figure out which were run on an Intel Core i9 processor with a GeForce RTX
component of the anomaly is causing the problem. As 2070s GPU, and the code was written under the Ubuntu
anomalies come in various sizes, their identification must take 18.04+CUDA 10.2+CUDNN+PyTorch environment. The
into account a variety of scales. An accurate map of experimental learning rate was set to 0.0001, and 150 epochs
reconstruction effects can be constructed by considering were performed. The network is trained using Adam optimizer
numerous reconstructions of a single image generated using with S and G are set to 1. Due to the GPU's limited memory,
multiple values of k . The recovery reconstruction network the input batch size was set to 1, and 100 batches were
employed in this paper is a U-Net encoder-decoder model with processed in each epoch, with an average running time of
a ResNet-like Skip Connection between the shallow and deep roughly 250 seconds for each epoch. Each batch takes roughly
layers. 2.5 seconds to run on average.

818

Authorized licensed use limited to: NYSS'S Yeshwantrao Chavan College of Engineering. Downloaded on February 03,2023 at 10:17:27 UTC from IEEE Xplore. Restrictions apply.
The experimental training process is mostly used to update
parameters, change the weight value of the model, and evaluate
good and bad model training using the AUC value, which is the
total area under the ROC curve .The higher the False Positive
Rate (FPR), the more abnormal data are present in data that is
measured as normal; the higher the True Positive Rate (TPR),
the more normal data are present in data that is anticipated to be
normal. As a result, the higher the TPR and the lower the FPR,
the better, which is reflected in the AUC value, which is higher
than the AUC value. The best results obtained from model
training are judged by comparing the AUC values obtained
experimentally under different parameter conditions.
Figure 3, it depicts the change in AUC value during the
training process. when the model accepts different threshold
values, the leaf img_ROCAUC and pixel_ROCAUC values
continue to rise, reaching a maximum of 0.953, indicating that
the model is properly applied and can efficiently detect
anomalous regions in the leaves. Figure 4 shows the results of
the model training loss function transformation curve, which
includes L1 loss, SSIM loss, and GMS loss.
Figure 5 the detect result of normal and abnormal plant leaf

The experimental results of testing on the test dataset are


shown in Figure 5, showing four categories of effect pictures,
respectively, gray spot disease leaves, human-damaged leaves,
normal pictures, and brown spot disease leaves. The first
column is the original test set image, the effect map by
reconstruction algorithm lies in the second column, the third
column is Ground Truth, the predicted heat map is generated in
the fourth column, the fifth column represents the predicted
mask map, and the last column is the segmentation effect
performed on the original image. The higher the chance of an
abnormal image, the redder the color of the region of the graph;
conversely, the higher the probability of a normal image, the
bluer the hue. The first and second row images can detect and
segment the abnormal region, while the third row is a normal
image, and the testing effect is also relatively excellent,
Figure 3 the value of leaf img_ROCAUC and pixel_ROCAUC
effectively hiding the aberrant region. However, as illustrated
in the fourth row, the detecting result is less satisfactory when
a substantial section of the image is aberrant.
V. CONCLUSION
Plant leaf diseases and pests are investigated in this research
using a unsupervised learning approach. On the one hand, a
huge amount of pest and disease data does not need to be
labeled, and only a large number of normal samples need to be
collected, reducing labor consumption. On the other hand, the
location of plant leaf damage is located, delivering relevant and
crucial information to workers and plant experts.
ACKNOWLEDGMENT
The authors gratefully acknowledge the support of the
Natural Science Key Project of Anhui Provincial Education
Department(No.KJ2020A0636,
Figure 4 the curve change of three kinds of loss with epoch
No.KJ2021A0937,NO.KJ2020A0623), Academic funding
project of Anhui Provincial Department of Education for
University Top-notch Talents(No.gxbjZD2020084), Natural
science school-level key projects of the west University of
Anhui (No.WXZR201928, No.WXZR202016) and the Big
Data Project of West Mountain Pharmacy(No.20201226).

819

Authorized licensed use limited to: NYSS'S Yeshwantrao Chavan College of Engineering. Downloaded on February 03,2023 at 10:17:27 UTC from IEEE Xplore. Restrictions apply.
REFERENCES
[1] Sowmya B J , Shetty C , See Ma S , et al. Utility system for premature
plant disease detection using machine learning - ScienceDirect[J]. Hybrid
Computational Intelligence, 2020:149-172.
[2] Alguliyev R , Imamverdiyev Y , Sukhostat L , et al. Plant disease
detection based on a deep model[J]. Soft Computing, 2021, 25(21):13229-
13242.
[3] Y Li, Chao X . Semi-supervised few-shot learning approach for plant
diseases recognition[J]. Plant Methods, 2021, 17(1).
[4] Clohessy J W , Sanjel S , O'Brien G K , et al. Development of a high-
throughput plant disease symptom severity assessment tool using machine
learning image analysis and integrated geolocation[J]. Computers and
Electronics in Agriculture, 2021, 184(6):106089.
[5] Cohen, Niv, and Yedid Hoshen. "Sub-image anomaly detection with deep
pyramid correspondences." arXiv preprint arXiv:2005.02357 (2020).
[6] Deecke, Lucas, et al. "Image anomaly detection with generative
adversarial networks." Joint european conference on machine learning
and knowledge discovery in databases. Springer, Cham, 2018.
[7] Zhou, Kang, Yuting Xiao, Jianlong Yang, Jun Cheng, Wen Liu, Weixin
Luo, Zaiwang Gu, Jiang Liu, and Shenghua Gao. "Encoding structure-
texture relation with p-net for anomaly detection in retinal images."
In European Conference on Computer Vision, pp. 360-377. Springer,
Cham, 2020.
[8] Zavrtanik, Vitjan, Matej Kristan, and Danijel Skočaj. "Reconstruction by
inpainting for visual anomaly detection." Pattern Recognition 112 (2021):
107706.
[9] Xu, Shuaijing, Hao Wu, and Rongfang Bie. "CXNet-m1: anomaly
detection on chest X-rays with image-based deep learning." IEEE
Access 7 (2018): 4466-4477.Nguyen, Bao, Adam Feldman, Sarath
Bethapudi, Andrew Jennings, and Chris G. Willcocks. "Unsupervised
region-based anomaly detection in brain mri with adversarial image
inpainting." In 2021 IEEE 18th International Symposium on Biomedical
Imaging (ISBI), pp. 1127-1131. IEEE, 2021.
[10] Chen, Yurong, Hui Zhang, Yaonan Wang, Yimin Yang, Xianen Zhou, and
QM Jonathan Wu. "MAMA net: multi-scale attention memory
autoencoder network for anomaly detection." IEEE Transactions on
Medical Imaging 40, no. 3 (2020): 1032-1041.
[11] Pirnay, Jonathan, and Keng Chai. "Inpainting transformer for anomaly
detection." arXiv preprint arXiv:2104.13897 (2021).
[12] Yi, Jihun, and Sungroh Yoon. "Patch svdd: Patch-level svdd for anomaly
detection and segmentation." In Proceedings of the Asian Conference on
Computer Vision. 2020.
[13] Fan, Jinan, Qianru Zhang, Jialei Zhu, Meng Zhang, Zhou Yang, and
Hanxiang Cao. "Robust deep auto-encoding Gaussian process regression
for unsupervised anomaly detection." Neurocomputing 376 (2020): 180-
190.
[14] Li, Chun-Liang, Kihyuk Sohn, Jinsung Yoon, and Tomas Pfister.
"Cutpaste: Self-supervised learning for anomaly detection and
localization." In Proceedings of the IEEE/CVF Conference on Computer
Vision and Pattern Recognition, pp. 9664-9674. 2021.

820

Authorized licensed use limited to: NYSS'S Yeshwantrao Chavan College of Engineering. Downloaded on February 03,2023 at 10:17:27 UTC from IEEE Xplore. Restrictions apply.

You might also like