Next Article in Journal
Volatile Oils Discrepancy between Male and Female Ochradenus arabicus and Their Allelopathic Activity on Dactyloctenium aegyptium
Previous Article in Journal
Insecticidal Activity of Essential Oils against Mealybug Pests (Hemiptera: Pseudococcidae): A Systematic Review and Meta-Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Design of Intelligent Detection Platform for Wine Grape Pests and Diseases in Ningxia

Department of Mechanical Engineering, Ningxia University, Yinchuan 750000, China
*
Author to whom correspondence should be addressed.
Plants 2023, 12(1), 106; https://doi.org/10.3390/plants12010106
Submission received: 6 August 2022 / Revised: 22 December 2022 / Accepted: 22 December 2022 / Published: 26 December 2022
(This article belongs to the Section Plant Protection and Biotic Interactions)

Abstract

:
In order to reduce the impact of pests and diseases on the yield and quality of Ningxia wine grapes and to improve the efficiency and intelligence of detection, this paper designs an intelligent detection platform for pests and diseases. The optimal underlying network is selected by comparing the recognition accuracy of both MobileNet V2 and YOLOX_s networks trained on the Public Dataset. Based on this network, the effect of adding attention mechanism and replacing loss function on recognition effect is investigated by permutation in the Custom Dataset, resulting in the improved network YOLOX_s + CBAM. The improved network was trained on the Overall Dataset, and finally a recognition model capable of identifying nine types of pests was obtained, with a recognition accuracy of 93.35% in the validation set, an improvement of 1.35% over the original network. The recognition model is deployed on the Web side and Raspberry Pi to achieve independent detection functions; the channel between the two platforms is built through Ngrok, and remote interconnection is achieved through VNC desktop. Users can choose to upload local images on the Web side for detection, handheld Raspberry Pi for field detection, or Raspberry Pi and Web interconnection for remote detection.

1. Introduction

In terms of target detection algorithms, a lot of research has been conducted by many scholars. Jaime et al. [1] proposed a wireless sensor based on IEEE802.11a/b/g/n transmission standard for image acquisition and real-time monitoring of vineyard site conditions. Since its image processing system detects diseases by setting the threshold of Hue Saturation Value (HSV), it failed to identify those diseases with HSV values close to healthy leaves, such as grape downy mildew, sunburn, etc. Bharate et al. [2] used K-nearest Neighbor (KNN) to classify the given grape leaves as healthy and non-healthy with an accuracy of 90%. Ntihemuka et al. [3] combined wireless sensor network (WSN) with KNN classification algorithm and Ran learning algorithm in machine learning to build a farm environment monitoring platform that can monitor eight environmental parameters related to pests and diseases in real time. However, these algorithms, KNN and RAN, are unable to extract features effectively and have weaker generalization ability than convolutional neural networks such as CNN and DCNN.
Militante et al. [4] used an improved CNN model to detect and identify diseases in six crops, including grapes, apples, corn, and others, achieving 96.5% accuracy. Rajinder et al. [5] used a deep convolutional neural network (DCNN) model to identify three grape diseases the model with an accuracy of 99.34%. Xiaoyue et al. [6] introduced the ResNet-v2 module and SE module on the basis of Faster R-CNN network and proposed the DR-IACNN model for detecting four common grape leaf diseases. The model has stronger feature extraction capability, and it achieves 81.1% detection accuracy on the grape leaf disease dataset. Singh et al. [7] proposed a method to detect black measles disease from grape leaf image samples using Support Vector Machines (SVM) with an accuracy of 97.2%, but a single type of disease was detected. Juanhua et al. [8] used the Prewitt Operator to extract the complete edge of the lesion region, extracted five effective feature parameters such as perimeter, area, and roundness, and proposed an automatic grape leaf disease detection model based on back propagation neural network (BPNN), which can effectively detect and identify five grape leaf diseases with an average correct rate of 91%. Syed et al. [9] compared the performance of five different deep learning models for rice paddy disease detection, namely Vgg16 [10], Vgg19 [11], ResNet50 [12], ResNet50V2, and ResNet101V2. Among them, the ResNet101V2 model performed the best with an accuracy of 86.799%. Although the CNN, Faster R-CNN, and ResNet networks have high recognition accuracy, the large number of network parameters and long training time make them unsuitable for deployment on mobile platforms.
Considering the large number of pest species detected in this experiment and the long training time, a more lightweight network should be selected to ensure the appropriate accuracy and improve the training speed of the model. Rui Yang et al. [13] combined RGB images (RGBI), multispectral images (MSI), and thermal infrared images (Tiri) of leaf pests and diseases into a multi-source data connection (MDC) model with 31 channels by acquiring, and proposed a multi-source data fusion (MDF) decision method based on ShuffleNetV2 [14] lightweight network to improve the detection performance of five grape leaf diseases with an overall accuracy of 96.05%. Although the MDF method has high accuracy with low number of network parameters and high parallel computing capability, it increases the difficulty of sample production and prolongs the model training time due to the need to extract three dimensions of information on the target simultaneously. Andler et al. [15] proposed the MobileNet V2 model, which enhances the gradient propagation by introducing the inverse residual structure and significantly reduces the memory usage during inference, with 9 times fewer parameters than SSD300 and SSD512, which is very suitable for small mobile devices such as Raspberry Pi and cell phones, and meets the design requirements of this experiment.
The YOLO series is improved from R-CNN, and the detection speed is greatly improved by regression processing of target border and classification probability, which is suitable for real-time detection tasks. Jun et al. [16] used image pyramid feature fusion to achieve the extraction of multi-scale features, and the detection accuracy of the improved YOLOv3 model was 92.39%, which was 1.72% and 4.08% better than the Faster R-CNN and the original network, respectively. Yan Zhang et al. [17] proposed an improved YOLOv5 to detect closed cotton boll by combining density network and attention mechanism, and the model reduced 37.3 Mb and 91.8 Mb compared with SSD-VGG16 and FasterRCN-Inceptionv2, respectively, with 17.78% and 17.33% improvement in accuracy. YOLOX achieved 50.0% AP on COCO (1.8% higher AP than YOLOv5) in YOLOv4 and v5 with similar number of parameters, and YOLOX was able to achieve 68.9 FPS on a single Tesla V100, which has extremely high real-time detection performance [18]. Therefore, YOLOX with better performance was chosen as the base network for this experiment.
For the application of detection networks, Ganesh et al. [19] designed Android mobile applications based on YOLO, R-CNN object detection and recognition to navigate indoors for people with visual impairment. Labiba et al. [20] designed an Android application to classify fruits and vegetables and implemented the classification function and target detection function by VGG-16 and YOLO, respectively, with an average accuracy of 84%. Michael et al. [21] built an annotated dataset of Arabidopsis plants, trained it by Tiny-YOLOv3 network, and implanted the training model into an Android phone, which could accurately localize and count leaves in real time with inference time under 0.01 s. Ing-Chau et al. [22] developed a vehicle blind spot warning (PBSW) system based on YOLOv4. The detection system consisting of RaspberryPi, cell phone, and cloud server feeds the safety distance information between vehicles to the cell phone application with 92.82% correct estimated distance. However, the system process is too cumbersome, and it is possible to skip the mobile application and cloud processing ring to embed YOLO directly into the Raspberry Pi system. Gokulr et al. [23] use TensorFlow and Keras to build a CNN model to detect the distance between face masks, process the distance information through Firebase, and push the violation information to the Android-based StaySafe application.
This paper intends to select MobileNet V2 network and YOLOX_s, the smallest number of parameters in YOLOX series [18], as the base network and through further comparison, to explore the best detection model. It combines hardware and network communication technology to realize the application of neural network learning in the field of grape pest detection, providing a reference for the solution of pest detection of other agricultural crops.

