Wheat storage grain insect detection method based on YOLOv8m and ShuffleNetv2 network

By using the YOLOv8m and ShuffleNetv2 network method in wheat storage grain insect detection, the problem of low efficiency and poor accuracy of wheat storage grain insect detection in the prior art is solved, faster and more accurate detection is achieved, and food loss is reduced. Provide technical support for food security.

CN118887388APending Publication Date: 2024-11-01HENAN UNIVERSITY OF TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410931252.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-11-01

AI Technical Summary

Technical Problem

The existing wheat storage grain insect detection methods are inefficient and have poor accuracy, and cannot be detected and warned in time, resulting in food loss.

Method used

Using the wheat warehousing grain insect detection method based on YOLOv8m and ShuffleNetv2 networks, through data collection, model construction and training, using ShuffleNetv2 as the backbone network, Squeeze-and-Excitation Networks attention mechanism and WIoU loss function are added to improve feature extraction of the detection model and loss function.

Benefits of technology

It improves the accuracy and speed of wheat storage grain insect detection, can issue early warnings in a timely manner and reduces grain losses. The model is small and easy to transplant to mobile devices, enhancing the generalization ability and robustness of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887388A_ABST
    Figure CN118887388A_ABST
Patent Text Reader

Abstract

The invention relates to a wheat storage grain insect detection method based on YOLOv8m and ShuffleNetv2 networks. Compared with the prior art, the problems that the detection accuracy is low and the detection speed is low due to the fact that a detection target is too small are solved. The method comprises the following steps: data acquisition and preprocessing; constructing a wheat storage grain insect detection model; training a wheat storage grain insect detection model; obtaining a to-be-detected wheat storage grain insect image; obtaining a wheat storage grain insect detection result; according to the invention, the accuracy and speed of wheat storage grain insect detection can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of wheat stored grain insect detection, and in particular to a wheat stored grain insect detection method based on YOLOv8m and ShuffleNetv2 networks. Background Art

[0002] As one of China's basic staple foods, wheat safety issues cannot be ignored. After wheat is stored, pest problems are the main factor affecting wheat storage, and pest detection becomes an important means to maintain food security. Traditional grain insect detection methods mainly rely on manual identification of the types of pests in grain, using the sampling and screening method and probe tube trapping method specified in the standard method LS / T 1211-2008 recommended by my country's Grain Bureau to detect the density of pests in grain. The sampling and screening method is labor-intensive, inefficient, and has large errors; the probe tube trapping method has poor detection effects on pests with small activity levels, and both methods are greatly affected by subjective factors.

[0003] With the development of deep learning theory, target detection algorithms have demonstrated their irreplaceable advantages in grain insect detection. The algorithms are divided into two-step algorithms based on candidate regions and one-step algorithms based on regression. The two-step algorithm based on candidate regions refers to a two-step target detection method using CNN convolutional neural network, which integrates candidate region selection and feature extraction into the deep learning framework to achieve end-to-end optimization. The accuracy and speed of grain insect detection have been significantly improved compared with manual detection. The YOLO model has pushed target detection to a new stage with its one-step output feature.

[0004] The existing storage of grain insects still cannot effectively and timely detect and warn the speed and efficiency of grain insects, and cannot be discovered and dealt with in time, which causes damage to the stored grain and causes certain losses. Summary of the invention

[0005] An object of the present invention is to provide a wheat storage grain insect detection method based on YOLOv8m and ShuffleNetv2 networks that solves at least any aspect of the above-mentioned technical problems.

[0006] A further object of the present invention is to avoid the situation where grain insects are not discovered in time and early warning cannot be given in time.

[0007] Another further object of the present invention is to improve the detection speed and accuracy, and to provide timely warning and pest control.

[0008] In particular, the present invention provides a wheat storage grain insect detection method based on YOLOv8m and ShuffleNetv2 networks, comprising the following steps:

[0009] S100: Data collection and preprocessing: Use mobile phones and other shooting tools to capture images of wheat stored grain insects, and annotate the collected images of wheat stored grain insects, perform data enhancement and data set division operations to form a wheat stored grain insect image dataset;

