A rapid detection method for pine wilt disease discolored epidemic wood based on deep learning

By improving the YOLOv5s model and using RepVGG, C2fCA, GSConv and BiFPN technologies, the accuracy and speed issues of detecting pine wilt diseased wood in mixed forests were solved, enabling efficient detection on consumer-grade drones.

CN117115682BActive Publication Date: 2025-11-21NANJING FORESTRY UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310852749.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-07-12
Publication Date
2025-11-21
Estimated Expiration
2043-07-12

AI Technical Summary

Technical Problem

Existing deep learning algorithms cannot be effectively applied to mixed forest areas with complex backgrounds when detecting pine wilt disease-infected wood. They suffer from low detection accuracy, slow speed, large model size, and a large number of parameters, making them unsuitable for deployment on consumer drones.

Method used

An improved YOLOv5s model, PWD-YOLO, is adopted, using RepVGG as the backbone for feature extraction. The C2fCA module, GSConv network, and BiFPN are combined to gather feature information, simplifying the model structure and deploying it on embedded devices of UAVs for real-time detection.

Benefits of technology

It achieves high-precision and rapid detection of pine wood lesions and diseased wood under complex backgrounds. The model is lightweight and can be deployed on consumer-grade drones to meet real-time detection needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115682B_ABST
    Figure CN117115682B_ABST
Patent Text Reader

Abstract

The application discloses a kind of rapid detection method of pine wood nematode disease discolored sick wood based on deep learning, belongs to the technical field of pine wood nematode disease discolored sick wood detection.First, pine wood nematode disease discolored sick wood image data is obtained by unmanned aerial vehicle, after the image data obtained is cleaned, pine wood nematode disease sick wood dataset is established and discolored sick wood is marked;Model improvement is carried out based on YOLOv5s, and the improved model PWD-YOLO is used for model training;The trained model is deployed to embedded device such as unmanned aerial vehicle, and the pine wood nematode disease sick wood in forest area is detected in real time.The application improves the model in mixed forest with complex background by improving the original YOLOv5s, improves the detection accuracy of the model, greatly compresses the volume, parameter quantity and calculation amount of the model, also improves the detection degree of the model, realizes the deployment to consumer-grade unmanned aerial vehicle, and carries out real-time and efficient detection on complex background forest stand.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of pine wood nematode diseased color wood detection, and particularly relates to a rapid detection method for pine wood nematode diseased color wood based on deep learning. BACKGROUND

[0002] The pine wood nematode disease is a major forest devastating disease, which has the characteristics of rapid transmission, strong destructive power and difficult prevention and control, is called "SARS in the plant kingdom", and has strong infectivity. When the pine tree is infected with the pine wood nematode disease, the disease gradually worsens over time, and the pine needles change from dark green to yellow, yellow-brown, and finally to red-brown or red-brown. At this time, the resin will disappear, and the whole plant will appear withered, but the needles will still not fall off and hang on the branches. Therefore, some people use the appearance of the diseased pine tree to detect the diseased color wood by using a deep learning method. The specific steps are as follows: an unmanned aerial vehicle is used to obtain images containing pine wood nematode diseased color wood, and an image labeling software is used to label the pine wood nematode diseased color wood samples, then the labeled data is used to establish a data set, and a deep learning algorithm is used to train the samples, and finally a model is obtained, which can be used for detection of pine wood nematode diseased color wood.

[0003] However, the existing deep learning algorithm is directly applied to the detection of pine wood nematode diseased color wood by the above method, which can only be applied in pure forest or artificial forest areas. Most of the pine wood nematode disease epidemic areas in China are mixed forests. For these areas with complex backgrounds, the previous method has the disadvantages of low precision and slow speed in detection performance. In terms of model deployment, the existing method has the characteristics of large model size, large parameter quantity and large calculation amount, and can only be deployed on devices with strong computing resources, and cannot be deployed on consumer drones.

[0004] At present, the detection of pine wood nematode diseased color wood by using RGB images combined with a deep learning algorithm is only suitable for pure pine forests and areas with mild epidemic situation. For some mixed forests with complex backgrounds and areas with serious epidemic situation, the detection may miss or misjudge, and the detection accuracy is greatly reduced. In addition, the existing deep learning algorithm applied in the field of pine wood nematode diseased color wood detection has the characteristics of large model size, large parameter quantity and large calculation amount, and needs to be equipped with powerful computing resources to make the model run. It is not friendly to consumer drones and other devices that lack computing resources. A large amount of calculation will inevitably slow down the detection speed and cannot meet the requirements of real-time detection tasks. SUMMARY

