Tea insect pest recognition method based on deep learning

Through deep learning methods, the YOLOv8n network and specific loss functions and feature extraction modules are improved, and the problem of poor adaptability of tea pest recognition algorithm in high-resolution image processing and multi-scale changes is solved, achieving the accuracy of tea pest recognition.

CN119206486AInactive Publication Date: 2024-12-27YUNNAN AGRICULTURAL UNIVERSITY
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411233613.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing tea pest recognition algorithm is difficult to process high-resolution images, and there are limitations in extracting pest features and poor adaptability to multi-scale changes, resulting in low recognition accuracy.

Method used

Using a deep learning-based method, a tea pest recognition model is created through the YOLOv8n network, and using WIoUv3 loss function, SCConv unit and EMA unit, feature extraction and bounding box regression are optimized to improve the generalization ability and recognition accuracy of the model.

Benefits of technology

It significantly improves the accuracy of tea pest recognition, especially the recognition accuracy of small and multi-objectives, enhances the generalization ability of the model, avoids overfitting, and improves the overall performance of the recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119206486A_ABST
    Figure CN119206486A_ABST
Patent Text Reader

Abstract

The invention provides a tea insect pest recognition method based on deep learning in the technical field of tea insect pest recognition. The tea insect pest recognition method comprises the steps that S1, a large number of tea images are collected and preprocessed, and then a data set is constructed; s2, dividing the data set into a training set, a test set and a verification set; s3, creating a tea insect pest recognition model based on an input module, a feature extraction module, a neck module and a head module of the YOLOv8n network, and setting a loss function of the tea insect pest recognition model; the feature extraction module is provided with an SCConv unit; the neck module is provided with an EMA unit; the head module is provided with a bounding box regression layer and a classification layer; s4, training the tea insect pest recognition model through the training set, testing the tea insect pest recognition model through the test set, and verifying the tea insect pest recognition model through the verification set; and S5, performing tea insect pest recognition through the tea insect pest recognition model. The method has the advantage that the tea insect pest recognition accuracy is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of tea pest identification, and in particular to a tea pest identification method based on deep learning. Background Art

[0002] The favorable ecological environment of tea trees easily leads to the breeding of complex and diverse pests in tea leaves. Pests are directly related to the yield and quality of tea, so pests need to be prevented and controlled. In order to carry out targeted prevention and control of pests, pests need to be identified.

[0003] With the development of deep learning, Internet of Things, big data and other technologies, the field of intelligent prevention and control of agricultural pests has developed rapidly. At present, the identification of tea pests is mainly carried out by analyzing the pest features (image features) in tea images, but the existing recognition algorithms are difficult to process high-resolution images, have limitations in extracting pest features, and have poor adaptability to multi-scale changes and easy loss of important information, resulting in poor accuracy in identifying tea pests.

[0004] Therefore, how to provide a tea pest identification method based on deep learning to improve the accuracy of tea pest identification has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a tea pest identification method based on deep learning to improve the accuracy of tea pest identification.

[0006] The present invention is implemented as follows: a tea pest identification method based on deep learning, comprising the following steps:

[0007] Step S1, collecting a large number of tea leaves images containing pests of different types and numbers, and constructing a data set after preprocessing each of the tea leaves images;

[0008] Step S2, dividing the data set into a training set, a test set and a validation set;

[0009] Step S3, creating a tea pest recognition model based on the input module, feature extraction module, neck module and head module of the YOLOv8n network, and setting the loss function of the tea pest recognition model to the WIoUv3 function;

[0010] The feature extraction module is composed of SCConv units; the neck module is composed of EMA units; the head module is composed of bounding box regression layers and classification layers;

[0011] Step S4, training the tea insect pest recognition model by using the training set, testing the trained tea insect pest recognition model by using the test set, and verifying the tested tea insect pest recognition model by using the verification set;

[0012] Step S5: identifying tea pests using the verified tea pest identification model.

[0013] Furthermore, the step S1 is specifically as follows:

[0014] A large number of tea images containing different types and numbers of pests are collected, and the pest boundary box, pest type, and pest number of each tea image are annotated through Labelimg. The brightness, contrast, or random rotation sample expansion operations are performed on each annotated tea image to complete the preprocessing of each tea image, and a data set is constructed based on the preprocessed tea images.

