Lightweight mung bean drought stress identification method based on SGL-YOLOv8s

By using StarNet and C2f_GLFF modules in the mung bean drought stress identification model, combined with data enhancement technology, the problems of complex model structure and low detection efficiency in the existing technology are solved, and high-precision and lightweight detection effects are achieved, which is suitable for agricultural environments. Rapid deployment.

CN119131587APending Publication Date: 2024-12-13HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411197623.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

The prior art is difficult to achieve a good balance between lightweighting and inference speed of mung bean drought stress recognition model while maintaining high accuracy, resulting in low detection efficiency and low accuracy in agricultural environments.

Method used

By replacing the backbone network of the YOLOv8s model with StarNet, and introducing the C2f_GLFF module and LAWDS module in the neck module, combining data enhancement and feature fusion technology, the model structure is optimized to improve detection accuracy and reduce calculation amount.

Benefits of technology

The model is lightweighted, the detection accuracy and inference speed are improved, the parameter quantity and calculation quantity are reduced, the model's ability to extract image features is enhanced, and it is suitable for deployment on portable devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131587A_ABST
    Figure CN119131587A_ABST
Patent Text Reader

Abstract

The invention discloses a lightweight mung bean drought stress identification method based on SGL-YOLOv8s. The method comprises the following steps: firstly, acquiring mung bean drought stress fluorescence image data, and labeling each image by using LabelImg software; performing preprocessing and data enhancement processing on the labeled picture, and then segmenting an image data set after data enhancement into a training set, a verification set and a test set; a YOLOv8s model is improved, an original backbone network is replaced with StarNet, C2fGLFF is introduced into a neck module, and common convolution is replaced with a lightweight LAWDS module; inputting the obtained mung bean drought stress picture into the improved YOLOv8s model for training, and obtaining a pre-trained SGL-YOLOv8s model; the method is used for detecting to-be-recognized mung bean drought stress pictures. The SGL-YOLOv8s model provided by the invention can be used for detecting mung bean fluorescence pictures of different drought stress levels, the parameter quantity and the floating-point number of the model are respectively reduced by 61% and 53%, and the lightweight of a model algorithm is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of deep learning and agricultural technology, and specifically relates to a lightweight mung bean drought stress recognition method based on SGL-YOLOv8s. Background Art

[0002] Droughts caused by global climate change are becoming more frequent and severe, posing a serious threat to agricultural production and food security. Mung beans are a kind of grain rich in various nutrients, with the effects of clearing away heat and detoxification, promoting diuresis and reducing swelling, and are widely used in processing. However, affected by drought, it is difficult for mung beans to achieve large-scale and industrial development. Traditional drought stress identification methods mainly rely on manual identification and instrument identification, but their low accuracy and small monitoring range can no longer meet the needs of scientific research and production. Therefore, the development of high-quality and efficient mung bean drought stress detection technology is of great practical significance.

[0003] In recent years, the rise of deep learning has greatly promoted the development of target detection technology, among which single-stage target detection models represented by the YOLO series are widely used in agricultural production. However, due to the complexity and diversity of the agricultural environment, it is difficult for existing single-stage target detection methods to achieve lightweight while maintaining a certain accuracy. Based on this reality, achieving a good balance between lightweight, inference speed and detection accuracy of the mung bean drought stress recognition model is an urgent problem that technicians in this field need to solve. Summary of the invention

[0004] Purpose of the invention: The present invention proposes a lightweight mung bean drought stress recognition method based on SGL-YOLOv8s, which achieves an effective balance among model lightweight, inference speed and detection accuracy.

[0005] Technical solution: The present invention proposes a lightweight mung bean drought stress recognition method based on SGL-YOLOv8s, comprising the following steps:

[0006] (1) Obtain the mung bean drought stress fluorescence image data in advance and label each image using LabelImg software;

[0007] (2) Preprocess and data augment the labeled images, and then divide the data augmented image dataset into training set, validation set, and test set;

[0008] (3) Improve the YOLOv8s model to obtain the SGL-YOLOv8s model: replace the backbone network of the YOLOv8s model with StarNet, introduce the C2f_GLFF module in the neck module to replace the original C2f module, and replace all convolutional layers in the neck with LAWDS modules;

[0009] (4) Input the training set into the SGL-YOLOv8s model for training to obtain a pre-trained SGL-YOLOv8s model;

[0010] (5) Use the pre-trained SGL-YOLOv8s model to detect the mung bean drought stress images to be identified.

[0011] Furthermore, the label in step (1) is used to classify the drought stress level according to different light quantum efficiency values, namely level 0, level 1, level 2, level 3, level 4, and level 5.