[0005] The technical problem solved by the present application is to provide a rapid detection method for pine wood nematode diseased color wood based on deep learning, which solves the problems of slow detection speed, low detection accuracy, missed detection and misjudgment in the detection of pine wood nematode diseased color wood.

[0006] The application aims to solve the above technical problems, and adopts the technical solutions as follows:

[0007] A rapid detection method for pine wood nematode discolored sick wood based on deep learning, comprising the following steps:

[0008] Step 1: Obtain pine wood nematode discolored sick wood image data by using a drone, and establish a pine wood nematode sick wood data set after cleaning the obtained image data and labeling the discolored sick wood;

[0009] Step 2: Model improvement based on YOLOv5s, the improved model PWD-YOLO uses RepVGG as Backbone for feature extraction;

[0010] C2fCA module is used to replace the original C3 structure, so that the model is lightweight, and more effective feature information is paid attention to;

[0011] GSConv network is used to replace the standard convolution, and the model network is simplified;

[0012] BiFPN is used to collect different scale feature information, increase the same scale skip connection, retain the nodes with high contribution degree, and remove the nodes with low feature contribution degree;

[0013] Finally, the features are fused by upsampling to obtain three channel scale feature maps for subsequent prediction;

[0014] Step 3: Model training using PWD-YOLO;

[0015] Step 4: Deploy the trained model to the embedded device of the drone to detect the pine wood nematode sick wood in the forest area in real time.

[0016] As preferred, the specific implementation steps of step 1 are as follows:

[0017] Step 1-1: Data acquisition

[0018] First, use a drone to obtain images of forest areas containing pine wood nematode discolored sick wood at different heights, and make the sick wood in the images clear and visible;

[0019] Step 1-2: Data cleaning

[0020] Select the obtained drone image data and remove invalid data;

[0021] Step 1-3: Establish a pine wood nematode discolored sick wood data set

[0022] Re-number the cleaned data and divide the training set and the validation set in proportion;

[0023] Step 1-4: Pest wood labeling

[0024] For the proportionally divided training set and validation set, LabelImg is used to sequentially label the pine wood nematode disease pest wood in the image with a rectangular frame, and the labeling results are saved in txt format. The key information saved includes the four point coordinates of the rectangular frame arranged in clockwise order (x1, y1), (x2, y2), (x3, y3), (x4, y4) and the class ID—PWD.

[0025] As a preferred, in step 2, the specific implementation of using RepVGG as Backbone for feature extraction is as follows:

[0026] The RepVGG module is introduced into the Backbone, and the ten-layer network including standard convolution Conv, C3 module, SPPF in the Backbone is reconstructed into a seven-layer network containing only a single RepVGG module; the RepVGG module extracts the feature information of the target in the Backbone through the structure reparameterization method, and models the information flow as y=x+g(x)+f(x); specifically: in the training stage, the network architecture is mainly composed of two kinds of residual structures: the first kind of residual structure is a 1x1 convolution residual branch; the second kind of residual structure contains a 1x1 convolution residual branch and also contains an Identity residual branch; at the beginning of running, the model uses a simple residual structure, and then, as the model network deepens, the residual structure also becomes more complex, the purpose is to obtain robust features in the deep network while considering the gradient vanishing problem in the deep network; in the inference stage, the trained module is converted into a single 3x3 convolution through the reparameterization technology and then the inference operation is performed.

[0027] As a preferred, in step 2, the specific implementation of using C2fCA module to replace all C3 structures in the original YOLOv5s feature fusion network to make the model lightweight while paying more attention to more effective feature information is as follows:

[0028] The bottleneck network in the C2F module not only uses a serial superposition similar to C3, but also adds a well-row cascade operation of the bottleneck network, which is a module with rich gradient flow information. For different scales of the discoloration sick wood, the network of the module adjusts the number of channels correspondingly, and can obtain more color and texture feature information of the discoloration sick wood. In addition, the network increases the skip connection and the Split operation, so that the model is more lightweight. The Coordinate Attention mechanism has the ability to capture two channel features, and considers channel information while also taking into account orientation information, forming a set of direction and position sensitive feature maps, complementarily enhancing effective feature information, and helping the model network to quickly focus on the texture features of the discoloration sick wood. The CA mechanism also applies the residual design in the network to avoid the problem of gradient disappearance, making the network more efficient.