2. Materials and Methods

In this paper, three datasets are created according to the differences of experimental requirements and the applicable scenarios of each dataset are clarified. Firstly, a pre-test for cross-sectional comparison is designed to clarify the base detection network by comparing the detection accuracy of YOLOX_s and MobileNet V2 on different test items. Then, optimization for this base network occurs in various ways, while establishing an evaluation system to measure the effect of optimization. Based on the experimental results, the best performing improved network is selected and the final pest detection model is trained. Finally, the target detection module is deployed on the Web side and Raspberry Pi respectively to build the interconnection channel, and then the detection function of the Web platform, the on-site detection function, and the VNC remote real-time detection function are realized. The technical route is shown in Figure 1.

2.1. Construction of Dataset

The datasets in this paper are divided into three categories: public dataset, custom dataset, and overall dataset. The samples of the dataset part are shown in Figure 2, and the characteristics of the dataset are shown in Table 1.
The public dataset was derived from the Python crawler and Plant Village dataset, which included 12 pests and diseases such as grape brown spot, black rot, and grapevine rash, with a total of 42,150 images. The custom dataset was collected from the grape growing base of Yuquanying Farm, Ningxia Province (106°1′35.75″ N, 38°15′46.14″ E) and the grape growing base of Luoshan Flying Camp, Ningxia Province (106°4′6.32″ N, 37°25′54.78″ E) from the beginning of May to the end of August 2020. The collection equipment was SKW-A0 and SONY CX610E. Nine pests and diseases were finally acquired, with a total of 21,850 images. The overall dataset was based on the self-defined dataset with samples of the same disease category in some public datasets, including a total of 32,760 pictures of 9 pests and diseases.
The public dataset is suitable for screening the underlying network. Having the largest number of disease species is suitable for testing the detection ability of the base network in a complex sample environment. It is also the least difficult to obtain and facilitates faster comparison of the base network before the collection of the custom dataset is completed. The custom dataset is used to filter the optimization network. It has a smaller sample size than the public dataset, but contains the characteristics of Ningxia pests and diseases, thus saving the time spent on training multiple optimization networks, while ensuring the relevance of the optimization model to Ningxia samples. The full dataset further expands the sample size while retaining the relevance of the custom dataset for Ningxia geographical samples, which is ideal for training the final identification model.
The operating system of this study is Windows 10, using PyTorch 1.10.0 framework, Anaconda3-5.1.0 (Python 3.7) environment, CUDA11.3 + CUDNN8.2.1, Intel Xeon-5118 CPU, Nvidia Titan RTX GPU, DRAM 64G. The initial resolution of the manually acquired images was 3000 × 4000 pixels, and the initial image volume was compressed to 640 × 640 and stored to improve the model training efficiency. The labeling of leaf pests and diseases was done using labelImg, and the ratio of training set to validation set was 8:2 for all three datasets.