[0012] Furthermore, the level 0 is represented by O, which represents the CK control group, with no drought stress and normal leaf growth; level 1 is represented by HR, which represents high drought resistance, with naturally stretched leaves and emerald green or dark green color; level 2 is represented by R, which represents drought resistance, with slightly curled leaf edges; level 3 is represented by MR, which represents moderate resistance, with curled leaf edges and wrinkled leaf surfaces; level 4 is represented by S, which represents sensitive, with leaves curled into a tube, large areas of leaves drying up and turning yellow; level 5 is represented by HS, which represents high sensitivity, extreme drought, severe leaf dehydration, and plant death.

[0013] Furthermore, the data enhancement processing in step (2) includes cropping and translation, changing brightness, adding noise, rotating and mirroring, and randomly deleting a rectangular area in the image.

[0014] Furthermore, the implementation process of replacing the backbone network of the YOLOv8s model with StarNet in step (3) is as follows:

[0015] By stacking multiple StarBlock modules, the star operation is used to fuse different subspace features; the star operation is (W1 T X+B1)*(W2 T X+B2), which means fusing the features of two linear transformations through principal element multiplication; merging the weight matrix and bias into one entity, denoted as Likewise, Thus, the star operation is simplified to (W1 T X)*(W2 T X).

[0016] Furthermore, the implementation process of introducing a C2f_GLFF module into the neck module to replace the original C2f module in step (3) is as follows:

[0017] The C2f_GLFF module first extracts the local feature information and global feature information of the input feature vector through a dual-branch structure; then the output feature map after the feature fusion module consisting of two fully connected layers, a ReLu activation function and a Sigmoid function is multiplied element by element with the input feature map to fuse their information; and then the initial feature map is added to the final output feature map.

[0018] Furthermore, the dual-branch structure is as follows: first, a 1×1 convolution kernel is used to perform a convolution operation on the input feature vector to reduce the number of channels of the feature map by half; the output feature map is subjected to a depthwise separable convolution operation and an expanded convolution operation with a convolution kernel size of 3×3 respectively; then, an adaptive average pooling layer is used to automatically reduce the size of the feature map to 1×1 to retain important feature information of the image.

[0019] Furthermore, the LAWDS module in step (3) dynamically adjusts the inertia weight to balance the ability of global search and local search for important features; it consists of two branches, the first branch is composed of an attention module and a softmax function connected in series with an average pooling layer and a convolution layer, and this branch uses the attention module to assign large weights to improve the model's sensitivity to image context features; the other branch uses a 3×3 DW convolution to downsample the input feature map, the feature map size is reduced by half and a small weight is assigned to help the model search for key areas of the image.

[0020] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are as follows: In view of the problems of complex model structure, large number of parameters, low detection efficiency, etc., the present invention replaces the backbone network of the yolov8 network model with the ultra-strong and lightweight StarNet. While ensuring high precision, the calculation amount and parameter amount of the model are greatly reduced, thereby realizing the lightweight of the model and facilitating deployment on portable devices; the present invention introduces the LAWDS module to replace the traditional convolution, which reduces the number of parameters and the amount of calculation, and enables the model to adaptively allocate weights to focus on the global information and local information of the image, thereby enhancing the model's ability to extract image features; in view of the problems of missed detection, wrong detection and low detection accuracy in complex agricultural environments, the present invention improves the C2f module on the neck of the model, replaces the C2f module with the C2f_GLFF module, adopts two branches to extract the local features and global features of the image respectively, and then uses the feature fusion module to fuse the double-branch information, thereby improving the network's perception ability and detection accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Figure 1 This is a schematic diagram of the SGL-YOLOv8s model structure proposed in the present invention;

[0022] Figure 2 This is a schematic diagram of the C2f_GLFF module structure;

[0023] Figure 3 This is a schematic diagram of the module structure of LAWDS;

[0024] Figure 4 This is the result of mung bean drought stress identification and detection using the SGL-YOLOv8s model. DETAILED DESCRIPTION