[0029] As a preferred, in step 2, the GSConv network is used to replace the standard convolution Conv, and the specific implementation mode of the simplified model network is as follows:

[0030] GSConv combines standard convolution, depthwise separable convolution and Shuffle in a way to shuffle channel information; Shuffle is a channel mixing method that enables the information generated by standard convolution to be completely mixed into the output of depthwise separable convolution by transmitting its feature information on each channel; in GSConv, first, the feature map with channel number C1 is used to perform depthwise separable convolution operation on half of the channels, and standard convolution operation is performed on the other half of the channels, then the two are connected and the features are spliced; then the information generated by standard convolution penetrates into each part of the information generated by depthwise separable convolution through shuffle, and the output feature map channel number C2.

[0031] As a preferred, in step 2, the specific implementation mode of using BiFPN to collect different scale feature information, increase the skip connection of the same scale, and retain the nodes with high contribution degree and remove the nodes with low feature contribution degree is as follows:

[0032] BiFPN adds cross-scale connections by introducing the idea of weights, retains nodes with high contribution degree, and collects feature information of different scales using weighted fusion, which not only retains shallow semantic information, but also takes into account deep semantic information in the network.

[0033] As a preferred, in step 3, the steps of using PWD-YOLO for model training are as follows:

[0034] Step 3-1: Before training, the training set is first subjected to data enhancement

[0035] The data enhancement method includes image translation, flipping, brightness transformation and Mosaic data enhancement, wherein the Mosaic data enhancement is specifically: a plurality of different images are spliced into one image according to different proportions, the image contains a pine wilt disease sample instance and a complex background, the image is input into the network for training, so as to facilitate the model to learn the general characteristics of all data, improve the training effect, and improve the generalization ability of the model.

[0036] Step 3-2: input the enhanced image into the feature extraction network of PWD-YOLO

[0037] The feature extraction network contains RepVGG, so that the feature extraction network is simplified, and the extracted different scale target feature information is input into the feature fusion module;

[0038] Step 3-3: in the feature fusion module of PWD-YOLO, on the one hand, the original C3 module is replaced by the C2fCA module, so that the model network is light, and the network can pay more attention to effective feature information; on the other hand, the standard convolution is replaced by a light GSConv formed by combining a depth separable convolution and a standard convolution through channel shuffling; the original PANet structure is improved, and a BiFPN with weight idea is introduced, so that different scale feature information is collected; the feature fusion module is to fuse the three different scale feature maps extracted in the early stage, integrate the feature map information in different stages, and increase the receptive field of the network;

[0039] Step 3-4: the prediction module is to fuse the feature information into a feature map through upsampling for prediction, each feature map generates three different size prior boxes, and the NMS method is used to determine the final prediction result; the prediction module outputs three different scale feature maps of 20x20, 40x40 and 80x80, which are used to predict three different scale pine wilt disease;

[0040] Step 3-5: model verification

[0041] After each round of training of the model ends, the training effect of the model is verified by using the verification set;

[0042] Step 3-6: after all the training rounds are completed, the best model weight in all rounds is selected for subsequent deployment.

[0043] As preferred, in step 4, the trained model is deployed on a consumer-level unmanned aerial vehicle to implement the following steps for real-time detection of pine wilt disease in the forest area:

[0044] Step 4-1: deployment:

[0045] The trained PWD-YOLO model is converted into the format of the corresponding deployment framework and deployed to a consumer-grade drone platform.

[0046] Step 4-2: Detection:

[0047] Images acquired in real time by the UAV platform are input into the PWD-YOLO model for prediction. Each predicted bounding box has a confidence value. When the value is higher than a preset threshold of 0.55, it is considered a suspected target and is filtered by NMS. When the intersection-union ratio of two predicted bounding boxes is greater than a preset threshold of 0.5, the two predicted bounding boxes are considered to be the same target. For multiple predicted bounding boxes of the same target, the predicted bounding box with the highest confidence value is selected as the final result, and its coordinates and category information are output.

[0048] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0049] 1) This invention optimizes the PANet network structure of the YOLOv5s model and introduces BiFPN with weighting concept to solve the problem of false detection and false detection caused by different scales of discolored diseased trees in mountain forests due to the undulating terrain.

