A morphological perception-based unmanned aerial vehicle tea tree disease detection method
By embedding a differentiable morphological perceptron and an adversarial learning mechanism into tea tree disease detection, and combining it with a multi-model integration strategy, the problem of insufficient perception of disease morphological features in tea tree disease detection is solved, and high-precision and high-robust automated detection is achieved.
Patent Information
- Application Number
- CN202511793051.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2045-12-01
AI Technical Summary
In the detection of tea tree diseases in complex tea garden environments, existing technologies are insufficient in their perception of disease morphological characteristics, are easily affected by background interference, and are difficult to achieve high-precision and high-robust automated detection, especially for early-stage and atypical diseases.
A single-stage target detection network with embedded differentiable morphological perceptron modules is adopted. Combined with adversarial learning mechanism and multi-model ensemble strategy, the features of diseased areas are explicitly extracted through multi-scale morphological feature extraction and adversarial training. Difficult sample samples are automatically mined for supplementary training. Finally, the detection results are generated through weighted ensemble strategy.
It significantly improves the accuracy and robustness of tea tree disease detection, effectively identifying early and atypical diseases in complex environments, and achieving high-precision automated disease monitoring.
Smart Images

Figure CN121214282B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computer vision and agricultural information technology, and particularly relates to a UAV tea tree disease detection method based on morphological perception, which is suitable for automatic identification and positioning of crop diseases by using UAV remote sensing images, and can realize high-precision and high-robustness disease detection in the face of challenges such as variable disease morphology and strong background interference in complex tea garden environment. BACKGROUND
[0002] Early detection and accurate prevention of tea tree diseases are the key to guaranteeing tea yield and quality. Traditional disease detection mainly relies on manual field investigation, which is inefficient, highly subjective, and difficult to implement large-scale monitoring. In recent years, target detection technology based on UAV remote sensing and deep learning has provided a new solution for the automatic monitoring of tea garden diseases. However, the background of tea garden environment is complex (such as leaf overlap, uneven lighting, soil and shadow interference), and the disease usually shows subtle morphological characteristics (such as small lesions and specific leaf lesions) in the early stage, which poses serious challenges to general detection models in this specific application: first, the model lacks perception of key discriminative features such as disease morphology and texture, and is easily disturbed by complex background, resulting in missed detection or false detection; second, the model's learning ability is limited for atypical morphological and similar appearance to healthy leaves "difficult example" disease samples, resulting in low detection confidence.
[0003] To solve the above problems, existing technologies mainly focus on two types of solutions: one is to use more complex general detection network architecture, which increases the model depth and parameter quantity to improve feature extraction capability, but this method has high computational cost and is difficult to deploy on resource-limited edge devices, and lacks targeted enhancement of disease-specific morphological features. The second is to simply enhance data or expand the training sample size to improve model robustness, but this method does not fundamentally improve the model's perception and discrimination of disease essential morphological features, and has limited improvement effect on difficult example samples with special morphology. Therefore, there is an urgent need for a technical solution that can specifically enhance the model's perception of disease morphological features and effectively mine and learn difficult example samples to achieve efficient and accurate automatic detection of tea tree diseases in complex tea garden environment. SUMMARY
[0004] The main purpose of the present application is to overcome the shortcomings of the prior art and provide a UAV tea tree disease detection method that can accurately perceive disease morphological features and effectively learn difficult example samples. This method enhances the network's ability to extract disease morphology by embedding an adversarial morphological perceiver, improves feature discriminability by introducing an adversarial training mechanism, and combines morphological difference-based difficult example mining and multi-model integration strategy to comprehensively improve detection performance.
[0005] The application innovatively proposes a disease detection framework combining morphological perception and adversarial learning. The framework takes a single-stage target detection network as a benchmark, and embeds a differentiable morphological perception module capable of multi-scale morphological feature extraction in it. The module explicitly extracts and enhances features related to the shape and edge of the disease area through differentiable morphological operations such as erosion and dilation. At the same time, an adversarial learning mechanism is introduced during training, which forces the main detection network to learn more discriminative features through a lightweight discriminator, so that the feature distribution of the disease area and the healthy background area is better separated. In addition, after the model training is completed, the cosine similarity between the deep morphological feature vector of the training sample and the disease prototype vector is calculated to automatically identify those samples with atypical morphological features that are difficult for the model to learn for supplementary training, thereby improving the model's recognition ability for difficult examples. Finally, several models with the best performance on the validation set are integrated, and weighted inference is performed according to their performance to further integrate the advantages of each model and ensure the accuracy and robustness of the final detection result. This method significantly improves the detection accuracy of tea tree diseases, especially early and atypical diseases, in complex tea garden backgrounds.
[0006] The application is implemented as follows:
[0007] The technical solution for achieving the object of the application is:
[0008] 1. An unmanned aerial vehicle tea tree disease detection method based on morphological perception, comprising the following steps:
[0009] Step S1: Collecting tea garden RGB images through an unmanned aerial vehicle, performing size normalization processing, and labeling the boundary boxes of the disease areas in the images to divide the disease categories, and then dividing the data set into a training set, a validation set and a test set;
[0010] Step S2: Taking a single-stage target detection network as a benchmark framework, a main detection network embedded with a differentiable morphological perception module is constructed:
[0011] Step S3: Using the training set in step S1 to perform initial training on the main detection network, and through the introduction of a lightweight discriminator D, the morphological enhancement feature map output by the differentiable morphological perception module in step S2 is subjected to adversarial learning, and the optimal model of initial training is selected based on the performance of the validation set; F
[0012] Step S4: Using the optimal model in step S3, K difficult example samples with the largest difference from typical disease morphology are automatically mined from the training set according to the deep morphological features extracted by the optimal model;
[0013] Step S5: Add the difficult sample in step S4 to the training set, and supplement the training of the optimal model in step S3; then, form a model set from all the models obtained by initial training and supplementary training, select N models with the best performance on the validation set from the model set, and formulate a corresponding weighted integration strategy;
[0014] Step S6: Perform weighted reasoning on the test set constructed in step S1 by using the weighted integration strategy formulated in step S5, and generate a disease detection result.
[0015] Further, in step S2, in the main detection network, after at least one feature layer with a downsampling rate of 1 / 32 and at least two feature layers with a downsampling rate not lower than 1 / 16, a differentiable morphological perceiver module is embedded respectively; each differentiable morphological perceiver module takes the feature map output by the feature layer where it is embedded as input, and extracts multi-scale shape features by using a differentiable morphological operation.
[0016] Further, for the differentiable morphological perceiver module embedded after any feature layer, the processing flow is as follows:
[0017] Step S21: Multi-scale morphological perception: the input feature map of the differentiable morphological perceiver module is processed by using differentiable morphological operations of M different structural elements respectively, to obtain M a set of feature maps capable of highlighting shape information of different scales; wherein the M different structural elements include rectangular and cross-shaped structural elements, 5≥ M ≥2, M is a positive integer;
[0018] Step S22: Morphological feature fusion: splice the M set of feature maps capable of highlighting shape information of different scales with the input feature map of the differentiable morphological perceiver module;
[0019] Step S23: Feature selection and sharpening: the spliced feature map is reduced and fused by a 1x1 convolution layer, and then passes through a Sigmoid activation function to generate a spatial attention weight map with the same number of input channels;
[0020] Step S24: Feature enhancement and output: point multiply the spatial attention weight map with the input feature map of the differentiable morphological perceiver module, and finally output a morphological enhanced feature map F .
[0021] Further, in step S3, the specific process of the adversarial learning is as follows:
[0022] Step S31: forward propagation and feature extraction: input the tea garden RGB training images of step S1 into the main detection network, and extract the morphological enhancement feature maps output by the differentiable morphological perception module after the feature layer with a downsampling rate of 1 / 32 F ; at the same time, generate a binary mask Y according to the annotation data of the batch of tea garden RGB training images, wherein the region with Y = 1 corresponds to the disease region, and the region with Y = 0 corresponds to the healthy region;
[0023] Step S32: feature separation and pooling: use the binary mask Y to separate the morphological enhancement feature maps F into two parts: the disease feature maps located in the Y = 1 region, and the healthy background feature maps located in the Y = 0 region; then, perform global average pooling operation on the disease feature maps and the healthy background feature maps respectively to obtain the disease feature F d and the healthy background feature F h ;
[0024] Step S33: adversarial discrimination: send F d and F h into the lightweight discriminator D respectively to obtain the probability that the disease feature F d is judged as a disease D( F d ), and the probability that the healthy background feature F h is misjudged as a disease D( F h );
[0025] Step S34: loss calculation and back propagation: the loss function of the adversarial learning consists of two parts:
[0026] ① the loss L D of the discriminator D, which aims to maximize the discrimination ability of the disease and healthy features:
[0027] L D =-[log(D( F d ))+log(1-D( F h ))]
[0028] ② the total loss of the main detection network is:
[0029] L total =L det +λ×L adv
[0030] wherein, Ldet is the standard detection loss, λ is a hyper-parameter, L adv is the adversarial loss, which is defined as L adv = -log(1-D( F h )).
[0031] Further, in step S21, the differentiable morphological operation is implemented by a self-defined operator, wherein:
[0032] An approximate implementation of the differentiable erosion operation Erode(X) is:
[0033] Erode(X) = -Maxpool(-X, kernel_size=k, stride=1, padding='same')
[0034] An approximate implementation of the differentiable dilation operation Dilate(X) is:
[0035] Dilate(X) = Maxpool(X, kernel_size=k, stride=1, padding='same')
[0036] wherein X is an input feature map, kernel_size=k defines the size of the local receptive field of the differentiable morphological operation, i.e. a maximum value finding operation is performed within a local window of k x k, k is a configurable hyper-parameter and is a positive integer, MaxPool is a maximum value pooling operation, stride=1 indicates that the step length of the pooling operation is 1; padding='same' indicates that the input feature map is boundary padded to ensure that the output feature map has the same spatial size as the input feature map.
[0037] Further, in step S4, the specific process of determining the difficult example sample is:
[0038] Step S41: after the model training is completed, forward propagate all training images, and extract the feature map output by the differentiable morphological perceptual module after the feature layer with a downsampling rate of 1 / 32;
[0039] Step S42: for all training images, the feature map corresponding to the real disease area in the disease area bounding box region labeled in step S1 is subjected to global average pooling to obtain a disease area feature vector corresponding to each training image; then, the arithmetic mean of all these disease area feature vectors is calculated to construct a disease morphological prototype vector;
[0040] Step S43: Calculate the cosine similarity between the feature vector obtained by globally average pooling the feature map corresponding to the real disease area in each training sample and the disease morphological prototype vector.
[0041] Step S44: Determine the K samples with the lowest cosine similarity as morphological difficult cases, where K is a predetermined positive integer.
[0042] Further, in step S5, the specific process of the weighted integration strategy is as follows:
[0043] Step S51: Model prediction: for each sample in the test set, forward propagation is performed using the N models selected in step S5 respectively to obtain N sets of detection results, including bounding box coordinates and class confidence;
[0044] Step S52: Result weighted fusion: the N sets of detection results are weighted and averaged according to the weights assigned in step S5 to obtain the final integrated detection result;
[0045] wherein the weighted average formula of the class probability is:
[0046] P final =Σ( w i × P i ) / Σ w i
[0047] wherein w i is the weight of the i-th model, i P i is the class confidence predicted by the i-th model, i i is the serial number of the model;
[0048] The weighted average formula of the bounding box coordinates is:
[0049] B final =Σ( w i × B i ) / Σ w i wherein B i is the bounding box coordinates predicted by the i-th model; i
[0050] Step S53: non-maximum suppression: performing non-maximum suppression processing on the detection result after weighting and averaging, removing overlapping detection boxes, and obtaining the final disease detection bounding box and class label.
[0051] The beneficial effects of the present application are: in view of the challenge of complex tea garden environment, subtle disease morphology and large background interference, a detection framework integrating explicit morphological perception and adversarial learning is innovatively constructed. By embedding a differentiable morphological perceiver in the network, the model can actively enhance the shape and edge features of the disease spot, fundamentally improving the perception ability of early and subtle diseases. The introduced adversarial training mechanism effectively forces the network to learn more discriminative features, significantly suppressing the interference of complex background. Further, the present application designs a difficult example automatic mining method based on morphological prototype vector, which can intelligently identify and learn those atypical morphological difficult example samples, effectively improving the generalization ability of the model. Finally, through multi-model weighted integration strategy, the advantages of multiple optimal models are integrated, ensuring the final accuracy and stability of the detection result. This method systematically solves the key problems of feature perception, difficult example learning and precision improvement in tea tree disease detection, and provides a reliable technical solution for realizing high-precision and high-robustness automatic disease monitoring. BRIEF DESCRIPTION OF DRAWINGS
[0052] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can also be obtained without creative labor.
[0053] Figure 1 is a flowchart of a morphological perception-based unmanned aerial vehicle tea tree disease detection method provided by an embodiment of the present application;
[0054] Figure 2 is a flowchart of a differentiable morphological perception module provided by an embodiment of the present application;
[0055] Figure 3 is a schematic diagram of a tea brown spot disease recognition result provided by an embodiment of the present application;
[0056] Figure 4 is a schematic diagram of a tea brown spot disease recognition result provided by an embodiment of the present application;
[0057] Figure 5 is a schematic diagram of a tea brown spot disease recognition result provided by an embodiment of the present application;
[0058] Figure 6 is a confusion matrix diagram of a tea tree disease recognition result provided by an embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the embodiments in the present application and drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0060] A morphological perception-based unmanned aerial vehicle tea tree disease detection method will be described in detail below with reference to the drawings and specific embodiments.
[0061] As Figure 1 , 1. A morphological perception-based unmanned aerial vehicle tea tree disease detection method, comprising the following steps:
[0062] Step S1: Collecting a tea garden RGB image by an unmanned aerial vehicle, performing size normalization processing, and marking a boundary box of a disease area in the image to divide disease categories, and then dividing a data set into a training set, a validation set and a test set;
[0063] Step S2: Taking a single-stage target detection network as a benchmark framework, a main detection network embedded with a differentiable morphological perception module is constructed:
[0064] Step S3: Using the training set in step S1 to perform initial training on the main detection network, introducing a lightweight discriminator D to perform adversarial learning on the morphological enhancement feature map output by the differentiable morphological perception module in step S2, and selecting an optimal model of initial training based on the performance of the validation set; F
[0065] Step S4: Using the optimal model in step S3, K difficult example samples with the largest difference in typical disease morphology are automatically mined from the training set according to the extracted deep morphological features;
[0066] Step S5: Adding the difficult example samples in step S4 to the training set, and supplementally training the optimal model in step S3; subsequently, all models obtained by initial training and supplementally training are combined to form a model set, N models with the optimal performance on the validation set are selected from the model set, and a corresponding weighted integration strategy is formulated;
[0067] Step S6: using the weighted integration strategy formulated in step S5, performing weighted inference on the test set constructed in step S1 to generate the disease detection result.
[0068] Further, in step S2, in the main detection network, after at least one feature layer with a downsampling rate of 1 / 32 and at least two feature layers with a downsampling rate not lower than 1 / 16, a differentiable morphological perception module is embedded respectively; each differentiable morphological perception module takes the feature map output by the feature layer where it is embedded as input, and extracts multi-scale shape features using differentiable morphological operations.
[0069] Further, for the differentiable morphological perception module embedded after any feature layer, the processing flow is as follows:
[0070] Step S21: multi-scale morphological perception: using differentiable morphological operations of M different structural elements on the input feature map of the differentiable morphological perception module respectively to obtain M a set of feature maps that can highlight shape information of different scales; wherein the M different structural elements include rectangular and cross-shaped structural elements, 5≥ M ≥2, M is a positive integer;
[0071] Step S22: morphological feature fusion: splicing the M set of feature maps that can highlight shape information of different scales with the input feature map of the differentiable morphological perception module;
[0072] Step S23: feature selection and sharpening: reducing and fusing the spliced feature map through a 1x1 convolution layer, and then passing it through a Sigmoid activation function to generate a spatial attention weight map with the same number of input channels as the input channel number;
[0073] Step S24: feature enhancement and output: point-multiplying the spatial attention weight map with the input feature map of the differentiable morphological perception module to finally output a morphological enhancement feature map F .
[0074] Further, in step S3, the specific process of the adversarial learning is as follows:
[0075] Step S31: forward propagation and feature extraction: inputting a training batch of the tea garden RGB training images in step S1 into the main detection network to extract the morphological enhancement feature map FMeanwhile, a binary mask Y is generated according to the annotation data of the batch of tea garden RGB training images, wherein the area corresponding to Y = 1 is the disease area, and the area corresponding to Y = 0 is the healthy area;
[0076] Step S32: feature separation and pooling: using the binary mask Y, the morphological enhanced feature map is separated into two parts: the disease feature map located in the Y = 1 area and the healthy background feature map located in the Y = 0 area; then, global average pooling operations are respectively performed on the disease feature map and the healthy background feature map to obtain the disease feature F F d and the healthy background feature F h ;
[0077] Step S33: adversarial discrimination: the disease feature F d and the healthy background feature F h are respectively sent into the lightweight discriminator D to obtain the probability that the disease feature F d is discriminated as the disease D( F d ), and the probability that the healthy background feature F h is misjudged as the disease D( F h );
[0078] Step S34: loss calculation and back propagation: the loss function of the adversarial learning is composed of two parts:
[0079] ① the loss L D of the discriminator D, which aims to maximize the discrimination ability of the disease and the healthy feature:
[0080] L D =-[log(D( F d ))+log(1-D( F h ))]
[0081] ② the total loss of the main detection network is:
[0082] L total =L det +λ×L adv
[0083] wherein L det is the standard detection loss, λ is a hyperparameter, and L adv is the adversarial loss, which is defined as L adv =-log(1-D( F h )).
[0084] Further, in step S21, the differentiable morphological operation is implemented by a self-defined operator, wherein:
[0085] An approximate implementation of the differentiable erosion operation Erode(X) is:
[0086] Erode(X) = -Maxpool(-X, kernel_size=k, stride=1, padding='same')
[0087] An approximate implementation of the differentiable dilation operation Dilate(X) is:
[0088] Dilate(X) = Maxpool(X, kernel_size=k, stride=1, padding='same')
[0089] wherein X is an input feature map, kernel_size=k defines a local receptive field size of the differentiable morphological operation, i.e., a maximum value finding operation is performed within a local window of k x k, k is a configurable hyperparameter and is a positive integer, MaxPool is a maximum value pooling operation, stride=1 indicates that the pooling operation has a step size of 1, and padding='same' indicates that the input feature map is boundary padded to ensure that the output feature map has the same spatial size as the input feature map.
[0090] Further, in step S4, the specific process for determining the difficult example sample is:
[0091] Step S41: After the model training is completed, forward propagate all training images, and extract the feature map output by the differentiable morphological perception module after the feature layer with a downsampling rate of 1 / 32;
[0092] Step S42: Perform global average pooling on the feature map corresponding to the real disease area of the disease area bounding box region labeled in step S1 in all training images, to obtain a disease area feature vector corresponding to each training image; then, calculate the arithmetic mean of all these disease area feature vectors to construct a disease morphological prototype vector;
[0093] Step S43: Calculate the cosine similarity between the feature vector obtained by performing global average pooling on the feature map corresponding to the real disease area in each training sample and the disease morphological prototype vector;
[0094] Step S44: Determine the K samples with the lowest cosine similarity as morphological difficult examples, wherein K is a predetermined positive integer.
[0095] Furthermore, in step S5, the specific process of the weighted integration strategy is as follows:
[0096] Step S51: Model prediction: For each sample in the test set, forward propagation is performed using the N models selected in step S5 to obtain N sets of detection results, including bounding box coordinates and class confidence.
[0097] Step S52: Weighted fusion of results: The N groups of detection results are weighted and averaged according to the weights assigned in step S5 to obtain the final integrated detection result;
[0098] The weighted average formula for category probabilities is:
[0099] P final =Σ( w i × P i ) / Σ w i
[0100] in w i For the first i The weights of each model, P i For the first i The confidence score of the class predicted by each model. i The model number;
[0101] The weighted average formula for the bounding box coordinates is:
[0102] B final =Σ( w i × B i ) / Σ w i ,in B i For the first i The bounding box coordinates predicted by the model;
[0103] Step S53: Non-maximum suppression: Perform non-maximum suppression on the weighted average detection results to remove overlapping detection boxes and obtain the final disease detection bounding box and category label.
[0104] Taking the identification of tea tree diseases in a tea plantation in Southwest China as an example, the implementation process of this invention is illustrated by using a DJI Phantom 4 Multispectral drone equipped with a visible light camera to acquire high-definition RGB tea garden images at a height of 4-6 meters above the tea tree canopy.
[0105] The specific implementation process is as follows:
[0106] As shown in the figure, a morphological perception-based unmanned aerial vehicle tea tree disease detection method comprises the following steps: Figure 1
[0107] Step S1: Collecting tea garden RGB images by an unmanned aerial vehicle, performing size normalization processing, and marking the boundary box of the disease area in the image to divide the disease categories, and then dividing the data set into a training set, a verification set and a test set;
[0108] Preferably, the image resolution is fixed to 640x640 pixels, and the pixel value is normalized to the range of [0, 1], the LabelImg labeling tool is used to label the disease area in the image, the boundary box is used as the labeling format, and the corresponding disease category label is specified for each boundary box. The disease categories contained in this embodiment are: tea brown spot, tea red leaf spot, and tea white spot, a total of 625 images are labeled; wherein the training set, the verification set and the test set are randomly divided into 250, 100 and 275, respectively, for model training, hyperparameter tuning and final performance evaluation;
[0109] Step S2: Taking YOLOv8s as a single-stage target detection framework based on the main detection network of the embedded differentiable morphological perception module; in the main detection network, a total of three differentiable morphological perception modules are embedded, which are located after the following three feature layers: one feature layer with a downsampling rate of 1 / 32, and two feature layers with a downsampling rate of 1 / 16; the differentiable morphological perception module uses differentiable morphological operations to extract multi-scale shape features;
[0110] The processing flow of the differentiable morphological perception module is as shown in the figure, and specifically comprises: Figure 2
[0111] Multi-scale morphological perception: using M=4 different structure elements of differentiable morphological operations on the input feature map in parallel, including: using a 3x3 rectangular structure element open operation, using a 3x3 rectangular structure element closed operation, using a 5x5 cross-shaped structure element open operation, and using a 5x5 cross-shaped structure element closed operation;
[0112] Morphological feature fusion: splicing the above four groups of morphological feature maps and the original input feature map in the channel dimension;
[0113] Feature selection and sharpening: the spliced feature map is passed through a 1x1 convolution layer to reduce the channel number to the same as the input channel number, and then passed through a Sigmoid activation function to generate a spatial attention weight map;
[0114] Feature enhancement and output: point-multiply the spatial attention weight map with the original input feature map of the module, and output a morphologically enhanced feature map.
[0115] Step S3: The constructed main detection network is initially trained using the training set. The training period is 300 rounds, the batch size is 16, the SGD optimizer is used, the initial learning rate is 0.01, the momentum is 0.937; during the training process, a light discriminator is introduced for each differentiable morphological perceptual module, and the morphologically enhanced feature map output by the differentiable morphological perceptual module in step S2 is subjected to adversarial learning, and the optimal model of the initial training is selected based on the performance of the verification set; the light discriminator is composed of two fully connected layers (the input dimension is the feature channel number, the hidden layer dimension is 64, the output dimension is 1, and the LeakyReLU activation function is used); wherein the adversarial loss weight hyperparameter F is set to 0.2; Lambda
[0116] Step S4: using the trained model, forward propagating all training images, and extracting the feature map output by the differentiable morphological perceptual module after the feature layer with a downsampling rate of 1 / 32; according to the real labeled disease area, the corresponding area in the feature map is subjected to global average pooling, which is converted into a feature vector; the average value of the feature vectors corresponding to the real disease area in all training images is calculated, and a disease morphological prototype vector is constructed. Subsequently, the cosine similarity between the target area feature vector of each training sample and the prototype vector is calculated, and the K=30 samples with the lowest cosine similarity are determined as morphological difficult examples;
[0117] Step S5: the K=30 morphological difficult examples mined are added to the training set, and the initial training optimal model obtained in step S3 is subjected to one round of supplementary training to obtain a model after supplementary training. Subsequently, the optimal model obtained by initial training and the model obtained after supplementary training jointly constitute a model set, and the first three models with the best average precision mean (mAP@0.5:0.95) performance on the verification set are selected from the model set, and a corresponding weighted integration strategy is formulated;
[0118] Step S6: using the integration strategy formulated in step S5, the test set is subjected to weighted reasoning, the intersection over union threshold is set to 0.5, the final disease detection bounding box and class label are obtained, and are visualized on the original image, as shown in Figure 3 、 Figure 4 、 Figure 5 . The final quantitative evaluation result is shown in the confusion matrix Figure 6 ) and performance comparison table (Table 1). Among them, in order to reflect the advantages of the present application, the detection results of the present embodiment are compared with the average precision (Average Precision, AP) and mean average precision (Mean Average Precision, mAP) of the benchmark framework (YOLOv8s) used in the present embodiment under the intersection over union of 0.5, as follows:
[0119] Table 1 Performance comparison table
[0120]
[0121] As can be seen from Table 1, compared with the baseline model YOLOv8s, the method proposed in the present application has significant improvement in total accuracy and detection accuracy of each disease category, proving the effectiveness and superiority of the present application for tea tree disease detection in complex tea garden environment.
[0122] The above only describes the preferred embodiments of the present application and is not intended to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for detecting tea tree diseases using unmanned aerial vehicles (UAVs) based on morphological perception, characterized in that, Includes the following steps: Step S1: Collect RGB images of the tea garden using a drone, perform size normalization processing, and label the diseased areas in the images with bounding boxes to classify the disease categories. Then, divide the dataset into training set, validation set and test set. Step S2: Using a single-stage object detection network as the baseline framework, construct a main detection network that embeds a differentiable morphological perceptron module: Step S3: Initially train the main detection network using the training set described in Step S1. By introducing a lightweight discriminator D, train the morphological enhancement feature map output by the differentiable morphological perceptron module described in Step S2. F Perform adversarial learning and select the optimal model from the initial training based on the performance on the validation set; Step S4: Using the optimal model described in step S3, based on the deep morphological features extracted by it, automatically mine the K most difficult case samples that differ the most from the typical disease morphology from the training set. Step S5: Add the difficult example samples described in Step S4 to the training set and perform supplementary training on the optimal model described in Step S3; then, combine all the models obtained from the initial training and supplementary training into a model set, select the N models with the best performance on the validation set, and formulate a corresponding weighted ensemble strategy. Step S6: Using the weighted integration strategy established in step S5, perform weighted inference on the test set constructed in step S1 to generate disease detection results; In step S2, after the main detection network includes at least one feature layer with a downsampling rate of 1 / 32 and at least two feature layers with a downsampling rate of not less than 1 / 16, a differentiable morphological perceptron module is embedded respectively; each of the differentiable morphological perceptron modules takes the feature map output by the embedded feature layer as input and uses differentiable morphological operations to extract multi-scale shape features. In step S4, the specific process for determining the difficult sample is as follows: Step S41: After the model training is completed, forward propagate all training images and extract the feature map output by the differentiable morphological perceptron module located after the feature layer with a downsampling rate of 1 / 32. Step S42: Perform global average pooling on the feature maps of the disease area bounding box regions marked in step S1 in all training images, i.e. the feature maps corresponding to the real disease areas, to obtain the disease area feature vector corresponding to each training image. Subsequently, the arithmetic mean of the feature vectors of all these diseased areas is calculated to construct a disease morphology prototype vector; Step S43: Calculate the cosine similarity between the feature vector of the feature map corresponding to the real disease area in each training sample after global average pooling and the disease morphological prototype vector. Step S44: The K samples with the lowest cosine similarity are identified as morphologically difficult examples, where K is a preset positive integer.
2. The method for detecting tea tree diseases using unmanned aerial vehicles based on morphological perception as described in claim 1, characterized in that, The processing flow for the differentiable morphological perceptron module embedded after any feature layer is as follows: Step S21: Multi-scale morphological perception: For the input feature map of the differentiable morphological perceptron module, respectively use... M Differentiable morphological operations on different structural elements are performed to obtain... M The group can highlight feature maps of different scales; wherein, the M The different structural elements include rectangular and cross-shaped structural elements, 5≥ M ≥2, M It is a positive integer; Step S22: Morphological feature fusion: The morphological features are fused together... M The feature map that can highlight shape information at different scales is stitched together with the input feature map of the differentiable morphological perceptron module; Step S23: Feature selection and sharpening: The concatenated feature maps are reduced in dimension and fused through a 1x1 convolutional layer, and then a sigmoid activation function is used to generate a spatial attention weight map with the same number of input channels. Step S24: Feature Enhancement and Output: Perform a dot product between the spatial attention weight map and the input feature map of the differentiable morphological perceptron module to finally output the morphologically enhanced feature map. F .
3. The method for detecting tea tree diseases using unmanned aerial vehicles based on morphological perception as described in claim 1, characterized in that, In step S3, the specific process of adversarial learning is as follows: Step S31: Forward Propagation and Feature Extraction: Input the RGB training images of the tea garden described in Step S1 of a training batch into the main detection network, and extract the morphological enhancement feature map output by the differentiable morphological perceptron module located after the feature layer with a downsampling rate of 1 / 32. F Meanwhile, a binary mask Y is generated based on the labeled data of the batch of tea garden RGB training images, where the area with Y=1 corresponds to the diseased area and the area with Y=0 corresponds to the healthy area. Step S32: Feature Separation and Pooling: Using a binary mask Y, the morphologically enhanced feature map is... F It is separated into two parts: the disease feature map located in the Y=1 region, and the healthy background feature map located in the Y=0 region; Subsequently Global average pooling is performed on both the disease feature map and the healthy background feature map to obtain the disease features. F d and health background characteristics F h ; Step S33: Adversarial discrimination: F d and F h The samples are fed into a lightweight discriminator D to obtain the disease characteristics. F d The probability D of being diagnosed as a disease F d ), and health background characteristics F h The probability D of being misdiagnosed as a disease F h ); Step S34: Loss Calculation and Backpropagation: The loss function of the adversarial learning consists of two parts: ① The loss L of discriminator D D The aim is to maximize the ability to distinguish between disease and health characteristics: L D =-[log(D( F d ))+log(1-D( F h ))] ②The total loss of the main detection network is: L total =L det +λ×L adv Among them, L det Let L be the standard detection loss, λ be the hyperparameter, and L be the standard detection loss. adv To counteract losses, it is defined as L adv =-log(1-D( F h )).
4. The method for detecting tea tree diseases using unmanned aerial vehicles based on morphological perception as described in claim 3, characterized in that, In step S21, the differentiable morphological operation is implemented using a custom operator, wherein: An approximate implementation of the differentiable erosion operation Erode(X) is as follows: Erode(X)=-Maxpool(-X,kernel_size=k,stride=1,padding='same') An approximate implementation of the differentiable dilation operation Dilate(X) is as follows: Dilate(X)=Maxpool(X,kernel_size=k,stride=1,padding='same') Where X is the input feature map, kernel_size=k defines the local receptive field size of the differentiable morphological operation, that is, the maximum value search operation is performed within a k×k local window, k is a configurable hyperparameter with a positive integer value, MaxPool is the maximum pooling operation, stride=1 indicates that the stride of the pooling operation is 1; padding='same' indicates that the input feature map is padded to ensure that the output feature map has the same spatial size as the input feature map.
5. The method for detecting tea tree diseases using unmanned aerial vehicles based on morphological perception as described in claim 1, characterized in that, In step S5, the specific process of the weighted integration strategy is as follows: Step S51: Model prediction: For each sample in the test set, forward propagation is performed using the N models selected in step S5 to obtain N sets of detection results, including bounding box coordinates and class confidence. Step S52: Weighted fusion of results: The N groups of detection results are weighted and averaged according to the weights assigned in step S5 to obtain the final integrated detection result; The weighted average formula for category probabilities is: P final =Σ( w i × P i ) / S w i in w i For the first i The weights of each model, P i For the first i The confidence score of the class predicted by each model. i The model number; The weighted average formula for the bounding box coordinates is: B final =Σ( w i × B i ) / Σ w i ,in B i For the first i The bounding box coordinates predicted by the model; Step S53: Non-maximum suppression: Perform non-maximum suppression on the weighted average detection results to remove overlapping detection boxes and obtain the final disease detection bounding box and category label.
Citation Information
Patent Citations
Real-time tea disease condition detection method, system and equipment based on meta-learning and deep learning, and medium
CN116168299A
Peanut disease intelligent monitoring method and system and electronic equipment
CN120808267A