[0015] Furthermore, the step S2 is specifically as follows:

[0016] The dataset is divided into a training set, a test set, and a validation set based on a ratio of 6:2:2.

[0017] Furthermore, in step S3, the input module is used to input tea images; the feature extraction module is used to extract pest features from the tea images; the neck module is used to fuse the extracted pest features; and the head module is used to output pest identification results.

[0018] Furthermore, in step S3, the formula of the WIoUv3 function is:

[0019] L WIoUv3 =rL WIoUv1 ;

[0020] r=β / δα β-δ ;

[0021]

[0022] L WIoUv1 =R WIoU L IoU ;

[0023]

[0024] Among them, L WIoUv3 represents the loss value of WIoUv3 function; r represents the non-monotonic focusing coefficient; L WIoUv1 represents the loss value of the WIoUv1 function; β represents the outlier coefficient; α and δ both represent hyperparameters that control the characteristics of the model; Indicates LWIoUv1 The monotonic focusing coefficient of represents the sliding average with momentum m; R WIoU ∈[1,e), represents a normal anchor box with enhanced quality; L IoU represents a high-quality anchor box whose quality has been reduced; (x, y) represents the coordinates of the upper left corner of the ordinary anchor box; (x gt ,y gt ) represents the coordinates of the upper left corner of the target box; W g Indicates the width of the pest boundary box; H g Indicates the height of the pest bounding box; represents the stable convergence factor.

[0025] Further, in step S3, the SCConv unit is composed of an SRU subunit and a CRU subunit; the SRU subunit is connected to the CRU subunit;

[0026] The SRU subunit is used to suppress the spatial redundancy of the tea leaf image; and the CRU subunit is used to suppress the channel redundancy of the tea leaf image.

[0027] Furthermore, in step S3, the EMA unit is composed of a 1×1 convolution subunit, a 3×3 convolution subunit and a cross-space learning subunit.

[0028] Furthermore, in step S3, the bounding box regression layer is used to predict the location of the pests and output a predicted pest bounding box;

[0029] The classification layer is used for prediction of pest types.

[0030] Furthermore, the step S4 is specifically as follows:

[0031] The tea pest identification model is trained by the training set, and the hyperparameters of the tea pest identification model including at least a random deactivation rate, a weight decay rate, and a learning rate are continuously optimized during the training process until the loss value of the loss function is less than a preset loss threshold;

[0032] The trained tea pest identification model is tested by the test set to determine whether the identification accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then:

[0033] The accuracy, recall rate, F1 score, average precision and mean of average precision of the tested tea pest identification model are calculated through the verification set, and the performance of the tea pest identification model is verified through the accuracy, recall rate, F1 score, average precision and mean of average precision.

[0034] Furthermore, the step S5 is specifically as follows:

[0035] The tea image to be identified is obtained, and after preprocessing the tea image to be identified by image enhancement, the tea image to be identified is input into a verified tea pest identification model, and a tea pest identification result containing at least a pest boundary box, pest type, and identification time is output.

[0036] The advantages of the present invention are:

[0037] 1. By collecting a large number of tea images containing different types and numbers of pests, each tea image is preprocessed to construct a data set, and the data set is divided into a training set, a test set and a validation set; then a tea pest recognition model is created based on the input module, feature extraction module, neck module and head module of the YOLOv8n network, and the loss function of the tea pest recognition model is set to the WIoUv3 function; the feature extraction module is composed of SCConv units; the neck module is provided with an EMA unit; the head module is provided with a bounding box regression layer and a classification layer; then the tea pest recognition model is trained with the training set, the trained tea pest recognition model is tested with the test set, the tested tea pest recognition model is verified with the validation set, and finally the tea pest recognition model is used to recognize tea pests; that is, the traditional CIoU function is replaced by the WIoUv3 function, and a non-monotonic focusing system is introduced. The number is used to more accurately describe the boundary difference between the predicted box (predicted pest bounding box) and the true box (real pest bounding box), improve the detection effect of small targets, optimize the training process and enhance the generalization ability of the tea pest recognition model; the network structure of the traditional feature extraction module is improved through the SCConv unit, the spatial information and channel information are enriched, and redundant features (spatial redundancy, channel redundancy) are suppressed to maintain high accuracy and reduce the number of parameters of the tea pest recognition model; by introducing the EMA unit in the neck module, different feature semantics are effectively learned, and multi-scale pixel-level attention of the global context is realized, so that the tea pest recognition model pays more attention to the target area (pests), and improves the recognition accuracy of the tea pest recognition model for small targets, multiple targets and interference targets, that is, the tea pest recognition model created by the improved YOLOv8n network is used for tea pest recognition, which ultimately greatly improves the accuracy of tea pest recognition.