2.2. Underlying Network Comparison Pre-Experiment

The YOLOX_s network was trained with MobileNet V2 network under the Public Data Trainingset, where V2num_classes was set to 9, epoch value was set to 200, batch-size was set to 4, and input-size was defaulted [640, 640]. The detection results in the validation set of the public dataset are shown in Figure 3. The results showed that YOLOX_s had higher AP values than MobileNet V2 for all disease tests, except for grape rust and grape black rot, which had 1.5% and 0.8% lower AP values than MobileNet V2, respectively. YOLOX_s has better performance than MobileNet V2 with the same training set and settings, and it can maintain higher recognition accuracy in a wide variety of diseases. Therefore YOLOX_s is chosen as the underlying network.

2.3. Optimization of Yolox_s

YOLOX_s network is optimized by adding some tricks to Yolov5s. At the input side, YOLOX_s adds the ixup data enhancement effect on top of the Mosa data enhancement. In the Backbone and Neck parts, the activation functions both use SiLU functions. At the output side, the detection head is changed to Decoupled Head and uses anchor free, multi positives, SimOTA, etc. YOLOX_s uses 8×, 16× and 21× upsampling, i.e., the smallest pixels are 8 × 8, 16 × 16 and 32 × 32. These smallest pixels are used as feature points to form feature maps at different scales and are fused by means of FPN to form the final feature vector. The network structure is shown in Figure 4.
Since the actual area of the grape leaf pest is affected by the variation of the distance between the camera and the target, the area of the target cannot be used as the detection threshold of the metric system. In contrast, the target pixel size is more suitable as a metric for measuring the minimum detection threshold. Therefore, 8 × 8 pixels is used as the minimum value for the threshold of grape leaf pest detected by this network.
To meet the accuracy of actual grape pest detection, this paper intends to further improve the detection accuracy of the network by adding an appropriate attention mechanism or replacing the confidence function on top of the original YOLOX_s network.

2.3.1. Attention Mechanism Optimization

The SE Net attention mechanism [24,25], mainly by establishing the correlation between channels, automatically obtains the importance of each feature channel, according to which the useful features are promoted and irrelevant features are suppressed to achieve adaptive recalibration of channel orientation. Its structure is shown in Figure 5a. Initially, the feature map acquired by convolution is processed to obtain a one-dimensional vector with the same number of channels as the evaluation score of each channel, and then the modified scores are weighted to the corresponding channels by multiplication, and finally the output result is calculated.
CBAM attention mechanism [26], contains 2 independent submodules: the Channel Attention Module (CAM) and the Spatial Attention Module (SAM), both of which perform Attention on the channel and space, respectively, which can save parameters and computational power. The structure is shown in Figure 5b.
Both are easily integrated into existing network architectures as plug-and-play modules. In this paper, the SE Net and CBAM attention mechanisms are inserted in forward () for feature maps output by YOLOX_s backbone network, as shown in Figure 4.

2.3.2. Confidence Loss Function Optimization

The loss function is used to evaluate the degree of difference between the predicted and true values of the model, and usually the smaller the loss function, the better the performance of the model. The original confidence prediction function is a binary Cross-entropy loss function, which is mostly applied to binary classification tasks with the following equation.
L o s s = 1 N i = 1 N y i · log [ p ( y i ) ] + ( 1 y i ) · log [ 1 p ( y i ) ]
In Equation (1), y i = 0 , 1 is the binary label and y i = 0 , 1 is the probability that the output belongs to the label y i . When p ( y i ) = 1 , p ( y i ) is expected to become large enough. When y i is a positive case, p ( y i ) = 1 , the loss is zero. When p ( y i ) tends to zero, log p ( y i ) tends to negative infinity, the loss is extremely large. From the cross-entropy loss function, we know that for positive samples, the higher the cross-entropy output probability, the smaller the loss. For negative samples, the smaller the output probability is, the smaller the loss is. Since the loss function is very slow and may not even be optimized to the optimum during iterations with a large number of simple samples, the binary cross-entropy loss is considered to be replaced by Focalloss or Varifocalloss.
  • Focalloss function