[0050] 2) This invention improves the original YOLOv5s by introducing a lightweight RepVGG network into the model backbone. By applying structural reparameterization technology to the RepVGG network, the RepVGG network can not only obtain target texture feature information with strong robustness, but also make the model lighter, the inference faster and more efficient, simplify the model structure, reduce the number of parameters and computation, and reduce the model size, so that it can be deployed on consumer drones.

[0051] 3) This invention has high detection accuracy in mixed forests with complex environments and fast detection speed, enabling real-time and efficient monitoring of pine wilt disease-infected trees. Attached Figure Description

[0052] Figure 1 This is a flowchart of a rapid detection method for pine wood diseased by pine wilt disease based on deep learning;

[0053] Figure 2 This is a diagram illustrating the dataset annotation.

[0054] Figure 3 This is a RepVGG structure diagram;

[0055] Figure 4 This is a comparison diagram of the C3, C2f, and C2fCA module structures;

[0056] Figure 5 This is a diagram of the CA mechanism structure;

[0057] Figure 6 is the structure diagram of GSConv;

[0058] Figure 7 is the network structure diagram of PWD-YOLO model;

[0059] Figure 8 is the model training flowchart of the present application;

[0060] Figure 9 is the flowchart of model deployment to a consumer drone platform;

[0061] Figure 10 is the comparison chart of the mainstream target detection model detection on the validation set. DETAILED DESCRIPTION

[0062] The present application will be further illustrated below in conjunction with specific embodiments, which are implemented on the premise of the technical solutions of the present application, and it should be understood that these embodiments are only used to illustrate the present application and not to limit the scope of the present application.

[0063] As shown in Figures 1-10 , the present application provides a rapid detection method for pine wood nematode diseased color blight wood based on deep learning. By improving YOLOv5 (target detection algorithm), the detection accuracy of the model in mixed forest with complex background is improved, while the volume, parameter quantity and calculation quantity of the model are greatly compressed, the detection speed of the model is improved, and the model is deployed to a consumer drone to realize real-time and efficient detection of forest stands under complex background.

[0064] The specific implementation steps are as follows:

[0065] Step 1: Obtain pine wood nematode diseased color blight wood image data by drone, and after cleaning the obtained image data, establish a pine wood nematode diseased wood data set and label the color blight wood, as follows:

[0066] 1-1: Data acquisition, first use the drone to obtain image data of forest area containing pine wood nematode diseased color blight wood through different heights, and make the diseased wood in the image clear and visible.

[0067] 1-2: Data cleaning, select the obtained drone image data and eliminate invalid data.

[0068] 1-3: Establish a pine wood nematode diseased color blight wood data set, renumber the cleaned data, and divide the training set and the validation set in the ratio of 8:2, wherein the training set and the validation set have no intersection, the validation set functions as a test, and no separate test set is provided.

[0069] 1-4: Epidemic wood annotation. For the training set and the validation set divided in proportion, the rectangular frame of the pine wood nematode disease epidemic wood in the image was labeled in sequence using LabelImg (an image labeling tool), and the labeling results were saved in txt format. The key information saved included the four point coordinates of the rectangular frame arranged in clockwise order (x1, y1), (x2, y2), (x3, y3), (x4, y4) and the class ID-PWD.

[0070] Step 2, improvement of the model based on YOLOv5s. The improved model was named PWD-YOLO, and the details were as follows:

[0071] 2-1: Backbone. PWD-YOLO used RepVGG (a structure reparameterization network) as Backbone for feature extraction, which reduced the complexity of the model and improved the detection speed.

[0072] By improving the original YOLOv5s, a light RepVGG network was introduced into the backbone of the model. RepVGG is composed of 3×3 convolution and ReLU, and the network is simple and has few parameters, which is suitable for mobile terminal devices that lack computing resources. The network applies structure reparameterization technology, so that the trained model has a multi-branch topology structure. In the training process, one module can be split into several identical or different modules, and in the inference process, multiple previously split modules can be fused into an equivalent module.