[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings.

[0026] The present invention proposes a lightweight mung bean drought stress recognition method based on SGL-YOLOv8s, which specifically includes the following steps:

[0027] Step 1: Obtain the mung bean drought stress fluorescence image data and use LabelImg software to label each image.

[0028] The mung bean drought stress fluorescence image data is obtained based on chlorophyll fluorescence imaging technology. It is a chlorophyll fluorescence image. By observing the chlorophyll fluorescence released by the leaves, the photosynthesis status of the leaves can be understood. The chlorophyll fluorescence value can indirectly reflect the degree of drought stress of the plant.

[0029] LabelImg software was used to label each image. The labels were mainly divided into six categories, which were graded according to the different light quantum efficiency values ​​(FV / FM), namely level 0, level 1, level 2, level 3, level 4, and level 5. Level 0 was represented by O, representing the CK control group, with no drought stress and normal leaf growth; level 1 was represented by HR, representing high drought resistance, with naturally stretched leaves and emerald or dark green colors; level 2 was represented by R, representing drought resistance, with slightly curled leaf edges; level 3 was represented by MR, representing moderate resistance, with curled leaf edges and wrinkled leaf surfaces; level 4 was represented by S, representing sensitive leaves, with curled leaves into a tube shape, large areas of leaves drying up and turning yellow; level 5 was represented by HS, representing high sensitivity, extreme drought, severe leaf dehydration, and plant death.

[0030] Step 2: Preprocess and data augment the labeled images, and then divide the data augmented image dataset into training set, validation set, and test set.

[0031] Data augmentation techniques include cropping and translation, changing brightness, adding noise, rotating and mirroring, and randomly deleting a rectangular area in the image. The labels and images of each category after data augmentation are divided into training set, validation set, and test set in a ratio of 7:2:1.

[0032] Step 3: Improve the YOLOv8s model to obtain Figure 1 The SGL-YOLOv8s model shown: the original backbone network is replaced with StarNet, the C2f_GLFF module is introduced in the neck module instead of the original C2f module, and the ordinary convolution is replaced with the lightweight LAWDS module.

[0033] Specifically, the backbone network of the YOLOv8s model is first replaced with StarNet, which consists of multiple Star Block modules. By stacking multiple StarBlock modules and using the star operation, the model can map the input to a high-dimensional nonlinear feature space without widening the network, while greatly reducing the number of model calculation parameters and floating point numbers. The star operation is a method of fusing different subspace features through element-wise multiplication, usually written as (W1 T X+B1)*(W2 T X+B2), which means that the features of two linear transformations are fused by principal element multiplication. For the sake of convenience, the weight matrix and bias are combined into one entity, denoted as Likewise, Thus, the star operation is simplified to (W1 T X)*(W2 T X).

[0034] Secondly, a new Figure 2 The C2f_GLFF module shown in the figure replaces the original C2f module. First, a 1×1 convolution kernel is used to convolve the input feature vector, which reduces the number of channels of the feature map by half and reduces the computational complexity of the model. Then, the output feature map is subjected to a depthwise separable convolution operation and a dilated convolution operation with a convolution kernel size of 3×3, respectively. This not only captures the characteristics of the local area of ​​the image, but also pays attention to the contextual information of the entire image, thereby improving the model's ability to recognize objects of different scales. Next, the feature map size is automatically reduced to 1×1 using an adaptive average pooling layer, which not only retains the important feature information of the image but also improves the generalization ability of the model. Subsequently, the output feature map after the feature fusion module consisting of two fully connected layers, a ReLu activation function, and a Sigmoid function is multiplied element by element with the input feature map to fuse their information. In this way, common features can be enhanced and unimportant features can be weakened. Finally, the initial feature map is added to the final output feature map, which strengthens the important features of the image and weakens the image noise.

[0035] Finally, replace all convolutional layers in the neck with Figure 3The LAWDS (Light Adaptive-weightdownsampling) module shown in the figure dynamically adjusts the inertia weight to balance the ability of global search and local search for important features. It mainly consists of two branches. The first branch is composed of an attention module and a softmax function connected in series with an average pooling layer and a convolution layer. This branch uses the attention module to assign large weights to improve the model's sensitivity to image context features. The other branch uses a 3×3 DW convolution to downsample the input feature map, reducing the size of the feature map by half and assigning small weights to help the model search for key areas of the image, thereby improving the model's performance.

[0036] Step 4: Input the previously obtained mung bean drought stress pictures into the SGL-YOLOv8s model for training to obtain a pre-trained SGL-YOLOv8s model.

[0037] In order to maximize the performance of the experimental equipment and overcome the problem of large data volume, the model training is performed on the training set, and the batch size value is set to 16, which allows the model to converge to the local optimal solution or closer to the global optimal solution faster during the training process. The present invention sets the number of iterations to 100 rounds, the initial learning rate to 0.001, uses the SGD optimizer, and automatically saves the optimal model during training. During the model training process, after 100 rounds of iteration, the results detected are as follows Figure 4 As shown. Figure 4 As shown in the results, HS represents leaves with a drought level of 5, O represents the CK control group, MR represents leaves with a drought level of 3, and R represents leaves with a drought level of 2.

[0038] Step 5: Use the pre-trained SGL-YOLOv8s model to detect the mung bean drought stress pictures to be identified. The present invention uses several commonly used performance evaluation indicators: precision, recall, average precision AP (Average Precision), and mean average precision mAP (meanAverage Precision). In order to more intuitively reflect the lightweight effect of the model, the present invention also uses parameters and calculation amount (FLOPS) for evaluation. Parameters are used to describe the size of the model, which is similar to the spatial complexity in the algorithm; and the calculation amount (FLOPS) is used to describe the execution efficiency of the model, which is similar to the time complexity in the algorithm, that is, the number of floating-point operations per second. The specific experimental comparison results are shown in Table 1.

[0039] Table 1 Comparison results before and after improvement

[0040] Model Precision(%) Recall(%) mAP0.5(%) Parameters GFLOPS YOLOv8s 78.86 84.26 84.20 11166560 28.8 SGL-YOLOv8s 79.17 84.56 84.96 4374788 13.8

[0041] From the results in Table 1, we can see that compared with the original YOLOv8s, the precision, recall rate and mAP0.5 value of SGL-YOLOv8s have all been improved. At the same time, the number of parameters and the amount of calculation of the model have been reduced by more than half, with the number of parameters and floating point numbers decreasing by 61% and 53% respectively, which makes it possible for the rapid and efficient deployment and application of farmland production in the field of smart agriculture.

Claims

1. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s, characterized in that: The following steps are involved: (1) Obtain the mung bean drought stress fluorescence image data in advance and label each image using LabelImg software; (2) Preprocess and data augment the labeled images, and then divide the data augmented image dataset into training set, validation set, and test set; (3) Improve the YOLOv8s model to obtain the SGL-YOLOv8s model: replace the backbone network of the YOLOv8s model with StarNet, introduce the C2f_GLFF module in the neck module to replace the original C2f module, and replace all convolutional layers in the neck with LAWDS modules; (4) Input the training set into the SGL-YOLOv8s model for training to obtain a pre-trained SGL-YOLOv8s model; (5) Use the pre-trained SGL-YOLOv8s model to detect the mung bean drought stress images to be identified.

2. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 1, characterized in that: The label in step (1) is used to classify the drought stress level according to the different light quantum efficiency values, namely level 0, level 1, level 2, level 3, level 4, and level 5.

3. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 2, characterized in that: The 0th grade is represented by O, which represents the CK control group, with no drought stress and normal leaf growth; the 1st grade is represented by HR, which represents high drought resistance, with naturally stretched leaves and emerald green or dark green in color; the 2nd grade is represented by R, which represents drought resistance, with slightly curled leaf edges; the 3rd grade is represented by MR, which represents medium resistance, with curled leaf edges and wrinkled leaf surfaces; the 4th grade is represented by S, which represents sensitive leaves, with curled leaves into a tube shape, large areas of leaves drying up and turning yellow; the 5th grade is represented by HS, which represents high sensitivity, extreme drought, severe leaf water loss, and plant death.

4. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 1, characterized in that: The data enhancement processing in step (2) includes cropping and translation, changing brightness, adding noise, rotating and mirroring, and randomly deleting a rectangular area in the image.

5. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 1, characterized in that: The implementation process of replacing the backbone network of the YOLOv8s model with StarNet in step (3) is as follows: By stacking multiple StarBlock modules, the star operation is used to fuse different subspace features; the star operation is (W1 T X+B1)*(W2 T X+B2), which means fusing the features of two linear transformations through principal element multiplication; merging the weight matrix and bias into one entity, denoted as Likewise, Thus, the star operation is simplified to (W1 T X)*(W2 T X).

6. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 1, characterized in that: The implementation process of introducing a C2f_GLFF module into the neck module to replace the original C2f module in step (3) is as follows: The C2f_GLFF module first extracts the local feature information and global feature information of the input feature vector through a dual-branch structure; then the output feature map after the feature fusion module consisting of two fully connected layers, a ReLu activation function and a Sigmoid function is multiplied element by element with the input feature map to fuse their information; and then the initial feature map is added to the final output feature map.

7. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 6, characterized in that: The dual-branch structure is as follows: first, a 1×1 convolution kernel is used to perform a convolution operation on the input feature vector to reduce the number of channels of the feature map by half; the output feature map is subjected to a depthwise separable convolution operation and an expanded convolution operation with a convolution kernel size of 3×3 respectively; then, an adaptive average pooling layer is used to automatically reduce the size of the feature map to 1×1 to retain important feature information of the image.

8. A lightweight mung bean drought stress identification method based on SGL-YOLOv8s according to claim 1, characterized in that: The LAWDS module in step (3) dynamically adjusts the inertia weight to balance the ability of global search and local search for important features. It consists of two branches. The first branch is composed of an attention module and a softmax function connected in series with an average pooling layer and a convolution layer. This branch uses the attention module to assign large weights to improve the model's sensitivity to image context features. The other branch uses a 3×3 DW convolution to downsample the input feature map, reducing the size of the feature map by half and assigning small weights to help the model search for key areas of the image.

Citation Information

Cited By

  • Lightweight bamboo chip defect detection method and device based on deep learning

    CN119850590A

  • A lightweight bamboo defect detection method and device based on deep learning

    CN119850590B