The useless easily separable negative samples in the confidence prediction loss process cause the model to fail in learning and only discriminate the background without objects but not the specific objects. For the category imbalance problem, the Focalloss function proposed by Tsung et al. [27] makes the model more focused on such indistinguishable samples thus reducing the effect of simple samples. It is defined as follows.
F L ( p t ) = α t ( 1 p t ) γ log ( p t )
In Equation (2), ( 1 p t ) γ is the adjustment factor, γ is the adjustable focusing parameter. When γ = 0 , Focalloss function becomes the cross-entropy loss function. When γ > 0 , the loss of easy classification samples is reduced and the model focuses more on difficult and misclassified samples. When γ increasing, the effect of the adjustment factor also increases.
2.
Varifocalloss function
In past research work, the classification score is usually used or combined with the IoU-based localization score as the basis for ranking. This approach is unreliable and can even impair detection performance. Varifocalloss, proposed by Zhang Haoyang et al. [28], is mainly used to train dense object detectors to predict IACS. It is defined as follows.
V F L ( p , q ) = q [ q log ( p ) + ( 1 q ) l o g ( 1 q ) ] α p γ log ( 1 p ) q > 0 q = 0
In Equation (3), p is used to predict the IACS score, q stands for target IoU score. Set q to IoU between bbox and gtbox. For negative samples, the q value of the training target is 0 for all categories. Varifocalloss will predict the classification score and IACS score. p γ is used to effectively reduce the loss of negative sample weights and maintain the original weights of positive samples. q is used to increase the loss weights of positive samples, making the training focus on high quality samples.

2.4. Platform System Design

2.4.1. Web Detection Platform

Flask is a lightweight web application framework written in Python that is highly scalable and flexible, as shown in Figure 6. Jinja2 provides the template language and the Werkzeug module is responsible for configuring the web server gateway interface. Deploy improved Yolox_s grape pest detection module with Flask to achieve the function of user uploading local images for detection. The Web user service system is built by embedded database SQLite, including registration and login function, grape pest and disease encyclopedia model search, and pest and disease control suggestion function.

2.4.2. Raspberry Pi Detection System Design

Raspberry Pi system includes wine grape pest and disease detection and remote interconnection to the Web [29,30,31].
Under the Raspberry Pi4 aarch64 Buster system, OpenCV4.5.1, ncnn deep learning framework, Gstreamer multimedia framework [32] and V4L2 driver framework are used to build the identification system. CSI cameras are used to detect grape pests and diseases. The system structure is shown in Figure 7a.
The motion open-source camera monitoring software in Linux is used to achieve remote monitoring function in the intranet. Establishing a channel between the public endpoint and the Web server through ngrok to achieve intranet server management and extranet access functions, as shown in Figure 7b. Finally, in the Raspberry Pi system environment, noVNC and websockify are used to build VNC remote desktop, while designing html layout on the web side to achieve remote interconnection with Raspberry Pi. Based on the web platform, remote desktop function users can call the Raspberry Pi CSI camera to get real-time images of the grape farm.

3. Results

3.1. Evaluation Indicators

For the binary classification problem, the samples can be classified into four cases based on the combination of the sample true category and the learner prediction category: true case (TP), false positive case (FP), true negative case (TN), and false negative case (FN). The classification results are shown in Figure 8. The performance of the improved YOLOX_s is measured quantitatively using the average precision (AP) and the average recall (AR).
Precision represents the ratio of correct samples to all predicted subsamples. Recall is the proportion of samples that match the actual in the predicted correct sample to the total number of samples in the predicted correct sample. Precision (P) and recall (R) are defined as in Equations (4) and (5).
P r e c i s i o n = T P T P + F P
R e c a l l = T P T P + F N
The performance of the model is determined by both precision and recall.
When the sample category is more homogeneous, the average precision AP is a comprehensive index to balance the two. With precision as the vertical axis and recall as the horizontal axis, a precision-recall curve (P-R Curve), can be obtained. The value of AP is the area of the closed graph formed by this curve and the horizontal axis in the interval of [0, 1].
A P = 0 1 P ( R ) d R
When there are many kinds of sample categories, mAP evaluates the performance of the model. The formula uses N to denote the kind of samples. Summing and then averaging the APs for each species, we can obtain the mean average precision (mAP), as in Equation (7).
m A P = i = 1 N A P i N
IoU is a criterion that defines the accuracy of target objective detection, which is calculated by the overlap ratio between the predicted bounding box and the true bounding box, as in Equation (8). The predicted results are considered valid when the value of IoU is greater than 0.5.
I O U = S o v e r l a p S u n i o n
The average recall (AR) is defined as taking the maximum value of recall and then averaging it for different IoU of samples of the same category. The mean average recall (mAR) is defined as summing and then averaging the AR for each sample category under multiple samples.
The mAP when exceeding the IoU threshold of 0.5 is defined as the accuracy determination criterion. The mAR at the IOU confidence interval of [0.5, 0.95] was defined as the outcome quality determination criterion. The mAP priority reference level is defined to be higher than the mAR, and both are jointly used to measure our performance of improving YOLOX_s.

3.2. Comparison of Optimized Models

Eight optimization schemes were arranged and combined according to the optimization methods mentioned above, namely: inserting only SE module, inserting only CBAM module, replacing only Focalloss, replacing only Varifocalloss, SE + Focalloss, SE + Varifocalloss, CBAM + Focalloss, CBAM + Varifocalloss. The nine optimization models are trained in the training set of the custom dataset and tested one by one in the validation set to find the optimal solution, while the original YOLOX_s network is added for comparison. The experimental results are shown in Table 2.
The experimental results showed that compared with the original YOLOX_s, the average precision (mAP) increased by 2.5%, the mean average recall (mAR) increased by 3%, the time increment was 0.02 ms, and the detection speed did not decrease significantly after inserting CBAM attention mechanism. The recall rates of Focalloss, Varifocalloss, and CBAM + Varifocalloss are improved by 0.3%, 0.8% and 0.16%, respectively, but only the sample detection coverage is improved and the precision and speed are decreased. The other optimization combination methods failed to achieve good optimization results for each index. Therefore, this paper proposes to select CBAM + YOLOX_s as the final improved network and conduct training and validation.