[0073] In ResNet, the information flow is modeled as y=x+f(x), and f is learned in a residual manner; if the channel numbers of x and f(x) do not match, y=g(x)+f(x), and g(x) corresponds the channel number of the residual part to f(x) through 1x1 convolution. The model performance is improved through the verification of the method by ResNet. In the RepVGG network, the information flow is modeled as y=x+g(x)+f(x) by referring to this idea. In the training stage, the network architecture is mainly composed of two kinds of residual structures: the first kind of residual structure is a 1x1 convolution residual branch; the second kind of residual structure contains a 1x1 convolution residual branch and an Identity residual branch. At the beginning of running, the model uses a simple residual structure, and as the model network deepens, the residual structure also becomes more and more complex, the purpose is to obtain robust features in the deep network while considering the gradient disappearance problem of the deep network. In the inference stage, the trained module is converted into a single 3x3 convolution through the reparameterization technology and then the inference operation is performed, which not only enables the RepVGG network to obtain strong robustness of the target texture feature information, but also makes the model more lightweight, and the inference is more rapid and efficient, which makes up for the defects of the multi-branch architecture in the inference process. Combined with the reduction of the number of Backbone network layers and the application of single module structure, the inference speed is further improved.

[0074] 2-2: The application designs a C2fCA module with gradient flow information and strong attention to key areas, which replaces all C3 structures in the original YOLOv5s feature fusion network (Neck), so that the model is further lightened, more effective feature information can be paid attention to, and the purpose of improving the precision is achieved.

[0075] The C2fCA module is formed by fusing the C2f module with the CA (Coordinate Attention, referred to as CA) attention mechanism. The bottleneck network in the C2f module not only uses a series of cascades similar to C3, but also adds a well-row cascade operation of the bottleneck network. It is a module with rich gradient flow information. For different scales of the color-changing sick wood, the network of this module adjusts the channel number correspondingly, which can obtain more color, texture and other feature information of the color-changing sick wood. In addition, many skip connections and Split operations are added in the network, making the model more lightweight; the Coordinate Attention (CA) mechanism has the ability to capture the features of two channels, that is, it considers the channel information while also taking into account the orientation information, forming a set of direction and position sensitive feature maps, which can be used to complementarily enhance the effective feature information and help the model network quickly focus on the texture features of the color-changing sick wood. The CA mechanism also applies the residual design in the network, avoiding the problem of gradient disappearance, making the network more efficient. The C2f module and the CA mechanism are fused to design a C2fCA module with more rich gradient flow information and stronger attention to key areas, effectively enhancing the fitting ability and expression ability between modules in the network, helping the model to extract the feature information of the color-changing sick wood under complex background and strong interference conditions, making the model further lightweight while allowing more effective feature information to be focused on, improving the overall detection accuracy of the model.

[0076] 2-3: GSConv (a deep learning model for image recognition tasks) network is used to replace the standard convolution, achieving the purpose of simplifying the model network and improving the detection speed.

[0077] GSConv combines standard convolution (SC), depth separable convolution (DSC) and Shuffle in a way to shuffle channel information, making up for the defect of DSC that loses a lot of channel information. Shuffle is a channel mixing method that enables SC-generated information to be completely mixed into DSC output by transmitting its feature information on each channel, achieving the purpose of channel information interaction. In GSConv, first, the feature map with channel number C1 is used to perform depth separable convolution operation on half of the channels, and standard convolution operation is performed on the remaining half of the channels, then the two are connected and the features are spliced. Then the information generated by SC penetrates into every part of the information generated by DSC through shuffle, and the output feature map channel number C2, so that the model maintains performance while taking into account the cost of calculation.

[0078] 2-4: BiFPN (weighted bidirectional feature pyramid network) with weight idea is used to solve the problem of false detection and missed detection caused by different scales of color-changing sick wood due to terrain undulation in the mountains.

[0079] BiFPN (Bi-directional Feature Pyramid Network) is an improvement of PANet (Path Aggregation Network). By introducing the concept of weights, it adds cross-scale connections, retains nodes with high contribution, and uses weighted fusion to collect feature information of different scales. It not only retains shallow semantic information, but also takes into account deep semantic information in the network, so that the model accuracy is improved, and the network is simple and efficient.

[0080] The features are fused by upsampling to obtain 20x20, 40x40, and 80x80 channel scale feature maps for subsequent prediction.

[0081] Step 3, use PWD-YOLO to train the model, which needs to be trained for multiple rounds, as follows:

[0082] 3-1: Before training, perform data augmentation on the training set. Data augmentation methods include image translation, flipping, brightness transformation, and Mosaic data augmentation. Mosaic data augmentation specifically involves: combining multiple different images into one image according to different proportions, which contains sample instances and complex backgrounds. Inputting this image into the network for training can help the model learn the general characteristics of all data, improve training effectiveness, and improve the model's generalization ability.

[0083] 3-2: Input the enhanced image into the feature extraction network of PWD-YOLO, which contains RepVGG, simplifying the feature extraction network and inputting the extracted different scale target feature information into the feature fusion module.

