Disease and pest detection method and system for edge calculation
Through the self-developed DGS-YOLOv7-Tiny model combined with lightweight global attention mechanism and deep separable convolution, it solves the complex problem of traditional pest detection models for computing, and realizes efficient and real-time pest detection in an edge computing environment. It is suitable for embedded devices with limited resources.
Patent Information
- Application Number
- CN202510465445.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-07-25
AI Technical Summary
The existing traditional pest and disease detection models have large and complex calculations, making it difficult to meet the dual requirements of real-time and accuracy in an edge computing environment, and cannot be efficiently deployed on devices with limited computing resources.
The self-developed DGS-YOLOv7-Tiny model is adopted, which combines lightweight global attention mechanism and deep separable convolution. Through data augmentation and optimization training process, it reduces the computational complexity and improves feature expression capabilities. Edge computing is performed using Jetson XavierNX equipment.
It realizes efficient and real-time pest detection in complex agricultural environments, reduces computing and storage requirements, is suitable for embedded devices with limited resources, and has good robustness and generalization capabilities.
Smart Images

Figure CN120375281A_ABST
Abstract
Description
Technical Field
[0001] A pest and disease detection method and system for edge computing. Background Art
[0002] Smart agriculture is gradually integrating technologies such as the Internet of Things, big data, edge computing, cloud computing, and artificial intelligence to achieve the intelligence and precision of agricultural production. In this process, object detection technology plays a key role. It can identify crops, pests and diseases, and agricultural machinery in farmland in real time, providing important information support for agricultural production. However, traditional object detection models have large computational requirements and are complex, making it difficult to meet the dual requirements of real-time performance and accuracy in smart agriculture. Especially in the edge computing environment, how to achieve efficient detection under limited computing resources and power consumption is a challenge.
[0003] Edge computing migrates data processing tasks from the cloud to the network edge, reducing data transmission latency and improving system response speed, which is particularly suitable for smart agriculture applications with high real-time requirements. In this environment, lightweight object detection models have become a research hotspot. Lightweight models can significantly reduce computational and storage requirements while ensuring detection accuracy, facilitating deployment and operation on edge devices with limited resources.
[0004] To enable the pest and disease detection model to be more easily deployed on edge devices with limited computing resources, there is an urgent need for an efficient, low-power, and lightweight pest and disease detection method and system. Based on this background, this patent proposes a lightweight object detection model, the DGS-YOLOv7-Tiny model, which improves the self-developed DGS by fusing convolution and a lightweight global attention mechanism (Global Attention Module, abbreviated as GAM module) of yolov7-tiny, and designs a matching embedded device and system to achieve efficient pest and disease detection in modern agriculture. Summary of the Invention
[0005] The main objective of the present invention is to solve the problem that existing traditional methods can no longer meet the demand for efficient and real-time monitoring of pests and diseases in the face of the rapid development of modern agriculture;
[0006] Another objective of the present invention is to solve the problem that there are many bottlenecks in existing deep learning models for pest and disease identification;
[0007] The present invention provides a pest and disease detection method and system for edge computing to achieve the above objectives and solve the above problems.
[0008] The present invention provides a detection method, and the steps included in the method are as follows:
[0009] Step 1: Data Collection: In the pest and disease detection system, data collection captures farmland images through a high-definition camera under different lighting, weather, and time conditions to ensure the diversity and comprehensiveness of the images, covering various pest and disease characteristics. Subsequently, LabelImg is used for data annotation. By manually drawing bounding boxes and assigning class labels, the annotated data is saved in the YOLO format. Finally, the data is divided into a training set, a validation set, and a test set for model training;
[0010] Step 2: Data Preprocessing: In the pest and disease detection system, data preprocessing improves the efficiency and stability of model training through size normalization (such as resizing to 640×640) and color standardization (scaling pixel values to the range [0,1]). In addition, data augmentation strategies are applied, such as random flipping, rotation, brightness adjustment, contrast enhancement, and noise addition, to enhance the robustness of the model. The preprocessed data can effectively reduce overfitting, improve the detection accuracy, and optimize the inference performance of DGS-YOLOv7-Tiny on edge devices, achieving the stability and reliability of real-time detection;
[0011] Step 3: Model Training: An efficient object detection model is constructed by using the self-developed lightweight DGS to fuse convolutional and global attention mechanisms. The DGS fusion convolution combines depthwise separable convolution, the Ghost module, and the SE attention mechanism, retaining rich feature expression capabilities while reducing computational complexity and the number of parameters. The global attention mechanism enhances the model's ability to capture long-range dependencies. During training, the SIOU loss function is used to optimize the detection performance, and hyperparameters such as the learning rate, optimizer, and batch size are adjusted to ensure the model converges quickly, achieving high accuracy and low loss;
[0012] Step 4: Model Validation: In the validation stage, the mAP is used as the main evaluation metric to measure the detection effect of the model on different classes, and the change in the loss function on the validation set is monitored to detect overfitting or underfitting. Further, metrics such as precision, recall, and F1-score are used to evaluate the performance of the model, and the classification effect is analyzed through a confusion matrix to ensure the reliability and stability of the model in practical applications;
[0013] Step 5: Saving the Best Weights and Results: During the training process, the best performance of the model is ensured by saving the best weights. After each training epoch, the performance of the model is evaluated based on key metrics such as the mAP of the validation set. If the current model is better than the previous best performance, the latest weight file is saved. Finally, the best weights and model results are stored in a specified directory for subsequent inference and testing, ensuring the accuracy and stability of pest and disease detection;
[0014] Step 6, Model Testing: In the testing stage, use an independent test set to comprehensively evaluate the model. Infer the input images and obtain the prediction results. Evaluate the detection ability through indicators such as mAP, precision, recall rate, and F1 score. At the same time, visualize the results to analyze the performance of the model in complex scenarios. Finally, verify the accuracy and robustness of the model by comparing the overlap between the predicted bounding boxes and the actual label bounding boxes, providing a basis for actual deployment.
[0015] The pest and disease identification system of this invention patent consists of three devices: an embedded device based on Jetson Xavier NX, an image acquisition device, and a network communication device.
[0016] In this study, NVIDIA Jetson Xavier NX is selected as the embedded device for edge computing in the pest and disease detection system. This platform is equipped with a 6-core CPU, 384-core GPU, and 2 NVDLA acceleration engines, with a computing power of 21 TOPS and a memory bandwidth of 59.7 GB / s, ensuring the efficient execution of neural network inference tasks. By integrating the DGS-YOLOv7-Tiny model with visualization software, precise detection is achieved. At the same time, a rechargeable mobile power supply with a capacity of 90,000 mAh and a power output of 300 W is adopted, with multiple safety protections and wide-temperature adaptability, ensuring the stable operation of the device in complex environments.
[0017] To achieve precise detection of pests and diseases, this study uses a Hikvision MV-CA032-10GC industrial camera for image acquisition in pest and disease detection. This camera has high performance, high precision, and stability, can operate stably in complex environments, and ensures the provision of high-quality image data. It supports a wide spectral range and automatic exposure control, adapts to different lighting conditions, and has horizontal and vertical mirror functions to meet diverse needs. The compact design and USB lock catch further ensure the stability and reliability of the device, avoiding data loss or connection interruption.
[0018] To ensure high-speed and stable communication between the Jetson Xavier NX device and the local PC software platform, this study selects the Quectel RM500Q-GL 5G communication module, which is connected to Jetson Xavier NX through an M.2 interface, supports PCIe 3.0 or USB 3.1, and realizes high-speed and low-latency data transmission. The module is compatible with NSA and SA 5G modes and supports 4G LTE networks at the same time to ensure automatic switching when 5G is unavailable, maintaining communication stability and system adaptability, and enhancing the remote monitoring ability of the pest and disease detection system.
[0019] The working principle of a pest and disease detection method and system for edge computing provided by this invention is as follows:
[0020] In terms of hardware, the system is based on the Jetson Xavier NX embedded computing platform, and can efficiently run the DGS-YOLOv7-Tiny model with 21 TOPS computing power to achieve accurate pest and disease detection. The image acquisition uses the Hikvision MV-CA032-10GC industrial camera, which ensures clear images in complex environments through automatic exposure and mirror functions. With the Quectel RM500Q-GL5G module, the system realizes high-speed data transmission, ensures real-time feedback of detection results, and improves the response speed and remote management capabilities.
[0021] In terms of software, the system designs an intuitive GUI interaction interface based on PyQt5, which facilitates users to adjust detection parameters, view detection results, and manage historical data. Users can easily perform image loading and detection operations through the interface, and view key information such as detection targets, confidence levels, and IoU in real time, significantly improving the user-friendliness of the system.
[0022] The system adopts the DGS-YOLOv7-Tiny lightweight object detection model, with only 4.43M parameters and a computational volume of 10.2 GFLOPs. While maintaining high detection accuracy, it significantly reduces the computational cost and ensures efficient operation in the embedded environment. Combining preprocessing techniques such as automatic exposure, image enhancement, and color normalization, the model still has excellent detection robustness and generalization ability under different lighting and background conditions.
[0023] The system realizes remote connection with the local PC or mobile device through the 5G communication module, supports real-time monitoring and control, and allows viewing of detection results and device status even without personnel on site. With its efficient pest and disease detection capabilities, remote management, and multi-dimensional environmental monitoring functions, the system significantly improves the automation level of agricultural intelligent monitoring.
[0024] The new model introduces a Global Attention Module (GAM) between the backbone network and the detection head, enhancing the context information aggregation ability, improving the detection performance of small objects, and reducing noise interference at the same time. By replacing some components with DGS-ELAN modules and DGS convolutions, the feature extraction ability is optimized, and the number of parameters and computational volume are reduced. The activation function is changed from Leaky ReLU to SiLU, enhancing the non-linear expression ability and accelerating the training convergence speed. The loss function is replaced by SIOU Loss from CIOU Loss, further reducing the risk of overfitting and improving the detection accuracy. The lightweight design of the overall model makes it suitable for mobile devices and embedded systems.
[0025] Introduce GAM before the backbone network and the detection head of the YOLOv7-Tiny model to strengthen the global context modeling of low-level features, improve the target localization and classification accuracy, and perform particularly well in the case of small targets or occlusions. GAM can also reduce information redundancy and suppress noise interference to ensure the model maintains stable detection performance in complex scenarios.
[0026] A lightweight new model effectively reduces the number of model parameters and the amount of computation, and improves the efficiency of the convolutional layer. In this paper, a new fused convolution - DGS convolution is designed. Replace some standard convolutions with DGS convolutions, and replace the ELAN module in the YOLOv7-Tiny model with the DGS-ELAN module to achieve the goal of retaining detailed information, reducing the number of model parameters and the amount of computation.
[0027] Using DGS convolution is beneficial to improving the efficiency and accuracy of the DGS-YOLOv7-Tiny model. Use depthwise separable convolution (DSC) to process the input feature map. The depthwise convolution independently performs spatial convolution on each input channel, effectively reducing the amount of computation, while the pointwise convolution integrates cross-channel information through a 1x1 convolution kernel, combining channels while retaining the feature resolution. DSC can reduce the number of model parameters and the amount of computation while maintaining good feature extraction ability, and is suitable for resource-constrained scenarios. Then, introduce Ghost convolution to further reduce the computational cost. Ghost convolution generates "pseudo" features (ghost feature) through inexpensive operations, combines them with the basic feature map (cheap feature), reduces the computational overhead and memory occupancy, thereby making the model more lightweight and suitable for mobile devices and embedded systems. Finally, the DGS-ELAN module introduces the SE attention mechanism to dynamically adjust the importance of different positions and channels in the feature map.
[0028] Although the CIOU (Complete IoU) loss function of YOLOv7-tiny considers factors such as the overlapping area, the distance between the center points, and the aspect ratio, it fails to fully consider the spatial alignment between the target bounding boxes. To improve the model accuracy and robustness, the SIOU (Scalable IoU) loss function, as an improved version of IoU, provides more refined bounding box regression optimization. SIOU not only inherits the traditional IoU calculation method but also introduces information such as the scale, angle, shape, and orientation of the bounding box, and can provide a more comprehensive and accurate metric through the difference between the predicted box and the ground truth box.
[0029] The SIoU loss consists of four parts: IoU loss, distance loss, aspect ratio loss, and shape loss. The IoU loss measures the degree of overlap, the distance loss optimizes the precise positioning of the center point of the bounding box, the aspect ratio loss adjusts the aspect ratio of the bounding box, and the shape loss improves the geometric shape of the box. By integrating these factors, the SIoU loss can effectively enhance the model's understanding of the target's position, shape, and orientation, especially in complex scenarios, significantly improving the detection accuracy and robustness.
[0030] Advantages of the present invention:
[0031] To more clearly display the experimental results, Tomato Early Blight Leaf, Tomato Septoria Leaf Spot, Tomato Leaf, Tomato Leaf Bacterial Spot, Tomato Leaf Late Blight, Tomato Leaf Mosaic Virus, Tomato Leaf Yellow Virus, and Tomato Mold Leaf are abbreviated as TEBL, TSLS, TL, TLBS, TLLB, TLMV, TLYV, and TML, respectively. BF stands for background FP, representing the background. The classification accuracy of the TL category is the highest, reaching 98%, showing excellent performance; the TEBL and TSLS categories are 97% and 96% respectively, also showing stable performance. However, the classification accuracy of the TLMV category is relatively low, only 91%, and although the accuracy of the TLYV category is 95%, the background misdetection rate is as high as 0.37, possibly due to the insignificant sample features or the similar background color and disease area. In terms of the background missed detection rate, although it is relatively low for most categories, the TLMV category reaches 0.09, reflecting that its symptoms are usually local and insignificant, making it difficult to effectively identify. Generally speaking, the DGS-YOLOv7-tiny model performs well in most categories, with strong robustness and generalization ability.
[0032] The training results of DGS-YOLOv7-tiny show that before the number of training rounds reaches 200, the value of the loss function drops rapidly, while the precision, recall, and mean average precision increase significantly, and the model performance improves rapidly. When the number of training rounds is between 200 and 250, the rate of decline of the loss function value gradually slows down, and at the same time, the growth trends of accuracy, recall, and mean average precision also tend to level off. After the number of training rounds exceeds 250, although the loss curve on the training set still has a slight decline, the change amplitude is very small, and other indicators basically remain stable. This indicates that the network model is approaching convergence. In addition, the value of the loss function on the validation set is slightly higher than that on the training set, but the two are always in the same order of magnitude, indicating that the model performs well on the validation set, has good generalization ability, and there is no obvious overfitting phenomenon. The DGS-YOLOv7-Tiny model performs excellently in the object detection task and also performs well in the recognition of small objects, and can accurately capture the subtle disease spots and small pests on the leaves. Overall, this model can not only effectively detect the pests and diseases on crops, but also has good adaptability, can operate stably in complex agricultural environments such as different lighting and background interference, and provides efficient and accurate technical support for intelligent agricultural pest and disease monitoring.
[0033] Comparison of the evaluation metrics of Precision, Recall, mAP, Params, and GFLOPs between the DGS-YOLOv7-tiny model and various comparison models. The parameters of the DGS-YOLOv7-tiny model are only 4.43M, the GFLOPs is only 10.2, and the FPS reaches 198. Compared with YOLOv8s, the size is reduced by 60.2%, the GFLOPs is reduced by 64.21%, and the speed is increased by 36.55%. Compared with YOLOv7, the size is reduced by 88.24%, the GFLOPs is reduced by 90.74%, and the speed is increased by 133.55%. Compared with YOLOv7-tiny, the size is reduced by 26.53%, the GFLOPs is reduced by 22.73%, and the speed is increased by 7.61%. Compared with YOLOv5s, the size is reduced by 36.98%, the GFLOPs is reduced by 35.44%, and the speed is increased by 25.32%. Compared with YOLOv3-tiny, the size is reduced by 48.96%, the GFLOPs is reduced by 20.93%, and the speed is increased by 43.48%. Compared with YOLOv7 and YOLOv8s, the Precision and mAP_0.5 of the DGS-YOLOv7-tiny model are slightly lower, but this model has fewer parameters and computational requirements and faster processing speed. It should be noted that compared with the benefits brought by the model size and speed, the slight decrease in Precision and mAP_0.5 is negligible to a certain extent. Compared with other models, while accurately detecting pests and diseases, DGS-YOLOv7-tiny significantly reduces the hardware requirements and operating costs, meeting the needs of agricultural scenarios for high efficiency, low power consumption, and real-time performance. This model is particularly suitable for applications such as drone field patrol, intelligent agricultural machinery equipment, on-site farmland detection, portable devices, and fixed monitoring nodes, becoming a key technology in the field of intelligent pest and disease identification. Description of the Drawings
[0034] Figure 1 Flowchart of the pest and disease detection method provided by the embodiment of the present invention;
[0035] Figure 2 Diagram of the pest and disease detection device provided by the embodiment of the present invention;
[0036] Figure 3 Software design process of the detection system provided by the embodiment of the present invention;
[0037] Figure 4 Core network structure diagram of the DGS-YOLOv7-Tiny model provided by the embodiment of the present invention;
[0038] Figure 5 Network structure diagram of the GAM module provided by the embodiment of the present invention;
[0039] Figure 6 The network structure diagram of the CBS module provided by the embodiment of the present invention;
[0040] Figure 7 The network structure diagram of the DGS-ELAN module provided by the embodiment of the present invention;
[0041] Figure 8 The network structure diagram of the DGS module provided by the embodiment of the present invention;
[0042] Figure 9 The confusion matrix diagram of the DGS-YOLOv7-Tiny model provided by the embodiment of the present invention;
[0043] Figure 10 The F1-score-confidence curve of the DGS-YOLOv7-Tiny model provided by the embodiment of the present invention;
[0044] Figure 11 The accuracy-recall curve of the DGS-YOLOv7-Tiny model provided by the embodiment of the present invention;
[0045] Figure 12 The training results of the DGS-YOLOv7-tiny provided by the embodiment of the present invention;
[0046] Figure 13 The pest and disease detection result diagram provided by the embodiment of the present invention; Detailed implementation manners
[0047] The detailed implementation manners of the device cover two core parts: hardware deployment and software system design, ensuring the efficient operation and convenient operation of the system in a complex agricultural environment.
[0048] Hardware deployment
[0049] In terms of hardware, the system relies on the Jetson Xavier NX embedded computing platform for efficient AI computing. This platform has a computing power of 21 TOPS and can smoothly run the DGS-YOLOv7-Tiny lightweight object detection model, ensuring high-precision and high-efficiency pest and disease detection. The image acquisition part uses the Hikvision MV-CA032-10GC industrial camera, which has high-resolution imaging capabilities, supports automatic exposure adjustment, horizontal / vertical mirroring, and can operate stably for a long time in complex environments such as greenhouse sheds and farmlands, ensuring that the acquired image data is clear and rich in details. In addition, the system integrates the Quectel RM500Q-GL 5G communication module, using the high-speed 5G network to achieve real-time data transmission between the embedded device and the local PC software platform, ensuring that the detection results can be quickly fed back, improving the response speed and remote management ability of the system.
[0050] At the same time, the device supports a variety of external interfaces, which can expand more sensors (such as temperature and humidity sensors) to achieve multi-dimensional agricultural environment monitoring. The device adopts a compact embedded design, which is convenient for flexible installation and deployment in greenhouses, farmlands and other environments, and combines an industrial-grade USB interface locking design to prevent data collection interruptions due to loose equipment during operation, ensuring long-term stable operation.
[0051] Hardware deployment software system design
[0052] In terms of software, the system is designed with a GUI based on PyQt5, providing an intuitive and easy-to-operate user interface, which allows users to adjust detection parameters, view detection results, manage historical data, etc. Users can easily complete image loading and detection operations through the visual interface, and view key information such as detection targets, confidence, IoU (intersection over union) in real time, which greatly improves the user-friendliness of the system.
[0053] The core algorithm uses the DGS-YOLOv7-Tiny lightweight target detection model, which has only 4.43M parameters and 10.2GFLOPs of computing power. While maintaining high-precision detection, it greatly reduces the computing cost and ensures that the device can run efficiently in an embedded environment. In addition, combined with image preprocessing technologies such as automatic exposure, image enhancement, and color normalization, the detection effect is further optimized, so that the model can stably identify targets under different lighting and backgrounds, improving the robustness and generalization ability of detection.
[0054] The system connects to the local PC or mobile device through the 5G communication module, allowing users to remotely monitor and control in real time. Even if there is no one on duty, they can check the test results and equipment status at any time, improving the automation level of agricultural intelligent monitoring. Overall, the device not only has efficient pest and disease detection capabilities, but also has remote management, real-time interaction, multi-dimensional environmental monitoring and other functions, providing modern agriculture with more intelligence.
[0055] The experimental verification of the above implementation is as follows:
[0056] (1) Dataset:
[0057] This invention patent uses the publicly available dataset Tomato LeafDiseases Detection provided by Rboflow, which involves 8 types. This experiment uses 3,826 images of 8 types, namely Tomato Earlyblight leaf, Tomato Septoria leaf spot, Tomato leaf, Tomato leafbacterial spot, Tomato leaflate blight, Tomato leafmosaic virus, Tomato leafyellow virus, and Tomato mold leaf. Considering that a small amount of data may make it difficult for the model to learn features, this paper adopts the data augmentation method provided by Rboflow official to perform operations such as horizontal flipping, adjusting the saturation by ±25% up and down, and adding 0.1% random noise to the images in the Tomato LeafDiseases Detection dataset, increasing the number of original dataset pictures from 3,826 to 9,186.
[0058] (2) Performance metrics:
[0059] Confusion matrix:
[0060] The confusion matrix shows the object detection performance of the model on images of different categories, providing an intuitive perspective for understanding the classification accuracy error situation. Figure 9 It is the confusion matrix diagram of the DGS-YOLOv7-Tiny model.
[0061] To more clearly display the experimental results, Tomato Early Blight Leaf, TomatoSeptoria LeafSpot, Tomato Leaf, TomatoLeafBacterial Spot, Tomato LeafLate Blight, Tomato LeafMosaic Virus, Tomato LeafYellowVirus, and Tomato Mold Leaf are abbreviated as TEBL, TSLS, TL, TLBS, TLLB, TLMV, TLYV, and TML respectively. BF stands for backgroundFP, indicating the background. Figure 9It shows that the classification accuracy of the TL category is the highest, reaching 98%, showing excellent performance; the TEBL and TSLS categories are 97% and 96% respectively, also showing stable performance. However, the classification accuracy of the TLMV category is relatively low, only 91%, and although the accuracy of the TLYV category is 95%, the background misdetection rate is as high as 0.37, which may be due to the insignificant sample features or the similar background color and disease area. In terms of the background missed detection rate, although most categories are low, the TLMV category reaches 0.09, reflecting that its symptoms are usually local and insignificant, resulting in difficulty in effective identification. Generally speaking, the DGS-YOLOv7-tiny model performs well in most categories and has strong robustness and generalization ability.
[0062] F1-Score - Confidence Curve:
[0063] The F1-Score - Confidence Curve is a way to evaluate the performance of the F1 at different confidence thresholds as Figure 10 shown, demonstrating the trend of the F1-Score changing with the confidence. The F1-Score is the harmonic mean of Precision and Recall, and is often used to measure the overall performance of a classification model. Different application scenarios may have different requirements for Precision and Recall. By observing the F1-Score curve, users can select the most appropriate confidence threshold to maximize the F1-Score of the model and ensure a good balance between Precision and Recall.
[0064] Precision - Recall Curve:
[0065] The Precision - Recall Curve is used to evaluate the performance of the model in object detection by showing the relationship between Precision and Recall at different confidence thresholds as Figure 11 shown. The Area Under the Curve (AUC-PR) of the PR curve is an important evaluation metric. The closer the AUC-PR is to 1, the better the performance of the model.
[0066] (3) Comparative Experiments:
[0067] The comparison of the Precision, Recall, mAP, Params, and GFLOPs evaluation metrics between the DGS-YOLOv7-tiny model and each comparative model is shown in Table 1.
[0068] Table 1 Comparison of Key Metrics of Each Model
[0069]
[0070] As can be seen from Table 1, the DGS-YOLOv7-tiny model is superior to other models in terms of parameters and computational complexity. Specifically, the DGS-YOLOv7-tiny model has only 4.43M parameters, 10.2 GFLOPs, and an FPS of 198. Compared with YOLOv8s, the size is reduced by 60.2%, GFLOPs is reduced by 64.21%, and the speed is increased by 36.55%. Compared with YOLOv7, the size is reduced by 88.24%, GFLOPs is reduced by 90.74%, and the speed is increased by 133.55%. Compared with YOLOv7-tiny, the size is reduced by 26.53%, GFLOPs is reduced by 22.73%, and the speed is increased by 7.61%. Compared with YOLOv5s, the size is reduced by 36.98%, GFLOPs is reduced by 35.44%, and the speed is increased by 25.32%. Compared with YOLOv3-tiny, the size is reduced by 48.96%, GFLOPs is reduced by 20.93%, and the speed is increased by 43.48%. Compared with YOLOv7 and YOLOv8s, the Precision and mAP_0.5 of the DGS-YOLOv7-tiny model are slightly lower, but this model has fewer parameters and less computational complexity and faster processing speed. It is worth noting that compared with the benefits brought by the model size and speed, the slight decrease in Precision and mAP_0.5 is negligible to a certain extent. Compared with other models, while accurately detecting pests and diseases, DGS-YOLOv7-tiny significantly reduces the hardware requirements and operating costs, meeting the needs of agricultural scenarios for high efficiency, low power consumption, and real-time performance. This model is particularly suitable for applications such as drone field patrol, intelligent agricultural machinery equipment, on-site farmland detection, portable devices, and fixed monitoring nodes, becoming a key technology in the field of intelligent pest and disease identification.
[0071] Application scenarios:
[0072] This device is applicable to agricultural production environments such as greenhouse, farmland, and orchard, and can be used for intelligent agricultural applications such as pest and disease detection, crop health monitoring, and agricultural environment monitoring. With the help of a high-resolution industrial camera, the system can accurately capture images of key parts such as crop leaves and fruits, and use the DGS-YOLOv7-Tiny lightweight detection model to identify pests, diseases, and growth abnormalities. Combined with a 5G high-speed communication module, the detection results can be uploaded to the local PC or cloud in real time to achieve remote monitoring and intelligent early warning, reducing the cost of manual inspection and improving the intelligent level of agricultural management. In addition, this device supports the expansion of environmental sensors such as temperature, humidity, and light, and can comprehensively analyze the agricultural ecological environment, providing technical support for precision agriculture and unmanned planting, and helping the development of smart agriculture.
Claims
1. A pest and disease detection method for edge computing, characterized in that: The steps included are as follows: First step, data collection: In the pest and disease detection system, data collection captures farmland images through a high-definition camera under different lighting, weather, and time conditions to ensure the diversity and comprehensiveness of the images, covering various pest and disease characteristics at the same time. Subsequently, LabelImg is used for data annotation. By manually drawing bounding boxes and assigning class labels, the annotated data is saved in the YOLO format. Finally, the data is divided into a training set, a validation set, and a test set for model training; Second step, data preprocessing: In the pest and disease detection system, data preprocessing improves the efficiency and stability of model training through size normalization (such as resizing to 640×640) and color standardization (scaling pixel values to the [0,1] interval). In addition, data augmentation strategies are applied, such as random flipping, rotation, brightness adjustment, contrast enhancement, and noise addition, to enhance the robustness of the model. The preprocessed data can effectively reduce overfitting, improve the detection accuracy, and at the same time optimize the inference performance of DGS-YOLOv7-Tiny on edge devices, achieving the stability and reliability of real-time detection; Third step, model training: An efficient object detection model is constructed by using the self-developed lightweight DGS to fuse convolution and global attention mechanisms. The DGS fusion convolution combines depthwise separable convolution, the Ghost module, and the SE attention mechanism, retaining rich feature expression capabilities while reducing the computational complexity and the number of parameters. The global attention mechanism enhances the model's ability to capture long-range dependency relationships. During training, the SIOU loss function is used to optimize the detection performance, and the hyperparameters such as the learning rate, optimizer, and batch size are adjusted to ensure the rapid convergence of the model, achieving high accuracy and low loss; Fourth step, model validation: In the validation stage, mAP is used as the main evaluation metric to measure the detection effect of the model on different categories. At the same time, the change of the loss function on the validation set is monitored to detect overfitting or underfitting. Further, metrics such as precision, recall, and F1 score are used to evaluate the performance of the model, and the classification effect is analyzed through a confusion matrix to ensure the reliability and stability of the model in practical applications; Fifth step, saving the best weights and results: During the training process, the best performance of the model is ensured by saving the best weights. After each training epoch, the performance of the model is evaluated based on key metrics such as the mAP of the validation set. If the current model is better than the previous best performance, the latest weight file is saved. Finally, the best weights and model results are stored in a specified directory for subsequent inference and testing to ensure the accuracy and stability of pest and disease detection; Sixth step, model testing: In the testing stage, the model is comprehensively evaluated using an independent test set. The input images are inferred to obtain prediction results. The detection ability is evaluated through metrics such as mAP, precision, recall, and F1 score. At the same time, the results are visualized to analyze the performance of the model in complex scenarios. Finally, by comparing the overlap between the predicted bounding boxes and the actual label bounding boxes, the accuracy and robustness of the model are verified, providing a basis for actual deployment.
2. A pest and disease detection system for edge computing, characterized in that: It consists of three devices: an embedded device based on Jetson Xavier NX, an image acquisition device, and a network communication device; In this study, NVIDIA Jetson Xavier NX is selected as the embedded device for edge computing in the pest detection system. This platform is equipped with a 6-core CPU, 384-core GPU, and 2 NVDLA acceleration engines, with a computing power of 21 TOPS and a memory bandwidth of 59.7 GB / s, ensuring the efficient execution of neural network inference tasks. By integrating the DGS-YOLOv7-Tiny model with visualization software, accurate detection is achieved. At the same time, a rechargeable mobile power supply with a capacity of 90,000 mAh and a power output of 300 W is adopted, which has multiple safety protections and wide-temperature adaptability to ensure the stable operation of the device in complex environments; To achieve accurate detection of pests and diseases, in this study, a Hikvision MV-CA032-10GC industrial camera is used for image acquisition of pest and disease detection. This camera has high performance, high precision, and stability, and can operate stably in complex environments to ensure the provision of high-quality image data. It supports a wide spectral range and automatic exposure control, adapts to different lighting conditions, and has horizontal and vertical mirror functions to meet diverse needs. The compact design and USB locking buckle further ensure the stability and reliability of the device, avoiding data loss or connection interruption; To ensure high-speed and stable communication between the Jetson Xavier NX device and the local PC software platform, in this study, the Quectel RM500Q-GL 5G communication module is selected and connected to Jetson Xavier NX through the M.2 interface, supporting PCIe 3.0 or USB 3.1 to achieve high-speed and low-latency data transmission. The module is compatible with NSA and SA 5G modes and also supports 4G LTE networks to ensure automatic switching when 5G is unavailable, maintaining communication stability and system adaptability, and enhancing the remote monitoring ability of the pest detection system.
3. The pest and disease detection system for edge computing according to claim 2, characterized in that: In this study, PyQt5 is used to develop the user interface of the pest detection system. First, the development environment is set up and necessary libraries such as PyQt5, OpenCV, and PyTorch are configured. The main window is designed through Qt Designer, and the components are reasonably laid out to ensure the interface is simple and beautiful. QLabel and QTableWidget are used to display the detection results, and the QGroupBox is used for modular management of the function areas. The interactive functions are realized with the help of PyQtSignal and PyQtSlot, making the user operation intuitive and convenient. Finally, the DGS-YOLOv7-Tiny model is integrated into the interface to achieve image input, parameter adjustment, and real-time detection, ensuring that users can quickly obtain accurate detection results.
4. The pest and disease detection system for edge computing according to claim 2, characterized in that: The Jetson Xavier NX has an AI computing power of 21 TOPS and can efficiently run the DGS-YOLOv7-Tiny model with only 4.43M parameters and 10.2 GFLOPs of computational volume, achieving accurate and rapid pest and disease detection. Combined with the high-resolution images provided by the Hikvision MV-CA032-10GC industrial camera, it further improves the detection accuracy while maintaining a low computational burden and a high detection speed.
5. The pest and disease detection system for edge computing according to claim 2, characterized in that: The Quectel RM500Q-GL 5G module provides high-speed data transmission capabilities, enabling real-time communication between embedded devices and the PC-side software platform, significantly enhancing the usability and response speed of detection results. Through the 5G network, researchers can remotely view the detection results, supporting unattended intelligent management and further improving the convenience and efficiency of agricultural monitoring.
6. The pest and disease detection system for edge computing according to claim 2, wherein: The device adopts a compact embedded design, facilitating flexible deployment in complex environments such as greenhouse sheds and farmlands. Combining the automatic exposure, mirror adjustment, and USB interface locking design of the industrial camera, the device can operate stably under harsh conditions such as high humidity and large temperature differences, ensuring long-term reliability while improving the overall maintainability of the system.
7. The pest and disease detection system for edge computing according to claim 2, wherein: The software system based on PyQt5 provides an intuitive GUI interaction interface, making it convenient for users to adjust detection parameters, view results, and manage data. The device supports multiple external interfaces, facilitating the expansion of more sensors to achieve comprehensive monitoring of the agricultural environment and enhancing the comprehensiveness and adaptability of the system.