Lightweight rice disease prediction method based on SCL-YOLOv8n

By improving the GSConv module of the Slim-Neck network in rice disease detection, building the RFCA-CSP module and using the LSCSBD detection head, the problems of complex detection characteristics, low detection accuracy and huge model in the prior art are solved, and efficient and accurate disease recognition effect is achieved.

CN119625543AActive Publication Date: 2025-03-14NORTH CHINA UNIVERSITY OF SCIENCE AND TECHNOLOGY

Patent Information

Application Number
CN202510156073.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-12
Publication Date
2025-03-14
Estimated Expiration
2045-02-12

AI Technical Summary

Technical Problem

The prior art has complex characteristics, low detection accuracy and huge models in rice disease detection, making it difficult to meet the real-time and accurate disease identification needs.

Method used

A lightweight rice disease prediction method based on SCL-YOLOv8n is proposed. By improving the GSConv module in the Slim-Neck network, building the RFCA-CSP module and using the LSCSBD detection head, the feature extraction capability and computing efficiency of the model are improved.

Benefits of technology

It realizes the significant reduction in model parameters and calculation complexity while maintaining high performance, improves the fusion effect and detection speed of multi-scale features, and is suitable for rice disease detection in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119625543A_ABST
    Figure CN119625543A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight rice disease prediction method based on SCL-YOLOv8n, and belongs to the technical field of rice disease prediction. The method comprises the following steps: constructing a rice disease data set; performing enhancement, labeling and division processing on the rice disease data set; in a GSConv module of a Slim-Neck network structure, before Shuffle operation, lightweight convolution is introduced to be connected with an original path in parallel to form a GSLConv module; the method comprises the following steps: based on a CSP-RFA structure, dividing data, and distributing the data to two branches to form an RFCA-CSP module; a lightweight sharing enhanced detection head LSCSBD is adopted; an SCL-YOLOv8n model is constructed according to the model; taking the processed data set as the input of an improved model SCL-YOLOv8n, and training the improved model SCL-YOLOv8n by using the training set; in the aspect of rice disease prediction under the complex background, the parameter quantity and the calculation complexity are reduced, the precision is improved, and an effective reference is provided for rice disease prediction under the complex background.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of rice disease prediction, and specifically relates to a lightweight rice disease prediction method based on SCL-YOLOv8n. Background Art

[0002] During the growth of rice, diseases occur frequently. If these diseases are not identified and effectively controlled in time, they may directly affect rice yields and cause serious economic losses. Therefore, how to quickly and accurately identify the type of disease, determine the location and severity of the disease, and take targeted prevention and control measures during the growth of rice has become the key to improving rice production efficiency, reducing losses, and ensuring food security.

[0003] Traditional disease detection and prediction methods mainly rely on manual visual observation and empirical judgment, which is time-consuming, labor-intensive, and highly subjective, making it difficult to meet the actual needs of pest control. Compared with traditional computer vision technology, deep learning technology has demonstrated strong generalization capabilities in multiple image analysis fields due to its superior feature learning capabilities, and has been widely used in agricultural crop disease identification. Object detection methods in deep learning can be divided into two categories: single-stage and dual-stage. Single-stage methods include the YOLO series, SSD, and EfficientDet, while dual-stage methods include Mask R-CNN and Faster R-CNN. Compared with single-stage methods, dual-stage detection methods usually require generating candidate boxes first and then performing convolution operations, resulting in slower recognition speed and poor real-time performance.

[0004] In contrast, the YOLO series, as a single-stage method, combines target box generation and feature extraction into one step, with faster recognition speed and stronger real-time performance. In the existing technology, the YOLOv8 Rice model proposed on the basis of YOLOv8n introduces deformable convolution to optimize the C2f module and adopts weighted bidirectional feature pyramid network (Bi-FPN) to improve performance and reduce computational complexity, and uses Wise IOU loss function to improve evaluation accuracy; the C2f-MSEC module is introduced to replace C2f in the backbone network, and the weighted bidirectional feature pyramid network is adopted to enhance the feature fusion capability of different sizes of rice false smut, and a group normalized shared convolution lightweight detection head is designed to improve lightweight performance; partial convolution (PConv) is introduced to replace the bottleneck layer of YOLOv8 to reduce the number of parameters and improve the detection speed, reconstruct the feature pyramid BFP, and embed Gaussian non-local attention (EGNA) to effectively reduce the aliasing effect caused by multi-layer fusion; a lightweight YOLO v8-Rice algorithm is proposed on the basis of YOLOv8, and ContextGuided Block is adopted to replace the C2f module, depthwise separable convolution replaces standard convolution, and a lightweight shared convolution detection head is reconstructed to significantly reduce the number of parameters and computation. Summary of the invention