[0010] S200: Building a wheat stored grain insect detection model: Based on YOLOv8m, the Backbone part was replaced with the ShuffleNetv2 network to build a wheat stored grain insect detection model;

[0011] S300: Training of wheat stored grain insect detection model: inputting the wheat stored grain insect image dataset into the wheat stored grain insect detection model for training;

[0012] S400: Acquisition of an image of wheat stored grain insects to be detected: Acquisition of an image of wheat stored grain insects to be detected and preprocessing;

[0013] S500: Obtaining the wheat stored grain insect detection result: inputting the pre-processed wheat stored grain insect image to be detected into the trained wheat stored grain insect detection model to obtain the wheat stored grain insect detection result.

[0014] Furthermore, based on the YOLOv8m in step S200, a wheat stored grain insect detection model is constructed, and the wheat stored grain insect detection model is set to be divided into five parts:

[0015] The first part is Input. As the input end, Input is responsible for receiving image data from the front end and preprocessing the data, including: the basic size of the input data set is 640*640, image scaling, Mosaic data enhancement operation and closing it in the last 10 epochs, and channel dimension adjustment operation;

[0016] The second part is Backbone, which is responsible for feature extraction as the backbone. Backbone is a Darknet-53 network. The main C2f module realizes feature fusion and uses Bottleneck units with a block number of 3-6-6-3. The SPPF module realizes the fusion of local features and global features at the featherMap level. The specific structure is that the input feature map continuously enters 3 convolution maximum poolings with a kernel size of 5, and then the result before pooling is concat with the result after each pooling. The channel is convolutionally upgraded to 1024 outputs.

[0017] The third part is the Neck part. The Neck part is responsible for extracting the feature hierarchy structure of PAN-FPN. Bakbone's Layer4, Layer6, and Layer9 are used as input. After upsampling and channel fusion, the three outputs send the data to the Head part for Loss calculation or result calculation.

[0018] The fourth part is the Head part. The Head part uses Decoupled Head and Anchor-Free to separate the classification and recognition tasks. The regression branch uses the integral form representation in Distribution Focal Loss. The calculation of the loss function includes two parts. The classification loss is VFL Loss, and the regression loss is CIOU Loss+DFL Loss.

[0019] The fifth part is the Output part, which is responsible for outputting the model prediction results and identifying and locating the targets in the image.

[0020] Furthermore, the ShuffleNetv2 network in step S200 is set as follows:

[0021] The ShuffleNetv2 network uses the Channel split module to divide the input channels of the model into two parts, one part is passed directly downward, and the other part is calculated backward. At the end of the model, the number of output channels of the above two parts is cascaded, and the RandomShuffle operation is performed on the final output feature maps; the Channelshuffle module is used to reorder the channels of the stacked feature maps; the stage module consists of a ShuffleNetv2 downsampling module and several basic modules.

[0022] Furthermore, replace ShuffleNetv2 as the backbone network:

[0023] The Backbone module of the wheat storage grain insect model was improved, the Darknet-53 network was replaced with the ShuffleNetv2 network, the feature layers with the same shape of the three preliminary effective feature layers were enhanced for feature extraction, and parameter settings and network structure definition were performed; the parameter settings included channel rearrangement, grouped convolution and depthwise separable convolution settings.

[0024] Furthermore, we add the attention mechanism:

[0025] Improve the second-layer Backbone of the wheat stored grain insect detection model and add the Squeeze-and-Excitation Networks attention mechanism at the end of the network;

[0026] Set the WIoU loss function:

[0027] Set the classification loss in the Yolov8 model to VFL Loss and the regression loss to CIoU Loss+DFL Loss.

[0028] The VFL Loss is defined as follows:

[0029]

[0030] Where p is the probability, q is the intersection-over-union ratio of the predicted box and the true box. If the two boxes intersect, that is, q>0, it is a positive sample, and the two boxes do not intersect; if the two boxes do not intersect, q=0, it is a negative sample;