[0038] 2. By performing sample expansion operations such as brightness adjustment, contrast adjustment or random rotation on the labeled tea images, sufficient sample size can effectively prevent overfitting of the tea pest recognition model training, thereby effectively improving the generalization ability of the tea pest recognition model.

[0039] 3. By continuously optimizing the hyperparameters including at least the random inactivation rate, weight decay rate and learning rate during the training process of the tea pest identification model, the recognition accuracy of the trained tea pest identification model is tested through the test set, and the accuracy, recall rate, F1 score, average precision and average precision mean of the tested tea pest identification model are calculated through the validation set to verify the performance of the tea pest identification model, that is, multi-dimensional optimization and verification are performed during the training process of the tea pest identification model, thereby greatly improving the accuracy of tea pest identification.

[0040] 4. After preprocessing the tea image for image enhancement, the image is input into the tea pest recognition model to identify tea pests, thereby further improving the accuracy of tea pest recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.

[0042] Figure 1 It is a flow chart of a tea pest identification method based on deep learning of the present invention.

[0043] Figure 2 It is a structural schematic diagram of the tea pest identification model of the present invention.

[0044] Figure 3 It is a schematic diagram of the structure of the SCConv unit of the present invention.

[0045] Figure 4 It is a schematic diagram of the structure of the SRU subunit of the present invention.

[0046] Figure 5 It is a schematic structural diagram of the CRU subunit of the present invention.

[0047] Figure 6 It is a structural schematic diagram of the EMA unit of the present invention. DETAILED DESCRIPTION

[0048] The technical solution in the embodiment of the present application has the following overall idea: tea pest recognition is performed by a tea pest recognition model created by an improved YOLOv8n network. The YOLOv8n network replaces the traditional CIoU function with the WIoUv3 function, and introduces a non-monotonic focusing coefficient to more accurately describe the boundary difference between the predicted box and the real box, thereby improving the detection effect of small targets, optimizing the training process and enhancing the generalization ability of the tea pest recognition model; the network structure of the traditional feature extraction module is improved by the SCConv unit, enriching spatial information and channel information, suppressing redundant features, so as to maintain a high accuracy and reduce the number of parameters of the tea pest recognition model; the EMA unit is introduced in the neck module to effectively learn different feature semantics and realize multi-scale pixel-level attention of the global context, so that the tea pest recognition model pays more attention to the target area, improves the recognition accuracy of the tea pest recognition model for small targets, multiple targets and interference targets, and thus improves the accuracy of tea pest recognition.

[0049] Please refer to Figures 1 to 6 As shown, a preferred embodiment of a tea pest identification method based on deep learning of the present invention comprises the following steps:

[0050] Step S1, collecting a large number of tea leaves images containing pests of different types and numbers, and constructing a data set after preprocessing each of the tea leaves images;

[0051] Step S2, dividing the data set into a training set, a test set and a validation set;

[0052] Step S3, creating a tea pest recognition model based on the input module (Input), feature extraction module (Backbone), neck module (Neck) and head module (Head) of the YOLOv8n (YOLOv8 Nano) network, and setting the loss function of the tea pest recognition model to the WIoUv3 function;

[0053] The feature extraction module is provided with a SCConv unit (Spatial and Channel Reconstruction Convolution for Feature Redundancy); the neck module is provided with an EMA unit (Efficient Multi-Scale Attention Module with Cross-Spatial Learning); the head module is provided with a bounding box regression layer and a classification layer;

[0054] Step S4, training the tea insect pest recognition model by using the training set, testing the trained tea insect pest recognition model by using the test set, and verifying the tested tea insect pest recognition model by using the verification set;

[0055] Step S5: identifying tea pests using the verified tea pest identification model.

[0056] The step S1 is specifically as follows:

[0057] A large number of tea images containing different types and numbers of pests are collected, and the pest boundary box, pest type, and pest number of each tea image are annotated through Labelimg. The brightness, contrast, or random rotation sample expansion operations are performed on each annotated tea image to complete the preprocessing of each tea image, and a data set is constructed based on the preprocessed tea images.

[0058] The step S2 is specifically as follows:

[0059] The dataset is divided into a training set, a test set, and a validation set based on a ratio of 6:2:2.

[0060] In step S3, the input module is used to input tea leaves images; the feature extraction module is used to extract pest features from tea leaves images; the neck module is used to fuse the extracted pest features; and the head module is used to output pest identification results.

[0061] In step S3, the formula of the WIoUv3 function is:

[0062] L WIoUv3 =rL WIoUv1 ;

[0063] r=β / δα β-δ ;

[0064]

[0065] L WIoUv1 =R WIoU L IoU ;

[0066]

[0067] Among them, L WIoUv3 represents the loss value of WIoUv3 function; r represents the non-monotonic focusing coefficient; L WIoUv1 represents the loss value of the WIoUv1 function; β represents the outlier coefficient; α and δ both represent hyperparameters that control the characteristics of the model; Indicates L WIoUv1 The monotonic focusing coefficient of represents the sliding average with momentum m; R WIoU ∈[1,e), represents a normal anchor box with enhanced quality; L IoUrepresents a high-quality anchor box whose quality has been reduced; (x, y) represents the coordinates of the upper left corner of the ordinary anchor box; (x gt ,y gt ) represents the coordinates of the upper left corner of the target box; W g Indicates the width of the pest boundary box; H g Indicates the height of the pest bounding box; Represents the stable convergence factor, that is, the factor that helps the model converge stably.

[0068] The loss function of the traditional YOLOv8n network is the CIoU (Complete IoU) function, which mainly focuses on the loU between the predicted box and the real box, and cannot fully capture the relative position and size differences between the targets. It cannot adapt to the images of pests with mutilated limbs. In the face of low-quality data sources (tea images), it cannot accurately measure the performance of target detection. Therefore, the present invention uses the WIoUv3 function instead of the CIoU function as the loss function.

[0069] The core idea of ​​the WIoUv3 function is to use the outlier coefficient β instead of IoU to evaluate the quality of the anchor box. is dynamic, making L WIoUv3 It can make a real-time gradient allocation strategy; when the β value is small, the anchor box quality is high, and the loss function will assign a smaller gradient gain to it, so that the bounding box regression focuses on the anchor box of normal quality; when the β value is large, the anchor box quality is low, and the loss function will assign a larger gradient gain to it to avoid harmful gradients caused by low-quality anchor boxes, while not losing attention to the anchor boxes of normal quality. The WIoUv3 function can pay more attention to samples of normal quality, thereby improving the overall performance of the tea pest recognition model.

[0070] In the step S3, the SCConv unit is composed of an SRU subunit (Spatial Reconstruction Unit) and a CRU subunit (Channel Reconstruction Unit); the SRU subunit is connected to the CRU subunit;

[0071] The SRU subunit is used to suppress the spatial redundancy of the tea leaf image; and the CRU subunit is used to suppress the channel redundancy of the tea leaf image.

[0072] Since the traditional YOLOv8n network will generate more redundant information during feature extraction, in order to reduce the invalid calculation of the process and reduce the computational cost of feature extraction, the feature extraction module is improved through the SCConv unit.

[0073] The core step of the SRU subunit is separation-reconstruction to suppress the spatial redundancy of the feature map (tea image).

[0074] The separation of SRU subunits uses group normalization (GN) to evaluate the information content of the feature map and obtain the feature X out :

[0075]

[0076] Among them, GN() represents the group normalization function; X represents the input feature map, that is, the tea image; γ and β' both represent trainable affine transformation coefficients; x represents the feature in the feature map; μ represents the mean of the feature map; σ represents the standard deviation of the feature map; ε is a positive constant used to stabilize division;

[0077] Initialize γ randomly and normalize it to get the channel weight set W γ :

[0078]

[0079] Among them, w i represents the i-th channel weight; γ i represents the i-th γ; γ j represents the jth γ; C represents the total number of channels;