[0005] The purpose of the present invention is to solve the problems of complex rice disease characteristics, low detection accuracy and large model, and proposes a lightweight rice disease prediction method based on SCL-YOLOv8n.

[0006] To solve the above technical problems, the specific steps are as follows: Step 1: Construct a rice disease dataset; Step 2: Enhance, label, and divide the rice disease dataset; Step 3. In the GSConv module of the Slim-Neck network structure, lightweight convolution is referenced in parallel with the original path before the Shuffle operation to form a GSLConv module; based on the CSP-RFA structure, after the data is divided, the data is diverted to two branches to form an RFCA-CSP module; a lightweight shared enhancement detection head LSCSBD is used; and an SCL-YOLOv8n model is constructed; Step 4: Use the rice disease dataset processed in step 2 as the input of the SCL-YOLOv8n model, and use the training set to train the SCL-YOLOv8n model; Step 5: Use the test set to test the rice disease category and locate the location; Step 6: Use the trained SCL-YOLOv8n model to predict rice diseases.

[0007] Furthermore, in step 1, the rice disease dataset is constructed by photographing the target from multiple angles and at different distances; the photographed images cover six diseases, namely, rice blast, brown spot, heart blight, dew drop, false smoke, and sheath disease, and pictures of normal rice.

[0008] Furthermore, in step 2, the dataset is enhanced by rotation, adding salt and pepper noise, and Gaussian noise. The rice disease dataset is annotated using the LabelImg tool, the location of rice lesions is annotated using rectangular boxes, and the dataset is divided into training set, test set, and validation set at a random ratio of 7:2:1.

[0009] Furthermore, in step 3, the specific construction steps of the GSLConv module are: (1) The input feature map is compressed from C1 to C2 / 2 through a 1×1 convolution. A 5×5 depthwise separable convolution DWConv is used to extract spatial features. The output of DWConv is concatenated with the 1×1 convolution result in the channel dimension to obtain a feature map X2, which combines local spatial features with global channel information. (2) The concatenated feature map is processed through two paths: one path performs channel shuffle, which mixes features by adjusting the channel order and breaking channel locality; the other path first processes the feature map through the LightConv layer, and then performs the shuffle operation, with an output dimension of H×W×C_out; (3) The outputs of the two paths are fused by addition.

[0010] Furthermore, in step 3, the RFCA-CSP module expands the number of channels of the input feature map from C_in to twice the original number through a 1x1 convolution, outputs the number of channels C_out, and then divides it into two branches: a convolution branch and a Transformer branch.

[0011] Furthermore, the convolution branch extracts local features through a Bottleneck-RFCAConv module and maintains the input spatial size feature map; (1) During the processing, N×N The input features are transformed by a group convolution, followed by batch normalization to stabilize the training process, and the ReLU activation function is applied to introduce nonlinearity; the formula is as follows: (1) In the formula, g i×i represents a grouped convolution of size i×i, N represents the convolution kernel size, Norm represents normalization, ReLU represents the use of ReLU activation function, x represents input features, and F represents output features; (2) Bottleneck-RFCAConv reduces the number of channels in the middle layer by introducing an expansion coefficient, thereby reducing computational complexity. It uses a two-layer convolution module: the first layer reduces the number of channels through standard convolution operations, and the second layer uses the RFCAConv module to enhance feature representation capabilities; (3) After the receptive field spatial features extracted by the RFCAConv module are processed, the CA attention mechanism is used to optimize the input features; the CA attention mechanism decomposes the feature information in the height and width directions respectively, thereby obtaining feature representations along these two directions, further improving the model's ability to capture spatial information; (4) Transform the features by concatenating the feature maps globally in height and width and applying convolution, batch normalization, and nonlinear activation operations; (5) Split the intermediate features into two independent features, and perform feature transformation through convolution operation and Sigmoid activation function so that the output dimension is consistent with the input vector; calculate the attention weights of the input feature map in the height and width dimensions, combine the calculated attention weights with the extracted feature map, and generate the final output.