[0031] DFL Loss is defined as follows:

[0032]

[0033] WIoU Loss is introduced to replace CIoU Loss, and the concept of weight is introduced to improve the similarity between the predicted box and the real target; WIoU Loss is defined as follows:

[0034]

[0035]

[0036] Furthermore, the training of the wheat stored grain insect detection model in step S300 includes the following steps:

[0037] S301: Build a Pytorch neural network training environment with Python=3.9 and CUDA=11.6;

[0038] S302: Set the image input size to 640*640, the initial learning rate to 0.01, the model training batch size to 8, and the training iteration cycle to 100;

[0039] S303: inputting the stored grain insect data set into the wheat stored grain insect detection model, completing the training and generating an optimal weight file;

[0040] S3031: The first part Input adjusts the image size and data enhancement of the input data set, standardizes the image data and sends it to the second part;

[0041] S3032: The second part, Backbone, uses the ShuffleNetv2 structure. First, a layer of Conv convolution module is used to convert the input image into a feature map, and a maximum pooling operation is performed. Then, the stage operation is repeated three times. The Squeeze-and-Excitation Networks attention mechanism selectively emphasizes information and suppresses useless information. Finally, the feature map, the location and size of the target box, and the corresponding category probability are output.

[0042] S3033: The third part Neck first uses the CSP module to fuse the feature map processed by Backbone with the original feature map, and outputs the result to the Head part through three outputs;

[0043] S3034: The fourth part of the Head uses Decoupled Head to perform classification and regression tasks respectively. Two CBS convolution modules separate the classification and recognition tasks. After a convolution, the classification loss and Bbox loss are calculated respectively.

[0044] S3035: The fifth part Output outputs the final prediction result of the model, predicting the location and category information of each object in the image;

[0045] S304: After the training is completed, a weight file of the trained wheat storage grain insect model is obtained.

[0046] Technical effects and advantages of the present invention:

[0047] The invention can effectively improve the accuracy and speed of wheat storage grain insect detection by using a wheat storage grain insect detection method based on YOLOv8m and ShuffleNetv2 networks compared with the prior art; it can issue an early warning in time when insect pests occur, achieve timely pest control, and minimize grain losses;

[0048] Furthermore, by replacing the backbone network with the ShuffleNetv2 network, using the WIoU loss function and adding the Squeeze-and-Excitation Networks attention mechanism, the accuracy and speed of wheat storage insect detection were effectively improved. The model is small and easy to port to mobile terminals such as mobile phones.

[0049] The ShuffleNetv2 network, Squeeze-and-Excitation Networks attention mechanism, and WIoU loss function are further introduced to improve the YOLOv8m target detection algorithm, enhance the feature extraction capability of the backbone network, strengthen the fusion effect of the feature fusion module, and improve the loss function of the detection module, ultimately improving the generalization ability and robustness of the model; the trained improved YOLOv8m small target detection model is used to detect the grain insect dataset, which can achieve accurate detection of wheat storage insects, while maintaining a high accuracy rate and ensuring the detection speed, which can provide certain technical support for the detection of wheat storage insects in grain depots, and further ensure food security. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] Hereinafter, some specific embodiments of the present invention will be described in detail in an exemplary and non-limiting manner with reference to the accompanying drawings. The same reference numerals in the accompanying drawings indicate the same or similar components or parts. It should be understood by those skilled in the art that these drawings are not necessarily drawn to scale. In the accompanying drawings:

[0051] Figure 1 It is a schematic diagram of the framework of the grain insect detection steps of the present invention.

[0052] Figure 2 This is a structural diagram of the detection model for wheat storage grain insects involved in the present invention. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0054] Figure 1 It is a schematic diagram of the framework of the grain insect detection steps of the present invention. Figure 2 This is a structural diagram of the detection model for wheat storage grain insects involved in the present invention.

[0055] The solution of this embodiment provides a method for detecting wheat stored grain insects based on YOLOv8m and ShuffleNetv2 networks, comprising the following steps:

[0056] S100: Data collection and preprocessing: Use mobile phones and other shooting tools to capture images of wheat stored grain insects, and annotate the collected images of wheat stored grain insects, perform data enhancement and data set division operations to form a wheat stored grain insect image dataset;

[0057] S200: Building a wheat stored grain insect detection model: Based on YOLOv8m, the Backbone part was replaced with the ShuffleNetv2 network to build a wheat stored grain insect detection model;

[0058] S300: Training of wheat stored grain insect detection model: inputting the wheat stored grain insect image dataset into the wheat stored grain insect detection model for training;

[0059] S400: Acquisition of an image of wheat stored grain insects to be detected: Acquisition of an image of wheat stored grain insects to be detected and preprocessing;

[0060] S500: Obtaining the wheat stored grain insect detection result: inputting the pre-processed wheat stored grain insect image to be detected into the trained wheat stored grain insect detection model to obtain the wheat stored grain insect detection result.

[0061] It should be further explained that the wheat stored grain insect detection model is constructed based on YOLOv8m in step S200, and the wheat stored grain insect detection model is set to be divided into five parts:

[0062] The first part is Input. As the input end, Input is responsible for receiving image data from the front end and preprocessing the data, including: the basic size of the input data set is 640*640, image scaling, Mosaic data enhancement operation and closing it in the last 10 epochs, and channel dimension adjustment operation;

[0063] The second part is Backbone, which is responsible for feature extraction as the backbone. Backbone is a Darknet-53 network. The main C2f module realizes feature fusion and uses Bottleneck units with a block number of 3-6-6-3. The SPPF module realizes the fusion of local features and global features at the featherMap level. The specific structure is that the input feature map continuously enters 3 convolution maximum poolings with a kernel size of 5, and then the result before pooling is concat with the result after each pooling. The channel is convolutionally upgraded to 1024 outputs.

[0064] The third part is the Neck part. The Neck part is responsible for extracting the feature hierarchy structure of PAN-FPN. Bakbone's Layer4, Layer6, and Layer9 are used as input. After upsampling and channel fusion, the three outputs send the data to the Head part for Loss calculation or result calculation.

[0065] The fourth part is the Head part. The Head part uses Decoupled Head and Anchor-Free to separate the classification and recognition tasks. The regression branch uses the integral form representation in Distribution Focal Loss. The calculation of the loss function includes two parts. The classification loss is VFL Loss, and the regression loss is CIOU Loss+DFL Loss.

[0066] The fifth part is the Output part, which is responsible for outputting the model prediction results and identifying and locating the targets in the image.

[0067] It should be further explained that the ShuffleNetv2 network in step S200 is set as follows:

[0068] The ShuffleNetv2 network uses the Channel split module to divide the input channels of the model into two parts, one part is passed directly downward, and the other part is calculated backward. At the end of the model, the number of output channels of the above two parts is cascaded, and the RandomShuffle operation is performed on the final output feature maps; the Channelshuffle module is used to reorder the channels of the stacked feature maps; the stage module consists of a ShuffleNetv2 downsampling module and several basic modules.

[0069] It should be further explained that the ShuffleNetv2 is replaced as the backbone network:

[0070] The Backbone module of the wheat storage grain insect model was improved, the Darknet-53 network was replaced with the ShuffleNetv2 network, the feature layers with the same shape of the three preliminary effective feature layers were enhanced for feature extraction, and parameter settings and network structure definition were performed; the parameter settings included channel rearrangement, grouped convolution and depthwise separable convolution settings.

[0071] It needs to be further explained that the attention mechanism is added:

[0072] Improve the second-layer Backbone of the wheat stored grain insect detection model and add the Squeeze-and-Excitation Networks attention mechanism at the end of the network;

[0073] Set the WIoU loss function:

[0074] Set the classification loss in the Yolov8 model to VFL Loss and the regression loss to CIoU Loss+DFL Loss.

[0075] The VFL Loss is defined as follows:

[0076]

