Bursaphelenchus xylophilus disease detection and identification method

By introducing different attention mechanisms and adjusting loss functions in YOLOv5 network model, the problems of low identification accuracy and missed detection in pine nematode disease monitoring are solved, and efficient and accurate detection of pine nematode disease is achieved.

CN119048925APending Publication Date: 2024-11-29SHANDONG UNIV

Patent Information

Application Number
CN202411173302.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

The existing pine nematode disease monitoring methods have problems such as insufficient generalization ability of model, low recognition accuracy in complex areas, easy to confuse red broadleaf trees with sick pine trees, frequent missed detection and slow processing speed.

Method used

The YOLOv5 network model is adopted and different attention mechanisms are introduced, such as SE, CA, CBAM, ECA, SimAM and NAM attention mechanisms, and the model's extraction ability and recognition accuracy of pine nematode disease characteristics are improved by adjusting the network structure and loss function. And reduce errors through model fusion.

Benefits of technology

It improves the accuracy, recall and robustness of pine nematode disease detection, enhances the recognition ability of the model in different natural environments, reduces false detection and missed detection, and improves the accuracy and efficiency of the detection results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119048925A_ABST
    Figure CN119048925A_ABST
Patent Text Reader

Abstract

The invention designs a pine wood nematode disease detection and identification method. The method comprises the following steps: S1, obtaining and preprocessing a remote sensing image of a pine forest; s2, constructing a plurality of YOLOv5 network models with the same structure, and adjusting the structure and / or the loss function of each YOLOv5 network model; s3, performing data training on the plurality of adjusted YOLOv5 network models by using the preprocessed image data set; s4, collecting a remote sensing image of a to-be-detected pine forest, preprocessing the remote sensing image, and inputting the preprocessed remote sensing image into one or more trained models to obtain a detection result; and S5, fusing / aggregating the detection results of the plurality of models by adopting a model fusion / aggregation method. According to the method, the unmanned aerial vehicle remote sensing technology and the YOLOv5 algorithm are combined to identify and detect the trees infected with the pine wood nematode disease, and compared with a traditional manual detection method, the area coverage range is expanded, and the detection accuracy and recall rate are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of forestry pest monitoring, and in particular relates to a pine wood nematode disease detection and identification method. Background Art

[0002] Forest pests are the main disaster facing forests at present. Among them, pine wood nematode disease has the characteristics of wide transmission routes, rapid mortality, difficulty in prevention and control, and high cost of eradication. It is one of the most dangerous and destructive diseases in forest ecosystems.

[0003] Existing pine wood nematode disease monitoring usually uses manual identification and sampling for inspection. However, manual inspection is not only labor-intensive and time-consuming, but also manual visual judgment is greatly affected by subjective factors such as color preference, resulting in serious false detections and missed detections.

[0004] In recent years, UAV remote sensing technology has been widely used in various fields. With the rapid development of remote sensing technology and geographic information systems, the use of aerospace remote sensing images for pest and disease monitoring has become an economical and effective way to monitor pests and diseases. With the sharp increase in the amount of remote sensing detection data, the workload of manual interpretation of pine wood nematode disease has also increased rapidly. Therefore, the use of artificial intelligence methods such as deep learning can quickly and efficiently identify the disease and disaster situation, and realize large-scale, rapid, accurate and comprehensive monitoring of pine wood nematode disease-infected trees.

[0005] There are also some studies in the existing technology of using drone remote sensing and deep learning to monitor pine wilt disease, which have certain effects on optimizing the detection of pine wilt disease-infected wood. However, there are still many problems and shortcomings in the automatic recognition algorithms of pine wilt disease at home and abroad. For example, the generalization ability of the model is not strong; the recognition accuracy is not high in complex areas such as dense distribution and mutual occlusion; it is easy to confuse red broad-leaved trees with diseased and dead pine trees; there are many false detections and missed detections; the processing speed is slow, etc. Therefore, how to provide an efficient, fast, accurate and precise detection method to grasp the characteristics of diseased trees has become an urgent problem to be solved in this field. Summary of the invention

[0006] The purpose of the present invention is to solve the above technical problems and provide a method for detecting and identifying pine wood nematode disease.

[0007] To achieve the above object, the technical solution adopted by the present invention is:

[0008] A method for detecting and identifying pine wood nematode disease, characterized in that it comprises the following steps:

[0009] S1: Obtain remote sensing images of pine forests, crop them into image blocks of a predetermined size, and manually annotate diseased trees in the images to obtain a preprocessed image dataset;

[0010] S2: construct multiple YOLOv5 network models with the same structure, adjust the structure and / or loss function of each YOLOv5 network model, and obtain multiple adjusted YOLOv5 network models;

[0011] Among them, the method for adjusting the structure of the YOLOv5 network model is to introduce the attention mechanism into the YOLOv5 network model in a predetermined addition manner;

[0012] The intended adding method is to embed the attention mechanism module into the previous layer of the fast spatial pyramid pooling structure in the backbone network of the YOLOv5 network model, or to replace the cross-stage partial connection module in the backbone network of the YOLOv5 network model with the attention mechanism module;

[0013] S3: Use the preprocessed image datasets to perform data training on multiple adjusted YOLOv5 network models to obtain multiple pine wood nematode disease detection models with different structures and / or loss functions;

[0014] S4: collecting remote sensing images of the pine forest to be detected, preprocessing the images, and inputting the preprocessed images into one or more pine wood nematode disease detection models to obtain detection results of one or more models;

[0015] S5: When the detection results of multiple models are obtained, the detection results of the multiple models are fused / aggregated using a model fusion / aggregation method.

[0016] In some embodiments of the present invention, the attention mechanism includes SE attention mechanism, CA attention mechanism, CBAM attention mechanism, ECA attention mechanism, SimAM attention mechanism and NAM attention mechanism;

[0017] The network models obtained after embedding the attention mechanism module into the backbone network of the YOLOv5 network model and the previous layer of the fast spatial pyramid pooling structure include YOLOv5s-SE, YOLOv5s-CA, YOLOv5s-CBAM, YOLOv5s-ECA, YOLOv5s-SimAM and YOLOv5s-NAM;

[0018] The network models obtained after replacing the cross-stage partial connection modules in the backbone network of the YOLOv5 network model with the attention mechanism module include YOLOv5s-C3SE, YOLOv5s-C3CA, YOLOv5s-C3CBAM, YOLOv5s-C3ECA, YOLOv5s-C3SimAM and YOLOv5s-C3NAM.

[0019] In some embodiments of the present invention, in step S2, the method for adjusting the loss function of the YOLOv5 network model is to replace the original loss function of the YOLOv5 network model with a different loss function;

[0020] Different loss functions include SIoU, WIoU V1, WIoU V2, and WIoU V3;

[0021] The YOLOv5 network models obtained after replacing the loss function are YOLOv5s-SIoU, YOLOv5s-WIoU V1, YOLOv5s-WIoU V2 and YOLOv5s-WIoU V3.

[0022] In some embodiments of the present invention, the preprocessing specifically includes the following steps:

[0023] Image cropping, using the sliding window method to cut the remote sensing image into image blocks of a predetermined size, with 20% overlap between adjacent image blocks;

[0024] Image annotation: Each diseased tree in the image is individually annotated, and each annotation box contains only one diseased tree;

[0025] Data enhancement: Data enhancement is performed on images with diseased tree annotation boxes. The data enhancement methods include image scaling, translation, rotation, and adjusting one or more of image brightness, contrast, saturation, and hue.

[0026] In some embodiments of the present invention, the SE attention mechanism module in the YOLOv5s-SE model and the YOLOv5s-C3SE model improves the feature extraction capability of the model by adaptively adjusting the weights of feature channels;

[0027] The method for SE attention mechanism module to adjust feature channel weights includes the following steps:

[0028] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0029] Among them, H is the height, W is the width, C is the number of channels, and R is the real number domain, which means that each element of the feature map is a real value ;

[0030] The spatial dimension of the input feature map X is compressed by global average pooling to obtain the global description vector Z c :

[0031]

[0032] Determine the weight of each channel based on the global description vector and generate a weight vector s. In the weight vector s, the weight of the pine tree lesion related feature channel is increased, and the pine tree lesion related feature channel at least includes a color feature channel, a morphological feature channel and a texture feature channel;

[0033] Apply the weight vector s to each channel of the input feature map X, and weight it by multiplying each channel to obtain the weighted pine wood nematode disease feature map X i ' ,j,c :

[0034] X′ i,j,c =S c ·X i,j,c .

[0035] In some embodiments of the present invention, the CA attention mechanism module in the YOLOv5s-CA model and the YOLOv5s-C3CA model improves the feature extraction capability of the model by performing global feature weighting in the horizontal and vertical directions;

[0036] The method of performing global feature weighting in the CA attention mechanism module includes the following steps:

[0037] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0038] Among them, H is the height, W is the width, and C is the number of channels;

[0039] The input feature map X is encoded in the horizontal and vertical directions respectively through global average pooling to obtain global information in the horizontal and vertical directions;

[0040] In the global information, the horizontal encoding is used to identify the characteristic changes of pine trees along the horizontal axis, and its expression is:

[0041]

[0042] The vertical encoding is used to capture the characteristic changes of pine trees along the vertical axis, and its expression is:

[0043]

[0044] The attention weights s in both directions are calculated based on the global information in the horizontal and vertical directions. h and w ,