3.3. Optimization Model Validation Based on the Overall Dataset

In order to make the improved YOLOX_s training model have better recognition performance, the training set of the overall dataset mentioned before is chosen to train the CBAM + YOLOX_s network, and finally the validation is performed in the validation set of the overall training set. The original YOLOX_s network was also added to the same training and configuration environment for control validation, and the experimental results are shown in Figure 9.
The test results showed that the mean average precision (mAP) of the original Yolox_s network was 92.00% and the mAP of Yolox_s + CBAM was 93.35%. Among all the items tested, grape sunburn had the highest detection accuracy of 94.85%. This is due to the fact that the disease is characterized by a brown color of the grape fruit and the differences are extremely pronounced leading to a high accuracy of identification. The worst detection was for grape powdery mildew, with an accuracy of 90.67%. This disease is characterized by a layer of white spots attached to the leaves, which is further weakened in sunlight conditions, resulting in poor identification accuracy. It is difficult to improve on the original detection accuracy of 92% in an unstructured natural environment. Taken as a whole, it is difficult to go up in unstructured natural environments based on the original detection accuracy of 92%. The overall recognition accuracy of this optimized model is improved by 1.35% over the original YOLO_s model, with significant optimization effect and better robustness in practical applications.

3.4. Platform Functionality Testing

3.4.1. Web Platform Testing

Uploading local pictures for pest and disease detection on the Web platform, the location of grape pests and diseases will be marked by the system with blue wireframes. The text is labeled with the type of pest and the number represents the probability that it may be that type of pest. The results of the platform test are shown in Figure 10a. The results of the detection of ten types of grape leaves are shown in Figure 10b.

3.4.2. Raspberry Pi Field Testing

Pest and disease detection is performed in the field by hand-held raspberry parties equipped with CSI cameras on grape leaves, and disease information and probabilities are shown in the on-screen display. The detection effect is shown in Figure 11. The experimental results show that the function works properly and can meet the needs of field detection while having portability.

3.4.3. Remote Interconnection Detection

The location of the Raspberry Pi is arranged in the field and ensure that the Raspberry Pi and the computer are in the same LAN environment. Users can monitor and control the Raspberry Pi in real time by enabling the VNC program on the computer. The Raspberry Pi will transmit the images taken by the CSI camera to the remote user’s computer desktop and mark the location and information of the pests and diseases present in the images. The effect of the remote display is shown in Figure 12.
The results show that both platforms can effectively detect pests and diseases of Ningxia wine grapes under natural environment and can meet the needs of three kinds of detection scenarios: on-site detection, Web-based detection, and remote real-time detection.

4. Conclusions and Discussion

In this paper, we designed a pest and disease detection platform for wine grapes in the Ningxia region, which can effectively detect 1 pest and 8 diseases. The public dataset, the custom dataset, and the overall dataset are constructed separately, and the appropriate dataset is selected from them according to the characteristics of different datasets to meet the needs of the experimental process.
For the target detection network, the recognized accuracy of both MobileNet V2 and YOLOX_s are compared under the training of public dataset to select the best base network. By exploring the effects of adding SE and CBAM attention mechanism modules and replacing FocalLoss and Varifocalloss loss functions on the optimization results, the best recognition network, YOLOX_s + CBAM, is identified from nine schemes. After comparing with the original YOLOX_s network, it can be seen that the optimized network has a significant improvement in the mean average accuracy.
To build the platform, Yolox_s model is deployed within the Flask framework to achieve the web-side pest identification function. The platform service module is built based on SQLite, an embedded database, to realize user login and pest and disease encyclopedia query. A Yolox_s model to ncnn deep learning framework in mobile side is added to realize the recognition of pests and diseases in Raspberry Pi system environment. Based on noVNC, websockify achieves Raspberry Pi VNC remote desktop remote desktop, through ngrok to establish a public endpoint and the local running Web server channel to achieve the interaction between the Web and Raspberry Pi.
Users can upload local pictures for inspection through the Web platform, or hold a Raspberry Pi equipped with a CSI camera to inspect the grapes in the field on site, or they can arrange the Raspberry Pi to the field for remote interconnection and inspection on the PC side. The platform is designed to meet the detection needs of different scenarios. This study greatly improves the efficiency of pest detection, improves grape yield and quality, reduces labor intensity, saves labor costs, solves the technical problems of intelligent pest control in the wine grape industry in Ningxia region, and plays a positive role in promoting the realization of agricultural intelligence and automation in the future.

Author Contributions

Conceptualization, Y.W., A.Q. and C.W.; methodology, C.W.; software, H.S.; validation, C.W.; formal analysis, C.W.; investigation, C.W.; resources, Y.W.; data curation, Y.W., A.Q., H.S. and C.W.; writing—original draft preparation, C.W.; writing—review and editing, Y.W. and A.Q.; visualization, C.W.; supervision, Y.W.; project administration, Y.W.; funding acquisition, Y.W. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Science Foundation of Ningxia (Project No: 2022AAC03034), the National Natural Science Foundation of China (Grant No. 32260431) and the Ningxia Key Research and the Development Program Major Program (Grant No. 2018BBF02020-01).