[0012] Furthermore, the Transformer branch uses the MHSA-CGLU module to establish global dependencies through multi-head self-attention MHSA, and combines the convolutional gating mechanism CGLU to transform features.

[0013] Furthermore, the multi-head self-attention mechanism MHSA maps the input sequence into multiple subspaces, each of which corresponds to an independent attention head; its specific expression is: (2) Where Q, K, and V represent query, key, and value vectors, respectively. k is the dimension of the key vector, which is used to scale the dot product to prevent the dot product result from being too large, thereby avoiding the gradient from disappearing. T represents the transposed matrix, and softmax represents the normalization operation; (1) A multi-head self-attention mechanism is introduced. Multiple attention heads are calculated in parallel, and each head learns different representations in its own subspace. The specific process is expressed by formula (3) and formula (4): In the formula, , , , is the parameter matrix learned by the model, Concat represents the concatenation operation, head represents the attention head, h represents the number of attention heads, and i represents the i-th one; (2) CGLU adds a 3x3 depth convolution operation before the gated linear unit GLU activation function to enhance local modeling capabilities and model robustness; (3) The outputs of the two branches are concatenated along the channel dimension and mapped to the final output channel number C_out through a 1x1 convolution to complete feature fusion; Furthermore, in step 3, the lightweight shared enhanced detection head LSCSBD operates as follows: (1) Input feature maps of different scales into the network, and map the number of channels of each feature map from C_i to the number of hidden channels hidc through a 1x1 convolutional layer, while keeping the spatial size unchanged; (2) At each detection layer, a 3×3 shared convolution is applied to extract spatial features. After the convolution operation, the output features are batch normalized (BN) and nonlinearly transformed using the SiLU activation function. The features after SiLU processing are further subjected to a second 3×3 shared convolution operation, BN normalization, and SiLU activation to enhance feature expression capabilities. (3) The output is a tensor containing bounding box regression and category scores. The entire process rescales the output of each detection layer through the Scale operation to ensure consistency and accuracy in multi-scale detection tasks.

[0014] Beneficial effects: The present invention has the following effects through three innovative points:

[0015] (1) Improve the GSConv module in the Slim-Neck network to enhance feature expression capabilities, reduce computational overhead, and improve the fusion effect of multi-scale features.

[0016] (2) The RFCA-CSP module is constructed. By combining the advantages of convolution and Transformer, it not only retains the high efficiency of CNN in local feature extraction, but also introduces the Transformer's ability to model global dependencies. Compared with the traditional Transformer structure, this module effectively reduces the computational complexity and achieves a good balance between capturing low-level local features and high-level global features.

[0017] (3) By adopting the LSCSBD detection head and introducing shared convolution, separate batch normalization and deep feature learning techniques, the model is made more efficient and flexible while maintaining high performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 This is the structure diagram of SCL-YOLOv8n; Figure 2 This is the GSLConv model structure diagram; Figure 3 This is the LVoVGSCSP structure diagram; Figure 4 Schematic diagram of RFCA-CSP module: (a) is the RFCA-CSP structure; (b) is the original Bottleneck structure; (c) is the Bottleneck-RFCAConv structure; (d) is the MHSA-CGLU structure diagram; Figure 5 This is the structure diagram of the LSCSBD model; Figure 6 This is a comparison chart of different weights of the PCB data set; Figure 7 It is a heat map with different weights; Figure 8 It is the overall structure diagram of the present invention. DETAILED DESCRIPTION

[0019] The technical solution of the present invention is further described below in conjunction with the accompanying drawings.

[0020] The following is an explanation of the English abbreviations that appear in the present invention: Slim-Neck: thin neck structure; GSConv module: shuffled group convolution; Shuffle operation: shuffle the data; RFCAConv: receptive field attention convolution; VoVGSCSP module: hybrid convolution and cross-level partial network module; LightConv: lightweight convolution; CA attention: channel attention; HSA-CGLU module: multi-head self-attention-convolution gated pass attention; Scale operation: scaling of the bounding box; SiLU activation function: Sigmoid gated linear unit; Bottleneck-RFCAConv: bottleneck receptive field attention convolution; mAP50: mean average precision with an intersection-over-union ratio of 0.5; GFLOPs: 1 billion floating-point operations per second; Params: parameter quantity; Grad-CAM: gradient-weighted class activation mapping.

[0021] like Figure 8 As shown, the present invention provides a rice disease detection and prediction method based on improved Y0L0v8n in a complex environment, and the process is as follows:

[0022] 1. Obtain and process rice disease dataset:

[0023] (1) Constructing a dataset. When collecting images, we took into account the shooting environment at different time periods and natural lighting conditions and photographed the target from multiple angles and at different distances. The images captured covered six diseases: rice blast, brown spot, heart blight, dew drop, false smoke, and sheath disease, as well as normal rice images.

[0024] (2) Data enhancement was performed on the collected images using data enhancement methods such as rotation, adding salt and pepper noise, and Gaussian noise. The rice disease dataset was annotated using the LabelImg tool, and the location of rice lesions was annotated using rectangular boxes, and the dataset was divided. The annotated dataset was randomly divided into a training set, a test set, and a validation set in a ratio of 7:2:1. The final training set had 3,248 images, the test set had 928 images, and the validation set had 464 images.

[0025] 2. If Figure 1 As shown, build the SCL-YOLOv8n model based on YOLOv8n:

[0026] (1) In the GSConv module of the Slim-Neck network structure, the lightweight convolution is referenced before the Shuffle operation and connected in parallel with the original path to form the GSLConv module.

[0027] (2) Based on the CSP-RFA structure, after the data is divided, the data is diverted to two branches to form the RFCA-CSP module.

[0028] (3) The LSCSBD detection head module is adopted to improve the efficiency and stability of YOLOv8n in multi-scale object detection by introducing optimization methods such as lightweight shared convolution, batch normalization BN and dynamic anchor box calculation.

[0029] like Figure 2-Figure 3 As shown, the present invention improves the GSConv module based on the Slim-Neck network.

[0030] (1) The Slim-Neck framework is introduced, which consists of two main modules: GSConv module and VoVGSCSP module. The VoVGSCSP module is mainly composed of GSConv and Conv convolution.

[0031] (2) In order to compensate for the loss of key information that may be caused by GSConv during the feature extraction process and reduce the amount of convolution calculations and parameters in the convolution kernel operation, the present invention proposes an improved convolution module GSLConv. The strategy of combining parallel paths and LightConv layers is used to optimize the traditional GSConv structure and enhance the feature extraction capability of the model. The specific process is as follows:

[0032] First, the input feature map is compressed from C1 to C2 / 2 through 1×1 convolution. Secondly, 5×5 depthwise separable convolution (DWConv) is used to extract spatial features. The output of DWConv is concatenated with the result of 1×1 convolution in the channel dimension to obtain feature map X2, which combines local spatial features with global channel information. Next, the concatenated feature map is processed through two paths: one path performs channel shuffle, mixing features by adjusting the channel order and breaking channel locality; the other path first processes the feature map through the LightConv layer, and the output dimension is H×W×C_out. Finally, the outputs of the two paths are fused by addition.

[0033] like Figure 4 As shown in (a), the present invention proposes an RFCA-CSP module, which expands the number of channels of the input feature map from C_in to twice the original through a 1x1 convolution, outputs the number of channels C_out, and then divides it into two branches: a convolution branch and a Transformer branch.

[0034] (1) If Figure 4 As shown in (b)-4(c), the convolution branch extracts local features through the Bottleneck-RFCAConv module and keeps the input space size in the feature map, specifically:

[0035] Step a: During the processing, the input features are transformed by group convolution, followed by batch normalization to stabilize the training process, and the ReLU activation function is applied to introduce nonlinearity. The formula is as follows:

[0036] (1) In the formula, g i×i represents a grouped convolution of size i×i, N represents the convolution kernel size, Norm represents normalization, ReLU represents the use of ReLU activation function, x represents input features, and F represents output features.

[0037] Step b: Bottleneck-RFCAConv reduces the number of channels in the middle layer by introducing an expansion coefficient, thereby effectively reducing the computational complexity. A two-layer convolution module is used: the first layer reduces the number of channels through standard convolution operations, and the second layer uses the RFCAConv module to enhance the feature representation capability.

[0038] Step c: After the receptive field spatial features extracted by the RFCAConv module are processed, the input features are optimized using the CA attention mechanism. The CA attention mechanism decomposes the feature information in the height and width directions respectively, thereby obtaining feature representations along these two directions, further improving the model's ability to capture spatial information.

[0039] Step d: The features are further transformed by concatenating the feature maps globally in height and width and applying operations such as convolution, batch normalization, and nonlinear activation.