[0045] The weight s h and w Applied to the horizontal and vertical directions of the input feature map respectively, weighting is achieved by multiplication;

[0046] Among them, the expression of the weighted result in the horizontal direction is:

[0047] X′ h (i,j,c)=s h (i,c)·X(i,j,c);

[0048] The expression of the weighted result in the vertical direction is:

[0049] X′ w (i,j,c)=s w (j,c)·X(i,j,c);

[0050] The weighted results in the two directions are fused to obtain the pine wood nematode disease feature map X′ after global feature weighting i,j,c :

[0051] X′ i,j,c =X′ h (i,j,c)·X′ w (i,j,c).

[0052] In some embodiments of the present invention, the CBAM attention mechanism module in the YOLOv5s-CBAM model and the YOLOv5s-C3CBAM model includes a feature channel attention module CAM and a feature space attention module SEM, which improves the feature extraction capability of the model by obtaining the importance of each feature channel and each feature space and adjusting the weight of each feature based on the importance of each feature;

[0053] The method for adjusting the weight of each feature by the CBAM attention mechanism module includes the following steps:

[0054] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0055] Among them, H is the height, W is the width, and C is the number of channels;

[0056] The input feature map is input into the feature channel attention module CAM and the feature space attention module SEM respectively;

[0057] The feature channel attention module CAM performs global average pooling and global maximum pooling operations on the input feature map to obtain the average and maximum values ​​of each feature channel:

[0058]

[0059] Among them, x avg is the average value of each feature channel, GAP(X) is the global average pooling operation on the input feature map, and X is the input feature map;

[0060]

[0061] Among them, x max is the maximum value of each feature channel, GMP(X) is the global maximum pooling operation on the input feature map ;

[0062] The results of global average pooling and global maximum pooling are feature fused to obtain the channel attention weight M c (X):

[0063] M c (X) = σ(MLP(x) avg )+MLP(x max ));

[0064] The channel attention weight M c (X) is applied to each channel of the input feature map, and the channel dimension of the input feature map is weighted by multiplication to obtain the feature map X′ weighted in the channel dimension:

[0065] X′=M c (X)·X;

[0066] The feature space attention module SEM first performs average pooling and maximum pooling operations on the input feature map channel by channel:

[0067]

[0068] Among them, x′ avg It is the result of the average pooling operation on each channel;

[0069]

[0070] Among them, x′ max It is the result of the maximum pooling operation on each channel;

[0071] Concatenate the results of average pooling and maximum pooling along the channel dimension to obtain the fused feature map X s :

[0072] X s ∈R H×W×2 ;

[0073] For the fused feature map X s Perform convolution operation to obtain the spatial attention weight map M s (X′):

[0074] M s (X′)=σ(Conv(X s ));

[0075] Among them, σ is the activation function;

[0076] The spatial attention weight map M s (X′) is applied to each spatial position of the input feature map, and the spatial dimension of the input feature map is weighted by multiplication to obtain the feature map X" after weighting in the spatial dimension:

[0077] X"=M s (X′)·X′.

[0078] In some embodiments of the present invention, the SimAM attention mechanism module in the YOLOv5s-SimAM model and the YOLOv5s-C3SimAM model is used to calculate the attention weight by calculating the similarity between the input feature and itself, and to improve the feature extraction capability of the model by weighting the importance of each pixel in the input feature map;

[0079] The method for adjusting weights in the SimAM attention mechanism module includes the following steps:

[0080] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0081] Among them, H is the height, W is the width, and C is the number of channels;

[0082] Calculate the mean μ of each feature channel c and variance

[0083]

[0084] Among them, X is the input feature map;

[0085] Reconstruct the features at each position based on the mean and variance and calculate the reconstruction error e(i,j,c):

[0086] e(i,j,c)=(X(i,j,c)-μ c ) 2 ;

[0087] Calculate the similarity weight a(i,j,c) of each pixel based on the reconstruction error:

[0088]

[0089] The similarity weight is applied to each pixel of the input feature map, and adaptive weighting is achieved by multiplication to obtain the pine wood nematode disease feature map X′(i, j, c) after weighting based on the importance of each pixel:

[0090] X′(i,j,c)=a(i,j,c)·X(i,j,c).

[0091] In some embodiments of the present invention, the NAM attention mechanism module in the YOLOv5s-NAM model and the YOLOv5s-C3NAM model is used to balance the feature scale by normalization and adjust the weight of the feature based on the scale to enhance the sensitivity of the model to the detection of the color change feature of pine leaves;

[0092] The method for adjusting weights in the NAM attention mechanism module specifically includes the following steps:

[0093] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0094] Among them, H is the height, W is the width, and C is the number of channels;

[0095] Normalize the channels and spaces of the input feature map respectively:

[0096] Calculate the mean μ for each channel c and standard deviation σ c :

[0097]

[0098] Among them, X is the input feature map;

[0099] Based on the mean μ c and standard deviation σ c Normalize each channel to obtain the channel-normalized feature map X c :

[0100]

[0101] For the normalized feature map X c Calculate the mean μ in the spatial dimension s and standard deviation σ s :

[0102]

[0103] Based on the mean μ s and standard deviation σ s Normalize the features at each position to obtain the position-characterized feature map X s :

[0104]

[0105] Based on the standard deviation σ s Calculate the attention weight A and apply it to the input feature map. Adaptive weighting is achieved by multiplication to obtain the pine wood nematode disease feature map X′(i, j, c) after weighting based on the feature scale:

[0106] X′(i,j,c)=A(i,j,c)·X(i,j,c).

[0107] In some embodiments of the present invention, the ECA attention mechanism module in the YOLOv5s-ECA model and the YOLOv5s-C3ECA model is used to capture the local interaction relationship between channels and adaptively weight the input feature map based on the local interaction relationship between channels to improve the feature extraction capability of the model;

[0108] The method for adjusting the weights of the ECA attention mechanism module specifically includes the following steps:

[0109] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0110] Among them, H is the height, W is the width, and C is the number of channels;

[0111] Perform global average pooling on each channel of the input feature map to extract the global feature z of each channel c , and obtain the global description vector z∈R C , global feature z c The expression is:

[0112]

[0113] Based on the global feature z c And the global description vector z, the channel attention weight s is obtained through a one-dimensional convolution operation;

[0114] The channel attention weight s is applied to each channel of the input feature map, and adaptive weighting is achieved by multiplying the weight of each channel with the corresponding channel of the input feature map to obtain the pine wood nematode disease feature map X after weighted processing based on the local interaction relationship between channels. i ' ,j,c :

[0115] X′ i,j,c =s c ·X(i,j,c).

[0116] The beneficial effects of the present invention are:

[0117] 1. This invention combines UAV remote sensing technology and YOLOv5 algorithm to identify and detect trees infected with pine wood nematode disease. Compared with traditional manual detection methods, it can not only expand the regional coverage, but also effectively improve the detection accuracy and recall rate;

[0118] 2. The present invention introduces different attention mechanisms at different positions of the YOLOv5 network model through two adding methods to form different network structures. The different attention mechanisms in each model enhance the model's ability to extract the features of trees infected with pine wood nematode disease in different ways, thereby improving the model's recognition accuracy and generalization ability for diseased trees in different natural environments.

[0119] 3. The present invention matches different models based on different detection scenarios, selects multiple models according to the characteristics of different models for specific application scenarios and specific recognition requirements, applies the selected multiple models to perform single recognition or combined recognition on the scenario, obtains multiple groups of recognition results, and uses the model fusion / aggregation method to integrate the detection results of multiple models, thereby realizing the advantages of integrating multiple models, reducing the errors that may exist in a single model, and improving the robustness of detection and the accuracy of detection results;

[0120] 4. The present invention replaces the original loss function of the YOLOv5 network model with SIoU and different versions of WIoU loss functions, and uses the new model obtained after replacing the loss function to identify diseased pine trees, which can better handle the regression problem of the bounding box, improve the accuracy and robustness of the bounding box prediction, and thus improve the accuracy of the prediction results of the model under different lighting and background environments. BRIEF DESCRIPTION OF THE DRAWINGS

[0121] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the specific embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0122] Figure 1 This is a flow chart of a method for detecting and identifying pine wood nematode disease;

[0123] Figure 2 Comparison of cutting and tiling results to preserve overlapping areas;

[0124] Among them, (a) is the effect of tile cutting, and (b) is the effect of cutting with 20% overlapping area reserved;

[0125] Figure 3 This is a schematic diagram of the image preprocessing results;

[0126] Figure 4 It is a schematic diagram of the structure of the YOLOv5 backbone network;

[0127] Among them, (a) is the original backbone network structure diagram, (b) and (c) are backbone network structures with attention mechanisms added in two predetermined ways;

[0128] Figure 5It is a schematic diagram of the overall structure of the YOLOv5 network model;

[0129] Among them, (a) and (b) are schematic diagrams of two ways of adding attention mechanisms in the backbone network;

[0130] Figure 6 This is a diagram showing the model recognition effect after adding the attention mechanism in an embedded manner;

[0131] Figure 7 This is a diagram showing the model recognition effect after adding the attention mechanism in a replacement manner;

[0132] Figure 8 This is a diagram showing the recognition effects of adding different attention mechanisms to the same mechanism;