[0084] 3-3: In the feature fusion module of PWD-YOLO, the original PANet structure is improved by introducing BiFPN with weight idea, which can collect feature information of different scales and solve the problem of missing detection and false detection caused by different scales of forest diseases in mountainous areas. In the feature fusion network (Neck) of the model, replace all C3 modules with a newly designed C2fCA module, which makes the model network further lightweight while allowing the network to pay more attention to effective feature information, achieving the purpose of improving accuracy.

[0085] In addition, in order to reduce the complexity of the network, in the feature fusion module, the standard convolution (SC), depth separable convolution (DSC), and Shuffle are combined to shuffle the channel information, which makes up for the defect of DSC losing a lot of channel information, and forms a lightweight GSConv to replace the standard convolution. The feature fusion module is to fuse the three different scale feature maps extracted in the early stage, integrate the feature map information of different stages, and increase the receptive field of the network.

[0086] 3-4: The prediction module is to fuse the feature information into a feature map by upsampling to make a prediction, and each feature map generates three different size prior boxes, and the method of NMS (Non-Maximum Suppression) is used to determine the final prediction result; the prediction module outputs three different scale feature maps of 20x20, 40x40 and 80x80, which are used to predict three different scale PWDs.

[0087] 3-5: Model verification. After each round of training of the model ends, the training effect of the model is verified by using the verification set.

[0088] 3-6: After all the training rounds are completed, the best model weight trained in all rounds is selected for subsequent deployment.

[0089] Step 4: Deploy the trained model to an embedded device such as a UAV to detect PWDs in the forest in real time, as follows:

[0090] 4-1: Deployment:

[0091] Convert the trained PWD-YOLO model into the format of the corresponding deployment framework and deploy it on a consumer-level UAV platform.

[0092] 4-2: Detection:

[0093] Input the image obtained by the UAV platform in real time into the PWD-YOLO model for prediction, each prediction box has a confidence value, when the value is higher than the pre-set threshold, such as 0.55, it is considered as a suspected target, and Non-Maximum Suppression (NMS) filtering is performed, that is, when the intersection over union of two prediction boxes is greater than the pre-set threshold, such as 0.5, it is considered that the two prediction boxes are the same target. For multiple prediction boxes of the same target, select the prediction box with the highest confidence value as the final result, and output its coordinate and category information.

[0094] Example 1

[0095] The effect of this example can be further illustrated by the following experiment:

[0096] The experimental environment and conditions of the present application are as follows:

[0097] CPU: Intel Xeon 8225C @ 2.5GHz

[0098] GPU:VIDIA GeForce RTX 2080Ti

[0099] RAM: 43GB

[0100] Software environment: CUDA 12.0 Torch 1.9.0 Python 3.8

[0101] Operating system: Ubuntu 18.01

[0102] The parameter settings of the model training of the application are as follows:

[0103] The image size of the model network input is 640*640 pixels, 150 Epochs are trained, the Batch size is set to 32, and the Num workers is set to 16. The super parameter settings in the experiment are as follows: the initial learning rate is set to 0.002, the cosine annealing algorithm is used for learning rate decay, the optimizer is Adam, the Momentum is 0.937, the threshold of NMS is set to 0.5, the Intersection over union (IoU) is set to 0.5, and the confidence threshold is set to 0.55.

[0104] The data used in the experiment are all obtained by a drone. In order to show the performance of the model, the application compares mainstream target detection models.

[0105] The model performance is evaluated by using the model size, computational complexity (FLOPS), parameter quantity (Params), frame rate FPS, accuracy (P), recall rate (R), mAP and F1 score. The calculation formula is as follows:

[0106] FLQPS=2HW(K h K w C in C out +C out ) (1)

[0107] Params=K h K w C in C out (2)

[0108]

[0109]

[0110]

[0111]

[0112]

[0113] In formula (1) (2), H, W and C in respectively represent the height, width and channel number of the input feature map, K h, K w respectively the height and width of the convolution kernel, C out is the number of output channels. In equation (3), t is the time required to process a single picture. In equations (4) and (5), TP is True Positive, meaning: correct judgment, actually positive; FP is False Positive, meaning: positive, actually negative; FN is False Negative, meaning: negative, actually positive. In equation (6), N is the number of categories, and mAP@0.5 is selected as the accuracy evaluation index in this study, that is, the accuracy of the detected picture when IoU = 0.5.