[0080] W γ With X out Multiply them, map the product to (0, 1) through the Sigmoid function, and use the threshold gating (Gate() function) to remove the W that is greater than the threshold. γ Set as a high information expression feature, weight W1, less than the threshold W γ Set as useless feature, weight is W2:

[0081] W n = Gate(Sigmoid(W γ *X out )), (n=1,2);

[0082] The reconstruction of SRU subunits is to transform the information-rich features into Features with less information Add and merge, and strengthen the information flow between the two to generate richer information features and suppress redundant features, and obtain a feature map X with rich spatial information w :

[0083]

[0084] in, Represents element-wise multiplication; It means element-by-element addition; The first part represents the reconstruction of rich information features; The second part represents the reconstruction of rich information features; Represents the first part of the reconstruction of less informative features; represents the second part of the reconstruction of less informative features; X w1 Indicates features with large amount of information after cross reconstruction; X w2 Indicates features with less information after cross-reconstruction.

[0085] The core steps of the CRU subunit are segmentation-conversion-fusion to reduce the channel redundancy of the feature map.

[0086] The segmentation of CRU subunits is to divide the feature map X w Split into two channel dimensions, αC and (1-α)C, and further use 1×1 convolution to compress the number of feature map channels to reduce the computational cost. w Divide into a channel-rich feature extractor X by splitting and compressing up and shallow channel feature extractor X low .

[0087] Conversion of CRU subunits, X up The efficient convolution GWC (Group-wise Convolution) and PWC (Point-wise Convolution) are combined to replace the standard K×K convolution to extract representative feature information while reducing the amount of calculation, and then the output is added and merged into a rich feature map Y1; X low Use 1×1 PWC to generate a complementary feature map, concatenate the generated features and reused features along the channel, and output the shallow hidden feature map Y2:

[0088]

[0089]

[0090] Among them, M G , All represent learnable weight matrices; + represents pixel-by-pixel addition operation; ∪ represents channel concatenation operation;

[0091] The fusion of CRU sub-units uses the Pooling operation to obtain the channel descriptor S with global spatial feature information. m , then stack the descriptor S1 of the upper channel and the descriptor S2 of the lower channel, and use the channel soft attention operation to generate important feature vectors β1 and β2, and finally fuse Y1 and Y2 to obtain the feature map Y with rich channel information:

[0092]

[0093]

[0094] Y=β1Y1+β2Y2;

[0095] Among them, Pooling() represents the pooling function; H represents the height of the feature map space dimension; W represents the height of the feature map space dimension; Y m Represents the input feature map before the pooling operation; Y C Represents the input feature map in a specific channel; e represents a natural constant.

[0096] In step S3, the EMA unit is composed of a 1×1 convolution subunit, a 3×3 convolution subunit and a cross-space learning subunit.

[0097] In order to solve the problem that as the network depth increases, redundant information increases, resulting in the loss of important information and reduced recognition accuracy, an EMA unit is added to the neck module to improve the portability of the model while retaining a higher attention weight.

[0098] First, in order to learn different feature semantics, the input feature map X is divided into G sub-features along the channel direction X = [X0, X i ,...,X G-1 ]; In the 1×1 convolution subunit, the channel is encoded using the global adaptive average pooling operation along the X and Y directions, the encoded feature maps are connected, and the 1×1 convolution is shared; the output after the convolution operation is decomposed into two solution vectors, which are fitted using the activation function Sigmoid, and then the Re-weight adaptive feature variable selection is performed and the 1×1 convolution subunit is output.

[0099] The 3×3 convolution subunit uses a convolution kernel of size 3×3 to extract multi-scale features as output.

[0100] In the cross-spatial learning subunit, the output of the 1×1 convolution subunit is globally average pooled, activated by the global information encoding Softmax function, and then multiplied and dot-product aggregated with the output of the 3×3 convolution subunit to achieve cross-channel information interaction; at the same time, the output of the 3×3 convolution subunit is activated by the global information encoding Softmax function, and multiplied and aggregated with the output of the 1×1 convolution subunit after grouping and standardization to retain accurate spatial and positional features; the output results of the two matrix multiplications are activated by the Sigmoid function, and the global information is retained through the Re-weight adaptive feature variable to achieve pixel-level attention of different scales of the global context.