[0133] Among them, sub-figures (a), (b) and (c) are comparison diagrams of the model recognition effects after the CA attention mechanism, ECA attention mechanism and SimAM attention mechanism are added in different ways. DETAILED DESCRIPTION

[0134] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments provided in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.

[0135] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0136] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.

[0137] The technical solution of the present invention is described in detail below in conjunction with specific embodiments and the accompanying drawings.

[0138] As attached Figure 1 - Attachment Figure 8 As shown, in an illustrative embodiment of a method for detecting and identifying pine wood nematode disease of the present invention, the method includes the following steps.

[0139] S1: Data collection and preprocessing: Use a drone equipped with a high-resolution camera to fly and shoot in the designated area to obtain the original remote sensing images of the pine forest. Perform orthorectification on the collected original remote sensing images to eliminate image distortion and ensure that the image quality meets the requirements of subsequent processing. Crop the high-resolution orthorectified remote sensing images into 1024×1024 pixel image blocks, and manually annotate the diseased trees in the images to obtain the preprocessed image dataset.

[0140] In this embodiment, the designated area for data collection in the dataset is the pine forest of Beihai Forest Farm and Linhai Park in Weihai City, Shandong Province, China. More than 70% of the vegetation in the area is covered by pine trees, and the rest is a small amount of broad-leaved trees. The image acquisition time is in the monitoring window period. Most of the pine trees infected with pine wilt disease have shown typical reddish-brown symptoms, and the relatively small number of broad-leaved trees have not changed color. Therefore, there is no need to consider the impact of discolored broad-leaved trees on aerial monitoring.

[0141] In this embodiment, step S1 also includes the following steps: after obtaining the preprocessed image data set, divide it into a training set and a test set without spatial intersection, wherein the training set is used to train the YOLOv5 network model, and the test set is used to verify the effectiveness of the adjusted model in improving the accuracy and recall of diseased pine trees.

[0142] In some embodiments of the present invention, the preprocessing in step S1 specifically includes the following steps.

[0143] S11: Image cropping: The remote sensing image is cut into image blocks of 1024×1024 pixels using the sliding window method to meet the input requirements of the deep learning model; a 20% overlap area is retained between adjacent image blocks to ensure the integrity of the image information.

[0144] It should be noted that, since tile cutting may cut the diseased tree into incomplete parts, the integrity of the image information of the diseased tree sample in the data set can be ensured by leaving a 20% overlap area during cutting. Figure 2 As shown, (a) is the effect of tile cutting, and (b) is the effect of cutting with 20% overlapping area retained.

[0145] S21: Image annotation: Manual field sampling, verification and determination of the geographic coordinates of the infected pine tree samples, and manual annotation of the pine wilt disease-infected trees based on the location information. During the annotation process, each diseased tree in the image is individually annotated, and each annotation box contains only one diseased tree to ensure the accuracy of the training data. Among them, each annotated diseased tree is manually surveyed, sampled and sent for inspection to further ensure the accuracy and authenticity of the diseased tree annotation.

[0146] S31: Data enhancement: Use the data loader and data enhancement module in YOLOv5 to perform data enhancement on the image with diseased tree annotation boxes. The data enhancement methods include image scaling, image translation, image rotation, and adjusting image brightness, image contrast, image saturation, image hue, etc.

[0147] Image preprocessing can expand the data set to a certain extent, thereby improving the robustness and generalization ability of the trained model. Figure 3 shown.

[0148] S2: Model construction and adjustment: Construct multiple original YOLOv5 network models with the same structure. The structure of the backbone network of the original YOLOv5 network model is as shown in the attached figure. Figure 4 As shown in sub-figure (a), the structure and / or loss function of each original YOLOv5 network model is adjusted to enhance the model's recognition effect on trees infected with pine wood nematode disease, and multiple adjusted YOLOv5 network models are obtained.

[0149] Among them, the method for adjusting the structure of the YOLOv5 network model is to introduce six attention mechanisms into the YOLOv5 network model in two predetermined adding methods respectively, and obtain twelve YOLOv5 network models with different structures.

[0150] There are two scheduled adding methods, namely, embedding the attention mechanism module into the previous layer of the fast spatial pyramid pooling-fast (SPPF) structure in the backbone network Backbone of the YOLOv5 network model, and replacing the cross-stage partial connection (C3) module in the backbone network Backbone of the YOLOv5 network model with the attention mechanism module.

[0151] Different adding methods will have different effects on the performance and feature extraction ability of the model. Among them, embedding the attention mechanism into the previous layer of the fast spatial pyramid pooling (SPPF) structure in the backbone network Backbone can perform targeted weighting and enhancement on the feature map before entering the global feature pooling, which helps to highlight the key areas in the spatial dimension of the feature map, thereby improving the ability to extract local features. At the same time, since the SPPF structure is mainly used to capture global context information, strengthening the key features before global pooling can enhance the model's understanding of the global context, thereby enhancing the model's ability to identify key areas in complex scenes.

[0152] Pine wilt disease may cause significant color changes in the entire crown or large areas of leaves, such as yellowing or withering. By adding an attention mechanism before SPPF, the model can pay special attention to the color changes of pine trees during the global feature extraction process, and thus better highlight the color characteristics of the diseased area in the global context. At the same time, in the natural environment, other background factors such as vegetation and terrain will also interfere with the detection of pine wilt disease. The added attention mechanism enhances the features of the diseased area before SPPF, so that the model can better suppress background noise during global feature extraction and highlight the significant features of the diseased area, so that the model can more accurately distinguish the diseased area in a complex background, reduce false detections and missed detections, and improve detection accuracy.

[0153] Replacing all C3 modules in the backbone network will enable the attention mechanism to be widely applied throughout the backbone network, enhancing each layer of feature maps in the backbone network, covering all features from shallow to deep layers, so that each layer of feature maps in the network model can benefit from the enhancement of the attention mechanism, focusing on comprehensively improving the feature representation capabilities. In particular, for the features of the middle layer, the attention mechanism can better capture the detailed features, thereby improving the model's detection effect on the target.

[0154] In the early stages of pine wilt disease, the lesion areas are usually small and scattered, and may only manifest as changes in the color or texture of some leaves. Therefore, replacing all C3 modules with attention mechanism modules can enable the model to capture the characteristics of small early lesion areas in detail at all levels. The enhancement of fine-grained features by the attention mechanism also enables the model to more accurately detect small early lesion areas and improve early warning capabilities. At the same time, in addition to leaf color changes, the lesion characteristics of trees infected with pine wilt disease also include more detailed features such as leaf cracking, withering, and spots. These features are also one of the important bases for judging lesions. The replaced model has improved its ability to capture detailed features and can more accurately identify the detailed lesion characteristics of trees infected with pine wilt disease.

[0155] The structures of the backbone network of the YOLOv5 network model after adding the attention mechanism in two predetermined ways are shown in the attached figure. Figure 4 As shown in sub-figure (b) and sub-figure (c).

[0156] In some embodiments of the present invention, the attention mechanism includes SE attention mechanism, CA attention mechanism, CBAM attention mechanism, ECA attention mechanism, SimAM attention mechanism and NAM attention mechanism.

[0157] After embedding the attention mechanism module into the previous layer of the fast spatial pyramid pooling structure in the backbone network of the YOLOv5 network model, the network models obtained are YOLOv5s-SE, YOLOv5s-CA, YOL Ov5s-CBAM, YOLOv5s-ECA, YOLOv5s-SimAM and YOLOv5s-NAM respectively.

[0158] After replacing the cross-stage partial connection modules in the backbone network of the YOLOv5 network model with the attention mechanism module, the network models obtained are YOLOv5s-C3SE, YOLOv5s-C3CA, YOLOv5s-C3CBAM, YOLOv5s-C3ECA, YOLOv5s-C3SimAM and YOLOv5s-C3NAM respectively.

[0159] It should be noted that the above twelve models with added attention mechanisms improve detection results by enhancing feature extraction capabilities. Different network structures are formed by introducing different attention mechanisms at different positions. Their performance in the pine wood nematode disease detection task is different, the improvement in detection results is also different, and the applicable scenarios are also different.

[0160] In practical applications, different models can be matched according to different detection scenarios. For example, after adding the SE attention mechanism, the model will be more sensitive to the color changes of diseased tree leaves; after adding the CA attention mechanism, the model will pay more attention to the coordinate information of the diseased tree; after adding the ECA attention mechanism, the model will be more accurate in identifying small targets, which can be applied when only a small area of ​​tree leaves turns yellow-brown in the early stage of the disease.

[0161] In some embodiments of the present invention, in step S2, the method for adjusting the loss function of the YOLOv5 network model is to replace the original loss function (Complete Intersection over Union, CIoU) of the YOLOv5 network model with a different loss function.

[0162] Among them, different loss functions include SIoU and three versions of WIoU, and the three versions of WIoU are WIoUV1, WIoU V2 and WIoU V3 respectively.

[0163] The YOLOv5 network models obtained after replacing the loss function are YOLOv5s-SIoU, YOLOv5s-WIoU V1, YOLOv5s-WIoU V2 and YOLOv5s-WIoU V3. Different loss functions make the model's evaluation indicators for measuring target detection performance different.

[0164] YOLOv5's original loss function CIoU is an IoU-based loss function. Although CIoU not only considers the overlapping area between the predicted bounding box and the ground truth bounding box, but also considers the center point distance and aspect ratio, which can make the bounding box regression more accurate and perform well in most cases, there is still room for improvement. For example, the multi-factor weights in CIoU may lead to imbalance problems, which in turn causes the model to over-focus on one metric in some cases and ignore other metrics. CIoU's insensitivity to target scale may also limit its effectiveness in detecting small objects.