Data Availability Statement

Data and code are available upon request.

Acknowledgments

The authors thank Xinxin Yao of Ningxia University for supporting the experimental logistics, Woo SH and Kweon of Korea Adv Inst Sci and Technol for licensing the use of CBAM module and Hu Jie of Momenta China for licensing the use of SE module.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Lloret, J.; Bosch, I.; Sendra, S.; Serrano, A. A Wireless Sensor Network for Vineyard Monitoring That Uses Image Processing. Sensors 2011, 11, 6165–6196. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  2. Bharate, A.A.; Shirdhonkar, M.S. Classification of Grape Leaves using KNN and SVM Classifiers. In Proceedings of the 2020 Fourth International Conference on Computing Methodologies and Communication (ICCMC), Erode, India, 11–13 March 2020; pp. 745–749. [Google Scholar]
  3. Materne, N.; Inoue, M. IoT Monitoring System for Early Detection of Agricultural Pests and Diseases. In Proceedings of the 2018 12th South East Asian Technical University Consortium (SEATUC), Yogyakarta, Indonesia, 12–13 March 2018; pp. 1–5. [Google Scholar]
  4. Militante, S.V.; Gerardo, B.D.; Dionisio, N.V. Plant Leaf Detection and Disease Recognition using Deep Learning. In Proceedings of the 2019 IEEE Eurasia Conference on IOT, Communication and Engineering (ECICE), Yunlin, Taiwan, 3–6 October 2019; pp. 579–582. [Google Scholar]
  5. Math, R.M.; Dharwadkar, N.V. Early detection and identification of grape diseases using convolutional neural networks. J. Plant Dis. Prot. 2022, 129, 521–532. [Google Scholar] [CrossRef]
  6. Xie, X.Y.; Ma, Y.; Liu, B.; He, J.R.; Li, S.Q.; Wang, H.Y. A Deep-Learning-Based Real-Time Detector for Grape Leaf Diseases Using Improved Convolutional Neural Networks. Front. Plant Sci. 2020, 11, 751. [Google Scholar] [CrossRef] [PubMed]
  7. Singh, U.; Srivastava, A.; Chauhan, D.; Singh, A. Computer Vision Technique for Detection of Grape Esca (Black Measles) Disease from Grape Leaf Samples. In Proceedings of the 2020 International Conference on Contemporary Computing and Applications (IC3A), Lucknow, India, 5–7 February 2020; pp. 110–115. [Google Scholar]
  8. Zhu, J.H.; Wu, A.; Wang, X.S.; Zhang, H. Identification of grape diseases using image analysis and BP neural networks. Multimed Tools Appl. 2020, 79, 14539–14551. [Google Scholar] [CrossRef]
  9. Burhan, S.A.; Minhas, S.; Tariq, A.; Hassan, M.N. Comparative Study Of Deep Learning Algorithms For Disease And Pest Detection In Rice Crops. In Proceedings of the 2020 12th International Conference on Electronics, Computers and Artificial Intelligence (ECAI), Bucharest, Romania, 25–27 June 2020; pp. 1–5. [Google Scholar]
  10. Subramanian, M.; Prasad, L.; Janakiramaiah, B.; Babu, A.M.; Sathishkumar, V.E. Hyperparameter Optimization for Transfer Learning of VGG16 for Disease Identification in Corn Leaves Using Bayesian Optimization. Big Data 2022, 10, 215–229. [Google Scholar] [CrossRef] [PubMed]
  11. Tiwari, D.; Ashish, M.; Gangwar, N.; Sharma, A.; Patel, S.; Bhardwaj, S. Potato Leaf Diseases Detection Using Deep Learning. In Proceedings of the 2020 4th International Conference on Intelligent Computing and Control Systems (ICICCS), Madurai, India, 13–15 May 2020; pp. 461–466. [Google Scholar]
  12. Wenchao, X.; Zhi, Y. Research on Strawberry Disease Diagnosis Based on Improved Residual Network Recognition Model. Math. Probl. Eng. 2022, 2022, 6431942. [Google Scholar] [CrossRef]
  13. Yang, R.; Lu, X.Y.; Huang, J.; Zhou, J.; Jiao, J.; Liu, Y.F.; Liu, F.; Su, B.F.; Gu, P.W. A Multi-Source Data Fusion Decision-Making Method for Disease and Pest Detection of Grape Foliage Based on ShuffleNet V2. Remote Sens. 2021, 13, 5102. [Google Scholar] [CrossRef]
  14. Ji, W.; Pan, Y.; Xu, B.; Wang, J.C. A Real-Time Apple Targets Detection Method for Picking Robot Based on ShufflenetV2-YOLOX. Agriculture 2022, 12, 856. [Google Scholar] [CrossRef]
  15. Sandler, M.; Howard, A.; Zhu, M.L.; Zhmoginov, A.; Chen, L.C. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 4510–4520. [Google Scholar]
  16. Liu, J.; Wang, X.W. Tomato Diseases and Pests Detection Based on Improved Yolo V3 Convolutional Neural Network. Front. Plant Sci. 2020, 11, 898. [Google Scholar] [CrossRef] [PubMed]
  17. Zhang, Y.; Yang, G.P.; Liu, Y.K.; Wang, C.; Yin, Y.L. An improved YOLO network for unopened cotton boll detection in the field. J. Intell. Fuzzy Syst. 2022, 42, 2193–2206. [Google Scholar] [CrossRef]
  18. Ge, Z.; Liu, S.; Wang, F.; Li, Z.; Sun, J. YOLOX: Exceeding YOLO Series in 2021. arXiv 2021, arXiv:2107.08430. [Google Scholar]
  19. Kotalwar, G.; Prajapati, J.; Patil, S.; Moralwar, D.; Jewani, K. Smart Navigation Application for Visually Challenged People in Indoor Premises. In Proceedings of the International Conference on Computer Networks, Big Data and IoT (ICCBI-2018), Madurai, India, 19–20 December 2018; Volume 31, pp. 998–1004. [Google Scholar]
  20. Fahad, L.G.; Tahir, S.F.; Rasheed, U.; Saqib, H.; Hassan, M.; Alquhayz, H. Fruits and Vegetables Freshness Categorization Using Deep Learning. CMC-Comput. Mater. Contin. 2022, 71, 5083–5098. [Google Scholar] [CrossRef]
  21. Buzzy, M.; Thesma, V.; Davoodi, M.; Velni, J.M. Real-Time Plant Leaf Counting Using Deep Object Detection Networks. Sensors 2020, 20, 6898. [Google Scholar] [CrossRef] [PubMed]
  22. Chang, I.C.; Chen, W.R.; Kuo, X.M.; Song, Y.J.; Liao, P.H.; Kuo, C.H. An Artificial Intelligence-based Proactive Blind Spot Warning System for Motorcycles. In Proceedings of the 2020 International Symposium on Computer, Consumer and Control (IS3C) 2021, Taichung City, Taiwan, 13–16 November 2020; pp. 404–407. [Google Scholar]
  23. Kumar, G.S.; Shetty, S.D. Application Development for Mask Detection and Social Distancing Violation Detection using Convolutional Neural Networks. In Proceedings of the 23rd International Conference on Enterprise Information Systems, ICEIS 2021, Online, 26–28 April 2021; pp. 760–767. [Google Scholar]
  24. Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
  25. Hu, J.; Shen, L.; Albanie, S.; Sun, G.; Wu, E. Squeeze-and-Excitation Networks. IEEE Trans. Pattern Anal. Mach. Intell. 2020, 42, 2011–2023. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  26. Woo, S.H.; Park, J.; Lee, J.Y.; Kweon, I.S. CBAM: Convolutional Block Attention Module. In Proceedings of the European conference on computer vision (ECCV), Munich, Germany, 8–14 September 2018; Volume 11211, pp. 3–19. [Google Scholar]
  27. Lin, T.Y.; Goyal, P.; Girshick, R.; He, K.M.; Dollar, P. Focal Loss for Dense Object Detection. IEEE Trans. Pattern Anal. Intell. 2020, 42, 318–327. [Google Scholar] [CrossRef] [PubMed] [Green Version]
  28. Zhang, H.Y.; Wang, Y.; Dayoub, F.; Sunderhauf, N. VarifocalNet: An IoU-aware Dense Object Detector. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 8510–8519. [Google Scholar]
  29. Na, S.J.; Song, J.W. Development of Remote Plant Monitoring System based on Raspberry Pi. J. Digit. Contents Soc. 2021, 22, 737–742. [Google Scholar] [CrossRef]
  30. Park, J.K.; Park, H. Implementation of a Smart Farming Monitoring System Using Raspberry Pi. J. Next-Gener. Converg. Technol. Assoc. 2020, 4, 354–360. [Google Scholar]
  31. Mudaliar, M.D.; Sivakumar, N. IoT based real time energy monitoring system using Raspberry Pi. Internet Things 2020, 12, 100292. [Google Scholar] [CrossRef]
  32. Burks, S.D.; Doe, J.M. GStreamer as a framework for image processing applications in image fusion. In Proceedings of the Multisensor, Multisource Information Fusion: Architectures, Algorithms, and Applications 2011, Orlando, FL, USA, 25–29 April 2011; Volume 8064. [Google Scholar]