[0101] In step S3, the bounding box regression layer is used to predict the location of the pests and output a predicted pest bounding box;

[0102] The classification layer is used for prediction of pest types.

[0103] The step S4 is specifically as follows:

[0104] The tea pest identification model is trained by the training set, and the hyperparameters of the tea pest identification model including at least a random deactivation rate, a weight decay rate, and a learning rate are continuously optimized during the training process until the loss value of the loss function is less than a preset loss threshold;

[0105] The trained tea pest identification model is tested by the test set to determine whether the identification accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then:

[0106] The accuracy, recall rate, F1 score, average precision and mean average precision of the tested tea pest identification model are calculated through the verification set, and the performance of the tea pest identification model is verified by the accuracy (Precision), recall rate (Recall), F1 score (F1 Score), average precision (average precision) and mean average precision (mean average precision).

[0107] The step S5 is specifically as follows:

[0108] The tea image to be identified is obtained, and after preprocessing the tea image to be identified by image enhancement, the tea image to be identified is input into a verified tea pest identification model, and a tea pest identification result containing at least a pest boundary box, pest type, and identification time is output.

[0109] In summary, the advantages of the present invention are:

[0110] 1. By collecting a large number of tea images containing different types and numbers of pests, each tea image is preprocessed to construct a data set, and the data set is divided into a training set, a test set and a validation set; then a tea pest recognition model is created based on the input module, feature extraction module, neck module and head module of the YOLOv8n network, and the loss function of the tea pest recognition model is set to the WIoUv3 function; the feature extraction module is composed of SCConv units; the neck module is provided with an EMA unit; the head module is provided with a bounding box regression layer and a classification layer; then the tea pest recognition model is trained with the training set, the trained tea pest recognition model is tested with the test set, the tested tea pest recognition model is verified with the validation set, and finally the tea pest recognition model is used to recognize tea pests; that is, the traditional CIoU function is replaced by the WIoUv3 function, and a non-monotonic focusing system is introduced. The number is used to more accurately describe the boundary difference between the predicted box (predicted pest bounding box) and the true box (real pest bounding box), improve the detection effect of small targets, optimize the training process and enhance the generalization ability of the tea pest recognition model; the network structure of the traditional feature extraction module is improved through the SCConv unit, the spatial information and channel information are enriched, and redundant features (spatial redundancy, channel redundancy) are suppressed to maintain high accuracy and reduce the number of parameters of the tea pest recognition model; by introducing the EMA unit in the neck module, different feature semantics are effectively learned, and multi-scale pixel-level attention of the global context is realized, so that the tea pest recognition model pays more attention to the target area (pests), and improves the recognition accuracy of the tea pest recognition model for small targets, multiple targets and interference targets, that is, the tea pest recognition model created by the improved YOLOv8n network is used for tea pest recognition, which ultimately greatly improves the accuracy of tea pest recognition.

[0111] 2. By performing sample expansion operations such as brightness adjustment, contrast adjustment or random rotation on the labeled tea images, sufficient sample size can effectively prevent overfitting of the tea pest recognition model training, thereby effectively improving the generalization ability of the tea pest recognition model.

[0112] 3. By continuously optimizing the hyperparameters including at least the random inactivation rate, weight decay rate and learning rate during the training process of the tea pest identification model, the recognition accuracy of the trained tea pest identification model is tested through the test set, and the accuracy, recall rate, F1 score, average precision and average precision mean of the tested tea pest identification model are calculated through the validation set to verify the performance of the tea pest identification model, that is, multi-dimensional optimization and verification are performed during the training process of the tea pest identification model, thereby greatly improving the accuracy of tea pest identification.

[0113] 4. After preprocessing the tea image for image enhancement, the image is input into the tea pest recognition model to identify tea pests, thereby further improving the accuracy of tea pest recognition.

[0114] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A tea pest identification method based on deep learning, characterized in that: The steps include: Step S1, collecting a large number of tea leaves images containing pests of different types and numbers, and constructing a data set after preprocessing each of the tea leaves images; Step S2, dividing the data set into a training set, a test set and a validation set; Step S3, creating a tea pest recognition model based on the input module, feature extraction module, neck module and head module of the YOLOv8n network, and setting the loss function of the tea pest recognition model to the WIoUv3 function; The feature extraction module is composed of SCConv units; the neck module is composed of EMA units; the head module is composed of bounding box regression layers and classification layers; Step S4, training the tea insect pest recognition model by using the training set, testing the trained tea insect pest recognition model by using the test set, and verifying the tested tea insect pest recognition model by using the verification set; Step S5: identifying tea pests using the verified tea pest identification model.