[0165] In this embodiment, the original loss function of YOLOv5 is replaced with SCYLLA Intersection over Union (SIoU) and Wise_IoU (WIoU) loss functions, which further optimizes the evaluation index of the model and makes the model more accurate in detecting diseased trees.

[0166] Among them, SIoU optimizes the overlap measurement of bounding boxes and introduces shape difference penalties to make the model more accurate in predicting the boundary of the target. It is suitable for scenes where the boundary of the diseased area is fuzzy. The SIoU loss function can consider the center point distance between the target box and the prediction box more carefully, making the model more accurate in locating the diseased area. Especially when the distance between the diseased areas is close, SIoU can better distinguish the target and reduce false detection and missed detection. At the same time, because pine wood nematode disease is spread by pine beetles, the diseased trees are often neighbors, and the SIoU loss function can help the model accurately distinguish and identify multiple adjacent diseased tree areas.

[0167] The SIoU loss function also introduces a shape difference penalty, so that SIoU can better match the shape features of the lesion area and thus accurately detect the location of the lesion area.

[0168] Since the size and shape of the lesion area may vary greatly depending on the stage of onset (early or late), the SIoU loss function can effectively measure the geometric difference between the target box and the prediction box at all scales, so that the model can maintain high accuracy when dealing with large and small lesions, and the model can maintain high accuracy and robustness for both early and late diseased trees.

[0169] SIoU also improves the geometric consistency of the model, making it more robust and generalizable in different environments and conditions. In pine wilt disease detection, this means that the model can maintain high performance under different lighting, weather, and viewing angle conditions.

[0170] WIoU is a dynamic non-monotonic focusing mechanism that uses "outlier degree" to evaluate the quality of anchor boxes and provides a wise gradient gain allocation strategy, which allows the model to pay more attention to most lesion areas rather than individual special areas, reduce harmful gradients, and improve detection performance. While reducing the competitiveness of high-quality anchor boxes, this strategy also reduces the harmful gradients generated by low-quality examples, allowing WIoU to focus on anchor boxes of ordinary quality and improve the overall performance of the detector. There are three versions of WIoU, among which WIoU V1 constructs an attention-based bounding box loss and introduces the concept of "outlierness", making the model's assessment of target quality more accurate and suitable for detecting some more obvious abnormal areas in pine wood nematode lesions; WIoU V2 and WIoU V3 introduce different focusing mechanisms by constructing a gradient gain (focusing coefficient) calculation method on WIoU V1. Specifically, WIoU V2 is further optimized on the basis of WIoU V1, and the "outlierness" mechanism is improved, making the model more robust when dealing with different types of lesion areas, and suitable for scenes where multiple lesion features exist at the same time; WIoU V3 is a further optimized and adjusted version of WIoU, which focuses on performance improvement in specific scenarios, so that the model has higher detection accuracy under specific conditions (such as lighting changes or complex backgrounds).

[0171] The WIoU loss function can also better handle the geometric differences between the target box and the prediction box by introducing outliers as evaluation criteria, making the target positioning more accurate when the target boxes are close or overlap more. Since the nematode disease lesions are not far apart, and because the pine trees have different ages and crown heights, there will be some overlap in the drone orthophotos. Relying on WIoU can help the model accurately distinguish overlapping diseased crowns.

[0172] The WIoU loss function also comprehensively considers IoU and outliers, so that the model can better distinguish the lesion area and the background when dealing with overlapping targets, reducing the false detection and missed detection of the model in detection tasks under complex backgrounds such as forests.

[0173] At the same time, WIoU will also make the dynamic focusing mechanism of the model more perfect. It dynamically adjusts the loss weight according to the outliers, pays more attention to the color and shape changes of the lesion area, and improves the positioning accuracy.

[0174] In practical applications, it is necessary to determine the advantages and applicability of different models through performance evaluation and combined with real-world scenarios. For example, the YOLOv5s-SIoU model is suitable for scenarios with fuzzy lesion area boundaries; the YOLOv5s-WIoU V1 model is suitable for detecting areas with obvious abnormalities; the YOLOv5s-WIoU V2 model is suitable for scenarios with coexistence of multiple lesion features, and the YOLOv5s-WIoU V3 model is suitable for situations with changing lighting or complex backgrounds.

[0175] The above 16 models improve the network structure and loss function of YOLOv5 in different ways, making their performance in the pine wood nematode disease detection task different.

[0176] S3: Model training and testing: Use the data from the training set to train multiple adjusted YOLOv5 network models, and obtain multiple YOLOv5-based pine wood nematode disease detection models with different structures and / or loss functions.

[0177] In this embodiment, the 12th Gen Intel(R) Core(TM) i5-12500 is used as the CPU, and NVIDIAGeForce GTX 1660Ti and NVIDIA GeForce RTX 3080Ti are used as GPUs for model training. During the training process, model parameters such as the learning rate, batch size, and patience value of the model are adjusted, and the model parameters are optimized using the cross-validation method to obtain the best detection performance.

[0178] The YOLOv5 network model at least includes the backbone network (Backbone), the neck network (Neck), the head network (Head) and the output layer. The overall structure of the YOLOv5 network model is shown in the attached figure. Figure 5 As shown in the figure, sub-figures (a) and (b) respectively represent two ways of adding attention mechanism in the backbone network, and AM is the attention mechanism.

[0179] The process of model data training specifically includes the following steps.

[0180] S31: After the image data is input into the YOLOv5 network model, the backbone network of YOLOv5 is used to extract the image features of the diseased tree. The main features of the diseased pine tree include the crown and leaves changing from healthy green to yellow or brown, the branches withering and twisting, and the bark cracking with fine lines and cracks.

[0181] As attached Figure 5As shown in the figure, the backbone network of YOLOv5 consists of multiple convolutional layers, multiple cross-stage partial connection (C3) modules and a fast spatial pyramid pooling structure (SPPF) module.

[0182] Among them, the convolution layer performs a convolution operation on the input image to extract local low-level features of the input diseased tree image, such as crown edges, textures, and leaf color changes.

[0183] The C3 module is used to divide the extracted feature map into two parts, one of which is used to extract the features of diseased trees through convolution and residual connection, and the other part is directly passed and then spliced ​​to finally form a richer feature map to process the features of diseased trees in a larger range and improve the recognition speed of the model.

[0184] The fast spatial pyramid pooling structure module (SPPF) fuses feature maps through pooling operations at different scales, increasing the receptive field of feature maps, so that the model can understand the pathological characteristics of pine trees more comprehensively.

[0185] It should be noted that the C3 module focuses more on capturing and extracting global information. However, except for the situation where pests and diseases have spread and caused large areas of pine trees to become sick, the use of the model for diseased tree detection and identification is more often to accurately find one or several diseased trees. This requires the detection model to have sufficient local information extraction capabilities. The C3 module is insufficient in this regard. Replacing the C3 module with an attention mechanism module can make up for this gap.

[0186] During the feature extraction process, the YOLOv5 network model with an attention mechanism module added before the SPPF structure uses the attention mechanism module to enhance the focus on important features before multi-scale fusion, reduce unimportant feature information, improve the effectiveness of feature representation, and improve the detection effect of small targets, thereby improving the model's detection effect on early diseased trees and targets with a small range of leaf color changes.

[0187] The YOLOv5 network model in which all C3 modules are replaced with attention mechanism modules enhances the representation ability of global features in the entire Backbone through the attention mechanism modules, so as to improve the detection effect of small targets in the early stage of the disease, as well as the detection effect of large targets and targets in complex backgrounds.

[0188] S32: Use the neck network (Neck) to further fuse and extract feature information. The modules used in the neck network (Neck) are the FPN module and the PAN module. The FPN module enhances feature maps of different scales through a top-down path to improve the target detection effect. The PAN module further fuses feature maps through a bottom-up path to improve detection accuracy.

[0189] S33: Use the head network (Head) to output a prediction result, which at least includes a bounding box of each diseased tree target.

[0190] S34: Use the output layer of YOLOv5 to convert the feature map into the final detection result and output it.

[0191] S4: Collect remote sensing images of the pine forest to be detected and preprocess them.

[0192] Different models are matched according to different detection scenarios, and the most suitable model or model combination is selected for detection. The preprocessed image is input into one or more matched pine wood nematode disease detection models for diseased tree identification to obtain the detection results of one or more models.

[0193] S5: When the detection results of multiple models are obtained, after obtaining the detection results of multiple models, the advantages and disadvantages of the multiple results are evaluated, the practicality of different models for the specific application scenario is judged, and multiple models with better results are selected, and the detection results of multiple models are fused / aggregated by the model fusion / aggregation method, and the image is detected in two ways: separate recognition and combined recognition, and the recognition results are summarized to combine the advantages of different models, reduce the errors that may exist in the detection using a single model, and improve the accuracy and robustness of the detection. Among them, different model fusion / aggregation methods can be selected according to different actual application scenarios, such as voting method, weighted average method, etc.

[0194] In some embodiments of the present invention, the SE attention mechanism module in the YOLOv5s-SE model and the YOLOv5s-C3SE model extracts fine features by adaptively adjusting the weights of feature channels for different lesion areas when the backbone network performs feature extraction, thereby improving the feature extraction capability of the model.