[0077] Where p is the probability, q is the intersection-over-unit ratio of the predicted box and the true box; if the two boxes intersect, that is, q>0, it is a positive sample, and the two boxes have no intersection; if the two boxes do not intersect, q=0, it is a negative sample.

[0078] DFLLoss is defined as follows:

[0079]

[0080] WIoU Loss is introduced to replace CIoU Loss. The concept of weight is introduced to improve the similarity between the predicted box and the true target. WIoU Loss is defined as follows:

[0081]

[0082]

[0083] It should be further explained that the training of the wheat stored grain insect detection model in step S300 includes the following steps:

[0084] S301: Build a Pytorch neural network training environment with Python=3.9 and CUDA=11.6;

[0085] S302: Set the image input size to 640*640, the initial learning rate to 0.01, the model training batch size to 8, and the training iteration cycle to 100;

[0086] S303: inputting the stored grain insect data set into the wheat stored grain insect detection model, completing the training and generating an optimal weight file;

[0087] S3031: The first part Input adjusts the image size and data enhancement of the input data set, standardizes the image data and sends it to the second part;

[0088] S3032: The second part, Backbone, uses the ShuffleNetv2 structure. First, a layer of Conv convolution module is used to convert the input image into a feature map, and a maximum pooling operation is performed. Then, the stage operation is repeated three times. The Squeeze-and-Excitation Networks attention mechanism selectively emphasizes information and suppresses useless information. Finally, the feature map, the location and size of the target box, and the corresponding category probability are output.

[0089] S3033: The third part Neck first uses the CSP module to fuse the feature map processed by Backbone with the original feature map, and outputs the result to the Head part through three outputs;

[0090] S3034: The fourth part of the Head uses Decoupled Head to perform classification and regression tasks respectively. Two CBS convolution modules separate the classification and recognition tasks. After a convolution, the classification loss and Bbox loss are calculated respectively.

[0091] S3035: The fifth part Output outputs the final prediction result of the model, predicting the location and category information of each object in the image;

[0092] S304: After the training is completed, a weight file of the trained wheat storage grain insect model is obtained.

[0093] Among them, in order to verify the accuracy of wheat stored grain insect detection and identification of the present invention, the obtained weight file is used to test the wheat stored grain insect images in the test set; at the same time, in order to verify the superiority and effectiveness of the detection algorithm proposed in the present invention compared with the current popular target detection model, the performance of the detection model in the mainstream network is evaluated, and the Faster-RCNN, YOLOv5, and YOLOv8 series algorithms are selected for experimental comparison under the same conditions (unified configuration and the same data set); in order to verify the effectiveness of the improved module of the algorithm of the present invention, the original model YOLOv8m is used as the basic model, and ablation experiments are carried out through different combinations of multiple improved modules; when the complexity of the data set is high, the improved network has obvious improvements in various detection indicators compared with other methods, and the detection performance of wheat is better.

[0094] Among them, in order to verify the accuracy of wheat stored grain insect detection and identification of the present invention, the obtained weight file is used to test the wheat stored grain insect images in the test set; at the same time, in order to verify the superiority and effectiveness of the detection algorithm proposed by the present invention compared with the current popular target detection model, the performance of the detection model in the mainstream network is evaluated, and the Faster-RCNN, YOLOv5m, and YOLOv8 series algorithms are selected for experimental comparison under the same conditions (unified configuration and the same data set); at the same time, the effectiveness of the improved module of the algorithm of the present invention is verified, and the original model YOLOv8m is used as the basic model, and ablation experiments are carried out through different combinations of multiple improved modules; as shown in the following Table 1:

[0095] Table 1 Comparison of detection performance of different algorithms

[0096]

[0097] When the data set is highly complex, the improved network still has significant improvements in various detection indicators compared to other methods, and still has certain advantages in the detection performance of wheat storage grain insects.

[0098] Working principle of the present invention:

[0099] When in use, the invention can effectively improve the accuracy and speed of wheat storage grain insect detection compared with the prior art through the wheat storage grain insect detection method based on YOLOv8m and ShuffleNetv2 networks, and can issue early warnings in time when insect pests occur, so as to eliminate insects in time and minimize grain losses;