[0040] Step e: Split the intermediate features into two independent features, and perform feature transformation through convolution operation and Sigmoid activation function to make the output dimension consistent with the input vector. Calculate the attention weights of the input feature map in the height and width dimensions, combine the calculated attention weights with the extracted feature map to generate the final output.

[0041] (2) Figure 4 As shown in (d), the Transformer branch uses the MHSA-CGLU module to establish global dependencies through multi-head self-attention (MHSA) and further transforms features in combination with the convolutional gating mechanism (CGLU).

[0042] Step a: The multi-head self-attention mechanism (MHSA) can effectively capture the complex dependencies within the sequence by mapping the input sequence into multiple subspaces, each of which corresponds to an independent attention head. Its specific expression is:

[0043] (2)

[0044] Where Q, K, and V represent query, key, and value vectors, respectively. k is the dimension of the key vector, which is used to scale the dot product to prevent the dot product result from being too large, thereby avoiding gradient disappearance. T represents the transposed matrix, and softmax represents the normalization operation.

[0045]

[0046]

[0047] In the formula, , , , It is the parameter matrix learned by the model, Concat represents the concatenation operation, head represents the attention head, h represents the number of attention heads, and i represents the i-th one.

[0048] Step b: CGLU adds a 3x3 depthwise convolution operation before the GLU (Gated Linear Unit) activation function to enhance the local modeling capability and the robustness of the model.

[0049] Step c: The outputs of the two branches are concatenated along the channel dimension and mapped to the final output channel number C_out through a 1x1 convolution to complete feature fusion.

[0050] like Figure 5 As shown, the present invention proposes a lightweight shared enhanced detection head LSCSBD.

[0051] First, feature maps of different scales are input into the network, and the number of channels of each feature map is mapped from C_i to the number of hidden channels hidc through multiple 1x1 convolutional layers, while keeping the spatial size unchanged; then, for each detection layer, a 3×3 shared convolution module is applied to extract spatial features; after the convolution operation, the output features are batch normalized (BN) and nonlinearly transformed using the SiLU activation function. The features processed by SiLU are further subjected to a second 3×3 shared convolution operation as well as BN normalization and SiLU activation to enhance the feature expression capability. The final output is a tensor containing bounding box regression and category scores. The entire process rescales the output of each detection layer through the Scale operation to ensure consistency and accuracy in multi-scale detection tasks.

[0052] 3. Use the processed rice disease dataset to train the improved SCL-YOLOv8n model, set the training coefficient to 500 rounds, the batch size to 16, and the number of images input for each training to 203. After the training is completed, save the trained weights.

[0053] 4. Use the test set to test the category and locate the rice disease. Use the optimal weight file obtained in step 3 to perform reasoning verification on the test set images divided in step 1.

[0054] 5. Use the optimal weight file obtained in step 3 to predict rice diseases. Apply the SCL-YOLOv8n model to the rice disease detection system, and achieve real-time prediction and identification of diseases through validation sets or captured images.

[0055] The experimental data of this embodiment illustrate:

[0056] (1) Model generalization experiments, such as Figure 6 shown.

[0057] In order to verify the generalization ability of the improved model SCL-YOLOv8n, images of 6 different defect categories were selected from the open source PCB defect detection dataset of Peking University for detection. The optimal weight files of the original model YOLOv8n and the improved model SCL-YOLOv8n were used to perform inference verification on the data in the validation set. The specific results are shown in Table 1.

[0058] Table 1 Generalization experiment algorithm Accuracy P(%) Recall rate R(%) mAP50(%) GFLOPs(G) Params(MB) YOLOv8n 94.3 90.7 92.0 8.2 3.01 SCL-YOLOv8n 92.1 89.1 92.4 5.2 1.93

[0059] From the experimental results in Table 1, we can see that compared with YOLOV8n, the improved SCL-YOLOv8n has a slight decrease in P and R on the PCB dataset, and the average precision mAP50 remains basically unchanged, while the number of model parameters and computational complexity are reduced by 35.9 and 36.6 percentage points respectively. The experimental results show that the performance of the model is significantly improved, and it has good generalization ability and robustness.

[0060] (2) Model comparison experiments, such as Figure 7 shown.

[0061] In order to comprehensively evaluate the improvement effect of SCL-YOLOv8n, this paper compares it with other classic target detection models, including YOLOv5n, YOLOv10n, YOLOv11n, SSD and other improved algorithms in the same field. All models are tested on the same dataset and the same experimental environment. The specific results are shown in Table 2.