[0195] When a pine tree becomes sick, the color of its leaves will change from healthy green to diseased brown or yellow. The SE attention mechanism module can effectively capture the details of leaf color change by focusing on global information. The specific operation is as follows: First, use global average pooling to generate an average to represent each channel feature of the input feature map, and then extract the global information of the feature map, including the overall color distribution of the leaves; then use the Excitation module in the SE attention mechanism to calculate the weight of each channel, emphasizing those feature channels that can reflect the color change of the leaves; finally, multiply the learned weights by the original feature map channel by channel to adjust the response strength of each channel. Through the re-weighted feature map, the model can more sensitively detect changes in leaf color and thus capture the details of the lesion.

[0196] Diseased pine trees may also experience changes such as branch withering and twisting. The SE attention mechanism module can enhance the ability to detect morphological changes by weighting the morphological feature channels. Especially in complex backgrounds, the SE attention mechanism can suppress irrelevant background information and highlight the morphological characteristics of diseased branches. After the pine tree is diseased, its bark will crack and produce fine lines and cracks. The SE module strengthens the texture feature channel and can better extract this feature, making the model more sensitive to these detailed changes and facilitating the detection of early lesions.

[0197] At the same time, adding the SE attention mechanism module to the model can effectively suppress background interference: by reducing the weight of irrelevant channels, reducing the interference of background noise, and improving the contrast of the lesion area, the model can focus on the lesion area more accurately.

[0198] In this embodiment, the method for adjusting the feature channel weights by the SE attention mechanism module includes the following steps.

[0199] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0200] Among them, H is the height, W is the width, C is the number of channels, and R is the real number domain, which means that each element of the feature map is a real value 。

[0201] The spatial dimension of the input feature map X is compressed by global average pooling to obtain the global description vector Z c :

[0202]

[0203] At this time, the SE attention mechanism can extract the full image information of the feature, including the overall color distribution of the crown; the general degree of withering and distortion of the trunk and branches, etc.

[0204] The weight of each channel is determined based on the global description vector, and a weight vector s is generated. In the weight vector s, the weight of the feature channel related to pine tree lesions is increased, and the weight of other irrelevant background information is reduced; the feature channel related to pine tree lesions includes at least a color feature channel corresponding to detecting leaf color changes, a morphological feature channel corresponding to detecting branch withering and distortion, and a texture feature channel corresponding to detecting bark cracks.

[0205] Apply the weight vector s to each channel of the input feature map, and achieve weighting by multiplying each channel to obtain the weighted pine wood nematode disease feature map X i ' ,j,c :

[0206] X′ i,j,c =S c ·X i,h,c .

[0207] Since pine wilt disease identification is usually carried out in natural environments with complex and diverse backgrounds, the SE attention mechanism can effectively improve the recognition performance of the model in complex backgrounds by aggregating global information and adaptively adjusting channel weights, enabling the model to adaptively adjust the weights of feature channels according to different environments, thereby improving the recognition adaptability of pine tree lesions in different environments. Whether it is shadows, light spots or different background colors, the SE attention mechanism module can dynamically adjust the weights to ensure stable detection of pine tree lesion features.

[0208] In some embodiments of the present invention, the CA attention mechanism module in the YOLOv5s-CA model and the YOLOv5s-C3CA model performs global feature weighting in the horizontal and vertical directions, suppresses irrelevant background information, shifts the model's attention to diseased pine trees, enhances the representation capability of diseased pine tree features, and thereby improves the model's feature extraction capability and the model's robustness in complex backgrounds.

[0209] Among them, the CA attention mechanism, namely the coordinate attention mechanism, has the ability to extract long-distance relationships and can encode horizontal and vertical position information, so that the mobile network can pay attention to a wide range of position information without incurring too much computational effort.

[0210] In this embodiment, the method for performing global feature weighting by the CA attention mechanism module includes the following steps:

[0211] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0212] Among them, H is the height, W is the width, and C is the number of channels.

[0213] The input feature map is encoded in the horizontal and vertical directions respectively through global average pooling to obtain the global information in the horizontal and vertical directions.

[0214] In the global information, the horizontal encoding is used to identify the characteristic changes of pine trees along the horizontal axis, such as the morphological changes of trunks and branches, and its expression is:

[0215]

[0216] The vertical encoding is used to capture the characteristic changes of pine trees along the vertical axis, such as leaf color changes, and its expression is:

[0217]

[0218] The attention weights s in both directions are calculated based on the global information in the horizontal and vertical directions. h and w,The two weights can weight the lesion features in different directions, thereby suppressing background information.

[0219] The weight s h and w Applied to the horizontal and vertical directions of the input feature map respectively, weighting is achieved by multiplication.

[0220] Among them, the expression of the weighted result in the horizontal direction is:

[0221] X′ h (i,j,c)=s h (i,c)·X(i,j,c).

[0222] The expression of the weighted result in the vertical direction is:

[0223] X′ w (i,j,c)=s w (j,c)·X(i,j,c).

[0224] The weighted results in the two directions are fused to obtain the pine wood nematode disease feature map X′ after global feature weighting i,j,c :

[0225] X′ i,j,c =X′ h (i,j,c)·X′ w (i,j,c).

[0226] In some embodiments of the present invention, the CBAM attention mechanism module in the YOLOv5s-CBAM model and the YOLOv5s-C3CBAM model automatically obtains the importance of each feature channel and each feature space through learning, and adjusts the weight of each feature based on the importance of each feature, thereby improving the feature extraction capability of the model.

[0227] The CBAM attention mechanism module, namely the Convolutional Block Attention Module (CBAM), is an attention mechanism that combines the two dimensions of the feature channel attention module CAM and the feature space attention module SEM. The CBAM attention mechanism can extract the pathological features in detail by adding attention mechanisms in the two dimensions of channel and space. Specifically, in this embodiment, through channel attention, the CBAM attention mechanism can enhance the capture of leaf color changes, and the feature of the leaves changing from green to yellow-brown is one of the most significant features of the pine tree in the drone orthophoto after it is sick. The CBAM attention mechanism module can help the model to more sensitively identify this color difference, thereby improving the recognition accuracy and reducing missed judgments. At the same time, when the pine tree is diseased, it will also be accompanied by morphological changes such as cracking of the trunk and withering and twisting of the branches. The CBAM attention mechanism can strengthen the model's attention to the morphological changes on the branches through spatial attention, so that the model can accurately identify the pathological features under complex backgrounds and improve the detection accuracy.

[0228] In this embodiment, the method for adjusting the weight of each feature by the CBAM attention mechanism module includes the following steps:

[0229] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0230] Among them, H is the height, W is the width, and C is the number of channels.

[0231] The input feature map is input into the feature channel attention module CAM and the feature space attention module SEM respectively.

[0232] The feature channel attention module CAM performs global average pooling and global maximum pooling operations on the input feature map to obtain the average and maximum values ​​of each feature channel:

[0233]

[0234] Among them, x avg is the average value of each feature channel, GAP(X) is the global average pooling, and X is the input feature map.

[0235]

[0236] Among them, x max is the maximum value of each feature channel, and GMP(X) is the global maximum pooling.

[0237] The results of global average pooling and global maximum pooling are feature fused to obtain the channel attention weight M c (X):

[0238] M c (X) = σ(MLP(x) avg )+MLP(x max )).

[0239] The channel attention weight M c (X) is applied to each channel of the input feature map, and the channel dimension of the input feature map is weighted by multiplication to obtain the feature map X′ weighted in the channel dimension:

[0240] X′=M c (X)·X.

[0241] The channel attention module is used to weight the channel dimension of the feature map and highlight the feature channels related to diseased pine trees, such as leaf color changes, branch withering, etc., so as to more accurately identify the diseased area.

[0242] The feature space attention module SEM first performs average pooling and maximum pooling operations on the input feature map channel by channel:

[0243]

[0244] Among them, x′ avg It is the result of the average pooling operation per channel.

[0245]

[0246] Among them, x′ max It is the result of the maximum pooling operation per channel.

[0247] Concatenate the results of average pooling and maximum pooling along the channel dimension to obtain the fused feature map X S :

[0248] X S ∈R H×W×2 .

[0249] For the fused feature map X S Perform convolution operation to obtain the spatial attention weight map M S (X′):

[0250] M s (X′)=σ(Conv(X s ));

[0251] Among them, σ is the activation function.

[0252] The spatial attention weight map M s(X′) is applied to each spatial position of the input feature map, and the spatial dimension of the input feature map is weighted by multiplication to obtain the feature map X" after weighting in the spatial dimension:

[0253] X"=M s (X′)·X′.

[0254] The spatial attention module is used to weight the spatial dimension of the feature map, which can highlight the spatial position of the diseased pine trees and suppress irrelevant information in the background, such as other plants and terrain changes, thereby reducing misjudgments and missed judgments and improving detection accuracy.

[0255] In some embodiments of the present invention, the SimAM attention mechanism module in the YOLOv5s-SimAM model and the YOLOv5s-C3SimAM model is used to calculate the attention weight by calculating the similarity between the input feature and itself, and to improve the feature extraction capability of the model by weighting the importance of each pixel in the input feature map.