Figure 1. The technical route of network optimization and testing platform construction.
Figure 1. The technical route of network optimization and testing platform construction.
Plants 12 00106 g001
Figure 2. Grape pest and disease samples from overall dataset.
Figure 2. Grape pest and disease samples from overall dataset.
Plants 12 00106 g002
Figure 3. Average precision values of Yolox_s and MobileNet V2 detection for 12 pests and diseases in the public dataset.
Figure 3. Average precision values of Yolox_s and MobileNet V2 detection for 12 pests and diseases in the public dataset.
Plants 12 00106 g003
Figure 4. Schematic diagram of YOLOX_s network structure with SE Net and CBAM insertion.
Figure 4. Schematic diagram of YOLOX_s network structure with SE Net and CBAM insertion.
Plants 12 00106 g004
Figure 5. Schematic diagram of the principles of the two attentional mechanisms. (a) SE Net structure diagram. (This image was provided by Dr. Hu Jie of Momenta); (b) CBAM structure diagram. (This image was provided by Dr. Woo Sanghyun and Prof. Kweon In So of Korea Adv Inst Sci and Technol).
Figure 5. Schematic diagram of the principles of the two attentional mechanisms. (a) SE Net structure diagram. (This image was provided by Dr. Hu Jie of Momenta); (b) CBAM structure diagram. (This image was provided by Dr. Woo Sanghyun and Prof. Kweon In So of Korea Adv Inst Sci and Technol).
Plants 12 00106 g005
Figure 6. Flask-based Web-side YOLOX_s detection system framework.
Figure 6. Flask-based Web-side YOLOX_s detection system framework.
Plants 12 00106 g006
Figure 7. Platform Raspberry Pi platform build. (a) Implementation flow of embedding YOLOX_s in Raspberry Pi system. (b) Raspberry Pi and Web platform interconnection channel.
Figure 7. Platform Raspberry Pi platform build. (a) Implementation flow of embedding YOLOX_s in Raspberry Pi system. (b) Raspberry Pi and Web platform interconnection channel.
Plants 12 00106 g007
Figure 8. Principles of sample classification.
Figure 8. Principles of sample classification.
Plants 12 00106 g008
Figure 9. Comparison of the validation results of the optimization model on the overall dataset.
Figure 9. Comparison of the validation results of the optimization model on the overall dataset.
Plants 12 00106 g009
Figure 10. Functional testing of grape pest and disease detection on a web-based platform. (a) Web detection platform user interface. (b) Detection results of healthy leaf and 9 types of pest and disease grape leaves.
Figure 10. Functional testing of grape pest and disease detection on a web-based platform. (a) Web detection platform user interface. (b) Detection results of healthy leaf and 9 types of pest and disease grape leaves.
Plants 12 00106 g010aPlants 12 00106 g010b
Figure 11. Verification of the Raspberry Pi field recognition function.
Figure 11. Verification of the Raspberry Pi field recognition function.
Plants 12 00106 g011
Figure 12. Functional validation of remote real-time detection of grape pests and diseases.
Figure 12. Functional validation of remote real-time detection of grape pests and diseases.
Plants 12 00106 g012
Table 1. Three types of dataset characteristics.
Table 1. Three types of dataset characteristics.
Data Set TypeTypes of Pests and Diseases
(Health /Disease/Insect)
Number of Samples
(Health/Disease/Insect)
Public Dataset13 (1/11/1)42150 (3570/35620/2960)
Custom Dataset10 (1/8/1)21850 (2450/17470/1930)
Overall Dataset10 (1/8/1)32760 (6020/24810/1930)
Table 2. Comparison of average precision, average recall and average NMS for 8 network optimization results.
Table 2. Comparison of average precision, average recall and average NMS for 8 network optimization results.
No.CombinationTypeOptimize Portfolio ContentMean Average
Precision (mAP) @ [IoU = 0.50|area = all|maxDets = 100]
Mean Average
Recall (mAR) @ [IoU = 0.50:0.95 |area = large|max
Dets = 100]
Average NMS Time (ms)
1InitialYOLOX_s0.9190.9451.41
2Add attention mechanismInsert SE Net0.862 (−0.057)0.921 (−0.024)1.70 (+0.29)
3Insert CBAM0.944 (+0.025)0.948 (+0.003)1.43 (+0.02)
4Confidence prediction loss replacementBinary Cross-entropy loss replacement with Focalloss0.913 (−0.006)0.953 (+0.008)2.98 (+1.57)
5Binary Cross-entropy loss replacement by Varifocalloss0.915 (−0.004)0.961 (+0.016)2.26 (+0.85)
6Insert attention mechanism + confidence prediction loss function replacementSE + Focalloss0.872 (−0.047)0.900 (−0.045)3.01 (+1.60)
7SE + Varifocalloss0.890 (−0.029)0.893 (−0.052)2.23 (+0.82)
8CBAM + Focalloss0.901 (−0.018)0.935 (−0.010)2.99 (+1.58)
9CBAM + Varifocalloss0.896 (−0.023)0.958 (+0.013)2.28 (+0.87)
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, Y.; Wei, C.; Sun, H.; Qu, A. Design of Intelligent Detection Platform for Wine Grape Pests and Diseases in Ningxia. Plants 2023, 12, 106. https://doi.org/10.3390/plants12010106

AMA Style

Wang Y, Wei C, Sun H, Qu A. Design of Intelligent Detection Platform for Wine Grape Pests and Diseases in Ningxia. Plants. 2023; 12(1):106. https://doi.org/10.3390/plants12010106

Chicago/Turabian Style

Wang, Yutan, Chi Wei, Haowei Sun, and Aili Qu. 2023. "Design of Intelligent Detection Platform for Wine Grape Pests and Diseases in Ningxia" Plants 12, no. 1: 106. https://doi.org/10.3390/plants12010106

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop