Rice brown spot detection and counting method, system and equipment

By improving the YOLOv8 model and introducing the C2f-EFA module, ASFPN module, WSIoU loss function, and TADHead detection head, the problems of insufficient accuracy in multi-scale feature extraction and small target detection in rice brown spot disease detection and counting were solved, achieving efficient and accurate disease detection and counting.

CN121482047AActive Publication Date: 2026-02-06SANYA NATIONAL INSTITUTE OF SOUTHERN BREEDING CHINESE ACADEMY OF AGRICULTURAL SCIENCES +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202610021410.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-08
Publication Date
2026-02-06
Estimated Expiration
2046-01-08

AI Technical Summary

Technical Problem

Existing target detection models suffer from insufficient accuracy in multi-scale feature extraction, feature fusion, and small target detection in the detection and counting of brown spot disease in rice, making it difficult to meet the needs of efficient and high-precision disease detection.

Method used

The YOLOv8 detection model is improved by introducing the C2f-EFA module, the ASPPN module, the WSIoU loss function, and the TADHead detection head to optimize model performance. The detection accuracy and efficiency are improved through residual feature attention connection, multi-scale feature fusion, and task adaptive decoupling.

Benefits of technology

It achieves efficient and accurate detection and counting of rice brown spot disease, improving the accuracy and efficiency of disease detection and counting, and is suitable for detection scenarios with complex backgrounds and limited resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121482047A_ABST
    Figure CN121482047A_ABST
Patent Text Reader

Abstract

The invention relates to the field of crop breeding, in particular to a rice brown spot detecting and counting method, which has the technical scheme that by improving a YOLOv8 model, introducing a C2f-EFA module, an ASFPN module, a WSIoU loss function and a TADHead detection head and optimizing model performance, efficient and accurate rice brown spot detecting and counting are realized, the accuracy and efficiency of brown spot disease detecting and counting are improved, and the rice brown spot disease detecting and counting method is suitable for large-scale popularization and application. Technical support is provided for rice disease analysis; wherein the C2f-EFA module enhances the feature expression ability of the disease spots and the disease leaves of the brown spot, the parameter quantity and the calculation complexity are remarkably reduced, and the method is suitable for a brown spot detection scene with limited resources; the ASFPN module effectively improves the detection capability of the model on the brown spot disease spots and diseased leaves, and is suitable for processing scenes with large scale difference, complex background and small disease spots; the TADHead detection head enhances the generalization ability of a brown spot detection model, enhances the detection precision of brown spot disease spots and diseased leaves, and ensures robustness under the condition of complex background or low contrast; the WSIoU loss function obviously improves the positioning accuracy of the disease spots and the disease leaves.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of crop breeding, and in particular to a method, system and equipment for detecting and counting brown spot disease in rice. Background Technology

[0002] Rice brown spot is one of the most serious rice diseases worldwide, significantly reducing rice yield and quality. Brown spot mainly manifests as brown spots and diseased areas on leaves, exhibiting complex and diverse morphology, size, and distribution. Traditional manual detection methods rely on visual observation, resulting in low efficiency, poor accuracy, and inconsistent results. The development of computer vision and deep learning technologies has made automated identification and counting of brown spot possible. However, existing target detection models face challenges in handling brown spot detection tasks: large differences in the scale of lesions and diseased leaves, complex backgrounds, blurred lesion boundaries, and difficulties in detecting small targets make it difficult for traditional methods to meet the demands of large-scale, high-precision, and efficient disease detection and counting.

[0003] The YOLO series of target detection models excels in agricultural disease detection due to their efficiency and real-time performance. YOLOv8, the latest version in the series, employs an anchor-free method, enhancing its adaptability to complex targets through flexible anchor point and offset prediction. However, in scenarios involving brown spot disease detection and counting, YOLOv8 still requires optimization in multi-scale feature extraction, feature fusion, and small target detection accuracy.

[0004] In view of this, we propose a method, system and equipment for the detection and counting of brown spot disease in rice to solve the existing problems. Summary of the Invention

[0005] The purpose of this invention is to provide a method, system, and device for detecting and counting brown spot disease in rice, so as to solve the problems mentioned in the background art.

[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for detecting and counting rice brown spot disease, comprising the following steps:

[0007] S1: Collect image data of rice leaves infected with brown spot disease, perform target detection through an improved YOLOv8 detection model, and obtain detection results. Improvement measures include C2f-EFA module, ASFPN module, WSIoU loss function and TADHead detection head;

[0008] S2: Based on the test results, count the number of bounding boxes for diseased leaves and lesions.

[0009] Furthermore, in S1, the C2f-EFA module includes residual feature attention connections, RFA block modules, and depthwise separable convolutions; wherein, the residual feature attention connections extract global and local features through a multi-path structure; the RFA block modules consist of multiple cascaded attention convolutional layers, each using the same kernel size and activation function; and the depthwise separable convolutions include depthwise convolutions and pointwise convolutions.

[0010] Furthermore, in S1, the ASFPN module includes a multi-scale feature input, a feature selection module, and a feature fusion module. The multi-scale feature input receives the multi-scale feature map output by the backbone network. The feature selection module performs feature filtering and channel alignment through channel attention and dimension matching. The feature fusion module adopts a selective feature fusion mechanism to achieve adaptive multi-scale feature interaction and weighted fusion.

[0011] Furthermore, in S1, the TADHead detection head includes a shared convolutional layer and a task-adaptive decoupling module. The shared convolutional layer receives multi-scale feature maps output by ASFPN, processes feature maps of different resolutions uniformly through a shared 3×3 convolutional kernel to generate a consistent feature representation, and then adjusts the number of channels through a 1×1 convolution. The task-adaptive decoupling module performs task-specific classification and regression branches. The output of each branch is concatenated and integrated through channel splicing, and then processed by a 1×1 convolution and the ReLU activation function.

[0012] Furthermore, in S1, the WSIoU loss function includes angle loss, distance loss, shape loss, and IoU loss. Among them, the angle loss optimizes the orientation alignment of the bounding box by calculating the angular deviation of the line connecting the center points of the predicted box and the ground truth box; the distance loss dynamically adjusts the weights based on the Euclidean distance between the center points of the predicted box and the ground truth box, combined with angle information, prioritizing the optimization of predictions that are closer to the ground truth box; the shape loss is used to compare the aspect ratio of the predicted box and the ground truth box; and the IoU loss is used to combine the angle, distance, and shape losses.

[0013] Furthermore, the specific steps of S2 include: detecting the bounding boxes of diseased leaves and lesions; assigning the lesion bounding boxes to the corresponding diseased leaf bounding boxes by calculating the overlapping parts between the bounding boxes; and counting the number of bounding boxes for each diseased leaf and its associated lesion.

[0014] Furthermore, the residual feature attention connection consists of five convolutional layers and one max pooling layer, employing residual topology for feature extraction and downsampling.

[0015] Furthermore, the RFA block module contains five cascaded attention convolutional layers, each using a 3×3 convolutional kernel and a ReLU activation function.

[0016] A rice brown spot disease detection and counting system includes an image acquisition module, a detection module, and a data analysis module; wherein, the image acquisition module acquires images of rice leaves; the detection module implements a method for detecting and counting rice brown spot disease; and the data analysis module queries the bounding box count statistics results from the detection module.

[0017] A device for detecting and counting rice brown spot disease includes a processor and a memory, the memory storing a computer program, which is executed by the processor to implement a method for detecting and counting rice brown spot disease.

[0018] Compared with the prior art, the beneficial effects of the present invention are:

[0019] 1. This invention improves the YOLOv8 model by introducing the C2f-EFA module, ASFPN module, WSIoU loss function, and TADHead detection head, thereby optimizing model performance and achieving efficient and accurate detection and counting of rice brown spot disease. This improves the accuracy and efficiency of brown spot disease detection and counting, and provides technical support for rice disease analysis.

[0020] 2. The C2f-EFA module of this invention employs a smaller convolution kernel size and fewer channels in its residual feature attention connection, significantly reducing the number of parameters and computational complexity. It fully extracts global and local features through multi-path residual topology, making it suitable for complex scenarios in brown spot disease detection. The included RFA block module enhances the feature representation ability of brown spot disease lesions and leaves through efficient attention convolution and multi-layer splicing, outperforming traditional convolution modules. The included depthwise separable convolution is applied to local paths of the residual feature attention connection and operations within the RFA block, significantly reducing computational complexity while maintaining the effectiveness of feature extraction, making it suitable for resource-constrained brown spot disease detection scenarios.

[0021] 3. The ASPPN module of this invention effectively improves the model's ability to detect brown spot disease lesions and leaves, and is particularly suitable for handling scenarios with large scale differences, complex backgrounds and small lesions. It optimizes computational efficiency and feature representation, and is superior to traditional FPN or PANet, making it suitable for brown spot disease detection needs.

[0022] 4. The shared convolutional layer included in the TADHead detection head of the present invention reduces redundant computation, optimizes memory usage, unifies multi-scale feature representation, and enhances the model generalization ability of brown spot disease detection; the included task adaptive decoupling module enhances the detection accuracy of brown spot disease lesions and diseased leaves through task adaptive decoupling, and ensures robustness in complex backgrounds or low contrast conditions, which is superior to the standard coupled detection head.

[0023] 5. The WSIoU loss function of this invention comprehensively optimizes the geometric characteristics of the bounding box, reduces interference from low-quality bounding boxes in complex backgrounds, and significantly improves the localization accuracy of lesions and diseased leaves. It is superior to the traditional IoU loss function, especially when dealing with small targets and irregularly shaped lesions. Attached Figure Description

[0024] Figure 1 This is a flowchart illustrating the process of a method for detecting and counting brown spot disease in rice according to the present invention.

[0025] Figure 2 This is a schematic diagram of the C2f-EFA module of the present invention;

[0026] Figure 3 This is a schematic diagram of the ASFPN module of the present invention;

[0027] Figure 4 This is a schematic diagram of the TADHead detection head of the present invention;

[0028] Figure 5 This is a schematic diagram of the structure of a rice brown spot disease detection and counting system according to the present invention. Detailed Implementation

[0029] The technical solution of the present invention will be further described below with reference to the accompanying drawings and specific embodiments.

[0030] Example 1

[0031] A method for detecting and counting rice brown spot disease, comprising the following steps:

[0032] S1: Collect image data of rice leaves infected with brown spot disease, perform target detection through an improved YOLOv8 detection model, and obtain detection results. Improvement measures include C2f-EFA module, ASFPN module, WSIoU loss function and TADHead detection head;

[0033] S2: Based on the test results, count the number of bounding boxes for diseased leaves and lesions.

[0034] YOLOv8 is the latest target detection model in the YOLO series. Employing the Anchor-Free method, it addresses the adaptability issues of rice leaves and disease spots with large aspect ratios or significant scale differences through flexible anchor point and offset prediction. This application, based on YOLOv8, proposes the following innovative improvements for brown spot disease detection and counting scenarios:

[0035] like Figure 1As shown, the workflow of a method for detecting and counting brown spot disease in rice includes: collecting image data of rice leaves infected with brown spot disease; improving the YOLOv8 target detection model; obtaining the detection results of bounding boxes of diseased leaves and lesions; calculating the IoU matching of bounding boxes to assign lesions to corresponding diseased leaves; and counting the number of lesions on each diseased leaf and the total count results.

[0036] like Figure 2 As shown, the C2f-EFA module includes residual feature attention connections, RFA block modules, and depthwise separable convolutions. The residual feature attention connections extract global and local features through a multi-path structure. The RFA block modules consist of multiple cascaded attention convolutional layers, each using the same kernel size and activation function to progressively refine and enhance the input features. The depthwise separable convolutions include depthwise convolutions and pointwise convolutions, reducing computational complexity.

[0037] The residual feature attention connection is a lightweight multi-path feature extraction structure consisting of five convolutional layers and one max-pooling layer. It employs residual topology for feature extraction and downsampling. The input feature map undergoes initial downsampling through a 3×3 convolutional layer to reduce resolution and extract preliminary features. Subsequently, the feature map is divided into three parallel paths: the first path extracts global contextual features through a 2×2 max-pooling layer, capturing overall information about large-scale lesions and diseased leaves; the second path extracts mesoscale local details through a 2×2 convolutional layer, focusing on lesion edges and texture features; and the third path preserves fine-grained information of the original features through a 1×1 convolutional layer.

[0038] The outputs of the three paths are concatenated along the channel dimension to form a multi-scale feature representation. This representation is then further downsampled using a 3×3 convolutional layer, and finally adjusted using a 1×1 convolutional layer to generate feature maps for subsequent network layers. This design employs a smaller convolutional kernel size and fewer channels, significantly reducing the number of parameters and computational complexity. It fully extracts global and local features through multi-path residual topology, making it suitable for complex scenarios in brown spot disease detection.

[0039] The RFA block module leverages the efficiency of attention convolutions to generate features through linear operations, maintaining model accuracy while improving computational efficiency. It captures feature information at different levels by concatenating multiple outputs. The RFA block module contains five cascaded attention convolutional layers, each using a 3×3 convolutional kernel and the ReLU activation function. Each attention convolutional layer simulates attention topology through a center point and radial branches: the center point extracts core features through standard convolution; the radial branches capture neighborhood information through fixed-direction offset convolutions, reducing computational cost.

[0040] The input feature map is adjusted for channel count using 1×1 convolutions, then sequentially passed through attention convolutional layers. The output of each layer is concatenated with the initial input to preserve original information. The concatenated feature map is then compressed for channel count using 1×1 convolutions to reduce computational overhead, and further enhanced for non-linear representation using another 1×1 convolution. This structure, through efficient attention convolutions and multi-layer concatenation, enhances the feature representation of brown spot disease lesions and leaves, outperforming traditional convolutional modules.

[0041] Depthwise separable convolutions achieve efficient feature extraction by decomposing standard convolutions into depthwise convolutions and pointwise convolutions. Depthwise convolutions assign a 3×3 kernel to each channel of the input feature map, independently extracting spatial features and reducing computational overhead between channels. Pointwise convolutions use 1×1 convolutions to integrate channel information and adjust the number of output channels. In the C2f-EFA module, depthwise separable convolutions are applied to local paths in residual feature attention connections and operations within RFA blocks, significantly reducing computational complexity while maintaining the effectiveness of feature extraction, making them suitable for resource-constrained brown spot disease detection scenarios.

[0042] like Figure 3 As shown, the ASFPN module includes a multi-scale feature input, a feature selection module, and a feature fusion module. The multi-scale feature input receives the multi-scale feature map output by the backbone network. The feature selection module performs feature filtering and channel alignment through channel attention (CA) and dimension matching (DM). The feature fusion module adopts a selective feature fusion (SFF) mechanism to achieve adaptive multi-scale feature interaction and weighted fusion, thereby optimizing feature representation.

[0043] ASFPN (Adaptive Select Feature Pyramid Network) is a highly efficient feature pyramid network that achieves multi-scale feature fusion through high-level selection and selective fusion, making it particularly suitable for detecting small targets in agricultural diseases. ASFPN receives multi-scale feature maps (P3, P4, P5, P6, P7, corresponding to different resolutions) output from the backbone network. Its implementation steps include:

[0044] For the feature selection module, the channel attention (CA) module uses global average pooling and global max pooling to process the input feature map, calculates the weights of the sigmoid activation, and generates a weighted channel feature map; the dimension matching (DM) module normalizes the number of channels of feature maps of different scales to a uniform dimension (256 channels) through 1×1 convolution, simplifying the network structure and reducing the computational cost of low-contribution features.

[0045] For the feature fusion module, Selective Feature Fusion (SFF) integrates refined low-level features with high-level features. High-level features are resized using a 3×3 convolution with a stride of 2, and then upsampled or downsampled using bilinear interpolation to match the low-level feature size. The attention weights generated by the CA module refine the low-level features, and the final fusion output is a weighted sum of the low-level features and the attention-weighted high-level features, ensuring a balance between contributions from different scales.

[0046] The fusion features are refined through 3×3 convolutional layers to enhance nonlinear expressive power.

[0047] This high-level screening and selective fusion design effectively enhances the model's ability to detect brown spot disease lesions and leaves, making it particularly suitable for scenarios with large scale differences, complex backgrounds, and small lesions. ASFPN optimizes computational efficiency and feature representation, outperforming traditional FPN or PANet, and is suitable for brown spot disease detection needs.

[0048] like Figure 4 As shown, the TADHead detection head includes a shared convolutional layer and a task-adaptive decoupling module. The shared convolutional layer reduces redundant computation of feature maps at different resolutions and achieves lightweighting through weight sharing. The task-adaptive decoupling module enhances the detection accuracy of lesions and diseased leaves through task-specific classification and regression branches.

[0049] Shared convolutional layers share kernel weights across multiple tasks or inputs, reducing the number of parameters and improving computational efficiency. These layers receive multi-scale feature maps (P3, P4, P5) from the ASFPN output, uniformly process feature maps of different resolutions using a shared 3×3 convolutional kernel, generating consistent feature representations, and then adjust the number of channels using 1×1 convolutions. This design reduces redundant computation, optimizes memory usage, unifies multi-scale feature representations, and enhances the generalization ability of the brown spot disease detection model.

[0050] The task-adaptive decoupling module optimizes the detection capability of lesions and diseased leaves through task-specific classification and regression branches. This module includes a classification branch, a regression branch, and a decoupling mechanism. The classification branch generates classification features using 3×3 convolutions and global average pooling, and combines this with a sigmoid activation function to predict the category confidence of lesions and diseased leaves. The regression branch generates bounding box regression features using 3×3 convolutions and 1×1 convolutions to predict the bounding box coordinates of lesions and diseased leaves. For the decoupling mechanism, the classification and regression branches handle task-specific feature extraction separately, avoiding conflicts between classification and localization tasks and improving detection accuracy.

[0051] The outputs of each branch are concatenated and integrated through channel splicing, and then enhanced with 1×1 convolution and ReLU activation function to improve nonlinear expressive power. The integrated features are extracted with task-related contextual information through global average pooling, improving the robustness of lesion and leaf detection. This design enhances the detection accuracy of brown spot disease lesions and leaves through task-adaptive decoupling, ensuring robustness in complex backgrounds or low-contrast conditions, outperforming standard coupled detection heads.

[0052] The WSIoU loss function includes angle loss, distance loss, shape loss, and IoU loss. Angle loss optimizes bounding box alignment by calculating the angular deviation between the center points of the predicted and ground truth bounding boxes, reducing localization errors caused by rotating or tilted targets. Distance loss dynamically adjusts weights based on the Euclidean distance between the center points of the predicted and ground truth bounding boxes, prioritizing predictions closer to the ground truth bounding boxes. Shape loss reduces the impact of mismatched bounding boxes by comparing their aspect ratios. IoU loss integrates angle, distance, and shape losses to improve the stability of the generated regression gradient.

[0053] In brown spot disease detection, the WSIoU loss function significantly improves the localization accuracy of lesions and diseased leaves by comprehensively optimizing the geometric characteristics of the bounding box and reducing interference from low-quality bounding boxes in complex backgrounds. It outperforms the traditional IoU loss function, especially when dealing with small targets and irregularly shaped lesions.

[0054] The specific steps of S2 include: detecting the bounding boxes of diseased leaves and lesions; assigning the lesion bounding boxes to the corresponding diseased leaf bounding boxes by calculating the inter-boundary overlap (IoU); and counting the number of bounding boxes for each diseased leaf and its associated lesion.

[0055] This method quantifies the severity of diseases through precise bounding box detection and counting, reducing human error and improving detection and counting efficiency and consistency compared to traditional manual detection methods.

[0056] The following describes the data preparation, model construction, model training, model testing and evaluation, deployment and application of a method for detecting and counting brown spot disease in rice.

[0057] Data preparation includes image acquisition, data annotation, and data augmentation.

[0058] For image acquisition, a 50-megapixel CMOS camera was used to capture images of rice leaves infected with brown spot disease in a field environment, ensuring that the images included different lighting conditions, complex backgrounds, and various lesion morphologies. The acquired images were all uniformly set to a resolution of 1280×720 and in JPEG format.

[0059] For data annotation, LabelImg was used to annotate the bounding boxes of diseased leaves and lesions in the images, generating annotation files containing the category (diseased leaf or lesion) and coordinates (x, y, w, h) in YOLO-compatible TXT format. The dataset is divided into a training set (70%), a validation set (20%), and a test set (10%), totaling 5000 images.

[0060] For data augmentation, strategies such as random flipping, scaling, brightness adjustment, and noise addition are applied to enhance the model's adaptability to complex backgrounds and lighting changes.

[0061] The model construction includes a backbone network, a neck network, a detection head, and a loss function.

[0062] For the backbone network, the standard convolutional modules are replaced with C2f-EFA modules, based on the YOLOv8 backbone network. For example... Figure 2 As shown, C2f-EFA achieves efficient feature extraction through residual feature attention connections, RFA blocks, and depthwise separable convolutions. The backbone network outputs multi-scale feature maps (P3, P4, P5, P6, P7) with resolutions of 80×80, 40×40, 20×20, 10×10, and 5×5, respectively.

[0063] For the neck network, the original feature pyramid network of YOLOv8 is replaced with an ASFPN module. For example... Figure 3 As shown, ASFPN achieves efficient fusion of multi-scale features through the feature selection module (CA and DM) and the feature fusion module (SFF) to generate refined feature maps (P3, P4, P5), with a unified number of channels of 256.

[0064] For the detection head, replace the original YOLOv8 detection head with the TADHead detection head. For example... Figure 4 As shown, TADHead reduces the number of parameters by sharing convolutional layers and optimizes the classification and regression tasks separately through a task adaptive decoupling module, outputting the category confidence and bounding box coordinates of diseased leaves and lesions.

[0065] For the loss function, the WSIoU loss function is adopted, which combines angle, distance, shape and IoU loss to optimize bounding box regression and improve positioning accuracy.

[0066] Model training includes environment configuration, hyperparameter settings, and the training process.

[0067] For the environment configuration, PyTorch 1.13 was used, the hardware environment was an NVIDIA RTX 3090 GPU with 24GB of video memory, and the operating system was Ubuntu 20.04.

[0068] For the hyperparameter settings, the batch size is 16, the initial learning rate is 0.001, the optimizer is AdamW, the number of training epochs is 200, and a cosine annealing learning rate scheduling strategy is used. The loss function is WSIoU, and the weight decay coefficient is 0.0005.

[0069] For the training process, the preprocessed training set is input into the model. The backbone network extracts multi-scale features, ASFPN performs feature fusion, and the TADHead detection head generates classification and regression predictions. The loss is calculated using the WSIoU loss function, and the model parameters are updated through backpropagation. The model performance is evaluated on the validation set every 10 rounds, and the model weights with the highest mAP are saved.

[0070] Model testing and evaluation includes the testing process, evaluation metrics, and counting methods.

[0071] For the testing process, the trained model is run on the test set, with rice leaf images as input, and the output is the bounding boxes of diseased leaves and lesions, along with class confidence scores. Redundant bounding boxes are removed using non-maximum suppression (NMS, IoU threshold of 0.5) to obtain the final detection results.

[0072] For evaluation metrics, the mean accuracy (mAP@0.5 and mAP@0.5:0.95) was used to assess the model's detection performance, and the frame rate (FPS) was used to assess real-time performance. Experimental results show that the proposed method achieves 92.5% accuracy at mAP@0.5 and 68.3% accuracy at mAP@0.5:0.95, with an FPS of 45, which is superior to the baseline YOLOv8 (89.7% accuracy at mAP@0.5 and 40 FPS).

[0073] For the counting method, based on the detection results, the number of bounding boxes of diseased leaves and lesions in each image is counted, the attribution relationship between lesions and diseased leaves is calculated (through IoU matching, threshold 0.3), and the number of lesions on each diseased leaf and the total count are output.

[0074] Deployment and application include system deployment and application scenarios.

[0075] For system deployment, the trained model is deployed on Jetson Xavier NX, combined with the image acquisition module (camera) and the data analysis module (Python-based statistical scripts) to achieve real-time field detection and counting.

[0076] For application scenarios, field tests were conducted at rice planting bases to collect images of rice leaves in the field. The system outputs real-time detection results and count data for diseased leaves and lesions, providing quantitative data for disease control. The system can operate stably under complex lighting and background conditions, with a detection time of approximately 22ms / frame, meeting the requirements of real-time applications.

[0077] Example 2

[0078] This embodiment describes the system composition, system workflow, and system testing of a rice brown spot disease detection and counting system.

[0079] like Figure 5 As shown, the system consists of an image acquisition module, a detection module, and a data analysis module.

[0080] The image acquisition module uses a high-resolution camera equipped with autofocus and illumination compensation to acquire images of rice leaves and output RGB images in 1280×720 format.

[0081] The detection module runs an improved YOLOv8 model, which includes C2f-EFA, ASFPN, and TADHead modules, and uses the WSIoU loss function to output the bounding boxes and confidence scores of diseased leaves and lesions.

[0082] The data analysis module, based on analysis scripts developed in Python, receives bounding box data output by the detection module, performs IoU matching and bounding box count statistics, calculates the number of diseased leaves and lesions, and generates statistical reports in CSV or JSON format.

[0083] The system workflow includes: the image acquisition module captures images of rice leaves and transmits them to the detection module; the detection module loads a pre-trained model, performs target detection, and outputs bounding boxes and category information; the data analysis module parses the detection results, counts the number of diseased leaves and lesions, generates a visualization report (disease distribution map), and stores it in the database.

[0084] The system was tested in both southern and northern rice paddies to verify its robustness under various environments. Test results showed that the system achieved a lesion detection accuracy (mAP@0.5) of over 90% and a counting accuracy of 95% under complex backgrounds, meeting the needs of agricultural applications.

[0085] Example 3

[0086] This embodiment describes the hardware configuration, software implementation, and equipment testing of a rice brown spot disease detection and counting device.

[0087] For hardware configuration, the processor uses NVIDIA Jetson Xavier NX (6-core ARM CPU, 384-core Volta GPU) or Intel Xeon; the memory uses 16GB RAM and 256GB SSD storage to store pre-trained model weights and acquired image data; other components include a high-definition camera (supporting 1080p video streaming), a power module, and a network interface (supporting Wi-Fi or 4G / 5G) to ensure real-time data transmission in the field.

[0088] For the software implementation, the operating system is Linux (Ubuntu 20.04 or embedded Linux); the software framework is PyTorch 1.13, integrating OpenCV for image preprocessing and TensorRT for model inference optimization; the program functions to load pre-trained models, perform real-time image detection, call the data analysis module to generate disease statistics results, and support local storage and cloud upload of results.

[0089] The equipment was deployed in experimental fields and actual planting bases to test its stability under harsh environments such as high temperature and high humidity. The results showed that the equipment could operate continuously for 24 hours at 30°C and 80% humidity, with stable detection and counting results and a false alarm rate of less than 5%.

[0090] The above three embodiments demonstrate that this application, by improving the YOLOv8 model and combining it with the C2f-EFA, ASPPN, WSIoU, and TADHead modules, significantly improves the accuracy and efficiency of rice brown spot disease detection and counting, making it suitable for real-time field applications and providing reliable technical support for rice disease control.

[0091] The above specific embodiments are merely several preferred embodiments of the present invention. Based on the technical solutions of the present invention and the relevant teachings of the above embodiments, those skilled in the art can make various alternative improvements and combinations to the above specific embodiments.

Claims

1. A method for detecting and counting brown spot disease in rice, characterized in that, The operating steps include: S1: Collect image data of rice leaves infected with brown spot disease, perform target detection through an improved YOLOv8 detection model, and obtain detection results. Improvement measures include C2f-EFA module, ASFPN module, WSIoU loss function and TADHead detection head; S2: Based on the test results, count the number of bounding boxes for diseased leaves and lesions.

2. The method for detecting and counting rice brown spot disease according to claim 1, characterized in that: In S1, the C2f-EFA module includes residual feature attention connections, RFA block modules, and depthwise separable convolutions. The residual feature attention connections extract global and local features through a multi-path structure. The RFA block modules consist of multiple cascaded attention convolutional layers, each using the same kernel size and activation function. The depthwise separable convolutions include depthwise convolutions and pointwise convolutions.

3. The method for detecting and counting rice brown spot disease according to claim 1, characterized in that: In S1, the ASFPN module includes a multi-scale feature input, a feature selection module, and a feature fusion module. The multi-scale feature input receives the multi-scale feature map output by the backbone network. The feature selection module performs feature filtering and channel alignment through channel attention and dimension matching. The feature fusion module adopts a selective feature fusion mechanism to achieve adaptive multi-scale feature interaction and weighted fusion.

4. The method for detecting and counting rice brown spot disease according to claim 1, characterized in that: In S1, the TADHead detection head includes a shared convolutional layer and a task-adaptive decoupling module. The shared convolutional layer receives multi-scale feature maps output by ASFPN, processes feature maps of different resolutions uniformly through a shared 3×3 convolutional kernel to generate a consistent feature representation, and then adjusts the number of channels through a 1×1 convolution. The task-adaptive decoupling module performs task-specific classification and regression branches. The output of each branch is concatenated and integrated through channel splicing, and then processed by a 1×1 convolution and the ReLU activation function.

5. The method for detecting and counting rice brown spot disease according to claim 1, characterized in that: In S1, the WSIoU loss function includes angle loss, distance loss, shape loss, and IoU loss. Among them, angle loss optimizes the orientation alignment of the bounding box by calculating the angular deviation of the line connecting the center points of the predicted box and the ground truth box; distance loss dynamically adjusts the weights based on the Euclidean distance between the center points of the predicted box and the ground truth box, combined with angle information, prioritizing the optimization of predictions that are closer to the ground truth box; shape loss is used to compare the aspect ratio of the predicted box and the ground truth box; and IoU loss is used to combine angle, distance, and shape losses.

6. The method for detecting and counting rice brown spot disease according to claim 1, characterized in that, The specific steps of S2 include: detecting the bounding boxes of diseased leaves and lesions; assigning the lesion bounding boxes to the corresponding diseased leaf bounding boxes by calculating the overlapping parts between the bounding boxes; and counting the number of bounding boxes for each diseased leaf and its associated lesion.

7. The method for detecting and counting rice brown spot disease according to claim 2, characterized in that: The residual feature attention connection consists of five convolutional layers and one max pooling layer, using residual topology for feature extraction and downsampling.

8. The method for detecting and counting rice brown spot disease according to claim 2, characterized in that: The RFA block module contains five cascaded attention convolutional layers, each using a 3×3 convolutional kernel and the ReLU activation function.

9. A system for detecting and counting rice brown spot disease, and a method for detecting and counting rice brown spot disease according to any one of claims 1-8, characterized in that: It includes an image acquisition module, a detection module, and a data analysis module; the image acquisition module acquires images of rice leaves; the detection module implements a method for detecting and counting rice brown spot disease; and the data analysis module queries the bounding box count statistics results from the detection module.

10. A device for detecting and counting rice brown spot disease, and a method for detecting and counting rice brown spot disease according to any one of claims 1-8, characterized in that: It includes a processor and a memory, the memory storing computer programs, which are executed by the processor to implement a method for detecting and counting brown spot disease in rice.

Citation Information

Patent Citations

  • Improved YOLOv6 target detection method introducing dynamic position loss

    CN116012686A

  • YOLOv8n-based lightweight insect small target detection method and device

    CN118470402A

  • Rice blast disease grade intelligent evaluation and disease resistance preliminary screening method, system and equipment

    CN119863464A

  • CTI-YOLO-based vehicle detection method under complex weather conditions

    CN120164175A

  • Traffic scene small target detection method based on adaptive spatial aggregation pyramid

    CN120599223A