[0256] It should be noted that the SimAM attention mechanism (Similarity Attention Mechanism) is a simple and efficient multi-head attention mechanism, which enhances the expressiveness of feature maps by simulating the attention mechanism in neuroscience. At the same time, it enhances the model's attention to key features by weighting the importance of each pixel in the feature map.

[0257] In complex natural backgrounds, for example, in the presence of other vegetation, multiple terrains, and different lighting conditions, the lesion features of pine wilt disease may be submerged. The SimAM attention mechanism module calculates the importance of each pixel, weights the feature map, and highlights the features of the pine tree lesion area, thereby more accurately identifying the lesion area in the complex background. In the case of complex backgrounds or unclear pine tree features, the SimAM attention mechanism module can also fine-tune the input feature map to strengthen the local features of the lesion area, so that the model can better distinguish between lesions and healthy areas.

[0258] In this embodiment, the method for adjusting the weight of the SimAM attention mechanism module includes the following steps:

[0259] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0260] Among them, H is the height, W is the width, and C is the number of channels.

[0261] Calculate the mean μ of each feature channel c and variance

[0262]

[0263] Among them, X is the input feature map.

[0264] Reconstruct the features at each position based on the mean and variance and calculate the reconstruction error e(i,j,c):

[0265] e(i,j,c)=(F(i,j,c)-μ c ) 2 .

[0266] Calculate the similarity weight a(i,j,c) of each pixel based on the reconstruction error:

[0267]

[0268] The similarity weight is applied to each pixel of the input feature map, and adaptive weighting is achieved by multiplication to obtain the pine wood nematode disease feature map X′(i, j, c) after weighting based on the importance of each pixel:

[0269] X′(i,j,c)=a(i,j,c)·X(i,j,c).

[0270] Through the above weighted process, the SimAM attention mechanism module is able to enhance features related to pine wilt disease, such as the change in leaf color from green to yellow-brown, branch wilting, etc., while suppressing irrelevant features.

[0271] In some embodiments of the present invention, the NAM attention mechanism module in the YOLOv5s-NAM model and the YOLOv5s-C3NAM model enhances the model's detection sensitivity to leaf color change features by normalizing and balancing the feature scale and adjusting the feature weights based on the scale, enabling the model to better detect subtle changes from healthy green to diseased yellow or brown, thereby improving the model's recognition results.

[0272] NAM attention mechanism (Normalization-based Attention) is a normalized attention mechanism that uses the contribution factor of weights to improve the attention mechanism, uses standard deviation to represent the importance of weights, reduces the weights of less significant features, and avoids adding fully connected layers and convolutional layers used in SE, BAM, and CBAM, making the model calculation more efficient.

[0273] In this embodiment, the method for adjusting the weight of the NAM attention mechanism module specifically includes the following steps:

[0274] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0275] Among them, H is the height, W is the width, and C is the number of channels.

[0276] Normalize the channels and spaces of the input feature map respectively.

[0277] Calculate the mean μ for each channel c and standard deviation σ c :

[0278]

[0279] Among them, X is the input feature map.

[0280] Based on the mean μ c and standard deviation σ c Normalize each channel to obtain the channel-normalized feature map X c :

[0281]

[0282] For the normalized feature map X c Calculate the mean μ in the spatial dimension s and standard deviation σ s :

[0283]

[0284] Based on the mean μ s and standard deviation σ s Normalize the features at each position to obtain the position-characterized feature map X s :

[0285]

[0286] Based on the standard deviation σ s Calculate the attention weight A and apply it to the input feature map. Adaptive weighting is achieved by multiplication to obtain the pine wood nematode disease feature map X′(i, j, c) after weighting based on the feature scale:

[0287] X′(i,j,c)=A(i,j,c)·X(i,j,c).

[0288] The weighted feature map X′(i,j,c) is input into the subsequent detection network for detection and identification of pine wood nematode disease.

[0289] In some embodiments of the present invention, the ECA attention mechanism module in the YOLOv5s-ECA model and the YOLOv5s-C3ECA model captures the local interaction relationship between channels, adaptively weights the input feature map based on the local interaction relationship between channels, enhances the model's attention to pine tree features, and thereby improves the model's feature extraction capability.

[0290] The ECA attention mechanism, namely the improved channel attention (Efficient Channel Attention, ECA), is an ultra-lightweight attention module. This module avoids dimensionality reduction and effectively captures the information of cross-channel interactions using one-dimensional convolution, realizing local cross-channel interactions without dimensionality reduction.

[0291] In this embodiment, the texture of the pine tree diseased area is usually different from that of the healthy part. The ECA attention mechanism captures the dependencies between channels through one-dimensional convolution, which improves the model's ability to detect subtle texture changes, thereby improving recognition accuracy. At the same time, when the pine tree diseased area is small (such as in the early stage of the disease), the traditional convolutional neural network has limited effect on small target detection and cannot be applied. The ECA attention mechanism module can enhance the extraction of fine-grained features through fine channel weighting and capture the dependencies between channels, helping the model to better understand and utilize the subtle features of the diseased area, thereby making the model perform better when detecting small diseased areas.

[0292] In this embodiment, the method for adjusting the weight of the ECA attention mechanism module specifically includes the following steps:

[0293] Set the input feature map of the diseased tree to X∈R H×W×C ;

[0294] Among them, H is the height, W is the width, and C is the number of channels.

[0295] Perform global average pooling on each channel of the input feature map to extract the global feature z of each channel c , and obtain the global description vector z∈R V , global feature z c The expression is:

[0296]

[0297] Based on the global feature z c and the global description vector z, and obtain the channel attention weight s through a one-dimensional convolution operation.

[0298] The channel attention weight s is applied to each channel of the input feature map, and adaptive weighting is achieved by multiplying the weight of each channel with the corresponding channel of the input feature map to obtain the pine wood nematode disease feature map X after weighted processing based on the local interaction relationship between channels. i ' ,j,c :

[0299] X′ i,j,c =s c ·X(i,j,c).

[0300] In some embodiments of the present invention, step S3 further includes the following steps:

[0301] S35: Performance evaluation, using the validation set data, and using accuracy (Precision), recall rate (Recall), F1 score, mean average precision (mAP50) and other indicators as standards to evaluate the detection performance of each trained pine wood nematode disease detection model. At the same time, by comparing with other deep learning algorithms (such as Faster-RCNN, YOLOv8, etc.), the superiority of the trained model in pine wood nematode disease detection is verified.

[0302] Among them, the accuracy rate refers to the ratio of the number of positive prediction samples to the total number of samples, and its calculation formula is as follows:

[0303]

[0304] Among them, TP is the number of positive samples predicted by positive samples, that is, a diseased tree is correctly detected; FP is the number of positive samples predicted by negative samples, that is, a healthy pine tree is mistakenly identified as a diseased tree.

[0305] The recall rate refers to the ratio of the number of positive samples predicted to the total number of samples, and its calculation formula is as follows:

[0306]

[0307] Among them, FN is the number of negative samples predicted by positive samples, that is, the number of diseased trees that were mistakenly identified as healthy trees.

[0308] The F1 score refers to the harmonic mean of precision and recall, and is an indicator for measuring the accuracy of a binary classification model. Its calculation formula is as follows:

[0309]

[0310] Mean average precision (mAP50) refers to the average of the average precision (AP) of each category. The average precision refers to the area under the precision and recall curve (PR curve), that is, the average of all accuracy rates under different recall rates. In this embodiment, the mean average precision under an IoU threshold of 0.5, i.e., mAP50, is used. Its calculation formula is as follows:

[0311]

[0312] Among them, K is the IoU threshold, and IoU is the degree of overlap between the predicted box and the real box.

[0313] The beneficial effects of the pine wood nematode disease identification method provided in this embodiment are described below in conjunction with experimental data of a specific embodiment.

[0314] In order to eliminate the influence of experimental contingency on the recognition results and ensure the reproducibility of the model, in this embodiment, each model was subjected to multiple repeated experiments and the average values ​​of the accuracy P, recall R, F1 score and mean average precision mAP50 of each group of experiments were calculated. The experimental results of each model after optimization are shown in Table 1, where AP, AR, AF1 and AmAP50 represent the average values ​​of the corresponding measurement indicators accuracy P, recall R, F1 score and mean average precision mAP50. Table 1 only contains one representative experimental result and the average experimental results of multiple repeated experiments.

[0315] Table 1: Experimental results of each model after optimization

[0316]

[0317] It can be seen from Table 1 that after adding the attention mechanism, the detection effect of each new model on trees infected with pine wood nematode disease has been improved.

[0318] Among the two attention mechanism adding methods, adding SE, CBAM and NAM attention mechanisms in an embedded manner significantly improved the model's ability to detect diseased trees. Among them, the YOLOv5s-SE model focuses more on improving accuracy, while embedding and adding CBAM and NAM is more effective in improving recall. The YOLOv5s-CBAM model has the most significant improvement in diseased tree detection, with its average accuracy and recall rates both significantly improved, reaching 85.0% and 81.5% respectively. Embedding the CA attention mechanism into the network structure improves the detection accuracy, with an average of 86.7%, and the detection recall rate is also improved. The improvement tendency of embedding the SimAM attention mechanism on the model is similar to that of the CA attention mechanism, and the improvement of the detection accuracy is also more obvious. Compared with the initial pre-trained model, the YOLOv5s-ECA model has a slight improvement in each evaluation index.