[0100] Furthermore, by replacing the backbone network with the ShuffleNetv2 network, using the WIoU loss function and adding the Squeeze-and-Excitation Networks attention mechanism, the accuracy and speed of wheat storage insect detection were effectively improved. The model is small and easy to port to mobile terminals such as mobile phones.

[0101] The ShuffleNetv2 network, Squeeze-and-Excitation Networks attention mechanism, and WIoU loss function are further introduced to improve the YOLOv8m target detection algorithm, enhance the feature extraction capability of the backbone network, strengthen the fusion effect of the feature fusion module, and improve the loss function of the detection module, ultimately improving the generalization ability and robustness of the model; the trained improved YOLOv8m small target detection model is used to detect the grain insect dataset, which can achieve accurate detection of wheat storage insects, while maintaining a high accuracy rate and ensuring the detection speed, which can provide certain technical support for the detection of wheat storage insects in grain depots, and further ensure food security.

[0102] The present invention can solve the problem of low detection accuracy of the existing target detection method for wheat stored grain insects in the prior art due to complex background and small targets, and improve the detection ability of the YOLOv8 network for small targets, so that it has higher detection accuracy and robustness in the case of complex background and small targets. This method improves the accuracy and speed of wheat stored grain insect detection by improving the backbone network Backbone of YOLOv8 to ShuffleNetv2 structure, enhancing feature fusion capability, adding the small target detection layer Squeeze-and-Excitation Networks attention mechanism and using WIoU boundary loss function.

[0103] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. Wheat storage insect detection method based on YOLOv8m and ShuffleNetv2 network, It is characterized in that The following steps are involved: S100: Data collection and preprocessing: Use mobile phones and other shooting tools to capture images of wheat stored grain insects, and annotate the collected images of wheat stored grain insects, perform data enhancement and data set division operations to form a wheat stored grain insect image dataset; S200: Building a wheat stored grain insect detection model: Based on YOLOv8m, the Backbone part was replaced with the ShuffleNetv2 network to build a wheat stored grain insect detection model; S300: Training of wheat stored grain insect detection model: inputting the wheat stored grain insect image dataset into the wheat stored grain insect detection model for training; S400: Acquisition of an image of wheat stored grain insects to be detected: Acquisition of an image of wheat stored grain insects to be detected and preprocessing; S500: Obtaining the wheat stored grain insect detection result: inputting the pre-processed wheat stored grain insect image to be detected into the trained wheat stored grain insect detection model to obtain the wheat stored grain insect detection result.

2. The method for detecting stored wheat grain insects according to claim 1, It is characterized in that Based on YOLOv8m in step S200, a wheat stored grain insect detection model is constructed, and the wheat stored grain insect detection model is set to be divided into five parts: The first part is Input. As the input end, Input is responsible for receiving image data from the front end and preprocessing the data, including: the basic size of the input data set is 640*640, image scaling, Mosaic data enhancement operation and closing it in the last 10 epochs, and channel dimension adjustment operation; The second part is Backbone, which is responsible for feature extraction as the backbone. Backbone is a Darknet-53 network. The main C2f module realizes feature fusion and uses Bottleneck units with a block number of 3-6-6-3. The SPPF module realizes the fusion of local features and global features at the featherMap level. The specific structure is that the input feature map continuously enters 3 convolution maximum poolings with a kernel size of 5, and then the result before pooling is concat with the result after each pooling. The channel is convolutionally upgraded to 1024 outputs. The third part is the Neck part. The Neck part is responsible for extracting the feature hierarchy structure of PAN-FPN. Bakbone's Layer4, Layer6, and Layer9 are used as input. After upsampling and channel fusion, the three outputs send the data to the Head part for Loss calculation or result calculation. The fourth part is the Head part. The Head part uses Decoupled Head and Anchor-Free to separate the classification and recognition tasks. The regression branch uses the integral form representation in Distribution Focal Loss. The calculation of the loss function includes two parts. The classification loss is VFL Loss, and the regression loss is CIOU Loss+DFL Loss. The fifth part is the Output part, which is responsible for outputting the model prediction results and identifying and locating the targets in the image.