[0114] The method proposed in the present application maximizes the simplification of the model network, reduces the parameter quantity and improves the detection speed, while improving the detection accuracy in complex forest background, with F1-Score and mAP@0.5 reaching 83% and 87.7%, respectively, which is 1% and 1.5% higher than the original YOLOv5s of 82% and 86.2%, and has strong robustness. Compared with other mainstream target detection methods, the method proposed in the present application is lightweight in model, with a model volume, calculation amount and parameter amount of only 2.7MB, 3.5GFLOPs and 1.09MB, far exceeding other mainstream methods. In terms of detection speed, the FPS reaches 98.0, meeting the requirements of deployment on consumer-level unmanned aerial vehicles and other embedded devices. The specific performance comparison experiment results are shown in the following table, and the comparison chart of the detection of mainstream target detection models on the validation set is shown in Figure 10 YOLOv5s is the original algorithm, PWD-YOLO is the improved algorithm, and the others are the current mainstream algorithms on the market.

[0115]

[0116] According to the problems in the detection of pine wood nematode disease discolored epidemic wood by the current deep learning algorithm, the present application proposes a rapid detection method for pine wood nematode disease discolored epidemic wood based on deep learning, which reduces the possibility of missed detection and false detection in the detection of some mixed forests with complex background and serious epidemic areas, shortens the volume of the model, improves the detection speed, improves the detection accuracy, and realizes the deployment of consumer-level unmanned aerial vehicles for real-time and efficient detection of forest stands in complex background.

[0117] The above is only a preferred embodiment of the present application, and it should be noted that those skilled in the art can make several improvements and refinements without departing from the principles of the present application, and these improvements and refinements should also be considered within the scope of protection of the present application.

Claims

