Bursaphelenchus xylophilus form identification method based on improved deep learning
By introducing the lightweight backbone network ShuffleNetV2 and the cross-scale feature fusion module CCFM, the YOLOv12 model was improved, which solved the problems of insufficient feature extraction and robustness in pine wood nematode detection and achieved high-precision, low-latency intelligent detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-27
- Publication Date
- 2026-04-07
AI Technical Summary
Existing technologies for detecting pine wilt disease suffer from insufficient feature extraction capabilities, easy missed detection, high model complexity, and insufficient robustness, making it difficult to meet the requirements of high accuracy, low latency, and strong robustness.
An improved YOLOv12 model is constructed by using the lightweight backbone network ShuffleNetV2 and the cross-scale feature fusion module CCFM, combined with a multi-scale detection head. The generalization ability of the model is enhanced through data augmentation strategies.
It significantly improves the accuracy and recall of pine wood nematode detection, reduces computational complexity and inference latency, and enhances the model's robustness, adaptability, and detection stability in complex contexts.
Smart Images

Figure CN121811399A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of artificial intelligence and forestry pest and disease detection, specifically involving a morphological recognition method for pine wilt nematodes based on improved deep learning. This method integrates microscopic imaging, lightweight backbone networks, and cross-scale feature fusion to achieve intelligent recognition of pine wilt nematodes. Background Technology
[0002] Pine wilt nematode (Bursaphelenchus xylophilus) is a devastating invasive species that damages pine forest ecosystems. The pine wilt disease it causes, known as "pine cancer," can lead to the death of entire pine forests, causing annual economic losses exceeding 10 billion yuan and severely disrupting the ecological balance, thus becoming a major threat to my country's forestry security. Early and accurate detection is crucial for controlling pine wilt disease, but existing technologies have significant limitations: traditional manual morphological detection relies on microscopic observation of nematode characteristics, requires professional personnel, and suffers from high subjectivity, time-consuming processes, and high false negative rates; while chemical and biochemical detection improves sensitivity, its complex procedures and expensive equipment make it difficult to promote on a large scale at the grassroots level.
[0003] In recent years, the development of artificial intelligence and deep learning technologies has provided a new path for intelligent detection of pine wilt disease. End-to-end detection models based on the YOLO series algorithms have been gradually applied to the field of agricultural and forestry pest identification due to their advantages in balancing speed and accuracy: Bai et al. optimized YOLOv5 through the CBAM attention mechanism to alleviate the problem of varying target scales in remote sensing images; Zhu et al. combined YOLOv4 and GoogLeNet to achieve staged detection of dead nematodes; Chen et al. improved the accuracy of diseased tree localization by fusing wavelet convolution and triple attention mechanisms based on YOLOv11; Wu et al. fused a locally fully convolutional network with YOLOv5 to improve the feature extraction capability for small targets. However, when the current mainstream YOLOv12 model is directly applied to pine wilt disease detection, it still faces three major bottlenecks:
[0004] 1. The pine wood nematode is only about 1 mm long. The model is not capable of extracting small target features of tiny, densely packed nematodes, and is prone to missed detection.
[0005] 2. The model has high complexity, redundant network structure, and high inference latency, making it difficult to meet the requirements of rapid detection;
[0006] 3. The model is susceptible to interference from image background, has weak anti-interference ability, and insufficient robustness, which affects the recognition stability in real-world scenarios.
[0007] Therefore, existing technologies lack a dedicated solution that can balance high accuracy, low latency, and strong robustness. There is an urgent need to make targeted improvements to existing models in order to build a detection model that meets the needs of large-scale, high-throughput intelligent pine wilt disease diagnosis, thereby providing key technical support for the scientific prevention and control of pine wilt disease. Summary of the Invention
[0008] This invention provides a morphological recognition method for pine wood nematode based on improved deep learning, in order to solve the problems of insufficient feature extraction capability, easy missed detection, high model complexity, insufficient robustness, and impact on recognition stability in real-world scenarios.
[0009] The technical solution adopted by this invention includes the following steps:
[0010] Step 1, Data Acquisition and Preprocessing: Acquire microscopic images of pine wood nematodes and perform data annotation and data augmentation;
[0011] Step 2: Construct an improved YOLOv12 model: Construct an improved model consisting of a lightweight backbone network, a cross-scale feature fusion neck network, and a multi-scale detection head collaboration.
[0012] Step 3: Model training and optimization;
[0013] Step 4: Detect and output the results.
[0014] In step 1 of this invention, data acquisition is carried out using a Hikvision MV-CS050-10GM industrial camera to collect microscopic images of pine wood nematodes, covering female pine wood nematodes, female larvae, and male pine wood nematodes, and clearly identifying the typical morphological features of pine wood nematodes, including the vulvar operculum, copulatory spine, tail tip, middle esophageal bulb, and stylet structure.
[0015] The data preprocessing in step 1 of this invention includes data labeling and data augmentation, wherein:
[0016] Data annotation: Regions of interest (ROIs) were annotated for key features of the vulva, copulatory spine, and tail tip of nematodes using the LabelImg tool. The annotation results were uniformly output in YOLO format to provide structured target location information for model training and validation.
[0017] Data augmentation: The original images are augmented by cropping, horizontal flipping, vertical flipping, rotation, brightness perturbation, or adding noise. The dataset is expanded by dividing the expanded dataset into training, validation, and test sets at a ratio of 70%, 15%, and 15%, respectively, for subsequent model training and validation.
[0018] The lightweight backbone network in step 2 of this invention includes:
[0019] The input image first passes through convolutional layer 1 and convolutional layer 2. These two layers use standard two-dimensional convolution operations. By weighted summation of local pixel neighborhoods, the information of the original pixel space is converted into low-level feature representation, thereby extracting basic texture, edge contour and brightness change information in the nematode image and providing stable input for subsequent feature extraction.
[0020] Subsequently, the feature map enters the 2D convolutional layer 1, which further expands the receptive field through two-dimensional convolution, enabling the model to capture continuous structural features of the nematode body in a larger spatial range, thereby enhancing its ability to express elongated morphology and overall orientation.
[0021] In the mid-level feature extraction stage, the feature map passes through convolutional layer 3 and 2D convolutional layer 2 in sequence. Convolutional layer 3 increases the number of convolutional channels and non-linear mapping capabilities, enabling the model to model more complex local structures. 2D convolutional layer 2 further enhances the spatial feature integration capability, enabling the model to gradually form a mid-level semantic understanding of the local morphology of nematodes and the neighborhood structure of organs while maintaining resolution.
[0022] By enhancing the response of the nematode body edge and striped structure through multi-directional and multi-scale filtering operations of the filter, and then weighting the feature channels and spatial regions through the convolutional block attention mechanism, the network can adaptively highlight key features related to the nematode structure while suppressing irrelevant background regions, thereby reducing false detection and false negative problems.
[0023] At the end of the lightweight backbone network, the feature map enters the 2D convolutional layer 3 for output shaping. Channel cleaning of the lightweight neural network is introduced at the output end to form a backbone output feature map suitable for input to the neck network.
[0024] The channel cleaning lightweight neural network of the present invention first obtains the number and distribution information of the input feature map through the channel statistics module, and then divides the feature map into two parts, bypass features and transformation features, along the channel dimension by the channel partitioning module. The bypass features directly retain the original information to reduce the computational overhead.
[0025] The transformed features are processed sequentially through 1×1 convolution 1, 3×3 depthwise separable convolution, and 1×1 convolution 2. 1×1 convolution 1 is used to achieve cross-channel linear combination and channel remapping to enhance information interaction between channels. 3×3 depthwise separable convolution performs independent spatial convolution on each channel to extract local texture and edge features and significantly reduce the number of parameters. 1×1 convolution 2 further fuses and compresses the spatial features. During these processes, batch normalization is applied after each convolutional module to normalize the output data of each layer, reducing the gradient vanishing problem and accelerating convergence. Additionally, the ReLU activation function is used.
[0026] The processed transformed features and bypass features are concatenated in the channel dimension, and the channel order is rearranged through a channel shuffling operation to output a multi-level feature map.
[0027] The cross-scale feature fusion neck network in step 2 of this invention includes:
[0028] The multi-level feature maps output by the lightweight backbone network then enter the cross-scale feature fusion neck network for cross-scale feature fusion and semantic enhancement. Features at different scales and semantic levels are aligned and fused to simultaneously ensure the localization accuracy of small organs and the semantic discrimination ability of the overall target. An upsampling module is set to map deep low-resolution features to a high-resolution scale, aligning them with shallow features in the spatial dimension. A concatenation module is set to fuse features from different levels in the channel dimension, thereby achieving complementarity between detailed information and high-level semantic information. After concatenation 2, a cross-scale feature fusion module CCFM is set. The C2f module and the convolutional shaping units of convolutional layers 4, 5, 2D convolutional layers 4 and 5 screen, compress, and recode the fused features to suppress redundant features and improve feature discriminability.
[0029] The cross-scale feature fusion module CCFM described in this invention first performs convolutional shaping on features from different levels to maintain consistency in the number of channels and their distribution. Then, it upsamples the deep features to a higher resolution and fuses them with the shallow features at the splicing node. The fused features are further purified by the C2f module to form a cross-scale feature representation that simultaneously contains local details and global semantics. This fusion process is repeated in multiple levels in the neck network to achieve top-down semantic information backflow and bottom-up detail information backflow, thereby significantly enhancing the model's ability to perceive small organ targets and improving detection stability under complex backgrounds and scale variations.
[0030] In step 2 of this invention, three parallel detection heads are set at the output end of the cross-scale feature fusion neck network to perform hierarchical detection of targets at different scales. Detection head 1 receives high-resolution fused features to detect the smallest and most detailed targets, focusing on key organs and minute local structures of the nematode. Detection head 2 receives medium-resolution features to detect local morphology and medium-scale structures of the nematode. Detection head 3 receives low-resolution features with stronger semantic information to detect the overall outline of the nematode and larger-scale targets. Each detection head performs bounding box regression, target confidence prediction, and category discrimination based on the input feature map, thereby achieving collaborative detection of the multi-level structure of the nematode at the "organ, local, and overall" levels. While ensuring detection accuracy, it also considers inference efficiency and engineering deployability. The candidate boxes output by each detection head undergo threshold screening and non-maximum suppression (NMS) post-processing steps to ensure the accuracy and reliability of the final output results.
[0031] The network training and optimization in step 3 of this invention includes:
[0032] Bounding box regression loss is used to strictly constrain the position and scale errors of the predicted boxes, ensuring the improvement of bounding box accuracy. Target confidence loss is used to strengthen the accurate judgment of target existence, and classification loss is used to optimize the accurate identification of target categories. The backpropagation algorithm continuously optimizes network parameters throughout the training process, gradually improving the model's ability to locate the overall outline of nematodes, distinguish microstructures, and suppress false detections in complex backgrounds.
[0033] The detection and output of results in step 4 of this invention includes:
[0034] After the model training is completed, the microscopic image to be detected is processed by the trained improved YOLOv12 model through forward propagation. The three parallel detection heads output multiple candidate detection boxes respectively. The final detection output includes the bounding box coordinates, class label and confidence score of each target. All detection results are superimposed with the original image to visualize the model's localization and classification effect on nematode body and organ structure.
[0035] The advantages of this invention are:
[0036] 1. Significantly Improved Detection Accuracy: By introducing ShuffleNetV2 as a lightweight backbone network, the expression efficiency of the feature extraction stage is effectively improved. Furthermore, the cross-scale feature fusion module CCFM enhances the information interaction capability between multi-scale features, resulting in significant improvements in both target detection accuracy and recall. Compared to the traditional YOLO model, the improved YOLOv12 can more fully integrate feature information from different scales, thereby enhancing the detection capability for small targets, complex backgrounds, and the microscopic organ structures of pine wood nematodes. Especially in microscopic images with small target scale, low contrast, and strong background interference, the traditional YOLO model is prone to false negatives, while the improved YOLOv12 significantly improves recall in such tasks, while effectively controlling the number of false positives. Leveraging the efficient feature extraction capabilities provided by ShuffleNetV2, the model achieves simultaneous improvements in precision and recall while maintaining inference speed, outperforming YOLOv8 and YOLOv11 on multiple standard evaluation metrics. Experimental results show that the improved YOLOv12 has an mAP (mean average accuracy) that is about 7% higher than that of the traditional model, and performs particularly well in small target detection tasks, verifying its significant advantage in detection accuracy.
[0037] 2. Optimized Computational Efficiency and Enhanced Structural Adaptability: At the model structure design level, introducing ShuffleNetV2 as the backbone network effectively reduces the computational complexity and parameter size of the network, thereby significantly improving inference efficiency. Compared with the complex backbone networks (such as CSPDarknet) used in traditional YOLO methods, ShuffleNetV2 significantly reduces redundant computation through lightweight designs such as channel separation structure, 1×1 convolutions, and 3×3 depthwise separable convolutions, enabling the model to maintain high efficiency even under limited computational resources. Simultaneously, the cross-scale feature fusion module CCFM effectively alleviates the problem of insufficient feature representation in traditional YOLO models under small target detection and complex background conditions by performing convolutional shaping, scale alignment, and cross-channel fusion of features at different levels. In the pine wood nematode detection task, the CCFM module significantly enhances the model's ability to perceive target features at different scales, especially effectively suppressing the interference of background noise on the detection results during the detection of small targets, thus improving the model's adaptability to multi-scale changes, dense targets, and complex imaging conditions from a structural perspective. Experimental results show that the improved YOLOv12 significantly reduces the computational cost and memory usage in both the training and inference phases compared to the traditional YOLO model, while achieving better computational efficiency while maintaining detection accuracy.
[0038] 3. Building upon network structure optimization, this invention further enhances the model's generalization ability in real-world application environments by introducing various data augmentation strategies. These data augmentation techniques simulate different imaging conditions and target variations, effectively improving the model's adaptability to complex scenarios.
[0039] First, a random cropping method is used to randomly select sub-regions from the original image as training samples, ensuring that the model can learn the distribution characteristics of the target at different spatial locations. This enhancement strategy helps the model improve its adaptability to changes in target location, enabling it to maintain high recognition ability when dealing with targets with significant positional changes.
[0040] Secondly, by applying a random horizontal flipping operation, this method can simulate the appearance changes of a target in different directions, making it particularly suitable for targets with variable morphological orientations, such as the pine wood nematode. Through this enhancement strategy, the model can cope with changes in target orientation, reducing the impact of orientation variations on detection performance.
[0041] Furthermore, to address the challenges posed by varying lighting conditions, this invention employs a random brightness perturbation technique. This strategy simulates different lighting environments, enabling the model to fully learn target recognition features under diverse lighting conditions, thereby enhancing its stability and robustness in real-world, complex lighting environments.
[0042] These data augmentation methods work synergistically to significantly improve the model's generalization ability. Through pruning, the model can adapt to changes in target location; through horizontal flipping, it can handle changes in target orientation; and through brightness perturbation, it can adapt to detection tasks under different lighting conditions. Ultimately, the combined application of these strategies helps the model maintain efficient and stable detection performance even when faced with the challenges of the tiny size and dense distribution of pine wilt nematodes, as well as complex background interference. This greatly enhances the model's robustness and provides reliable technical support for large-scale intelligent control of pine wilt nematode disease. Attached Figure Description
[0043] Figure 1 This is a schematic diagram of the improved YOLOv12 model of this invention;
[0044] Figure 2 This is an architecture diagram of the lightweight neural network for channel cleaning in this invention;
[0045] Figure 3 This is a schematic diagram of the cross-scale feature fusion module of the present invention. Detailed Implementation
[0046] Includes the following steps:
[0047] Step 1: Data Acquisition and Preprocessing;
[0048] Data Acquisition: The Hikvision MV-CS050-10GM industrial camera (5 megapixels, 2 / 3" target surface, 3.45μm pixel size, 20x objective lens) was used. The image data used in this invention was acquired at the Jilin Provincial Academy of Forestry Sciences, and a total of 200 microscopic images of nematodes were obtained, covering female pine wood nematodes, female pine wood nematodes, larvae, and males. The typical morphological characteristics of pine wood nematodes were clearly identified, including the vulva, copulatory spine, tail tip, middle esophageal bulb, and stylet structure.
[0049] Data annotation: The LabelImg tool was used to annotate the regions of interest (ROIs) of key features of nematodes (vaginal operculum, copulatory spine, tail tip, etc.). The annotation results were uniformly output in YOLO format to provide structured target location information for model training and validation.
[0050] Data augmentation: To improve the model's robustness and generalization ability, the original images were augmented using techniques such as cropping, horizontal flipping, vertical flipping, rotation, brightness perturbation, and noise addition, expanding the dataset from 200 images to 1200 images. The expanded dataset was then divided into training, validation, and test sets at a ratio of 70%, 15%, and 15%, respectively, ensuring that the distribution of nematodes in the three sets did not differ significantly, for use in subsequent model training and validation.
[0051] Step 2: Build an improved YOLOv12 model;
[0052] Improvements: To enhance the detection performance of the YOLOv12 model in microscopic images of pine wood nematodes and their microscopic organ structures, this invention systematically improves the overall network structure of the YOLOv12 model. An improved model is constructed, consisting of a lightweight backbone network, a cross-scale feature fusion neck network, and a multi-scale detection head collaboration. The overall technical approach is as follows: Figure 1 As shown, this technical approach, based on the core concepts of "efficient feature extraction, multi-scale information fusion, and hierarchical fine detection," effectively reduces model computational complexity while ensuring detection accuracy, making it suitable for automatic detection tasks in scenarios with small targets and high background interference.
[0053] In this overall technical approach, the input microscopic image first enters the backbone network for multi-level feature extraction. For example... Figure 1 As shown, the backbone network consists of multiple convolutional layers and feature enhancement modules. Its main function is to progressively transform the original image into a discriminative feature representation. Specifically, the input image first passes through convolutional layer 1 and convolutional layer 2. These two layers use standard two-dimensional convolution operations to convert the information in the original pixel space into a low-level feature representation by weighted summation of the local pixel neighborhood. This extracts information such as basic texture, edge contours, and brightness variations from the nematode image and provides stable input for subsequent feature extraction.
[0054] Subsequently, the feature map enters 2D convolutional layer 1. This layer further expands the receptive field through two-dimensional convolution, enabling the model to capture continuous structural features of the nematode body in a larger spatial range, thereby enhancing its ability to express elongated morphology and overall orientation. In the mid-level feature extraction stage, the feature map passes through convolutional layer 3 and 2D convolutional layer 2 in sequence. Convolutional layer 3 increases the number of convolutional channels and nonlinear mapping capabilities, enabling the model to model more complex local structures. 2D convolutional layer 2 further strengthens the spatial feature integration capability, allowing the model to gradually form a mid-level semantic understanding of the local morphology and organ neighborhood structure of the nematode body while maintaining resolution.
[0055] To enhance the response capability of directional textures and weak contrast boundaries in microscopic images, this invention introduces a beta filter into the backbone network. This filter strengthens the response of nematode body edges and striped structures through multi-directional and multi-scale filtering operations, which helps to improve the separability between the target and the background in complex backgrounds. Subsequently, the feature channels and spatial regions are weighted through a convolutional block attention mechanism, enabling the network to adaptively highlight key features related to the nematode structure while suppressing irrelevant background regions, thereby reducing false detections and false negatives.
[0056] At the end of the backbone network, the feature map enters a 2D convolutional layer 3 for output shaping. This layer further reshapes and compresses the enhanced features through two-dimensional convolution operations. To address the problems of large parameter count, high computational redundancy, and easy dilution of small structural features in traditional backbone networks, this invention introduces a channel-washing lightweight neural network (ShuffleNetV2) at the backbone output end to form a backbone output feature map suitable for input into the neck network. Its structure is as follows: Figure 2 As shown, the lightweight structure first obtains the number and distribution information of the input feature map through the channel statistics module, and then divides the feature map into two parts, bypass features and transform features, along the channel dimension by the channel partitioning module. The bypass features directly retain the original information to reduce computational overhead.
[0057] The transformed features are processed sequentially through 1×1 convolutions, 3×3 depthwise separable convolutions, and then another 1×1 convolution. The first 1×1 convolution is used to achieve cross-channel linear combination and channel remapping to enhance information interaction between channels. The 3×3 depthwise separable convolution performs independent spatial convolution on each channel to extract local texture and edge features and significantly reduce the number of parameters. Subsequently, the second 1×1 convolution further fuses and compresses the spatial features. During these processes, batch normalization is applied after each convolutional module to normalize the output data of each layer, reducing the gradient vanishing problem and accelerating convergence. Furthermore, the ReLU (Rectified Linear Unit) activation function is used to effectively enhance the model's nonlinear expressive power, enabling the model to better learn complex features.
[0058] The processed transformed features and bypass features are concatenated along the channel dimension, and the channel order is rearranged through a channel shuffling operation, thereby breaking the information isolation problem caused by channel grouping. This channel shuffling lightweight structure significantly reduces the computational complexity of the model while effectively preserving the morphological and organ details of nematodes, providing high-quality input for subsequent cross-scale fusion.
[0059] like Figure 1 , 3 As shown, the multi-level feature maps output by the backbone network are then fed into the neck network for cross-scale feature fusion and semantic enhancement. The main function of the neck network is to align and fuse features at different scales and semantic levels, so as to simultaneously consider the localization accuracy of small organs and the semantic discrimination ability of the overall target. The neck network sets up a sampling module to map deep low-resolution features to a high-resolution scale, so that they are aligned with shallow features in the spatial dimension; sets up multiple stitching modules to fuse features from different levels in the channel dimension, thereby achieving complementarity between detailed information and high-level semantic information; and uses the C2f module and convolutional shaping units such as convolutional layer 4, convolutional layer 5, 2D convolutional layer 4, and 2D convolutional layer 5 to filter, compress, and recode the fused features to suppress redundant features and improve feature discriminability.
[0060] The cross-scale feature fusion module (CCFM) is a key innovation of this invention, and its structure is as follows: Figure 3As shown, this module first performs convolutional shaping on features from different levels to maintain consistency in the number of channels and their distribution. Then, it upsamples the deep features to a higher resolution and fuses them with the shallow features at the concatenation node. The fused features are further purified by the C2f module to form a cross-scale feature representation that simultaneously contains local details and global semantics. This fusion process is repeated in multiple levels within the neck network, achieving top-down semantic information backflow and bottom-up detail information backflow, thereby significantly enhancing the model's ability to perceive small organ targets and improving detection stability under complex backgrounds and scale variations.
[0061] Finally, three parallel detection heads are set at the output of the neck network, such as... Figure 1 As shown, this architecture is used for hierarchical detection of targets at different scales. Detection head 1 receives high-resolution fused features, primarily used to detect the smallest and most detailed targets, with a focus on covering key organs and minute local structures of the nematode. Detection head 2 receives medium-resolution features, used to detect local morphology and medium-scale structures of the nematode. Detection head 3 receives low-resolution features with stronger semantic information, used to detect the overall outline of the nematode and larger-scale targets. Each detection head performs bounding box regression, target confidence prediction, and category discrimination based on the input feature map, thereby achieving collaborative detection of the multi-level structure of the nematode at the "organ, local, and overall" levels, while ensuring detection accuracy and balancing inference efficiency and engineering deployability.
[0062] Step 3: Model training and optimization;
[0063] After completing the above network structure design, the improved YOLOv12 model constructed in step 2 was systematically trained and optimized on the microscopic images of pine wood nematodes. During the training phase, a lightweight backbone network was first used to perform multi-level feature extraction on the input microscopic images, accurately capturing the detailed features in the nematode images. The introduction of a channel cleaning structure significantly reduced redundant computation while preserving high-resolution morphological information, ensuring effective representation of minute target features. Next, the images were aligned, stitched, and semantically enhanced through the cross-scale feature fusion module (CCFM) of the neck network, enabling the model to possess multi-scale perception capabilities and accurately capture the minute structures and overall morphology of the nematode.
[0064] During training, the model employs bounding box regression loss to rigorously constrain the position and scale errors of predicted boxes, ensuring improved bounding box accuracy. Target confidence loss is used to enhance accurate target presence assessment, and classification loss optimizes accurate target category identification. The backpropagation algorithm continuously optimizes network parameters throughout training, gradually improving the model's ability to locate the overall outline of the nematode, resolve microstructures, and suppress false detections in complex backgrounds. The lightweight design of the backbone network effectively reduces computational redundancy, while the cross-scale feature fusion module enhances responsiveness to small targets and suppresses background noise. Ultimately, the converged model exhibits higher stability and stronger robustness in small target detection tasks.
[0065] Through this training process, the model can accurately locate and distinguish the small organs, local morphology and overall outline of nematodes under varying experimental conditions, significantly improving the accuracy and recall of small target (micro-organ) detection.
[0066] Step 4: Detect and output the results;
[0067] After model training is complete, the inference phase begins. The microscopic images to be detected undergo forward propagation processing using the trained, improved YOLOv12 model, and three parallel detection heads each output multiple candidate bounding boxes. Each detection head is responsible for detecting targets at different scales: Detection Head 1 focuses on small organs and local structures, Detection Head 2 focuses on medium-scale local morphology, and Detection Head 3 is responsible for detecting larger targets. The candidate bounding boxes output by each detection head undergo post-processing steps such as thresholding and non-maximum suppression (NMS) to ensure the accuracy and reliability of the final output results.
[0068] The final detection output includes the bounding box coordinates, class label, and confidence score for each target. All detection results are overlaid with the original image to visualize the model's localization and classification of nematode bodies and organ structures. This process not only helps to qualitatively demonstrate the model's detection accuracy but also allows for quantitative analysis using a confusion matrix, providing a deeper assessment of the model's class separability.
[0069] Thus, this invention introduces the channel-cleaning lightweight neural network ShuffleNetV2 as the backbone feature extraction network, aiming to significantly reduce the computational complexity and redundancy of the model while maintaining strong feature representation capabilities. A cross-scale feature fusion module (CCFM) is designed to effectively enhance the network's ability to perceive and fuse multi-scale features, especially those of small targets. Through these targeted optimizations, a high-precision, low-latency, and robust intelligent morphological detection model for pine wood nematodes is finally constructed, providing core technical support for large-scale, high-throughput intelligent diagnosis of pine wood nematodes.
[0070] To comprehensively evaluate model performance, this invention employs a systematic analysis using multiple metrics, including precision, recall, F1 score, and mean average precision (mAP). These evaluation metrics quantify the model's detection capabilities across various test scenarios, validating the effectiveness and advancement of this invention in microstructure perception and microscopic target detection. Experimental results demonstrate that the proposed strategy of "lightweight backbone network + cross-scale feature fusion + three-detector hierarchical detection" significantly improves detection precision and recall while reducing the probability of false positives and false negatives in complex backgrounds and multi-scale target detection tasks. Furthermore, it surpasses the traditional YOLOv12 model while maintaining inference efficiency, fully validating the model's broad adaptability and superior performance in practical applications.
[0071] The effects of the present invention will be further illustrated below through specific experimental examples.
[0072] Experimental Example 1: Comparison of the effects of this invention with other models
[0073] The experimental environment and conditions are as follows:
[0074] CPU: Intel Core TM i7-13650HX;
[0075] GPU: NVIDIA GeForce RTX 4060 Laptop GPU;
[0076] RAM: 24GB;
[0077] Software environment: CUDA 12.4, PyTorch 2.6.0, Python 3.11;
[0078] Operating system: Windows 11;
[0079] Evaluation Indicators Introduction:
[0080] In this invention, multiple models were evaluated in detail, and the evaluation metrics included key indicators such as mAP (mean precision), recall, and precision.
[0081] mAP, as a comprehensive evaluation metric, considers both the model's precision and recall capabilities and is a widely used performance measure in object detection. Besides mAP, recall and precision are also commonly used evaluation standards, measuring the model's ability to detect true targets and reduce false positives, respectively.
[0082] Mean Average Precision (mAP) is the most commonly used comprehensive evaluation metric in object detection tasks, taking into account precision at different recall rates. It calculates the average precision at each IoU threshold by plotting the precision-recall (PR) curve, and then averages the precision across all thresholds to obtain the final result.
[0083]
[0084] Where APi is the average precision of the i-th class, and N is the number of classes.
[0085] Recall: Recall measures a model's ability to correctly identify all real targets; that is, the proportion of real targets that the model correctly detects. A higher recall means the model can find more targets, but may also be accompanied by more false positives.
[0086]
[0087] Here, TP stands for True Positive, which is the number of targets correctly identified by the model, and FN stands for False Negative, which is the number of actual targets that the model failed to identify.
[0088] Precision: Precision measures the percentage of all targets detected by the model that are actually present. Higher precision indicates more accurate detection results and fewer false positives.
[0089]
[0090] TP stands for true positives, and FP stands for false positives, which is the number of targets that the model incorrectly detects.
[0091] This invention compares multiple versions of the YOLO (You Only Look Once) model, including YOLOv8 and YOLOv11, and their performance in object detection tasks. The evaluation results are shown in Table 1.
[0092] Table 1. Experimental comparison results of different models
[0093] Models mAP / % Recall rate % Precision / % Parameters / M YOLOv8 84.4 74.8 82.3 52.3 YOLOv11 87.1 82.6 86.3 31.2 YOLOv12 86.2 82.1 92.8 23.7 YOLOv12+ ShuffleNetV2 88.7 85.5 91.3 24.4 YOLOv12+CCFM 89.4 86.7 92.8 23.7 YOLOv12 + ShuffleNetV2 + CCFM 93.2 88.5 94.4 25.3
[0094] In Table 1, YOLOv8 is an earlier version in the series. While it boasts high computational efficiency, it may exhibit performance bottlenecks in some complex detection tasks. In contrast, YOLOv11 is an optimized and improved version, achieving significant improvements in key metrics such as precision and recall. Specifically, compared to YOLOv8, YOLOv11 performs better in terms of mAP (mean precision), recall, and accuracy, making it better suited for target detection tasks in various scenarios.
[0095] YOLOv8: As an early version of the YOLO series, YOLOv8 has high inference speed and computational efficiency in object detection tasks, but its detection performance is slightly insufficient for some small objects and complex backgrounds.
[0096] YOLOv11: YOLOv11 has made several improvements on YOLOv8, especially in feature extraction, data augmentation and model optimization, which have improved detection accuracy and recall, making it perform better in complex scenarios.
[0097] In the experiments, YOLOv12 demonstrated stronger adaptability and higher detection accuracy compared to YOLOv8 and YOLOv11, especially in detecting small targets such as pine wood nematodes, effectively improving model performance. The input resolution of YOLOv12 was set to 640×640, the batch size to 32, the initial learning rate to 0.001, the optimizer to Adam (β1=0.9, β2=0.999), and the training epochs to 500. To improve the model's generalization ability, data augmentation methods were employed, including random scaling, horizontal flipping, vertical flipping, rotation, and brightness perturbation. Early stopping was also enabled to prevent overfitting. To reduce computational cost and improve detection speed, this study used the lightweight network ShuffleNetV2 as the backbone network of YOLOv12, effectively reducing model parameters and computational complexity while accelerating the inference process. The object detection part is based on the YOLOv12 architecture and introduces a cross-scale feature fusion module (CCFM). Through multi-scale convolution and cross-channel feature fusion, the model's ability to perceive small targets is significantly enhanced, especially its response to tiny organs in microscopic images of pine wood nematodes. During training, the SGD optimizer was used with an initial learning rate of 0.01, a batch size of 64, and loss functions of CIoU Loss (localization) and FocalLoss (classification).
[0098] Experiment Example 2 Ablation Experiment
[0099] To evaluate the effectiveness of the algorithm of this invention, an ablation experiment was designed. After gradually introducing the ShuffleNetV2 and CCFM modules, the model's precision, recall, and mAP all showed significant improvements. The results are shown in Table 2.
[0100] Table 2 Analysis of Ablation Experiment Results
[0101] ShuffleNetV2 CCFM Accuracy / % Precision / % Recall / % F1-Score FPS / (sheets / s) mAP (%) × × 87.5 92.8 82.1 0.87 27.5 86.2 √ × 90.2 91.3 85.5 0.90 26.9 88.7 × √ 92.4 92.8 86.7 0.91 26.3 89.4 √ √ 95.5 94.4 88.5 0.93 25.7 93.2
[0102] In Table 2, the model of this invention achieved an accuracy of 95.5%, a precision of 94.4%, a recall of 88.5%, an F1-Score of 0.93, an optimal mAP of 93.2%, and an inference speed of 25.7 frames per second. These results validate the superior performance of the improved model of this invention in the pine wood nematode identification task and demonstrate that the introduction of ShuffleNetV2 and CCFM modules effectively improves the model's detection capability and robustness, especially showing a significant improvement in detail recognition.
Claims
1. A morphological recognition method for pine wood nematode based on improved deep learning, characterized in that, Includes the following steps: Step 1, Data Acquisition and Preprocessing: Acquire microscopic images of pine wood nematodes and perform data annotation and data augmentation; Step 2: Construct an improved YOLOv12 model: Construct an improved model consisting of a lightweight backbone network, a cross-scale feature fusion neck network, and a multi-scale detection head collaboration. Step 3: Model training and optimization; Step 4: Detect and output the results.
2. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that: In step 1, data acquisition involves using a Hikvision MV-CS050-10GM industrial camera to collect microscopic images of pine wood nematodes, covering female pine wood nematodes, female larvae, and male pine wood nematodes, and clearly identifying typical morphological features of pine wood nematodes, including the vulvar operculum, copulatory spine, tail tip, middle esophageal bulb, and stylet structure.
3. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that: The data preprocessing in step 1 includes data labeling and data augmentation, wherein: Data annotation: Regions of interest (ROIs) were annotated for key features of the vulva, copulatory spine, and tail tip of nematodes using the LabelImg tool. The annotation results were uniformly output in YOLO format to provide structured target location information for model training and validation. Data augmentation: The original images are augmented by cropping, horizontal flipping, vertical flipping, rotation, brightness perturbation, or adding noise. The dataset is expanded by dividing the expanded dataset into training, validation, and test sets at a ratio of 70%, 15%, and 15%, respectively, for subsequent model training and validation.
4. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that, The lightweight backbone network in step 2 includes: The input image first passes through convolutional layer 1 and convolutional layer 2. These two layers use standard two-dimensional convolution operations. By weighted summation of local pixel neighborhoods, the information of the original pixel space is converted into low-level feature representation, thereby extracting basic texture, edge contour and brightness change information in the nematode image and providing stable input for subsequent feature extraction. Subsequently, the feature map enters the 2D convolutional layer 1, which further expands the receptive field through two-dimensional convolution, enabling the model to capture continuous structural features of the nematode body in a larger spatial range, thereby enhancing its ability to express elongated morphology and overall orientation. In the mid-level feature extraction stage, the feature map passes through convolutional layer 3 and 2D convolutional layer 2 in sequence. Convolutional layer 3 increases the number of convolutional channels and non-linear mapping capabilities, enabling the model to model more complex local structures. 2D convolutional layer 2 further enhances the spatial feature integration capability, enabling the model to gradually form a mid-level semantic understanding of the local morphology of nematodes and the neighborhood structure of organs while maintaining resolution. By enhancing the response of the nematode body edge and striped structure through multi-directional and multi-scale filtering operations of the filter, and then weighting the feature channels and spatial regions through the convolutional block attention mechanism, the network can adaptively highlight key features related to the nematode structure while suppressing irrelevant background regions, thereby reducing false detection and false negative problems. At the end of the lightweight backbone network, the feature map enters the 2D convolutional layer 3 for output shaping. Channel cleaning of the lightweight neural network is introduced at the output end to form a backbone output feature map suitable for input to the neck network.
5. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 4, characterized in that: The channel cleaning lightweight neural network first obtains the number and distribution information of the input feature map through the channel statistics module, and then divides the feature map into two parts, bypass features and transformed features, along the channel dimension by the channel partitioning module. The bypass features directly retain the original information to reduce computational overhead. The transformed features are processed sequentially through 1×1 convolution 1, 3×3 depthwise separable convolution, and 1×1 convolution 2. 1×1 convolution 1 is used to achieve cross-channel linear combination and channel remapping to enhance information interaction between channels. 3×3 depthwise separable convolution performs independent spatial convolution on each channel to extract local texture and edge features and significantly reduce the number of parameters. 1×1 convolution 2 further fuses and compresses the spatial features. During these processes, batch normalization is applied after each convolutional module to normalize the output data of each layer, reducing the gradient vanishing problem and accelerating convergence. Additionally, the ReLU activation function is used. The processed transformed features and bypass features are concatenated in the channel dimension, and the channel order is rearranged through a channel shuffling operation to output a multi-level feature map.
6. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that, The cross-scale feature fusion neck network in step 2 includes: The multi-level feature maps output by the lightweight backbone network then enter the cross-scale feature fusion neck network for cross-scale feature fusion and semantic enhancement. Features at different scales and semantic levels are aligned and fused to simultaneously ensure the localization accuracy of small organs and the semantic discrimination ability of the overall target. An upsampling module is set to map deep low-resolution features to a high-resolution scale, aligning them with shallow features in the spatial dimension. A concatenation module is set to fuse features from different levels in the channel dimension, thereby achieving complementarity between detailed information and high-level semantic information. After concatenation 2, a cross-scale feature fusion module CCFM is set. The C2f module and the convolutional shaping units of convolutional layers 4, 5, 2D convolutional layers 4 and 5 screen, compress, and recode the fused features to suppress redundant features and improve feature discriminability.
7. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 6, characterized in that, The cross-scale feature fusion module CCFM first performs convolutional shaping on features from different levels to maintain consistency in the number of channels and their distribution. Then, it upsamples the deep features to a higher resolution and fuses them with the shallow features at the splicing node. The fused features are further purified by the C2f module to form a cross-scale feature representation that simultaneously contains local details and global semantics. This fusion process is repeated in multiple levels in the neck network to achieve top-down semantic information backflow and bottom-up detail information backflow, thereby significantly enhancing the model's ability to perceive small organ targets and improving detection stability under complex backgrounds and scale variations.
8. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that, In step 2, three parallel detection heads are set at the output of the cross-scale feature fusion neck network to perform hierarchical detection of targets at different scales. Detection head 1 receives high-resolution fused features to detect the smallest and most detailed targets, focusing on key organs and small local structures of the nematode. Detection head 2 receives medium-resolution features to detect local morphology and medium-scale structures of the nematode. Detection head 3 receives low-resolution features with stronger semantic information to detect the overall outline of the nematode and larger-scale targets. Each detection head performs bounding box regression, target confidence prediction, and category discrimination based on the input feature map, thereby achieving collaborative detection of the multi-level structure of the nematode at the "organ, local, and overall" levels. While ensuring detection accuracy, it also considers inference efficiency and engineering deployability. The candidate boxes output by each detection head undergo threshold filtering and non-maximum suppression (NMS) post-processing steps to ensure the accuracy and reliability of the final output results.
9. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that, Step 3, network training and optimization, includes: Bounding box regression loss is used to strictly constrain the position and scale errors of the predicted boxes, ensuring the improvement of bounding box accuracy. Target confidence loss is used to strengthen the accurate judgment of target existence, and classification loss is used to optimize the accurate identification of target categories. The backpropagation algorithm continuously optimizes network parameters throughout the training process, gradually improving the model's ability to locate the overall outline of nematodes, distinguish microstructures, and suppress false detections in complex backgrounds.
10. The morphological recognition method for pine wood nematode based on improved deep learning according to claim 1, characterized in that, The detection and output of results in step 4 include: After the model training is completed, the microscopic image to be detected is processed by the trained improved YOLOv12 model through forward propagation. The three parallel detection heads output multiple candidate detection boxes respectively. The final detection output includes the bounding box coordinates, class label and confidence score of each target. All detection results are superimposed with the original image to visualize the model's localization and classification effect on nematode body and organ structure.