3. The method for detecting stored wheat grain insects according to claim 1, It is characterized in that Set the ShuffleNetv2 network in step S200: The ShuffleNetv2 network uses the Channel split module to divide the input channels of the model into two parts, one part is passed directly downward, and the other part is calculated backward. At the end of the model, the number of output channels of the above two parts is cascaded, and the RandomShuffle operation is performed on the final output feature maps; the Channel shuffle module is used to reorder the channels of the stacked feature maps; the stage module consists of a ShuffleNetv2 downsampling module and several basic modules.

4. The method for detecting stored wheat grain insects according to claim 3, It is characterized in that Replace ShuffleNetv2 as the backbone network: The Backbone module of the wheat storage grain insect model was improved, the Darknet-53 network was replaced with the ShuffleNetv2 network, the feature layers with the same shape of the three preliminary effective feature layers were enhanced for feature extraction, and parameter settings and network structure definition were performed; the parameter settings included channel rearrangement, grouped convolution and depthwise separable convolution settings.

5. The method for detecting stored wheat grain insects according to claim 4, It is characterized in that Adding attention mechanism: Improve the second-layer Backbone of the wheat stored grain insect detection model and add the Squeeze-and-Excitation Networks attention mechanism at the end of the network; Set the WIoU loss function: Set the classification loss in the Yolov8 model to VFL Loss and the regression loss to CIoU Loss+DFL Loss. The VFL Loss is defined as follows: ; in is the probability, is the intersection-over-union ratio of the predicted box and the real box. The two boxes intersect, that is, For positive samples, the two boxes do not intersect; the two boxes do not intersect, , is a negative sample; DFL Loss is defined as follows: ; WIoU Loss is introduced to replace CIoU Loss, and the concept of weight is introduced to improve the similarity between the predicted box and the real target; WIoU Loss is defined as follows: 。 6. The wheat stored grain insect detection method based on YOLOv8m and ShuffleNetv2 network according to claim 1, It is characterized in that The training of the wheat stored grain insect detection model in step S300 includes the following steps: S301: Build a Pytorch neural network training environment with Python=3.9 and CUDA=11.6; S302: Set the image input size to 640*640, the initial learning rate to 0.01, the model training batch size to 8, and the training iteration cycle to 100; S303: inputting the stored grain insect data set into the wheat stored grain insect detection model, completing the training and generating an optimal weight file; S304: After the training is completed, a weight file of the trained wheat storage grain insect model is obtained.

7. The wheat stored grain insect detection method based on YOLOv8m and ShuffleNetv2 network according to claim 6, It is characterized in that The step S303 also includes the following parts: S3031: The first part Input adjusts the image size and data enhancement of the input data set, standardizes the image data and sends it to the second part; S3032: The second part, Backbone, uses the ShuffleNetv2 structure. First, a layer of Conv convolution module is used to convert the input image into a feature map, and a maximum pooling operation is performed. Then, the stage operation is repeated three times. The Squeeze-and-Excitation Networks attention mechanism selectively emphasizes information and suppresses useless information. Finally, the feature map, the location and size of the target box, and the corresponding category probability are output. S3033: The third part Neck first uses the CSP module to fuse the feature map processed by Backbone with the original feature map, and outputs the result to the Head part through three outputs; S3034: The fourth part of the Head uses Decoupled Head to perform classification and regression tasks respectively. Two CBS convolution modules separate the classification and recognition tasks. After a convolution, the classification loss and Bbox loss are calculated respectively. S3035: The fifth part Output outputs the final prediction result of the model, predicting the location and category information of each target in the image.

Citation Information

Cited By

  • Warehouse grain insect detection method based on improved YOLOv8n network

    CN120339742A

  • Method for applying unmanned aerial vehicle remote sensing technology to agricultural information collection

    CN120725281A