[0319] The improvement of the model detection effect by adding the attention mechanism to the network structure by replacing the C3 module is also obvious. Among them, the SE and SimAM attention mechanisms improve the recall rate by reducing missed judgments, while replacing with CA, CBAM, ECA and NAM attention mechanisms reduces misjudgments to improve accuracy. Taking into account the accuracy and recall rate, adding SE, CA, CBAM and NAM attention mechanisms by replacement will make the model perform better in the detection of trees infected with pine wood nematode disease, with an average accuracy and recall rate of 85.6% and 81.1% respectively. Among them, the YOLOv5s-C3CBAM model significantly improved the detection accuracy and recall rate.

[0320] Some of the recognition results of the optimized model are shown in the attached figure. Figure 6 and attached Figure 7 shown.

[0321] After the six attention mechanisms were added to the original YOLOv5 network structure by two different methods, the detection performance of the original YOLOv5 network model was improved. The same attention mechanism showed different improvements in the recognition of pine trees infected with pine wilt disease using different addition methods. For example, embedding the CA attention mechanism into the YOLOv5 network improved the detection accuracy, with an average accuracy of 86.7% and a best accuracy of 89.1%. The replacement of the CA attention mechanism significantly improved the recall rate. The improvement tendency of the NAM attention mechanism is opposite to that of the CA attention mechanism. The embedding method focuses on improving the recall rate and reducing missed judgments, and its detection recall rate can reach 85.7%. The YOLOv5s-C3NAM model focuses on accuracy and reducing false positives, with an accuracy of 97.2%. For the ECA and SimAM attention mechanisms, replacing all C3 modules in Backbone is more suitable for improving the detection effect, and the improvement effect is more obvious than embedding. For the CBAM attention mechanism, both additions significantly promoted the improvement of P and R. Among them, the improvement effect of embedding addition is better, making the YOLOv5s-CBAM model the best model, with a detection accuracy of 90.1%, a recall rate of 88.3%, an F1 score of 86.3%, and an mAP50 of 88.0%. At the same time, the model also shows excellent stability. Its average accuracy can reach 85.0%, the average recall rate can reach 81.5%, the average F1 score is 83.1%, and the average mAP50 is 84.9%. The recognition results of the same attention with different addition methods are compared as shown in the attached figure. Figure 8 shown.

[0322] At the same time, this embodiment discovered the phenomenon of "pseudo-false positives" during the experimental process, that is, a certain tree was actually a diseased tree, but it was missed during manual screening and was not marked in the data set, so it was treated as a false positive during training. While the YOLOv5s-C3CA model correctly identified the diseased trees monitored manually, it also marked a number of diseased trees that had the same characteristics as the pine wilt disease-infected trees but were missed by manual screening, that is, "pseudo-false positives". This kind of "pseudo-false positives" recognition will effectively avoid missing diseased pine trees in practical applications, thereby curbing the spread of pine wilt disease. As shown in the attached figure Figure 8 As shown in Figure (b)-4, by replacing and adding the ECA attention mechanism, not only the confidence of the labeled diseased tree is improved, but also a "pseudo-misjudged" diseased tree with a color similar to the ground is identified. Figure 8 In the neutron image (c)-3, the YOLOv5s-SimAM model correctly identified the diseased tree that was manually re-inspected, and also identified an additional "pseudo-misjudged" diseased tree, which will effectively reduce missed detections in actual epidemic prevention.

[0323] To verify the optimization effect of the model, in this embodiment, a new data set that has no intersection with the training and validation sets is used to test all the optimized models. The data processing method is consistent with the data processing method of the training set, and contains images of diseased pine trees. Each model is tested twice; the confidence level of the first test is 0.1, and the second test uses the confidence level with the highest F1 score in the previous test. The test results are shown in Table 2.

[0324] Table 2: Test results of test set data

[0325]

[0326] As shown in Table 2, adding attention mechanisms will improve the recognition ability of the model. The models with SE, CBAM and NAM attention mechanisms perform better than other optimized models in the test experiment, which is consistent with our previous results and analysis. The recall rate of the YOLOv5s-SE model in the test set is 87.6% and the mAP50 is 90.5%. The recognition accuracy of the YOLOv5s-CBAM model is 90.1%, and the accuracy of the YOLOv5s-NAM model is 87.0%. Adding SE, CBAM and NAM by replacement also enhances the experimental results. The mAP50 of the YOLOv5s-C3SE, YOLOv5s-C3CBAM and YOLOv5s-C3NAM models reaches 85.9%, 87.4% and 88.0% respectively.

[0327] In order to verify the robustness of the model under different background conditions, this example merged the background images without infected pine trees into the original data set at a ratio of 10%, with a total of 15 background images. Each model was tested multiple times, and a set of experimental results are shown in Table 3.

[0328] Table 3: Experimental results after merging background images

[0329]

[0330] In order to eliminate the randomness of the experiment, in this embodiment, the average value of the evaluation index of each group of experiments is also calculated, and the average result is shown in Table 4.

[0331] Table 4: Average value calculation results

[0332]

[0333] The loss function is a key parameter for the adaptability of model experiments. Compared with the IoU loss, the original loss function CIoU of the YOLOv5 network has been optimized, but there are still shortcomings such as increased complexity and unbalanced weights of various indicators. This embodiment replaces the CIoU function with SIoU and WIoU loss functions, respectively, where the WIoU loss has three versions. This embodiment conducted experiments using the new loss function. Each group was repeated multiple times. In order to eliminate the impact of experimental randomness on model evaluation, this embodiment calculated the average value of each group of repeated experimental results, where one group of experimental results and the average experimental results are shown in Table 5.

[0334] Table 5: Experimental results of models with alternative loss functions

[0335]

[0336] The SIoU and WIoU loss functions improve the model recognition accuracy, with the average accuracy of SIoU, WIoU V1, and WIoU V3 being 87.3%, 88.3%, and 88.1%, respectively. It can therefore be argued that the SIoU and WIoU losses provide more significant enhancements in detecting diseased trees compared to CIoU.

[0337] The present invention combines UAV remote sensing technology and YOLOv5 algorithm to identify and detect trees infected with pine wilt disease. Compared with traditional manual detection methods, this method can not only expand the regional coverage, but also greatly improve the accuracy and recall rate of detection. In the present invention, by adding an attention mechanism in two ways, the model can better focus on the appearance characteristics of diseased trees, effectively improving the recognition ability of the model. And by changing the loss function, the model can better handle the regression problem of the bounding box, making the predicted box closer to the real box, while also enhancing the robustness and adaptability of the model.

[0338] Finally, it should be noted that: the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0339] 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, ordinary technicians in the field should understand that the specific implementation methods of the present invention can still be modified or some technical features can be replaced by equivalents without departing from the spirit of the technical solution of the present invention, which should be included in the scope of the technical solution for protection of the present invention.

Claims

1. A method for detecting and identifying pine wood nematode disease, characterized in that: The following steps are involved: S1: Obtain remote sensing images of pine forests, crop them into image blocks of a predetermined size, and manually annotate diseased trees in the images to obtain a preprocessed image dataset; S2: construct multiple YOLOv5 network models with the same structure, adjust the structure and / or loss function of each YOLOv5 network model, and obtain multiple adjusted YOLOv5 network models; The method for adjusting the structure of the YOLOv5 network model is to introduce the attention mechanism into the YOLOv5 network model in a predetermined addition manner; The predetermined adding method is to embed the attention mechanism module into the previous layer of the fast spatial pyramid pooling structure in the backbone network of the YOLOv5 network model, or to replace the cross-stage partial connection module in the backbone network of the YOLOv5 network model with the attention mechanism module; S3: using the preprocessed image data sets to perform data training on multiple adjusted YOLOv5 network models respectively, to obtain multiple pine wood nematode disease detection models with different structures and / or loss functions; S4: collecting remote sensing images of the pine forest to be detected, preprocessing the images, and inputting the preprocessed images into one or more pine wood nematode disease detection models to obtain detection results of one or more models; S5: When the detection results of multiple models are obtained, the detection results of the multiple models are fused / aggregated using a model fusion / aggregation method.

2. The method for detecting pine wood nematode disease according to claim 1, characterized in that: The attention mechanisms include SE attention mechanism, CA attention mechanism, CBAM attention mechanism, ECA attention mechanism, SimAM attention mechanism and NAM attention mechanism; The network models obtained after embedding the attention mechanism module into the backbone network of the YOLOv5 network model and the previous layer of the fast spatial pyramid pooling structure include YOLOv5s-SE, YOLOv5s-CA, YOLOv5s-CBAM, YOLOv5s-ECA, YOLOv5s-SimAM and YOLOv5s-NAM; The network models obtained after replacing the cross-stage partial connection modules in the backbone network of the YOLOv5 network model with the attention mechanism module include YOLOv5s-C3SE, YOLOv5s-C3CA, YOLOv5s-C3CBAM, YOLOv5s-C3ECA, YOLOv5s-C3SimAM and YOLOv5s-C3NAM.

3. The method for detecting pine wood nematode disease according to claim 1 or 2, characterized in that: In step S2, the method for adjusting the loss function of the YOLOv5 network model is to replace the original loss function of the YOLOv5 network model with a different loss function; The different loss functions include SIoU, WIoU V1, WIoU V2 and WIoU V3; The YOLOv5 network models obtained after replacing the loss function are YOLOv5s-SIoU, YOLOv5s-WIoU V1, YOLOv5s-WIoU V2 and YOLOv5s-WIoU V3.