[0062] Table 2 Comparative experiments of different algorithms algorithm Accuracy P(%) Recall rate R(%) mAP50(%) GFLOPs(G) Params(MB) SSD 83.1 68.29 72.1 62.8 26.3 Faster-RCNN 60.9 73.3 70.8 363.4 136.7 YOLOv5n 84.9 71.4 81.6 7.2 2.51 YOLOv6 82.7 70.4 77.3 11.9 4.20 YOLOv7-tiny 81.5 72.0 80.3 13.2 6.03 Yolov9t 79.2 75.0 81.2 7.9 2.01 YOLOv10n 83.9 76.4 82.4 8.4 2.71 YOLOv11n 84.0 77.6 83.3 6.4 2.59 RDN-YOLO 84.1 71.8 79.4 11.5 4.52 SCL-YOLOv8n 86.6 81.4 86.0 5.5 1.93

[0063] According to the experimental data in Table 2, the improved model proposed in this paper has better performance in terms of parameter quantity, computational complexity and detection accuracy compared with the classic SSD and Faster R-CNN detection algorithms.

[0064] Compared with the YOLOv5n model, the improved model reduces the number of parameters and computational complexity by 23.1% and 23.6%, respectively, and the mAP50 increases by 4.4 percentage points. Compared with YOLOv6, the SCL-YOLOv8n model has fewer parameters and computational complexity, and the mAP50 increases significantly. For the lightweight model YOLOv7-tiny, the improved SCL-YOLOv8n reduces the number of parameters and computational complexity by 4.1MB and 7.7G, respectively, and the mAP50 increases by 5.7 percentage points. Compared with YOLOv9t, although the difference in the number of parameters between the two is not large, the improved model increases P, R and mAP50 by 7.4, 6.4 and 4.8 percentage points, respectively, and the computational complexity decreases by 2.4G. When compared with the YOLOv10n model, the improved model increases mAP50 by 3.6 percentage points, and the computational complexity and parameter number decrease by 34.5% and 28.8%, respectively. Compared with the YOLOv11n model, the improved algorithm improved P, R and mAP50 by 2.6, 3.8 and 2.7 percentage points respectively, and the computational complexity and number of parameters were slightly reduced.

[0065] Compared with the improved algorithm RDN-YOLO, the improved model in this paper improves P, R and mAP50 by 2.5, 9.6 and 6.6 percentage points respectively, and the model parameter volume and computational complexity are reduced by 2.59MB and 6G respectively.

[0066] In summary, SCL-YOLOv8n performs well in terms of parameter quantity, computational complexity, and accuracy, and can be used for rice disease detection.

[0067] The heat map is used to intuitively show the degree of attention paid by the model to key features in the input image. The present invention uses Grad-CAM to generate the target detection heat map. Figure 7 The red areas in the graph indicate that the model pays high attention to a particular area, while the blue areas indicate lower attention.

[0068] This paper selects the models with higher accuracy in the comparative experiments and the original YOLOv8n model for comparison. The yellow circles represent missed detections. The original YOLOv8n model has 15 missed detections, and the improved SCL-YOLOv8n has 4 missed detections. The red triangles represent the wrong areas of attention. YOLOv11n has 2 wrong areas of attention. The original YOLOv8n model, the YOLOv10n model, and the improved SCL-YOLOv8n all have 1 wrong area of ​​attention. Through the heat map analysis, it can be proved that the improved SCL-YOLOv8n has better performance.

[0069] (3) Model ablation experiment.

[0070] In order to evaluate the impact of each improved module proposed in this paper on the rice disease detection performance, corresponding ablation experiments were carried out. The experimental results are shown in Table 3.

[0071] Table 3 Ablation experiment experiment Increase Slim-Neck of GSLConv RFCA-CSP LSCSBD Precision P(%) Recall rate R(%) mAP50(%) GFLOPs(G) Params(MB) Ablation experiment 1 × × × 81.3 75.2 81.0 8.0 3.00 Ablation experiment 2 √ × × 84.9 77.8 83.7 6.9 2.69 Ablation experiment 3 × √ × 81.4 76.0 82.3 7.7 2.71 Ablation experiment 4 × × √ 82.8 76.9 80.3 6.6 2.37 Ablation experiment 5 √ √ × 85.1 77.8 85.4 7.1 2.58 Ablation experiment 6 √ × √ 82.7 78.9 82.7 6.0 2.24 Ablation experiment 7 × √ √ 82.8 77.2 82.3 6.2 2.06 Ablation experiment 8 √ √ √ 86.6 81.4 86.0 5.5 1.93