2. A tea pest identification method based on deep learning as claimed in claim 1, characterized in that: The step S1 is specifically as follows: A large number of tea images containing different types and numbers of pests are collected, and the pest boundary box, pest type, and pest number of each tea image are annotated through Label img. The brightness, contrast, or random rotation sample expansion operations are performed on each annotated tea image to complete the preprocessing of each tea image, and a data set is constructed based on the preprocessed tea images.

3. The tea pest identification method based on deep learning as claimed in claim 1, characterized in that: The step S2 is specifically as follows: The dataset is divided into a training set, a test set, and a validation set based on a ratio of 6:2:

2.

4. The tea pest identification method based on deep learning according to claim 1, characterized in that: In step S3, the input module is used to input tea images; the feature extraction module is used to extract pest features from the tea images; The neck module is used to fuse the extracted pest features; the head module is used to output the pest identification result.

5. The tea pest identification method based on deep learning according to claim 1, characterized in that: In step S3, the formula of the WIoUv3 function is: L WIoUv3 =rL WIoUv1 ; r=β / δα β-δ ; L WIoUv1 =R WIoU L IoU ; Among them, L WIoUv3 represents the loss value of WIoUv3 function; r represents the non-monotonic focusing coefficient; L WIoUv1 represents the loss value of the WIoUv1 function; β represents the outlier coefficient; α and δ both represent hyperparameters that control the characteristics of the model; Indicates L WIoUv1 The monotonic focusing coefficient of represents the sliding average with momentum m; R WIoU ∈[1,e), represents a normal anchor box with enhanced quality; L IoU represents a high-quality anchor box whose quality has been reduced; (x, y) represents the coordinates of the upper left corner of the ordinary anchor box; (x gt ,y gt ) represents the coordinates of the upper left corner of the target box; W g Indicates the width of the pest boundary box; H g Indicates the height of the pest bounding box; represents the stable convergence factor.

6. The tea pest identification method based on deep learning according to claim 1, characterized in that: In step S3, the SCConv unit is composed of an SRU subunit and a CRU subunit; the SRU subunit is connected to the CRU subunit; The SRU subunit is used to suppress the spatial redundancy of the tea leaf image; and the CRU subunit is used to suppress the channel redundancy of the tea leaf image.

7. The tea pest identification method based on deep learning according to claim 1, characterized in that: In step S3, the EMA unit is composed of a 1×1 convolution subunit, a 3×3 convolution subunit and a cross-space learning subunit.

8. The tea pest identification method based on deep learning according to claim 1, characterized in that: In step S3, the bounding box regression layer is used to predict the location of the pests and output a predicted pest bounding box; The classification layer is used for prediction of pest types.

9. The tea pest identification method based on deep learning according to claim 1, characterized in that: The step S4 is specifically as follows: The tea pest identification model is trained by the training set, and the hyperparameters of the tea pest identification model including at least a random deactivation rate, a weight decay rate, and a learning rate are continuously optimized during the training process until the loss value of the loss function is less than a preset loss threshold; The trained tea pest identification model is tested by the test set to determine whether the identification accuracy is greater than a preset accuracy threshold. If not, the training set is expanded to continue training; if yes, then: The accuracy, recall rate, F1 score, average precision and mean of average precision of the tested tea pest identification model are calculated through the verification set, and the performance of the tea pest identification model is verified through the accuracy, recall rate, F1 score, average precision and mean of average precision.

10. The tea pest identification method based on deep learning according to claim 1, characterized in that: The step S5 is specifically as follows: The tea image to be identified is obtained, and after preprocessing the tea image to be identified by image enhancement, the tea image to be identified is input into a verified tea pest identification model, and a tea pest identification result containing at least a pest boundary box, pest type, and identification time is output.

Citation Information

Cited By

  • Pu'er sunning raw tea foreign matter detection method and system based on deep learning

    CN120599436A