Image-based tea pest detection method, device, equipment and storage medium
By deploying a lighter tea pest detection model in the tea garden, using regular reinforced backbone networks and lightweight neck networks for feature extraction and fusion, the problems of low pest image clarity and high deployment cost in the prior art are solved, and pest detection with high accuracy is achieved.
Patent Information
- Application Number
- CN202411105435.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-08-13
AI Technical Summary
When using artificial intelligence in tea gardens for pest detection, it is difficult to obtain clear pest images due to factors such as ambient light, pest activity and size, resulting in low recognition accuracy and high deployment cost of large-scale recognition models.
The lightweight tea pest detection model is adopted to perform multi-level feature extraction through regular reinforced backbone networks, combining the spatial pooled pyramid and path aggregated pyramid feature fusion of the lightweight neck network, and the pest frame selection network is used for target detection, reducing deployment costs and improving the accuracy of pest image capture.
The deployment of lightweight tea pest detection models in tea gardens has been achieved, which reduces deployment costs, improves the accuracy of pest image capture, and enhances the accuracy of subsequent pest identification.
Smart Images

Figure CN119107547B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to an image-based tea pest detection method, device, equipment and computer-readable storage medium. Background Art
[0002] Tea is an economic crop with high value. The pursuit of high-quality tea is the goal of every tea garden. Among them, insect pests are an important factor affecting the quality of tea.
[0003] Pest control in tea gardens is still highly dependent on relevant experts or experienced tea farmers. With the advancement of science and technology, people are gradually transforming manual experience into artificial intelligence to automatically identify the types and extent of pests. However, the collection of pest images by artificial intelligence today is affected by factors such as ambient light, pest activity, and pest size. It is difficult to obtain clearer pest images, which interferes with the subsequent identification of pest species and the analysis of the tea garden's ecological environment. In addition, artificial intelligence in tea gardens generally adopts edge computing, and the large data volume of pest identification models will increase deployment costs. Summary of the invention
[0004] The present invention provides an image-based tea pest detection method, device, equipment and storage medium, the main purpose of which is to reduce deployment costs and improve the accuracy of pest image capture by deploying a lightweight tea pest detection model.
[0005] To achieve the above object, the present invention provides an image-based tea pest detection method, comprising:
[0006] Obtain pest images;
[0007] Using the regularized reinforcement backbone network in the pre-trained tea pest detection model, multi-level feature extraction is performed on the pest image to obtain multi-scale features;
[0008] Using the lightweight neck network in the tea pest detection model, the multi-scale features are subjected to feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid to obtain a multi-scale fusion feature map;
[0009] Using the pest box selection head network in the tea pest detection model, according to the multi-scale fusion feature map, a target detection operation is performed on the pest part in the pest image to obtain a multi-scale detection box set, and a non-maximum suppression process is performed on the multi-scale detection box set to obtain a final detection box;
[0010] Among them, the lightweight neck network in the tea pest detection model is used to perform feature fusion operations based on spatial pooling pyramid and path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map, including:
[0011] Using a pre-constructed lightweight convolutional network, performing a convolution operation on a second image feature in the multi-scale feature to obtain a second convolution result, and performing a convolution operation on a third image feature in the multi-scale feature to obtain a third convolution result;
[0012] Using the spatial pooling pyramid in the lightweight neck network, a pooling operation is performed on the fourth image feature in the multi-scale fusion feature map to obtain a fourth pooling result;
[0013] Performing an upsampling operation on the fourth pooling result to obtain a first-level upsampling result, and performing feature splicing on the first-level upsampling result and the third convolution result to obtain a first splicing result, and performing lightweight convolution on the first splicing result using a pre-constructed VoVGSCSP network to obtain a third primary fusion feature;
[0014] Performing an upsampling operation on the third primary fusion feature to obtain a secondary upsampling result, and performing feature splicing on the secondary upsampling result and the second convolution result to obtain a second splicing result, and performing lightweight convolution on the second splicing result using a pre-constructed VoVGSCSP network to obtain a second primary fusion feature, and performing standardized convolution on the second primary fusion feature using a pre-constructed CBL convolution structure to obtain a second fusion feature map;
[0015] Performing feature splicing on the second primary fusion feature map and the third primary fusion feature to obtain a third splicing result, and performing lightweight convolution on the third splicing result using a pre-constructed VoVGSCSP network to obtain a third intermediate fusion feature, and performing standardized convolution on the third intermediate fusion feature using a pre-constructed CBL convolution structure to obtain a third fusion feature map;
[0016] Performing feature splicing on the third intermediate fusion feature map and the fourth pooling result to obtain a fourth splicing result, and performing lightweight convolution on the fourth splicing result using a pre-constructed VoVGSCSP network to obtain a fourth intermediate fusion feature, and performing standardized convolution on the fourth intermediate fusion feature using a pre-constructed CBL convolution structure to obtain a fourth fusion feature map;
[0017] The second fused feature map, the third fused feature map and the fourth fused feature map are output to obtain a multi-scale fused feature map.
[0018] Optionally, the regularized reinforcement backbone network in the pre-trained tea pest detection model is used to perform multi-level feature extraction on the pest image to obtain multi-scale features, including:
[0019] Using the CBL standardized structure in the regularized reinforcement backbone network, feature extraction is performed on the pest image to obtain initial image features;
[0020] Using a pre-constructed first convolution layer, the initial image features are subjected to three dimensionality reduction convolution operations to obtain a sampling result, and using a pre-constructed second convolution layer, the sampling result is sampled twice to obtain a primary image feature;
[0021] Using the second convolutional layer to sample the primary image feature twice to obtain a second image feature;
[0022] Using the second convolutional layer to sample the second image feature six times to obtain a third image feature;
[0023] The second convolutional layer samples the third image feature five times to obtain a fourth image feature;
[0024] The second image feature, the third image feature and the fourth image feature are output to obtain a multi-scale feature.
[0025] Optionally, the first convolution layer includes a 3×3 convolution kernel, an activation function that sets values less than 0 to 0 and values greater than 6 to 6, and a 1×1 convolution kernel, which are arranged in sequence;
[0026] The second convolutional layer includes a 1×1 convolution kernel, an activation function defined as x*sigmoid(x), a 3×3 depth-separable convolution layer, a Se attention mechanism layer, a 1×1 convolution kernel, and an activation function that sets values less than 0 to 0 and values greater than 6 to 6, arranged in sequence.
[0027] Optionally, before using the regularized reinforcement backbone network in the pre-trained tea pest detection model, the method further includes:
[0028] Obtain a pre-built MS COCO dataset, and use the MS COCO dataset to predict the pre-built tea pest detection model to obtain a prediction result set;
[0029] Using the IoU detection indicator based on the minimum point distance, according to the real label of each data image in the MS COCO dataset, the model detection is performed on the prediction result set to obtain the model performance detection result;
[0030] When the model performance test result is greater than or equal to a preset qualified threshold, a trained tea pest detection model is obtained.
[0031] Optionally, after obtaining the trained tea pest detection model, the method further includes:
[0032] Using the Network Slimming pruning technology, a structured channel pruning operation is performed on the trained tea pest detection model to obtain a lightweight tea pest detection model;
[0033] The portable tea pest detection model is fine-tuned and trained by utilizing transfer learning to obtain a trained portable tea pest detection model.
[0034] Optionally, after obtaining the trained tea pest detection model, the method further includes:
[0035] Using the Network Slimming pruning technology, a structured channel pruning operation is performed on the trained tea pest detection model to obtain a lightweight tea pest detection model;
[0036] The portable tea pest detection model is fine-tuned and trained by utilizing transfer learning to obtain a trained portable tea pest detection model.
[0037] Optionally, the acquiring of pest images includes:
[0038] When the pests caught by the pre-built insect trap are detected, the target area in the insect trap is photographed using the pre-built photographing equipment to obtain an image of the pests.
[0039] In order to solve the above problems, the present invention also provides an image-based tea pest detection device, the device comprising:
[0040] An image acquisition module, used for acquiring pest images;
[0041] A feature extraction module, used to perform multi-level feature extraction on the pest image using a regularized reinforcement backbone network in a pre-trained tea pest detection model to obtain multi-scale features;
[0042] A feature fusion module, used to utilize the lightweight neck network in the tea pest detection model to perform feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map;
[0043] A feature recognition module is used to use the pest frame selection head network in the tea pest detection model to perform a target detection operation on the pest part in the pest image according to the multi-scale fusion feature map to obtain a multi-scale detection frame set, and perform non-maximum suppression processing on the multi-scale detection frame set to obtain a final detection frame;
[0044] Among them, the use of the lightweight neck network in the tea pest detection model to perform a feature fusion operation based on the spatial pooling pyramid and the path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map includes: using a pre-constructed lightweight convolutional network to perform a convolution operation on the second image feature in the multi-scale features to obtain a second convolution result, and performing a convolution operation on the third image feature in the multi-scale features to obtain a third convolution result; using the spatial pooling pyramid in the lightweight neck network to perform a pooling operation on the fourth image feature in the multi-scale fusion feature map to obtain a fourth pooling result; performing an upsampling operation on the fourth pooling result to obtain a first-level upsampling result, and performing feature splicing on the first-level upsampling result and the third convolution result to obtain a first splicing result, and using the pre-constructed VoVGSCSP network to perform a lightweight convolution on the first splicing result to obtain a third primary fusion feature; performing an upsampling operation on the third primary fusion feature to obtain a second-level upsampling result, and performing feature splicing on the second-level upsampling result and the second convolution result to obtain a second splicing result. The second concatenation result is subjected to a lightweight convolution by using a pre-constructed VoVGSCSP network to obtain a second primary fusion feature, and the second primary fusion feature is subjected to a standardized convolution by using a pre-constructed CBL convolution structure to obtain a second fusion feature map; the second primary fusion feature map and the third primary fusion feature are subjected to feature concatenation to obtain a third concatenation result, and the third concatenation result is subjected to a lightweight convolution by using a pre-constructed VoVGSCSP network to obtain a third intermediate fusion feature, and the third concatenation result is subjected to a standardized convolution by using a pre-constructed CBL convolution structure to obtain a third intermediate fusion feature. The intermediate fusion features are subjected to standardized convolution to obtain a third fusion feature map; the third intermediate fusion feature map and the fourth pooling result are subjected to feature splicing to obtain a fourth splicing result, and the fourth splicing result is subjected to lightweight convolution using a pre-constructed VoVGSCSP network to obtain a fourth intermediate fusion feature, and the fourth intermediate fusion feature is subjected to standardized convolution using a pre-constructed CBL convolution structure to obtain a fourth fusion feature map; the second fusion feature map, the third fusion feature map and the fourth fusion feature map are output to obtain a multi-scale fusion feature map.
[0045] In order to solve the above problem, the present invention further provides an electronic device, the electronic device comprising:
[0046] at least one processor; and,
[0047] a memory communicatively connected to the at least one processor; wherein,
[0048] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the above-mentioned image-based tea pest detection method.
[0049] In order to solve the above problems, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned image-based tea pest detection method.
[0050] The embodiment of the present invention first realizes data extraction under different data dimensions through a regularized enhanced backbone network to obtain multi-scale features, which is convenient for obtaining data features under different fields of view, wherein the regularized enhanced backbone network adopts a method of gradually increasing the number of channels, replacing the traditional ReLU structure, which can effectively achieve the consistency of rank between input and output and reduce the impact of model bottlenecks; then the transmission and fusion of data features are realized through a lightweight neck network, wherein the lightweight neck network adopts a lightweight VoVGSCSP efficient aggregation network structure, which can effectively reduce the computational cost and realize lightweight model construction; then the pest selection head network is used to select pests, wherein the pest selection head network deploys an IoU detection index based on the minimum point distance, which can effectively control the training direction, increase the accuracy of pest image selection, and thus improve the subsequent pest recognition accuracy. Therefore, the image-based tea pest detection method, device, equipment and storage medium provided by the embodiment of the present invention can reduce the deployment cost and improve the accuracy of pest image capture by deploying a lightweight tea pest detection model. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 A schematic diagram of a process flow of an image-based tea pest detection method provided by an embodiment of the present invention;
[0052] Figure 2 A detailed flow chart of a step in an image-based tea pest detection method provided by an embodiment of the present invention;
[0053] Figure 3 A schematic diagram of the structure of a backbone network in an image-based tea pest detection method provided by an embodiment of the present invention;
[0054] Figure 4 A detailed flow chart of a step in an image-based tea pest detection method provided by an embodiment of the present invention;
[0055] Figure 5 A schematic diagram of the structure of a lightweight neck network in an image-based tea pest detection method provided by an embodiment of the present invention;
[0056] Figure 6 A schematic diagram of the structure of the SPP part in the lightweight neck network in the image-based tea pest detection method provided by one embodiment of the present invention;
[0057] Figure 7 A schematic diagram of a VoVGSCSP structure in a lightweight neck network in an image-based tea pest detection method provided by an embodiment of the present invention;
[0058] Figure 8 A schematic diagram of a GSConv structure in a lightweight neck network in an image-based tea pest detection method provided by an embodiment of the present invention;
[0059] Fig. 9 A schematic diagram showing the relationship between the true label and the predicted result during the training process of the tea pest detection model in the image-based tea pest detection method provided by an embodiment of the present invention;
[0060] Fig.10 A functional module diagram of an image-based tea pest detection device provided by an embodiment of the present invention;
[0061] Fig.11 A schematic diagram of the structure of an electronic device for implementing the image-based tea pest detection method provided by an embodiment of the present invention.
[0062] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0063] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0064] The embodiment of the present application provides an image-based tea pest detection method. In the embodiment of the present application, the execution subject of the image-based tea pest detection method includes but is not limited to at least one of the electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the image-based tea pest detection method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc. The server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN), and big data and artificial intelligence platforms.
[0065] Reference Figure 1 FIG. 1 is a flow chart of an image-based tea pest detection method according to an embodiment of the present invention. In this embodiment, the image-based tea pest detection method includes:
[0066] S1. Obtain pest images.
[0067] In detail, in the embodiment of the present invention, the step of acquiring the pest image includes:
[0068] When the pests caught by the pre-built insect trap are detected, the target area in the insect trap is photographed using the pre-built photographing equipment to obtain an image of the pests.
[0069] In the embodiment of the present invention, pests in the tea garden can be lured to the target area by deploying an insect trap, and then a shooting device that senses picture changes is set in the trap and aimed at the target area. When the pixel distribution in the monitoring video of the target area changes, for example, when a pest enters, shooting starts at a preset frequency to obtain an image of the pest.
[0070] S2. Using the regularized reinforcement backbone network in the pre-trained tea pest detection model, multi-level feature extraction is performed on the pest image to obtain multi-scale features.
[0071] In order to identify the types of pests in the embodiment of the present invention, it is first necessary to obtain a relatively complete pest image with a relatively suitable resolution and a relatively clear image. Therefore, the present invention designs a tea pest detection model, and the tea garden recognition model is a neural network image recognition model, including a regularized enhanced backbone network, a lightweight neck network and a pest frame selection head network. The regularization refers to controlling the complexity of the model, preventing overfitting, and improving the generalization ability of the model.
[0072] For details, refer to Figure 2 As shown, in the embodiment of the present invention, the regularized reinforcement backbone network in the pre-trained tea pest detection model is used to perform multi-level feature extraction on the pest image to obtain multi-scale features, including:
[0073] S21, using the CBL standardized structure in the regularized reinforcement backbone network to extract features of the pest image to obtain initial image features;
[0074] S22, using a pre-constructed first convolution layer to perform three dimensionality reduction convolution operations on the initial image features to obtain a sampling result, and using a pre-constructed second convolution layer to perform two sampling operations on the sampling result to obtain a primary image feature;
[0075] S23, using the second convolutional layer to sample the primary image feature twice to obtain a second image feature;
[0076] S24. Using the second convolutional layer to sample the second image feature six times to obtain a third image feature;
[0077] S25, the second convolutional layer samples the third image feature five times to obtain a fourth image feature;
[0078] S26: Output the second image feature, the third image feature, and the fourth image feature to obtain a multi-scale feature.
[0079] Specifically, it should be known that the CBL (Convolutional-BatchNorm-Activation) structure refers to the standard convolution, batch normalization layer and Leaky ReLU activation function. The CBL normalization structure is part of the standard convolution and batch normalization layers.
[0080] In order to effectively reduce information loss in the embodiment of the present invention, the Leaky ReLU activation function in the CBL convolution structure is replaced by the Swish activation function; then, in order to improve the high-rank spatial expression ability of the model, the number of channels is gradually increased to cope with it; finally, according to experimental data, for example, the tea garden pests in a certain place are mainly tea caterpillars, loopers, small green leafhoppers, etc., according to the wingspan volume, pattern category and other factors of these pests, a staged network hierarchical distribution of 2 second convolutional layers, 2 second convolutional layers, 6 second convolutional layers and 5 second convolutional layers is constructed, and the number of repetitions of each convolutional layer is related to the category and region of the local mainstream tea garden pests, and finally it is obtained. Figure 3 The backbone network shown.
[0081] Among them, reference Figure 3In the backbone network shown, the first convolutional layer includes a 3×3 convolution kernel [Conv3×3], an activation function [Relu6] that sets values less than 0 to 0 and values greater than 6 to 6, and a 1×1 convolution kernel [Conv1×1] arranged in sequence;
[0082] The second convolutional layer includes a 1×1 convolution kernel [Conv1×1], an activation function defined as x*sigmoid(x) [Swish], a 3×3 depth-wise separable convolution layer [Dwise3×3], a Se attention mechanism layer [Se], a 1×1 convolution kernel [Conv1×1] and an activation function that sets values less than 0 to 0 and values greater than 6 to 6 [Relu6], arranged in sequence.
[0083] The Swish is an activation function, which is defined as x*sigmoid(x), where sigmoid is an S-type function. The Swish activation function shows better performance than ReLU in some experiments and can help the model learn features better.
[0084] After sequential feature extraction, the embodiment of the present invention outputs the results at the three output interfaces from the bottom to the top [the 5-layer second convolutional layer, the 6-layer second convolutional layer and the 2-layer second convolutional layer] to obtain multi-scale features.
[0085] Furthermore, in the embodiment of the present invention, before using the regularized reinforcement backbone network in the pre-trained tea pest detection model, the method further includes:
[0086] Obtain a pre-built MS COCO dataset, and use the MS COCO dataset to predict the pre-built tea pest detection model to obtain a prediction result set;
[0087] Using the IoU detection indicator based on the minimum point distance, according to the real label of each data image in the MS COCO dataset, the model detection is performed on the prediction result set to obtain the model performance detection result;
[0088] When the model performance test result is greater than or equal to a preset qualified threshold, a trained tea pest detection model is obtained.
[0089] The MS COCO dataset (Microsoft Common Objects in Context) is a large-scale image dataset for computer vision tasks such as object detection, image segmentation, and image description. The dataset contains more than 330,000 images, each of which has annotation information of multiple objects, including the category, location, and attributes of the object. The MS COCO dataset is widely used in research and algorithm evaluation in the field of computer vision. The present invention can complete model training by only calling the database, thereby reducing the cost of model training.
[0090] In addition, the IoU detection indicator based on the minimum point distance (Minimum Point Distance basedIoU, referred to as MPDIoU) is an indicator used to calculate the degree of overlap between bounding boxes in target detection tasks. In the field of target detection, IoU is a commonly used evaluation indicator used to measure the degree of overlap between two bounding boxes. MPDIoU is an improved IoU calculation method that takes into account the minimum point distance between bounding boxes to more accurately evaluate the overlap between two bounding boxes. Therefore, MPDIoU is often referred to as IoU based on minimum point distance.
[0091] In the embodiment of the present invention, the IoU detection indicator based on the minimum point distance is used to implement the model performance analysis of the prediction result set, so as to grasp the direction and progress of the model training. When the model performance test result reaches the preset qualified threshold, the training process can be completed.
[0092] S3. Using the lightweight neck network in the tea pest detection model, the multi-scale features are subjected to feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid to obtain a multi-scale fusion feature map.
[0093] For details, refer to Figure 4 As shown, in the embodiment of the present invention, the lightweight neck network in the tea pest detection model is used to perform a feature fusion operation based on a spatial pooling pyramid and a path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map, including:
[0094] S31, using a pre-constructed lightweight convolutional network, performing a convolution operation on the second image feature in the multi-scale feature to obtain a second convolution result, and performing a convolution operation on the third image feature in the multi-scale feature to obtain a third convolution result;
[0095] S32, using the spatial pooling pyramid in the lightweight neck network, performing a pooling operation on the fourth image feature in the multi-scale fusion feature map to obtain a fourth pooling result;
[0096] S33, performing an upsampling operation on the fourth pooling result to obtain a first-level upsampling result, and performing feature splicing on the first-level upsampling result and the third convolution result to obtain a first splicing result, and using a pre-constructed VoVGSCSP network to perform a lightweight convolution on the first splicing result to obtain a third primary fusion feature;
[0097] S34, performing an upsampling operation on the third primary fusion feature to obtain a secondary upsampling result, and performing feature splicing on the secondary upsampling result and the second convolution result to obtain a second splicing result, and performing lightweight convolution on the second splicing result using a pre-constructed VoVGSCSP network to obtain a second primary fusion feature, and performing standardized convolution on the second primary fusion feature using a pre-constructed CBL convolution structure to obtain a second fusion feature map;
[0098] S35, performing feature splicing on the second primary fusion feature map and the third primary fusion feature to obtain a third splicing result, and performing lightweight convolution on the third splicing result using a pre-constructed VoVGSCSP network to obtain a third intermediate fusion feature, and performing standardized convolution on the third intermediate fusion feature using a pre-constructed CBL convolution structure to obtain a third fusion feature map;
[0099] S36, performing feature splicing on the third intermediate fusion feature map and the fourth pooling result to obtain a fourth splicing result, and performing lightweight convolution on the fourth splicing result using a pre-constructed VoVGSCSP network to obtain a fourth intermediate fusion feature, and performing standardized convolution on the fourth intermediate fusion feature using a pre-constructed CBL convolution structure to obtain a fourth fusion feature map;
[0100] S37: output the second fused feature map, the third fused feature map, and the fourth fused feature map to obtain a multi-scale fused feature map.
[0101] It should be known that the network feature data that has just entered the neck area of the model should first be standardized by the CBL structure, and then pyramid pooling and pyramid feature fusion should be performed. However, since the input channels are processed separately during the convolution process, the lack of interaction may cause information flow to be blocked, which is reflected in the loss of accuracy in the detection task. In the embodiment of the present invention, the lightweight convolutional network GSConv is used to replace the part of the CBL structure for downsampling, which can reduce the loss of features.
[0102] Therefore, reference Figure 5 As shown, for the multi-scale features entering the neck area, the present invention uses GSConv to convolve the second image features and the third image features in the multi-scale features to obtain the second convolution result and the third convolution result respectively.
[0103] For the fourth image feature at the bottom of the multi-scale features, the pyramid spatial pooling structure of the CSPSPP structure is directly used to obtain the fourth pooling result. Among them, the CSP represents the Cross Stage Partial module, and the SPP represents the Spatial Pyramid Pooling module. The CSPSPP structure is usually used in target detection or semantic segmentation tasks to improve the network's receptive field and feature expression capabilities.
[0104] Among them, reference Figure 6 shown Figure 5 The detailed structural diagram of the SPP part in the figure shows that the SPP structure improves the feature extraction ability of the model through multi-scale pooling operations, allowing the model to better capture multi-scale information. The model's ability to detect objects of different scales has been enhanced, making the model more stable when facing complex scenes.
[0105] according to Figure 5 As shown, the present invention first upsamples (UP) the fourth pooling result to obtain a first-level upsampling result.
[0106] Then, by means of a path aggregation pyramid, the first-level upsampling result is concatenated with the third convolution result to obtain a third primary fusion feature; the third primary fusion feature is upsampled to obtain a second-level upsampling result, and the second-level upsampling result is concatenated with the second convolution result to obtain a second fusion feature map; the second primary fusion feature map and the third primary fusion feature are concatenated to obtain a third fusion feature map; the third intermediate fusion feature map and the fourth pooling result are concatenated to obtain a fourth fusion feature map.
[0107] In the process of feature fusion, an efficient aggregation network and a CBL structure are required between the feature splicing result and the final fusion output result. In order to further reduce the order of magnitude of the network model, the present invention adopts a lightweight VoVGSCSP structure efficient aggregation network. Figure 7 The VoVGSCSP is a highly efficient aggregation network structure based on GSConv, with lower computational cost than ELAN. It is based on the design concept of CSPNet and combines the lightweight advantages of GSConv. The network structure diagram of the GSConv structure is shown in Figure 8As shown, the Shuffle in the GSConv represents a data rearrangement operation, which can increase information interaction between channels and help improve the expressiveness of the model; and the DWConv (Depthwise Separable Convolution) represents a depthwise separable convolution, which is used to first perform an independent spatial convolution on each input channel, and then use a 1x1 convolution to combine the outputs of these channels, which can significantly reduce the number of model parameters and the amount of calculation, while maintaining or approaching the performance of full convolution. In addition, input represents input, outout represents output, and concat represents vector concatenation, which are all common structures in neural networks and are not described in detail.
[0108] The present invention outputs the second fused feature map, the third fused feature map and the fourth fused feature map calculated by the above process to obtain a multi-scale fused feature map. The present invention can improve the model's detection ability for targets of different scales through multi-scale data output, while ensuring the comprehensive capture and full utilization of feature information, providing effective support for the performance optimization of the entire target detection network.
[0109] S4. Using the pest box selection head network in the tea pest detection model, according to the multi-scale fusion feature map, perform target detection operation on the pest part in the pest image to obtain a multi-scale detection box set, and perform non-maximum suppression processing on the multi-scale detection box set to obtain a final detection box.
[0110] The detection head of the pest box selection head network in the embodiment of the present invention uses Idetect, uses an implicit representation strategy to predict the results, and is responsible for detecting targets of three different scales, large, medium and small, for the multi-scale fusion feature map. After the target detection result is output, the detection head part uses non-maximum suppression (NMS for short) to eliminate redundant detection frames to ensure that each target is only uniquely marked. Among them, the implicit representation strategy refers to not directly predicting the position and attributes of the target when training the model, but indirectly predicting the target by learning implicit representations. This method can help the model better capture the relationship and features between targets and improve the generalization ability and performance of the model. The NMS is a post-processing technology in target detection and bounding box regression tasks. In the target detection task, some models will generate multiple candidate boxes (bounding boxes) to represent the area that may contain the target, but these candidate boxes may overlap or be redundant. The purpose of non-maximum suppression is to screen these candidate boxes through certain rules and algorithms, retain the most representative target box, and remove redundant boxes.
[0111] refer to Fig. 9 The schematic diagram of the recognition result is shown in FIG. to The area selected in the interval is the recognition result, and to The area selected in the interval is the real manual marking result. In the embodiment of the present invention, the recognition result is infinitely close to the real manual marking result through training, so that the model has a higher recognition accuracy.
[0112] Furthermore, in an embodiment of the present invention, there may be multiple pests in the pest image, and even some pests may be stacked. The final detection frame captured from the pest image through the above process of the present invention can mark each individual pest. These frames can reflect the most complete characteristics of the pests, which provides a solid foundation for subsequent identification of pest categories.
[0113] In addition, in another embodiment of the present invention, after obtaining the trained tea pest detection model, the method further includes:
[0114] Using the Network Slimming pruning technology, a structured channel pruning operation is performed on the trained tea pest detection model to obtain a lightweight tea pest detection model;
[0115] The portable tea pest detection model is fine-tuned and trained by utilizing transfer learning to obtain a trained portable tea pest detection model.
[0116] In the embodiment of the present invention, in order to make the model lightweight and more suitable for the application scenario of the tea garden, edge deployment is achieved. The magnitude of the model parameters can also be reduced through the pruning method, and the resources consumed in the model calculation process can be reduced.
[0117] The present invention realizes pruning through the structured channel pruning operation in the Network Slimming pruning technology. It should be known that its process includes: performing sparse processing on a mature trained network; finding the network layer that should be pruned while keeping the main structure of the network unchanged; sorting the scaling factors of the BN layer after the sparse processing, sorting them by importance (the smaller the value, the lower the importance), and then removing those channels with smaller coefficients, that is, removing the relevant convolutional layer weights and BN layer weights; building a new network model; and fine-tuning the training.
[0118] Among them, the BN layer is a batch normalization layer, which is one of the basic structures in the CNN network. It is used to normalize the output of the upper layer to between 0 and 1 to enhance the representativeness of the data and the generalization ability of the network. In addition, it can also combat the gradient vanishing and gradient exploding phenomena during training to a certain extent and accelerate the convergence speed of the training process.
[0119] Specifically, in the embodiment of the present invention, L1 norm regularization is applied to the gamma 65 (Gamma) parameters of the BN layer during training, so that the parameters of the BN layer continuously approach 0. By adding L1 regularization constraints on the weights of the BN layer in the loss function, the weights in the BN layer can be concentrated on neurons that are sensitive to the target, while the weights of neurons that are not sensitive to the target are increasingly close to 0, making the structure of the entire network model in terms of weights increasingly sparse.
[0120] Furthermore, the present invention affects the number of channels of the output of the network layer by reducing the number of convolution kernels in the model. After the model is sparsely trained, the scaling factors corresponding to each convolution kernel are arranged. The smaller the value, the lower the importance of the feature channel corresponding to the convolution kernel, and it can be pruned without affecting the overall performance of the network. In the experiment, the scaling factor threshold and mask matrix of the pruning are set to perform percentage pruning on the channels of the model, and the Mask matrix of each channel is processed. If its scaling factor is higher than the threshold, the Mask matrix factor is 1, so that the channel is retained. If the scaling factor is lower than the threshold, the Mask matrix factor is 0, so that the channel is pruned.
[0121] After pruning is completed, especially after a high proportion of shearing and compression, the accuracy of the simplified model may drop significantly or even return to zero. The present invention retrains the simplified model. If the accuracy of the model after sparse training remains good, after several rounds of retraining and fine-tuning, the accuracy indicators of the simplified model will be restored, thereby completing the fine-tuning operation of the model.
[0122] In addition, according to the test data, the model described in the embodiment of the present invention has an accuracy improvement of 6% and a recall rate improvement of 2.4% compared with the traditional YOLOv7-tiny model, and mAP@0.5 has increased by 3%, indicating that when the various improvements of this solution are used together, the modules have a good chemical reaction and ultimately show a better effect. In terms of model magnitude, the model of the present invention sacrifices an additional 10% of parameters in exchange for better detection effects. Although the number of parameters has increased, the FLOPs that measure the computing power requirements have decreased by 1.3, so the magnitude of the model remains basically unchanged.
[0123] The embodiment of the present invention first realizes data extraction under different data dimensions through a regularized enhanced backbone network to obtain multi-scale features, which is convenient for obtaining data features under different fields of view, wherein the regularized enhanced backbone network adopts a method of gradually increasing the number of channels, replacing the traditional ReLU structure, which can effectively achieve the consistency of rank between input and output and reduce the impact of model bottlenecks; then the transmission and fusion of data features are realized through a lightweight neck network, wherein the lightweight neck network adopts a lightweight VoVGSCSP efficient aggregation network structure, which can effectively reduce the computational cost and realize lightweight model construction; then the pest selection head network is used to select pests, wherein the pest selection head network deploys an IoU detection index based on the minimum point distance, which can effectively control the training direction, increase the accuracy of pest image selection, and thus improve the subsequent pest recognition accuracy. Therefore, the image-based tea pest detection method provided by the embodiment of the present invention can reduce the deployment cost and improve the accuracy of pest image capture by deploying a lightweight tea pest detection model.
[0124] like Fig.10 , which is a functional module diagram of an image-based tea pest detection device provided by an embodiment of the present invention.
[0125] The image-based tea pest detection device 100 of the present invention can be installed in an electronic device. According to the functions to be implemented, the image-based tea pest detection device 100 can include an image acquisition module 101, a feature extraction module 102, a feature fusion module 103 and a feature recognition module 104. The module of the present invention can also be called a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can complete fixed functions, which are stored in the memory of the electronic device.
[0126] In this embodiment, the functions of each module / unit are as follows:
[0127] The image acquisition module 101 is used to acquire pest images;
[0128] The feature extraction module 102 is used to perform multi-level feature extraction on the pest image using the regularized reinforcement backbone network in the pre-trained tea pest detection model to obtain multi-scale features;
[0129] The feature fusion module 103 is used to use the lightweight neck network in the tea pest detection model to perform feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map;
[0130] The feature recognition module 104 is used to use the pest frame selection head network in the tea pest detection model to perform a target detection operation on the pest part in the pest image according to the multi-scale fusion feature map to obtain a multi-scale detection frame set, and perform non-maximum suppression processing on the multi-scale detection frame set to obtain a final detection frame.
[0131] In detail, each module described in the tea pest identification device 100 described in the embodiment of the present application is used in the same manner as described above. Figures 1 to 9 The same technical means as the tea pest identification method described in and can produce the same technical effects are used, and will not be repeated here.
[0132] like Fig.11 FIG. 1 is a schematic diagram of the structure of an electronic device 1 for implementing an image-based tea pest detection method provided by an embodiment of the present invention.
[0133] The electronic device 1 may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an image-based tea pest detection program.
[0134] In some embodiments, the processor 10 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips. The processor 10 is the control core (ControlUnit) of the electronic device 1, and uses various interfaces and lines to connect various components of the entire electronic device, and executes or executes programs or modules stored in the memory 11 (for example, executing an image-based tea pest detection program, etc.), and calls data stored in the memory 11 to execute various functions of the electronic device and process data.
[0135] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a mobile hard disk of the electronic device. In other embodiments, the memory 11 can also be an external storage device of an electronic device, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device. Further, the memory 11 can also include both an internal storage unit of the electronic device and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device, such as the code of an image-based tea pest detection program, but also can be used to temporarily store data that has been output or is to be output.
[0136] The communication bus 12 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to realize connection and communication between the memory 11 and at least one processor 10, etc.
[0137] The communication interface 13 is used for communication between the above-mentioned electronic device 1 and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a display (Display), an input unit (such as a keyboard (Keyboard)), and optionally, the user interface may also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, and an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch device, etc. Among them, the display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visual user interface.
[0138] Fig.11 Only an electronic device with components is shown, and those skilled in the art will understand that Fig.11The structure shown does not constitute a limitation on the electronic device 1, and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0139] For example, although not shown, the electronic device 1 may also include a power source (such as a battery) for supplying power to each component. Preferably, the power source may be logically connected to the at least one processor 10 through a power management device, so that the power management device can realize functions such as charging management, discharging management, and power consumption management. The power source may also include any components such as one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, etc. The electronic device 1 may also include a variety of sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
[0140] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.
[0141] The image-based tea pest detection program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0142] Obtain pest images;
[0143] Using the regularized reinforcement backbone network in the pre-trained tea pest detection model, multi-level feature extraction is performed on the pest image to obtain multi-scale features;
[0144] Using the lightweight neck network in the tea pest detection model, the multi-scale features are subjected to feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid to obtain a multi-scale fusion feature map;
[0145] The pest box selection head network in the tea pest detection model is used to perform target detection operations on the pest part in the pest image according to the multi-scale fusion feature map to obtain a multi-scale detection box set, and non-maximum suppression processing is performed on the multi-scale detection box set to obtain a final detection box.
[0146] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to the description of the relevant steps in the corresponding embodiment of the accompanying drawings, which will not be repeated here.
[0147] Furthermore, if the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).
[0148] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor of an electronic device, the computer program can implement:
[0149] Obtain pest images;
[0150] Using the regularized reinforcement backbone network in the pre-trained tea pest detection model, multi-level feature extraction is performed on the pest image to obtain multi-scale features;
[0151] Using the lightweight neck network in the tea pest detection model, the multi-scale features are subjected to feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid to obtain a multi-scale fusion feature map;
[0152] The pest box selection head network in the tea pest detection model is used to perform target detection operations on the pest part in the pest image according to the multi-scale fusion feature map to obtain a multi-scale detection box set, and non-maximum suppression processing is performed on the multi-scale detection box set to obtain a final detection box.
[0153] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0154] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0155] In addition, each functional module in each embodiment of the present invention may be integrated into one processing unit, each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0156] It is obvious to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0157] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present invention is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present invention. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0158] The blockchain referred to in this invention is a new application mode of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0159] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0160] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in the system claim can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0161] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention.
Claims
1. A tea pest detection method based on image, characterized in that: The method comprises: Obtain pest images; Using the regularized reinforcement backbone network in the pre-trained tea pest detection model, multi-level feature extraction is performed on the pest image to obtain multi-scale features; Using the lightweight neck network in the tea pest detection model, the multi-scale features are subjected to feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid to obtain a multi-scale fusion feature map; Using the pest box selection head network in the tea pest detection model, according to the multi-scale fusion feature map, a target detection operation is performed on the pest part in the pest image to obtain a multi-scale detection box set, and a non-maximum suppression process is performed on the multi-scale detection box set to obtain a final detection box; Among them, the lightweight neck network in the tea pest detection model is used to perform feature fusion operations based on spatial pooling pyramid and path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map, including: Using a pre-constructed lightweight convolutional network, performing a convolution operation on a second image feature in the multi-scale feature to obtain a second convolution result, and performing a convolution operation on a third image feature in the multi-scale feature to obtain a third convolution result; Using the spatial pooling pyramid in the lightweight neck network, a pooling operation is performed on the fourth image feature in the multi-scale fusion feature map to obtain a fourth pooling result; Performing an upsampling operation on the fourth pooling result to obtain a first-level upsampling result, and performing feature splicing on the first-level upsampling result and the third convolution result to obtain a first splicing result, and performing lightweight convolution on the first splicing result using a pre-constructed VoVGSCSP network to obtain a third primary fusion feature; Performing an upsampling operation on the third primary fusion feature to obtain a secondary upsampling result, and performing feature splicing on the secondary upsampling result and the second convolution result to obtain a second splicing result, and performing lightweight convolution on the second splicing result using a pre-constructed VoVGSCSP network to obtain a second primary fusion feature, and performing standardized convolution on the second primary fusion feature using a pre-constructed CBL convolution structure to obtain a second fusion feature map; Performing feature splicing on the second primary fusion feature map and the third primary fusion feature to obtain a third splicing result, and performing lightweight convolution on the third splicing result using a pre-constructed VoVGSCSP network to obtain a third intermediate fusion feature, and performing standardized convolution on the third intermediate fusion feature using a pre-constructed CBL convolution structure to obtain a third fusion feature map; Performing feature splicing on the third intermediate fusion feature map and the fourth pooling result to obtain a fourth splicing result, and performing lightweight convolution on the fourth splicing result using a pre-constructed VoVGSCSP network to obtain a fourth intermediate fusion feature, and performing standardized convolution on the fourth intermediate fusion feature using a pre-constructed CBL convolution structure to obtain a fourth fusion feature map; The second fused feature map, the third fused feature map and the fourth fused feature map are output to obtain a multi-scale fused feature map.
2. The image-based tea pest detection method according to claim 1, characterized in that: The regularized reinforcement backbone network in the pre-trained tea pest detection model is used to perform multi-level feature extraction on the pest image to obtain multi-scale features, including: Using the CBL standardized structure in the regularized reinforcement backbone network, feature extraction is performed on the pest image to obtain initial image features; Using a pre-constructed first convolution layer, the initial image features are subjected to three dimensionality reduction convolution operations to obtain a sampling result, and using a pre-constructed second convolution layer, the sampling result is sampled twice to obtain a primary image feature; Using the second convolutional layer to sample the primary image feature twice to obtain a second image feature; Using the second convolutional layer to sample the second image feature six times to obtain a third image feature; The second convolutional layer samples the third image feature five times to obtain a fourth image feature; The second image feature, the third image feature and the fourth image feature are output to obtain a multi-scale feature.
3. The image-based tea pest detection method according to claim 2, characterized in that: The first convolutional layer includes a 3×3 convolution kernel, an activation function that sets values less than 0 to 0 and values greater than 6 to 6, and a 1×1 convolution kernel arranged in sequence; The second convolutional layer includes a 1×1 convolution kernel, an activation function defined as x*sigmoid(x), a 3×3 depth-separable convolution layer, a Se attention mechanism layer, a 1×1 convolution kernel, and an activation function that sets values less than 0 to 0 and values greater than 6 to 6, arranged in sequence.
4. The image-based tea pest detection method according to claim 1, characterized in that: Before using the regularized reinforcement backbone network in the pre-trained tea pest detection model, the method further includes: Obtain a pre-built MS COCO dataset, and use the MS COCO dataset to predict the pre-built tea pest detection model to obtain a prediction result set; Using the IoU detection indicator based on the minimum point distance, according to the real label of each data image in the MS COCO dataset, the model detection is performed on the prediction result set to obtain the model performance detection result; When the model performance test result is greater than or equal to a preset qualified threshold, a trained tea pest detection model is obtained.
5. The image-based tea pest detection method according to claim 4, characterized in that: After obtaining the trained tea pest detection model, the method further includes: Using the Network Slimming pruning technology, a structured channel pruning operation is performed on the trained tea pest detection model to obtain a lightweight tea pest detection model; The portable tea pest detection model is fine-tuned and trained by utilizing transfer learning to obtain a trained portable tea pest detection model.
6. The image-based tea pest detection method according to claim 1, characterized in that: The step of obtaining pest images comprises: When the pests caught by the pre-built insect trap are detected, the target area in the insect trap is photographed using the pre-built photographing equipment to obtain an image of the pests.
7. An image-based tea pest detection device, characterized in that: The device comprises: An image acquisition module, used for acquiring pest images; A feature extraction module, used to perform multi-level feature extraction on the pest image using a regularized reinforcement backbone network in a pre-trained tea pest detection model to obtain multi-scale features; A feature fusion module, used to utilize the lightweight neck network in the tea pest detection model to perform feature fusion operations based on the spatial pooling pyramid and the path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map; A feature recognition module is used to use the pest frame selection head network in the tea pest detection model to perform a target detection operation on the pest part in the pest image according to the multi-scale fusion feature map to obtain a multi-scale detection frame set, and perform non-maximum suppression processing on the multi-scale detection frame set to obtain a final detection frame; Among them, the use of the lightweight neck network in the tea pest detection model to perform a feature fusion operation based on the spatial pooling pyramid and the path aggregation pyramid on the multi-scale features to obtain a multi-scale fusion feature map includes: using a pre-constructed lightweight convolutional network to perform a convolution operation on the second image feature in the multi-scale features to obtain a second convolution result, and performing a convolution operation on the third image feature in the multi-scale features to obtain a third convolution result; using the spatial pooling pyramid in the lightweight neck network to perform a pooling operation on the fourth image feature in the multi-scale fusion feature map to obtain a fourth pooling result; performing an upsampling operation on the fourth pooling result to obtain a first-level upsampling result, and performing feature splicing on the first-level upsampling result and the third convolution result to obtain a first splicing result, and using the pre-constructed VoVGSCSP network to perform a lightweight convolution on the first splicing result to obtain a third primary fusion feature; performing an upsampling operation on the third primary fusion feature to obtain a second-level upsampling result, and performing feature splicing on the second-level upsampling result and the second convolution result to obtain a second splicing result. The second concatenation result is subjected to a lightweight convolution by using a pre-constructed VoVGSCSP network to obtain a second primary fusion feature, and the second primary fusion feature is subjected to a standardized convolution by using a pre-constructed CBL convolution structure to obtain a second fusion feature map; the second primary fusion feature map and the third primary fusion feature are subjected to feature concatenation to obtain a third concatenation result, and the third concatenation result is subjected to a lightweight convolution by using a pre-constructed VoVGSCSP network to obtain a third intermediate fusion feature, and the third concatenation result is subjected to a standardized convolution by using a pre-constructed CBL convolution structure to obtain a third intermediate fusion feature. The intermediate fusion features are subjected to standardized convolution to obtain a third fusion feature map; the third intermediate fusion feature map and the fourth pooling result are subjected to feature splicing to obtain a fourth splicing result, and the fourth splicing result is subjected to lightweight convolution using a pre-constructed VoVGSCSP network to obtain a fourth intermediate fusion feature, and the fourth intermediate fusion feature is subjected to standardized convolution using a pre-constructed CBL convolution structure to obtain a fourth fusion feature map; the second fusion feature map, the third fusion feature map and the fourth fusion feature map are output to obtain a multi-scale fusion feature map.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the image-based tea pest detection method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the image-based tea pest detection method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Forestry pest detection method and system based on multi-scale feature enhancement and fusion
CN117671655A