[0072] From the ablation experiment data in Table 3, it can be seen that ablation experiment 1 is the original experimental result of YOLOv8n without improvement. Ablation experiment 2 adds the Slim-Neck structure after the improved GSLConv module on the basis of ablation experiment 1, and captures the diverse manifestations of rice diseases more comprehensively by fusing shallow and deep features. Compared with ablation experiment 1, on the basis of mAP50 increasing by 2.7 percentage points, the number of parameters and computational complexity are reduced by 10.3 and 13.8 percentage points respectively. Ablation experiment 3 adds the RFCA-CSP module to YOLOv8n. Compared with ablation experiment 1, the number of parameters and computational complexity are reduced, and the mAP50 increases by 1.3 percentage points, which verifies that the combination of convolution and Transformer structure helps to combine local features with global features and extract richer disease information. Ablation experiment 4 uses the LSCSBD detection head based on the original model and reduces the number of model parameters by applying shared convolution. Although the mAP50 decreases, it only decreases by 0.7 percentage points. The number of parameters and computational complexity decrease by 21 and 17.5 percentage points respectively, verifying the effectiveness of the improvement measures.

[0073] Ablation experiments 5, 6, and 7 verify that the combination of the three modules in pairs has different effects on improving the model performance.

[0074] The above improvements are combined on the basis of ablation experiment 1. The improved SCL-YOLO v8n has only 1.93MB of parameters and 5.5G of computational complexity, which are 35.7 and 31.3 percentage points lower than the original model, respectively, and mAP50 increased by 5.0 percentage points.

[0075] In summary, it can be proved that the improved model SCL-YOLOv8n of the present invention achieves lightweightness on the basis of improving accuracy, and has better model performance and a lighter model framework.

[0076] The above embodiments are only intended to illustrate the technical concept and features of the present invention, and are intended to enable persons skilled in the relevant art to understand and implement the present invention, and are not intended to limit the scope of protection of the present invention. Any equivalent changes or modifications made based on the essence of the present invention should be included in the scope of protection of the present invention.

Claims

1. A lightweight rice disease prediction method based on SCL-YOLOv8n, characterized in that: The following steps are involved: Step 1: Construct a rice disease dataset; Step 2: Enhance, label, and divide the rice disease dataset; Step 3. In the GSConv module of the Slim-Neck network structure, lightweight convolution is referenced in parallel with the original path before the Shuffle operation to form a GSLConv module; based on the CSP-RFA structure, after the data is divided, the data is diverted to two branches to form an RFCA-CSP module; a lightweight shared enhancement detection head LSCSBD is used; and an SCL-YOLOv8n model is constructed; Step 4: Use the rice disease dataset processed in step 2 as the input of the SCL-YOLOv8n model, and use the training set to train the SCL-YOLOv8n model; Step 5: Use the test set to test the rice disease category and locate the location; Step 6: Use the trained SCL-YOLOv8n model to predict rice diseases.

2. A lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 1, characterized in that: In step 1, the rice disease dataset is constructed by photographing the target from multiple angles and different distances; the photographed images cover six diseases, namely, rice blast, brown spot, heart blight, dew drop, false smoke, and sheath disease, as well as pictures of normal rice.

3. The lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 1, characterized in that: In step 2, the dataset is enhanced by rotation, adding salt and pepper noise, and Gaussian noise. The rice disease dataset is annotated using the LabelImg tool, the location of rice lesions is annotated using rectangular boxes, and the dataset is divided into training, test, and validation sets at a ratio of 7:2:

1.

4. The lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 1, characterized in that: In step 3, the specific construction steps of the GSLConv module are: (1) The input feature map is compressed from C1 to C2 / 2 through a 1×1 convolution; a 5×5 depthwise separable convolution DWConv is used to extract spatial features; The output of DWConv is concatenated with the 1×1 convolution result in the channel dimension to obtain the feature map X2, which combines the local spatial features with the global channel information; (2) The concatenated feature map is processed through two paths: one path performs channel shuffle, which mixes features by adjusting the channel order and breaking channel locality; the other path first processes the feature map through the LightConv layer, and then performs the shuffle operation, with an output dimension of H×W×C_out; (3) The outputs of the two paths are fused by addition.