1. A method for rapid detection of pine wilt disease discolored wood based on deep learning, characterized in that: The method comprises the following steps: Step 1: Obtain the image data of the pine wood nematode diseased color wood by a drone, and establish a pine wood nematode disease wood data set after cleaning the obtained image data and labeling the color wood; Step 2: Model improvement based on YOLOv5, the improved model PWD-YOLO uses RepVGG as Backbone for feature extraction; The RepVGG module is introduced into the Backbone, and the ten-layer network including the standard convolution Conv, C3 module and SPPF in the Backbone is restructured into a seven-layer network containing only a single RepVGG module; The RepVGG module extracts the feature information of the target in the Backbone through the structure reparameterization, and models the information flow as y=x+g(x)+f(x); Specifically, in the training stage, the network architecture is composed of two kinds of residual structures: the first kind of residual structure is a 1x1 convolution residual branch; The second kind of residual structure contains a 1x1 convolution residual branch and an Identity residual branch; At the beginning, the model uses a simple residual structure, and then, as the model network deepens, the residual structure becomes more complex, aiming to obtain robust features in the deep network while considering the gradient disappearance problem in the deep network; In the inference stage, the trained module is converted into a single 3x3 convolution for inference operation through the reparameterization technology; The C2fCA module is used to replace the original C3 structure, so that the model is lightened and more effective feature information is obtained; The bottleneck network in the C2f module not only uses a serial superposition similar to C3, but also increases the well row cascade operation of the bottleneck network, which is a module with rich gradient flow information. The network of this module adjusts the channel number corresponding to different scales of the color wood, so as to obtain more color and texture feature information of the color wood. In addition, the network increases the skip connection and Split operation, so that the model is more lightweight. The Coordinate Attention mechanism has the ability to capture two channel features, considering channel information while also considering orientation information, forming a set of direction and position sensitive feature maps, complementarily enhancing effective feature information, and helping the model network to quickly focus on the texture features of the color wood. The CA mechanism also applies the residual design in the network, avoiding the problem of gradient disappearance, making the network more efficient; GSConv network is used to replace standard convolution to simplify the model network; GSConv combines standard convolution, depthwise separable convolution and shuffle in a way that the information generated by standard convolution is fully mixed into the output of depthwise separable convolution by transmitting its feature information on each channel, in GSConv, first, half of the channels are operated by depthwise separable convolution with the input feature map of channel number C1, and the other half of the channels are operated by standard convolution, then the two are connected and the features are spliced; then the information generated by standard convolution penetrates into each part of the information generated by depthwise separable convolution through shuffle, and the output feature map channel number C2; BiFPN is used to collect different scale feature information, increase the skip connection of the same scale, retain the nodes with high contribution degree, and remove the nodes with low feature contribution degree; Finally, the features are fused by upsampling to obtain three channel scale feature maps for subsequent prediction. Step 3: use PWD-YOLO to train the model; Step 4: deploy the trained model to the unmanned aerial vehicle embedded device to detect the pine wilt disease in the forest area in real time. 2.The method according to claim 1, wherein the method is characterized in that, The specific implementation steps of step 1 are as follows: Step 1-1: data acquisition First, use the unmanned aerial vehicle to obtain images of the forest area containing pine wilt disease color change by different heights, and make the pine wilt disease in the images clear and visible; Step 1-2: data cleaning Select the obtained unmanned aerial vehicle image data and eliminate invalid data; Step 1-3: establish pine wilt disease color change data set Re-number the cleaned data and divide the training set and the validation set according to the proportion; Step 1-4: disease marking Use LabelImg to mark the pine wilt disease in the image in the training set and the validation set divided according to the proportion, and save the marking results as txt format, the key information saved includes the four point coordinates of the rectangular frame in clockwise order (x1, y1), (x2, y2), (x3, y3), (x4, y4) and class ID-PWD. 3.The method of claim 1, wherein the method comprises the steps of: obtaining a color image of a sample; and inputting the color image into a pre-trained deep learning model to obtain a result of the color image. In step 2, the specific implementation of using BiFPN to collect different scale feature information, increase the skip connection of the same scale, retain the nodes with high contribution degree, and remove the nodes with low feature contribution degree is as follows: BiFPN introduces the idea of weight, adds cross-scale connection, retains nodes with high contribution degree, and collects feature information of different scales by weighted fusion, which not only retains shallow semantic information, but also takes into account deep semantic information in the network. 4.The method of claim 1, wherein the method is characterized by, In step 3, the steps of using PWD-YOLO to train the model are as follows: Step 3-1: before training, first perform data augmentation on the training set The data enhancement method comprises image translation, image flipping, brightness transformation and Mosaic data enhancement, wherein the Mosaic data enhancement is specifically: a plurality of different images are spliced into one image according to different proportions, the image contains a pine sample instance and a complex background, the image is input into the network for training, so as to facilitate the model to learn the general characteristics of all data, improve the training effect, and improve the generalization ability of the model. Step 3-2: input the enhanced image into the feature extraction network of PWD-YOLO The feature extraction network comprises RepVGG, so that the feature extraction network is simplified, and different scale target feature information extracted is input into the feature fusion module; Step 3-3: in the feature fusion module of PWD-YOLO, on the one hand, the original C3 module is replaced by a C2fCA module, so that the model network is light, and the network can pay more attention to effective feature information; on the other hand, a light GSConv formed by combining a depth separable convolution and a standard convolution through channel shuffling is used to replace the standard convolution; the original PANet structure is improved, and a BiFPN with a weight idea is introduced, so that different scale feature information is collected; the feature fusion module is to fuse three different scale feature maps extracted in the early stage, integrate feature map information in different stages, and increase the receptive field of the network; Step 3-4: the prediction module is to fuse the feature information into a feature map through upsampling for prediction, each feature map generates three different size prior boxes, and the NMS method is used to determine the final prediction result; the prediction module outputs three different scale feature maps of 20x20, 40x40 and 80x80, which are used to predict three different scale pine wilt disease; Step 3-5: model verification After each round of training of the model ends, the training effect of the model is verified by using the verification set; Step 3-6: after all the training rounds end, the best model weight in all rounds is selected for subsequent deployment.

5. The method according to claim 1, wherein the method is characterized by: In step 4, the trained model is deployed on a consumer-level unmanned aerial vehicle to implement the following steps for real-time detection of pine wilt disease in a forest area: Step 4-1: deployment: Convert the trained PWD-YOLO model into the format of the corresponding deployment framework, and deploy it on a consumer-level unmanned aerial vehicle platform; Step 4-2: detection: Input the image obtained by the unmanned aerial vehicle platform in real time into the PWD-YOLO model for prediction, each prediction box has a confidence value, when the value is higher than the pre-set threshold value 0.55, it is considered as a suspected target, and NMS filtering is performed, when the intersection over union of two prediction boxes is greater than the pre-set threshold value 0.5, it is considered that the two prediction boxes are the same target; for multiple prediction boxes of the same target, the prediction box with the highest confidence value is selected as the final result, and the coordinate and category information thereof are output.