4. The method for detecting pine wood nematode disease according to claim 1, characterized in that: The pretreatment specifically comprises the following steps: Image cropping, using the sliding window method to cut the remote sensing image into image blocks of a predetermined size, with 20% overlap between adjacent image blocks; Image annotation: Each diseased tree in the image is individually annotated, and each annotation box contains only one diseased tree; Data enhancement: performing data enhancement on the image with the diseased tree annotation box, wherein the method of performing data enhancement includes image scaling, translation, rotation, and adjusting one or more of image brightness, contrast, saturation, and hue.

5. The method for detecting pine wood nematode disease according to claim 2, characterized in that: The SE attention mechanism module in the YOLOv5s-SE model and the YOLOv5s-C3SE model improves the feature extraction capability of the model by adaptively adjusting the weights of feature channels; The method for adjusting the feature channel weights by the SE attention mechanism module comprises the following steps: Set the input feature map of the diseased tree to X∈R H×W×C ; Among them, H is the height, W is the width, C is the number of channels, and R is the real number field; The spatial dimension of the input feature map is compressed by global average pooling to obtain a global description vector Z c : Determine the weight of each channel based on the global description vector, and generate a weight vector s, in which the weight of the pine tree lesion-related feature channel is increased; the pine tree lesion-related feature channel includes at least a color feature channel, a morphological feature channel, and a texture feature channel; The weight vector s is applied to each channel of the input feature map, and weighting is achieved by multiplying each channel to obtain a weighted pine wood nematode disease feature map X′ i,j,c : X′ i,j,c =S c ·X i,h,c 。 6. The method for detecting pine wood nematode disease according to claim 2, characterized in that: The CA attention mechanism module in the YOLOv5s-CA model and the YOLOv5s-C3CA model improves the feature extraction capability of the model by performing global feature weighting in the horizontal and vertical directions; The method for performing global feature weighting by the CA attention mechanism module comprises the following steps: Set the input feature map of the diseased tree to X∈R H×W×C ; Among them, H is the height, W is the width, and C is the number of channels; The input feature map is encoded in the horizontal and vertical directions respectively by global average pooling to obtain global information in the horizontal and vertical directions; In the global information, the horizontal encoding is used to identify the characteristic changes of pine trees along the horizontal axis, and its expression is: The vertical encoding is used to capture the characteristic changes of pine trees along the vertical axis, and its expression is: Based on the global information in the horizontal and vertical directions, the attention weights s in the two directions are calculated. h and w , The weight s h and w Applied to the horizontal and vertical directions of the input feature map respectively, weighting is achieved by multiplication; Among them, the expression of the weighted result in the horizontal direction is: X′ h (i,j,c)=s h (i,c)·X(i,j,c); The expression of the weighted result in the vertical direction is: X′ w (i,j,c)=s w (j,c)·X(i,j,c); The weighted results in the two directions are fused to obtain the pine wood nematode disease feature map X′ after global feature weighting i,j,c : X′ i,j,c =X′ h (i,j,c)·X′ w (i,j,c)。 7. The method for detecting pine wood nematode disease according to claim 2, characterized in that: The CBAM attention mechanism module in the YOLOv5s-CBAM model and the YOLOv5s-C3CBAM model includes a feature channel attention module CAM and a feature space attention module SEM, which improves the feature extraction capability of the model by obtaining the importance of each feature channel and each feature space and adjusting the weight of each feature based on the importance of each feature; The method for adjusting the weight of each feature by the CBAM attention mechanism module comprises the following steps: Set the input feature map of the diseased tree to X∈R H×W×C ; Among them, H is the height, W is the width, and C is the number of channels; Input the input feature map into a feature channel attention module CAM and a feature space attention module SEM respectively; The feature channel attention module CAM performs global average pooling and global maximum pooling operations on the input feature map to obtain the average value and maximum value of each feature channel: Among them, x avg is the average value of each feature channel, GAP(X) is the global average pooling operation on the input feature map X, where X is the input feature map; Among them, x max is the maximum value of each feature channel, GMP(X) is the global maximum pooling operation on the input feature map X; The results of global average pooling and global maximum pooling are feature fused to obtain the channel attention weight M c (X): M c (X)=σ(MLP(x avg )+MLP(x max )); The channel attention weight M c (X) is applied to each channel of the input feature map, and the channel dimension of the input feature map is weighted by multiplication to obtain the feature map X′ after weighting in the channel dimension: X′=M c (X)·X; The feature space attention module SEM first performs average pooling and maximum pooling operations on the input feature map channel by channel: Among them, x′ avg It is the result of the average pooling operation on each channel; Among them, x′ max It is the result of the maximum pooling operation on each channel; Concatenate the results of average pooling and maximum pooling along the channel dimension to obtain the fused feature map X s : X s ∈R H×W×2 ; For the fused feature map X s Perform convolution operation to obtain the spatial attention weight map M s (X′): M s (X′)=σ(Conv(X s )); Among them, σ is the activation function; The spatial attention weight map M s (X′) is applied to each spatial position of the input feature map, and the spatial dimension of the input feature map is weighted by multiplication to obtain the feature map X" after weighting in the spatial dimension: X"=M s (X′)·X′。 8. The method for detecting pine wood nematode disease according to claim 2, characterized in that: The SimAM attention mechanism module in the YOLOv5s-SimAM model and the YOLOv5s-C3SimAM model is used to calculate the attention weight by calculating the similarity between the input feature and itself, and to improve the feature extraction capability of the model by weighting the importance of each pixel in the input feature map; The method for adjusting weights of the SimAM attention mechanism module comprises the following steps: Set the input feature map of the diseased tree to X∈R H×W×C ; Among them, H is the height, W is the width, and C is the number of channels; Calculate the mean μ of each feature channel c and variance Among them, X is the input feature map; The feature of each position is reconstructed based on the mean and the variance and the reconstruction error e(i, j, c) is calculated: e(i,j,c)=(X(i,j,c)-μ c ) 2 ; The similarity weight a(i,j,c) of each pixel is calculated based on the reconstruction error: The similarity weight is applied to each pixel of the input feature map, and adaptive weighting is achieved by multiplication to obtain a pine wood nematode disease feature map X′(i, j, c) after weighting based on the importance of each pixel: X′(i,j,c)=a(i,j,c)·X(i,j,c).

9. The method for detecting pine wood nematode disease according to claim 2, characterized in that: The method comprises the following steps: the NAM attention mechanism module in the YOLOv5s-NAM model and the YOLOv5s-C3NAM model is used to balance the feature scale by normalization, and adjust the weight of the feature based on the scale to enhance the sensitivity of the model to the detection of the color change feature of pine leaves; The method for adjusting the weight of the NAM attention mechanism module specifically includes the following steps: Set the input feature map of the diseased tree to X∈R H×W×C ; Among them, H is the height, W is the width, and C is the number of channels; The channels and spaces of the input feature map are normalized respectively: Calculate the mean μ for each channel c and standard deviation σ c : Among them, X is the input feature map; Based on the mean μ c and the standard deviation σ c Normalize each channel to obtain the channel-normalized feature map X c : For the normalized feature map X c Calculate the mean μ in the spatial dimension s and standard deviation σ s : Based on the mean μ s and the standard deviation σ s Normalize the features at each position to obtain the position-characterized feature map X s : Based on the standard deviation σ s The attention weight A is calculated and applied to the input feature map. Adaptive weighting is achieved by multiplication to obtain the pine wood nematode disease feature map X′(i, j, c) after weighted processing based on the feature scale: X′(i,j,c)=A(i,j,c)·X(i,j,c).

10. The method for detecting pine wood nematode disease according to claim 2, characterized in that: The ECA attention mechanism module in the YOLOv5s-ECA model and the YOLOv5s-C3ECA model is used to capture the local interaction relationship between channels, adaptively weight the input feature map based on the local interaction relationship between channels, and improve the feature extraction capability of the model; The method for adjusting the weight of the ECA attention mechanism module specifically includes the following steps: Set the input feature map of the diseased tree to X∈R H×W×C ; Among them, H is the height, W is the width, and C is the number of channels; Perform global average pooling on each channel of the input feature map to extract the global feature z of each channel c , and obtain the global description vector z∈R C , the global feature z c The expression is: Based on the global feature z c And the global description vector z, obtain the channel attention weight s through a one-dimensional convolution operation; The channel attention weight s is applied to each channel of the input feature map, and adaptive weighting is achieved by multiplying the weight of each channel with the corresponding channel of the input feature map to obtain a pine wood nematode disease feature map X′ after weighted processing based on the local interaction relationship between channels. i,j,c : X′ i,j,c =s c ·X(i,j,c)。

Citation Information

Patent Citations

  • Traffic multi-target detection method of YOLOv5 network based on CSA attention mechanism and C3SAC

    CN116935337A

  • Smoke and fire detection method based on YOLOv5 algorithm improvement

    CN117274907A

  • Lightweight Raspberry Pi deployment dangerous area intrusion state detection algorithm combined with deep learning

    CN117333822A

  • Diffusion model guided high-speed vehicle detection integrated learning method and device

    CN117746066A

  • Multi-modal face living body detection method based on attention mechanism

    CN117894082A

Cited By

  • Attention-based student behavior target detection method and system

    CN120071060A

  • Disease and pest image multi-scale detection method, device and equipment and storage medium

    CN120953673A