5. The lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 1, characterized in that: In step 3, the RFCA-CSP module expands the number of channels of the input feature map from C_in to twice the original number through a 1x1 convolution, outputs the number of channels C_out, and then divides it into two branches: a convolution branch and a Transformer branch.

6. A lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 5, characterized in that: The convolution branch extracts local features through the Bottleneck-RFCAConv module and maintains the input spatial size feature map; (1) During the processing, N×N The input features are transformed by a group convolution, followed by batch normalization to stabilize the training process, and the ReLU activation function is applied to introduce nonlinearity; the formula is as follows: (1), where g i×i represents a grouped convolution of size i×i, N represents the convolution kernel size, Norm represents normalization, ReLU represents the use of ReLU activation function, x represents input features, and F represents output features; (2) The Bottleneck-RFCAConv module reduces the number of channels in the middle layer by introducing an expansion coefficient, thereby reducing the computational complexity. It uses a two-layer convolution module: the first layer reduces the number of channels through standard convolution operations, and the second layer uses the RFCAConv module to enhance the feature representation capability; (3) After the receptive field spatial features extracted by the RFCAConv module are processed, the input features are optimized using the CA attention mechanism; the CA attention mechanism decomposes the feature information in the height and width directions respectively to obtain feature representations along these two directions; (4) Transform the features by concatenating the feature maps globally in height and width and applying convolution, batch normalization, and nonlinear activation operations; (5) Split the intermediate features into two independent features, and perform feature transformation through convolution operation and Sigmoid activation function so that the output dimension is consistent with the input vector; calculate the attention weights of the input feature map in the height and width dimensions, combine the calculated attention weights with the extracted feature map, and generate the final output.

7. A lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 5, characterized in that: The Transformer branch uses the MHSA-CGLU module to establish global dependencies through multi-head self-attention MHSA, and combines the convolutional gating mechanism CGLU to transform features.

8. The lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 7, characterized in that: The multi-head self-attention mechanism MHSA maps the input sequence into multiple subspaces, each of which corresponds to an independent attention head; its specific expression is: (2), where Q, K, and V represent query, key, and value vectors, respectively, and d k is the dimension of the key vector, which is used to scale the dot product to prevent the dot product result from being too large, thereby avoiding the gradient from disappearing. T represents the transposed matrix, and softmax represents the normalization operation; (1) A multi-head self-attention mechanism is introduced. Multiple attention heads are calculated in parallel, and each head learns different representations in its own subspace. The specific process is expressed by formula (3) and formula (4): , where , , , is the parameter matrix learned by the model, Concat means concatenation operation, head means attention head, h means the number of attention heads, and i means the i-th one; (2) CGLU adds a 3x3 depth convolution operation before the gated linear unit GLU activation function; (3) The outputs of the two branches are concatenated along the channel dimension and mapped to the final output channel number C_out through a 1x1 convolution to complete feature fusion.

9. The lightweight rice disease prediction method based on SCL-YOLOv8n according to claim 1, characterized in that: In step 3, the lightweight shared enhanced detection head LSCSBD operates as follows: (1) Input feature maps of different scales into the network, and map the number of channels of each feature map from C_i to the number of hidden channels hidc through a 1x1 convolutional layer, while keeping the spatial size unchanged; (2) At each detection layer, a 3×3 shared convolution is applied to extract spatial features. After the convolution operation, the output features are batch normalized (BN) and nonlinearly transformed using the SiLU activation function. The features after SiLU processing are further subjected to a second 3×3 shared convolution operation, BN normalization, and SiLU activation to enhance feature expression capabilities. (3) The output is a tensor containing bounding box regression and category scores. The entire process rescales the output of each detection layer through the Scale operation to ensure consistency and accuracy in multi-scale detection tasks.

Citation Information

Patent Citations

  • Rice pest detection method and device based on YOLOv5s algorithm

    CN117523354A

  • Lightweight multi-environment tomato detection method based on improved yolov8

    CN117557787A

  • Asphalt pavement disease detection method based on YOLOv8n model

    CN118247636A

  • Tea disease detection method and system

    CN119206440A

  • Wheat scab detection method and system based on unmanned aerial vehicle remote sensing and improved YOLOv8

    CN119206505A

Cited By

  • Industrial PCB defect identification method based on sample generation model

    CN120278974A

  • An industrial PCB defect identification method based on a sample generation model

    CN120278974B

  • Rice multi-disease detection method based on improved YOLOv11n

    CN121170590A