Bursaphelenchus xylophilus disease intelligent identification method and system
By using the Slim module, composite activation function and multi-task learning framework in intelligent recognition of pine nematode disease, the convolution kernel weights are dynamically calculated, and combined with regional proposal networks and U-Net, the problems of overfitting and improper feature selection in the existing technology are solved, achieving more efficient and accurate detection of pine nematode disease.
Patent Information
- Application Number
- CN202411880816.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-01
AI Technical Summary
The prior art has problems such as overfitting, improper feature selection and unquality in intelligent identification of pine nematode disease, which affects the detection effect.
The Slim module is used to combine the composite activation function to generate feature maps, dynamically calculate the weight of multi-scale convolution kernels, and a multi-task learning framework is introduced to build a single-wood recognition and segmentation model of pine wood nematode disease, and use the regional proposal network and U-Net to extract and segment the disease area.
By optimizing feature extraction and nonlinear transformation, the processing capability and computing efficiency of complex images are improved, the accuracy and robustness of detection are improved, and the adaptability and diversified data processing capabilities of the model are enhanced.
Smart Images

Figure CN119741611A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition and target detection, and in particular to an intelligent recognition method and system for pine wood nematode disease. Background Art
[0002] Pine wilt disease, as a major pest that harms forest ecosystems, has had a serious impact on pine resources in many countries around the world. With the spread of pests and diseases, traditional pine wilt disease detection methods have gradually exposed their problems such as low efficiency and high cost. Therefore, in recent years, intelligent detection methods based on image recognition and machine learning have gradually become an important direction for pine wilt disease detection. These methods usually use the external manifestations of trees to identify diseases. However, since the symptoms of pine wilt disease often manifest as non-specific or hidden lesions, existing image recognition methods still face certain challenges in practical applications. Currently, Deep learning technology, especially convolutional neural networks, has been widely used in tasks such as image classification and target detection. In the field of intelligent identification of pine wood nematode disease, many studies have adopted deep learning models, such as convolutional neural networks and residual networks, to extract features from collected tree images and identify diseases. These methods significantly improve the efficiency and accuracy of recognition by automatically extracting image features. However, existing deep learning models still have several shortcomings when dealing with pine wood nematode disease images, especially when processing sawdust sample images. They face problems such as high image complexity and unclear features, resulting in insufficient recognition accuracy and robustness.
[0003] In the traditional convolutional neural network structure, feature extraction and learning processes usually rely on preset convolution kernels and network layer structures. However, this fixed structural design method is difficult to adapt to the complexity of different images, especially when processing pine wood nematode disease images. Due to its sample diversity and feature complexity, traditional CNNs often have difficulty in effectively extracting useful image features. In addition, although existing target detection methods can achieve relatively accurate detection results. Summary of the invention
[0004] In view of the problems existing in the above-mentioned existing intelligent identification methods and systems for pine wood nematode disease, the present invention is proposed.
[0005] Therefore, the problem to be solved by the present invention is that the existing technology has problems such as overfitting, improper feature selection, and low quality in the special scenario of pine wood nematode disease, which further affects the final detection effect.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions: a method for intelligently identifying pine wood nematode disease, comprising: Collect sawdust samples and take pictures as sample images, and use the Slim module combined with the composite activation function to generate feature maps; Dynamically calculate multi-scale convolution kernel weights and output the final feature map; A multi-task learning framework was introduced to build a single tree recognition and segmentation model for pine wilt disease. The diseased area was extracted using a region proposal network and segmented using U-Net to extract the final pine wilt diseased area. All data is stored and managed in a relational database.
[0007] As a preferred solution of the intelligent identification method of pine wood nematode disease of the present invention, wherein: the collecting of sawdust samples and photographing of sample images, and using the Slim module to convert the sample images into output feature maps include: Collect sawdust samples from pine trees suspected of being infected by pine wilt disease, place the collected sawdust samples on a glass slide, dilute and flatten them with physiological saline, cover the sawdust samples with a cover glass, place the samples under a microscope, adjust the light source and focus, and use the high-definition camera equipment that comes with the microscope to take sample images of different areas of each sawdust sample; The sampling time, tree location, collection point number and sampling depth were recorded and stored corresponding to the sample image of the wood chip sample.
[0008] As a preferred solution of the intelligent identification method of pine wood nematode disease of the present invention, wherein: the use of the Slim module in combination with the composite activation function to generate the feature map includes: The size of all sample images is uniformly adjusted to H×W, where H and W are the height and width of the sample images respectively, and the pixel values of the sample images are scaled to the range of [0,1]; Define a lightweight convolutional network, add a fully connected layer to the last layer, and output the value G, where G represents the number of convolution groups; Set the dimension of the input sample image to , Indicates the number of input channels of the sample image; The Sobel operator is used to calculate the gradient intensity of each pixel in the sample image and average it to obtain the average gradient intensity of the entire sample image. According to the average gradient intensity, a complexity threshold is set to determine the complexity of the sample image. If the average gradient intensity of the sample image is greater than the complexity threshold, the sample image is determined to be a complex image, otherwise, the sample image is defined as a simple image. According to the complexity judgment result of the sample image, the number of convolution groups G of the group convolution operation is dynamically set. If the sample image is a complex image, the number of groups of the complex image is preferentially set to 16 groups. If the sample image is a simple image, the number of groups of the simple image is preferentially set to 4 groups. According to the set number of convolution groups G, group convolution is used to convert the number of input channels of the sample image to Group them and perform a 3×3 group convolution operation on each group of channels, sliding the convolution kernel and calculating the weighted sum of the coverage area; After group convolution, each group of channels extracts local features, and the local features of all groups are spliced in the channel direction to form a feature map F. The dimension of the feature map F is , Indicates the number of output channels; According to the feature map F, combined with the characteristics of ReLU6 and Swish, the composite activation function and pixel threshold K are set to calculate the activation value for each pixel , the expression is: , in, Represents the value of the i-th pixel in the feature map F. If , then Swish is used to provide a smooth nonlinear response. , then use ReLU6 to limit the output range, represents the smoothing control parameter; After being processed by the composite activation function, the feature map is obtained .
[0009] As a preferred solution of the intelligent identification method of pine wood nematode disease of the present invention, the dynamic calculation of multi-scale convolution kernel weights and output of the final feature map includes: Introduce the convolutional neural network model, use SqueezeNet as the basic network for optimization, and define the structure of the convolutional neural network model, including multi-layer convolutional layers, pooling layers, fully connected layers, activation functions, Bottleneck module layers, and output layers; In the pooling layer, the feature map Perform global average pooling to compress the spatial information of each channel into a single global eigenvalue z, the size of which is 1×1× , the global feature value z is input into two fully connected layers to calculate the dynamic attention weight; Define three fixed-size convolution kernels for the Bottleneck module layer: , size is 3×3, used to extract local detail features; , with a size of 5×5, used to extract medium receptive field features; , with a size of 7×7, used to extract features with a large receptive field; According to the generated attention weights, the three fixed-size convolution kernels are weighted to obtain the dynamic convolution kernel, and the formula is: ,in, Represents a dynamic convolution kernel; Use dynamically generated convolution kernels to calibrate feature maps Perform convolution operation to obtain dynamic feature map D; For the dynamic feature map D, the GELU activation function is used to process the value of each pixel. The formula is: in, Represents the value of the j-th pixel in the dynamic feature map D after activation, Represents the value of the jth pixel in the dynamic feature map D, represents the error function; The activation results of all pixels are combined according to the spatial and channel sorting of the dynamic feature map D to obtain the activated dynamic feature map ; Use the standard 3×3 convolution kernel to extract the fixed feature map of the dynamic feature map D, and convert the activated dynamic feature map The fixed feature map is weighted and fused in proportion to obtain the fused feature map, and the fused feature map is reduced in channel dimension by 1×1 convolution to generate the final feature map, which is then batch normalized.
[0010] As a preferred solution of the intelligent identification method of pine wood nematode disease of the present invention, the introduction of a multi-task learning framework to construct a pine wood nematode disease single tree identification and segmentation model includes: Set subtasks and construct loss functions. The formula is: in, represents the total loss value, represents the classification loss, represents the bounding box regression loss, represents the implementation of segmentation loss, , and Represent the weights of the target classification task, bounding box regression task, and instance segmentation task respectively; Use deep convolutional neural networks as feature extractors and design independent branches for each subtask; The independent branches of the design include: The classification branch predicts the category of the region proposal and outputs the category probability through a fully connected layer; The regression branch predicts the position of the candidate box and outputs the four coordinates of the bounding box through the regression network. The four coordinates are the four parameters of the bounding box, namely the horizontal coordinate of the center of the bounding box, the vertical coordinate of the center of the bounding box, the width of the bounding box, and the height of the bounding box. The segmentation branch generates a binary segmentation mask for each candidate box through a convolutional layer; Build a single tree recognition and segmentation model for pine wood nematode disease, annotate the optimized final feature map and use it as the training set input; The annotation information includes classification labels, bounding box regression labels and segmentation masks; In the training phase, the input training set passes through the shared feature extraction network and outputs three branches. The total loss value is weighted according to the weight of each task and back-propagated to update the weight of the network. The Adam optimizer is used in the training process, and the learning rate decay strategy is adopted. The model performance is evaluated using evaluation indicators on the validation set, and the grid structure is adjusted based on the evaluation results.
[0011] As a preferred solution of the intelligent identification method of pine wood nematode disease of the present invention, wherein: the diseased area is extracted using a region proposal network and segmented using U-Net, and the final pine wood nematode diseased area is extracted, including: Generate a series of candidate boxes by using a sliding window on the optimized final feature map, each of which includes position coordinates and confidence; The position coordinates include the center coordinates, width and height of the candidate frame; The confidence refers to the probability that the candidate box contains the target; For each sliding window position, the region proposal network generates multiple candidate boxes of different scales; The probability of each candidate box is calculated using the Softmax classifier. During the regression process, the position offset of the candidate box is predicted by the regression network. The regression loss uses the Smooth L1 loss function to calculate the error between the candidate box prediction and the true box. By minimizing the Smooth L1 loss, the regression network optimizes the position and size of the candidate box; For all candidate boxes, sort them according to confidence, select the first N high-confidence candidate boxes, use non-maximum suppression for post-processing, select the candidate box with the largest confidence as the best candidate box, and calculate the loU value of the remaining candidate boxes and the best candidate box. , then remove the candidate box, otherwise, keep the candidate box, repeat the above steps until all candidate boxes are processed and output the candidate box set; The Softmax classifier is used again on the candidate frame set to evaluate the probability that each candidate frame contains the pine wood nematode disease area. Based on the calculated probability, the classification result of the candidate frame is determined by setting the classification threshold: If the probability is greater than the classification threshold, the candidate box is judged to be in the diseased area, otherwise, no operation is performed; According to the classification results, the final pine wood nematode disease area is output, and a binary mask of the diseased area is generated through the instance segmentation network. The mask represents the pixel position of the diseased area. The value of 1 represents the diseased area, and the value of 0 represents the background. Conduct connected component analysis on the generated segmentation mask to remove small diseased areas, filter by area size, retain the diseased areas with the minimum load area threshold, perform edge smoothing on the segmentation mask to reduce the jagged edges of the segmentation, use Gaussian blur to smooth the diseased areas, obtain the processed mask, and extract the final pine wood nematode diseased areas; The accuracy of the segmentation result is evaluated by calculating the overlap between the segmented area and the true annotated area. According to the evaluation results, the weight of the loss function, the candidate box regression parameters and the learning rate of the segmentation grid are adjusted.
[0012] As a preferred solution of the intelligent identification method of pine wood nematode disease of the present invention, wherein: the storing and managing of all data in a relational database includes: Select a relational database to store and manage data and its analysis results, design the database table structure to store different types of data, set up regular backup tasks, back up all data in the database, manage the permissions of database users and encrypt and store data.
[0013] Another object of the present invention is to provide an intelligent identification system for pine wood nematode disease, which comprises: An image acquisition module, used for collecting sawdust samples and photographing them as sample images; Image processing module, used to generate feature maps using the Slim module combined with a composite activation function; Image optimization module, which is used to dynamically calculate the weights of multi-scale convolution kernels and output the final feature map; Model building module, which is used to introduce a multi-task learning framework to build a single tree recognition and segmentation model for pine wood nematode disease; Image segmentation module, used to extract the diseased area using the region proposal network and segment using U-Net to extract the final pine wood nematode diseased area; The data storage module is used to store and manage all data in a relational database.
[0014] A computer device comprises: a memory and a processor; the memory stores a computer program, and the processor implements the steps of an intelligent identification method for pine wood nematode disease when executing the computer program.
[0015] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of an intelligent identification method for pine wood nematode disease.
[0016] The beneficial effects of the present invention are as follows: by using the Slim module in combination with a composite activation function, the feature extraction process is optimized, efficient processing of complex images is achieved, and the number of convolution groups is dynamically adjusted according to the complexity of the image, thereby improving computational efficiency and accuracy. The introduced multi-task learning framework improves the accuracy and stability of the overall model by sharing a feature extraction network, collaboratively optimizing classification, bounding box regression, and instance segmentation tasks, and adaptively adjusting the network structure, so that the model can flexibly adapt to input images of different complexities, further enhancing the robustness of the model and its adaptability to diversified data. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0018] Figure 1 This is a flow chart of the intelligent identification method for pine wood nematode disease.
[0019] Figure 2 This is a schematic diagram of the structure of the intelligent identification system for pine wood nematode disease. DETAILED DESCRIPTION
[0020] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the specific embodiments of the present invention are described in detail below in conjunction with the accompanying drawings.
[0021] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0022] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor is it a separate or selective embodiment that is mutually exclusive with other embodiments. Example
[0023] Reference Figure 1 , which is the first embodiment of the present invention, and provides an intelligent identification method for pine wood nematode disease, the intelligent identification method for pine wood nematode disease comprising: S1, collect sawdust samples and shoot them as sample images, and use the Slim module combined with the composite activation function to generate feature maps; Specifically, wood chip samples are collected and photographed as sample images, and the Slim module is used to convert the sample images into output feature maps including: Collect sawdust samples from pine trees suspected of being infected by pine wilt disease, place the collected sawdust samples on a glass slide, dilute and flatten them with physiological saline, cover the sawdust samples with a cover glass, place the samples under a microscope, adjust the light source and focus, and use the high-definition camera equipment that comes with the microscope to take sample images of different areas of each sawdust sample; The collection of sawdust samples refers to selecting collection points in pine trees, distributed in different directions, using 75% alcohol to disinfect the borer and collection points, aligning the borer vertically with the marked point, and slowly drilling into the surface of the trunk with uniform force. The sawdust generated during the drilling process adheres to the borer, and the sawdust is collected using a clean sampling bag. After each sampling, the remaining sawdust is cleaned with tweezers, and after the sampling is completed, the drill hole is sealed with waterproof glue; The sampling time, tree location (GPS coordinates), collection point number, and sampling depth were recorded and stored corresponding to the sample image of the wood chip sample.
[0024] The above sampling and shooting process ensures the accurate acquisition of pine wood nematode disease samples and high-quality image acquisition, providing a reliable data basis for subsequent intelligent identification. By collecting sawdust samples in different directions and using disinfected and standardized sampling methods, the risk of cross-contamination is reduced, ensuring the representativeness and reliability of the samples. The high-definition images taken under a microscope can capture the details of the diseased area in detail, further improving the accuracy of disease identification. At the same time, the time, location, number and depth information of the sampling are recorded, providing complete support for sample traceability and data management.
[0025] Furthermore, the Slim module is used in combination with a composite activation function to generate feature maps including: The size of all sample images is uniformly adjusted to H×W, where H and W are the height and width of the sample image respectively. The values of H and W can be determined according to actual needs, and the pixel values of the sample images are scaled to the range of [0,1]; Define a lightweight convolutional network, add a fully connected layer to the last layer, and output the value G, where G represents the number of convolution groups; Set the dimension of the input sample image to , Indicates the number of input channels of the sample image; The Sobel operator is used to calculate the gradient intensity of each pixel in the sample image and average it to obtain the average gradient intensity of the entire sample image. According to the average gradient intensity, a complexity threshold is set to determine the complexity of the sample image. If the average gradient intensity of the sample image is greater than the complexity threshold, the sample image is determined to be a complex image, otherwise, the sample image is defined as a simple image. The Sobel operator is a commonly used edge detection tool, and its specific principle is based on the grayscale difference between adjacent pixels; The gradient strength is used to measure the degree of brightness change in the sample image. The gradient strength includes horizontal gradient and vertical gradient. The horizontal gradient is obtained by calculating the difference in grayscale values of each pixel point adjacent to the left and right, and the vertical gradient is obtained by calculating the difference in grayscale values of each pixel point adjacent to the top and bottom. By combining the horizontal gradient and the vertical gradient, the overall gradient strength of the pixel point is calculated to detect structural features in the sample image. The average gradient strength is calculated by dividing the sum of the gradient strengths of all pixels by the total number of pixels, where the total number of pixels is the width multiplied by the height of the sample image; According to the complexity determination result of the sample image, the number of convolution groups G of the group convolution operation is dynamically set. If the sample image is a complex image, the number of groups of the complex image is preferentially set to 16 groups. If the sample image is a simple image, the number of groups of the simple image is preferentially set to 4 groups. Those skilled in the art can adjust the number of groups according to specific application scenarios. For example, the number of groups can be appropriately reduced when computing resources are limited, or the number of groups can be increased when higher accuracy is required. The group convolution is a convolution optimization technique that divides the channels of the input sample image into several groups, and performs convolution operations on each group of channels respectively; Dynamic group convolution directly targets the complexity of input features (average gradient strength) and implements the ability to dynamically adjust the number of groups instead of fixed groups. This method introduces a lightweight module that quantifies the complexity of the input image, enhancing the adaptability to diverse inputs. The dynamic adjustment of the number of groups is based on the actual complexity of image features, allocating more computing resources to complex areas while simplifying the processing of simple areas, solving the problem of insufficient adaptability of traditional group convolution to diverse inputs. According to the set number of convolution groups G, group convolution is used to convert the number of input channels of the sample image to Group them and perform a 3×3 group convolution operation on each group of channels, sliding the convolution kernel and calculating the weighted sum of the coverage area; The coverage area refers to the area occupied by the currently calculated pixel and its surrounding neighborhood when the convolution kernel slides on the sample image; After group convolution, each group of channels extracts local features, and the local features of all groups are spliced in the channel direction to form a feature map F. The dimension of the feature map F is , Indicates the number of output channels; In order to further improve the feature expression ability, a composite activation function is introduced, and differentiated activation methods are adopted for different regions; According to the feature map F, combined with the characteristics of ReLU6 and Swish, the composite activation function and pixel threshold K are set to calculate the activation value for each pixel , the expression is: ,in, Represents the value of the i-th pixel in the feature map F. If , then Swish is used to provide a smooth nonlinear response, suitable for capturing detailed changes. , then use ReLU6 to limit the output range, improve calculation stability, and avoid the gradient disappearance problem. It represents the smoothing control parameter, which is dynamically adjusted according to the actual performance of the model. When the model fails to capture the detailed features, the value of β can be appropriately increased to enhance the sensitivity of the Swish activation part. When the model is overfitting, β can be appropriately reduced to increase the smoothness of the activation function. The present invention combines the stability of ReLU6 and the detail capture ability of Swish by setting a composite activation function, optimizes the robustness of feature extraction and the detail retention ability by dynamically selecting a suitable activation mode in different gradient regions, and effectively designs the subtle edge features of pine wood nematode disease images by organically combining the two activation functions; The output features of the dynamic group convolution are linked and optimized with the composite activation function to ensure the consistency and synergy of feature extraction and nonlinear transformation in adapting pine wood nematode disease images. The activation function further enhances the local detail feature expression capability of the dynamic group convolution. After being processed by the composite activation function, the feature map is obtained .
[0026] The above scheme significantly improves the ability of feature extraction and nonlinear transformation by introducing the combination of dynamic group convolution and composite activation function, thereby enhancing the intelligent recognition ability of pine wood nematode disease images. Dynamic group convolution dynamically adjusts the number of convolution groups according to the complexity of the image, and can adaptively allocate computing resources to ensure that complex image areas receive more processing, while simple areas reduce computing overhead, thereby improving computing efficiency and adapting to diversified inputs. The composite activation function combines the advantages of ReLU6 and Swish, and can dynamically select suitable activation methods in different gradient areas, achieving a balance between detail capture and computational stability, and is particularly suitable for the extraction of subtle edge features in pine wood nematode disease images. This innovative feature extraction method significantly improves the robustness, detail retention and adaptability of the model by optimizing the expression of local details and the nonlinear feature transformation of the overall image, ultimately improving the accuracy and efficiency of intelligent recognition and positioning of pine wood nematode disease.
[0027] S2, dynamically calculate the multi-scale convolution kernel weights and output the final feature map; Specifically, dynamically calculating the multi-scale convolution kernel weights and outputting the final feature map includes: Introduce the convolutional neural network model, use SqueezeNet as the basic network for optimization, and define the structure of the convolutional neural network model, including multi-layer convolutional layers, pooling layers, fully connected layers, activation functions, Bottleneck module layers, and output layers; In the pooling layer, the feature map Perform global average pooling to compress the spatial information of each channel into a single global eigenvalue z, the size of which is 1×1× , the global feature value z is input into two fully connected layers to calculate the dynamic attention weight; According to the bottleneck structure, the information is compressed and reconstructed. Through nonlinear mapping, the importance between channels is effectively learned, and a channel importance weight vector is generated. The global eigenvalues are mapped to different spatial dimensions (dimension reduction and then dimension increase), and the GELU activation function is introduced to improve the expressiveness of the model. The calculation of dynamic attention weights refers to the first fully connected layer reducing the dimension of the global feature value and the number of channels. Reduced to ,in, is the compression factor, which indicates the degree of dimensionality reduction. Its value range is usually [2,16]. ,The purpose of dimensionality reduction is to reduce the complexity of calculation and make the model pay more attention to the relationship between channels; The second fully connected layer will reduce the dimension To increase the dimension, the number of channels Restore to ,get ,right Perform Softmax operation to generate standardized weights , where the sum of all weights is equal to 1, and each weight is greater than or equal to 0. The purpose of the dimensionality increase operation is to generate dynamic weights for each channel, which reflect the importance of the channel in the current task; In this design, the dimensionality reduction operation plays the role of information compression, allowing the model to focus on the most important features without having to process a large amount of redundant information. The dimensionality increase operation is information reconstruction, allowing the model to restore the importance weight of the channel based on the compressed feature information. This is like compression first and then reconstruction. Compression is to extract more valuable features, and reconstruction is to calculate the importance of the channel based on this streamlined information. Define three fixed-size convolution kernels for the Bottleneck module layer: , size is 3×3, used to extract local detail features; , with a size of 5×5, used to extract medium receptive field features; , with a size of 7×7, used to extract features with a large receptive field; According to the generated attention weights, the three fixed-size convolution kernels are weighted to obtain the dynamic convolution kernel, and the formula is: , in, Represents a dynamic convolution kernel; This scheme uses the SE attention mechanism and dynamic weighting mechanism to dynamically adjust the combined weights of the convolution kernels according to the different distributions of the input features, and generates dynamic convolution kernels that can adapt to the needs of different receptive fields in real time, thereby flexibly extracting target features and having stronger adaptability to the diverse needs of intelligent identification of pine wood nematode disease. Use dynamically generated convolution kernels to calibrate feature maps Perform convolution operation to obtain dynamic feature map D; For the dynamic feature map D, the GELU activation function is used to process the value of each pixel. The formula is: in, Represents the value of the j-th pixel in the dynamic feature map D after activation, Represents the value of the jth pixel in the dynamic feature map D, Represents the error function, which is used to smoothly map the input value and give the activation function Gaussian distribution characteristics; The activation results of all pixels are combined according to the spatial and channel sorting of the dynamic feature map D to obtain the activated dynamic feature map ; Use the standard 3×3 convolution kernel to extract the fixed feature map of the dynamic feature map D, and convert the activated dynamic feature map The fixed feature map is weighted and fused proportionally to the activated dynamic feature map. The weights of the fixed feature maps are generated according to dynamic learning to obtain the fused feature map, and the 1×1 convolution is used to perform channel dimension reduction on the fused feature map to generate the final feature map, which is then batch normalized.
[0028] By combining SqueezeNet as the basic network, using the SE attention mechanism and dynamic convolution kernel weighting mechanism, feature extraction and optimization in the intelligent identification of pine wood nematode disease are realized. Global features are extracted through global average pooling, and information is effectively compressed and reconstructed through dimensionality reduction and dimensionality increase operations to generate channel importance vectors with dynamic attention weights, thereby improving the network's attention to important features. Through multi-scale convolution kernel weighting, the weights of the convolution kernel are adaptively adjusted according to the distribution of feature maps and receptive field requirements, so that the model can flexibly extract target features at different levels and enhance the model's diversified adaptability. Through the fusion of GELU activation function and feature map, the expression ability of the model and the nonlinear mapping performance of feature extraction are further improved. This scheme effectively improves the accuracy and efficiency of feature extraction. At the same time, through dynamic adjustment and weighting mechanisms, the robustness and adaptability of the model in the intelligent identification of pine wood nematode disease are enhanced, and it can better cope with complex disease patterns and diverse input data.
[0029] S3. Introduce a multi-task learning framework to build a pine wilt diseased tree single tree recognition and segmentation model, use a region proposal network to extract the diseased area, and use U-Net for segmentation to extract the final pine wilt diseased area; Specifically, the multi-task learning framework is introduced to build a single tree recognition and segmentation model for pine wilt disease, including: Set subtasks and construct loss functions. The formula is: in, represents the total loss value, Represents the classification loss, using cross entropy loss to measure the classification accuracy of the candidate box, which is used to classify the infection status of a single tree. represents the bounding box regression loss, using Smooth L1 loss, which is used to optimize the detection task. Indicates the implementation of segmentation loss, using binary cross entropy loss to calculate the predicted probability of each pixel in the diseased area, which is used to refine the segmentation of the diseased area. , and They represent the weights of the target classification task, bounding box regression task, and instance segmentation task respectively, and the weights are adjusted through cross-validation; The target classification task is to determine whether each area proposal contains a pine wood nematode disease area and its category (e.g., healthy, mild, moderate, severe); The bounding box regression task refers to performing position regression on each candidate box to optimize the accurate positioning of the pine wood nematode disease area; The instance segmentation task accurately segments the pine wood nematode disease area and generates a binary mask through pixel-level segmentation; Use deep convolutional neural networks as feature extractors and design independent branches for each subtask; The independent branches of the design include: The classification branch predicts the category of the region proposal and outputs the category probability through a fully connected layer; The regression branch predicts the position of the candidate box and outputs the four coordinates of the bounding box through the regression network. The four coordinates are the four parameters of the bounding box, which are used to describe the position and size of the matrix box. They are the horizontal coordinate of the center of the bounding box, the vertical coordinate of the center of the bounding box, the width of the bounding box, and the height of the bounding box. The segmentation branch generates a binary segmentation mask for each candidate box through a convolutional layer; Build a single tree recognition and segmentation model for pine wood nematode disease, annotate the optimized final feature map and use it as the training set input; The annotation information includes classification labels, bounding box regression labels and segmentation masks; In the training phase, the input training set passes through the shared feature extraction network and outputs three branches. The total loss value is weighted according to the weight of each task and back-propagated to update the weight of the network. The Adam optimizer is used in the training process, and the learning rate decay strategy is adopted. Use evaluation indicators on the validation set to evaluate model performance and adjust the grid structure based on the evaluation results; The grid structure refers to performing global average pooling on each channel of the final feature map to obtain the average pixel value of each channel, calculating the standard deviation of the average pixel values of all channels, and using the standard deviation as the image complexity index S of the final feature map; According to the image complexity index S, set the complexity low threshold and Complexity high threshold, adaptive adjustment of network structure: like , then the complexity of the final feature map is judged to be low, the number of channels is reduced, and only a 3×3 convolution kernel is selected in the Bottleneck module layer. The number of channels reduced is determined according to actual needs; like , then the complexity of the final feature map is judged to be medium, the original network width is maintained, and 3×3 and 5×5 convolution kernels are selected in the Bottleneck module layer; like , then the complexity of the final feature map is judged to be high, the number of channels is increased, and 3×3, 5×5 and 7×7 convolution kernels are selected in the Bottleneck module layer. The number of channels increased is determined according to actual needs; According to the adaptively adjusted network structure, the final feature map is re-convolved to optimize the final feature map.
[0030] By introducing a multi-task learning framework to construct a single-tree recognition and segmentation model for pine wilt disease, it can simultaneously handle classification, bounding box regression and instance segmentation tasks, and accurately identify and locate pine wilt disease areas. This method designs independent branches to handle each task, and optimizes the classification accuracy, candidate box position and pixel-level segmentation of the diseased area respectively, thereby improving the overall detection accuracy. Classification loss, regression loss and segmentation loss are introduced into the loss function, and the objectives of the three tasks are combined by weighted summation, which effectively improves the coordination between the tasks. An adaptive network structure adjustment strategy is adopted to dynamically select the convolution kernel and the number of channels according to the complexity of the image, so that the network can automatically optimize for images of different complexities, thereby improving the generalization ability and computational efficiency of the model. This combination of multi-task learning and adaptive network structure optimization helps to achieve efficient and accurate pine wilt disease detection and positioning, and is particularly suitable for the intelligent analysis of complex images in pine wilt disease monitoring systems.
[0031] Furthermore, the diseased area is extracted using the region proposal network and segmented using U-Net. The final pine wood nematode diseased area is extracted, including: Generate a series of candidate boxes by using a sliding window on the optimized final feature map, each of which includes position coordinates and confidence; The position coordinates include the center coordinates, width and height of the candidate frame; The confidence refers to the probability that the candidate box contains the target; For each sliding window position, the region proposal network generates multiple candidate boxes of different scales; The probability of each candidate box is calculated using the Softmax classifier. During the regression process, the position offset of the candidate box is predicted by the regression network. The regression loss uses the Smooth L1 loss function to calculate the error between the candidate box prediction and the true box. By minimizing the Smooth L1 loss, the regression network optimizes the position and size of the candidate box; For all candidate boxes, sort them according to confidence, select the first N high-confidence candidate boxes, use non-maximum suppression for post-processing, select the candidate box with the largest confidence as the best candidate box, and calculate the loU value of the remaining candidate boxes and the best candidate box. , then remove the candidate box, otherwise, keep the candidate box, repeat the above steps until all candidate boxes are processed and output the candidate box set; The Softmax classifier is used again on the candidate frame set to evaluate the probability that each candidate frame contains the pine wood nematode disease area. Based on the calculated probability, the classification result of the candidate frame is determined by setting the classification threshold: If the probability is greater than the classification threshold, the candidate box is judged to be in the diseased area, otherwise, no operation is performed; According to the classification results, the final pine wood nematode disease area is output, and a binary mask of the diseased area is generated through the instance segmentation network. The mask represents the pixel position of the diseased area. The value of 1 represents the diseased area, and the value of 0 represents the background. Conduct connected component analysis on the generated segmentation mask to remove small diseased areas, filter by area size, retain the diseased areas with the minimum load area threshold, perform edge smoothing on the segmentation mask to reduce the jagged edges of the segmentation, use Gaussian blur to smooth the diseased areas, obtain the processed mask, and extract the final pine wood nematode diseased areas; The accuracy of the segmentation result is evaluated by calculating the overlap between the segmented area and the true annotated area. According to the evaluation results, the weight of the loss function, the candidate box regression parameters and the learning rate of the segmentation grid are adjusted.
[0032] By combining the region proposal network and the U-Net network, the diseased area of pine wilt disease is accurately identified and segmented. RPN generates multi-scale candidate boxes on the optimized feature map. The position and size of the candidate boxes are optimized by regression network and Smooth L1 loss to make them fit the diseased area more accurately. Redundant boxes are removed by non-maximum suppression, and the optimal candidate boxes are retained. The classification accuracy is further improved by combining the Softmax classifier. U-Net is used for instance segmentation to generate binary masks of the diseased area, and post-processing such as connected component analysis and Gaussian blur smoothing is performed to finally extract the precise pine wilt disease area. This process not only improves the positioning accuracy of the diseased area, but also reduces background interference and optimizes the quality of the segmentation results through meticulous segmentation and post-processing. This multi-step and refined detection and segmentation method can effectively improve the automatic detection and diagnosis capabilities of pine wilt disease, and provide reliable technical support for large-scale forestry monitoring and disease prevention.
[0033] S4. Store and manage all data in a relational database; Specifically, all data is stored in a relational database and managed, including: Select a relational database to store and manage data and its analysis results, design the database table structure to store different types of data, set up regular backup tasks, back up all data in the database, manage the permissions of database users and encrypt and store data.
[0034] Storing and managing all data in a relational database can effectively ensure structured storage and efficient management of data. Choosing a relational database helps to achieve data consistency, integrity and maintainability, and facilitates querying, updating and analyzing data. By designing a reasonable database table structure, different types of data can be flexibly stored, such as disease detection results, image information and user records. Regular backup tasks ensure data security and avoid data loss. By managing the permissions of database users, access to sensitive data can be effectively restricted, enhancing the security of the system. Data encryption storage further improves data privacy protection, ensures the security of data during storage and transmission, and improves the reliability and security of data management as a whole. Example
[0035] Reference Figure 2 , which is the second embodiment of the present invention, and which is different from the previous embodiment, provides an intelligent identification system for pine wood nematode disease, including: An image acquisition module, used for collecting sawdust samples and photographing them as sample images; Image processing module, used to generate feature maps using the Slim module combined with a composite activation function; Image optimization module, which is used to dynamically calculate the weights of multi-scale convolution kernels and output the final feature map; Model building module, which is used to introduce a multi-task learning framework to build a single tree recognition and segmentation model for pine wood nematode disease; Image segmentation module, used to extract the diseased area using the region proposal network and segment using U-Net to extract the final pine wood nematode diseased area; The data storage module is used to store and manage all data in a relational database.
[0036] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program codes.
[0037] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0038] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0039] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit with a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit with a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0040] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. An intelligent identification method for pine wood nematode disease, characterized in that: include, Collect sawdust samples and take pictures as sample images, and use the Slim module combined with the composite activation function to generate feature maps; Dynamically calculate multi-scale convolution kernel weights and output the final feature map; A multi-task learning framework was introduced to build a single tree recognition and segmentation model for pine wilt disease. The diseased area was extracted using a region proposal network and segmented using U-Net to extract the final pine wilt diseased area. All data is stored and managed in a relational database.
2. The intelligent identification method for pine wood nematode disease according to claim 1, characterized in that: The collecting of sawdust samples and photographing of sample images, and using the Slim module to convert the sample images into output feature maps include: Collect sawdust samples from pine trees suspected of being infected by pine wilt disease, place the collected sawdust samples on a glass slide, dilute and flatten them with physiological saline, cover the sawdust samples with a cover glass, place the samples under a microscope, adjust the light source and focus, and use the high-definition camera equipment that comes with the microscope to take sample images of different areas of each sawdust sample; The sampling time, tree location, collection point number and sampling depth were recorded and stored corresponding to the sample image of the wood chip sample.
3. The intelligent identification method for pine wood nematode disease according to claim 2, characterized in that: The use of the Slim module in combination with the composite activation function to generate a feature map includes: The size of all sample images is uniformly adjusted to H×W, where H and W are the height and width of the sample images respectively, and the pixel values of the sample images are scaled to the range of [0,1]; Define a lightweight convolutional network, add a fully connected layer to the last layer, and output the value G, where G represents the number of convolution groups; Set the dimension of the input sample image to , Indicates the number of input channels of the sample image; The Sobel operator is used to calculate the gradient intensity of each pixel in the sample image and average it to obtain the average gradient intensity of the entire sample image. According to the average gradient intensity, a complexity threshold is set to determine the complexity of the sample image. If the average gradient intensity of the sample image is greater than the complexity threshold, the sample image is determined to be a complex image, otherwise, the sample image is defined as a simple image. According to the complexity judgment result of the sample image, the number of convolution groups G of the group convolution operation is dynamically set. If the sample image is a complex image, the number of groups of the complex image is preferentially set to 16 groups. If the sample image is a simple image, the number of groups of the simple image is preferentially set to 4 groups. According to the set number of convolution groups G, group convolution is used to convert the number of input channels of the sample image to Group them and perform a 3×3 group convolution operation on each group of channels, sliding the convolution kernel and calculating the weighted sum of the coverage area; After group convolution, each group of channels extracts local features, and the local features of all groups are spliced in the channel direction to form a feature map F. The dimension of the feature map F is , Indicates the number of output channels; According to the feature map F, combined with the characteristics of ReLU6 and Swish, the composite activation function and pixel threshold K are set to calculate the activation value for each pixel , the expression is: ,in, Represents the value of the i-th pixel in the feature map F. If , then Swish is used to provide a smooth nonlinear response. , then use ReLU6 to limit the output range, represents the smoothing control parameter; After being processed by the composite activation function, the feature map is obtained .
4. The intelligent identification method for pine wood nematode disease according to claim 3, characterized in that: The dynamic calculation of multi-scale convolution kernel weights and output of the final feature map includes: Introduce the convolutional neural network model, use SqueezeNet as the basic network for optimization, and define the structure of the convolutional neural network model, including multi-layer convolutional layers, pooling layers, fully connected layers, activation functions, Bottleneck module layers, and output layers; In the pooling layer, the feature map Perform global average pooling to compress the spatial information of each channel into a single global eigenvalue z, the size of which is 1×1× , the global feature value z is input into two fully connected layers to calculate the dynamic attention weight; Define three fixed-size convolution kernels for the Bottleneck module layer: , size is 3×3, used to extract local detail features; , with a size of 5×5, used to extract medium receptive field features; , with a size of 7×7, used to extract features with a large receptive field; According to the generated attention weights, the three fixed-size convolution kernels are weighted to obtain the dynamic convolution kernel, and the formula is: ,in, Represents a dynamic convolution kernel; Use dynamically generated convolution kernels to calibrate feature maps Perform convolution operation to obtain dynamic feature map D; For the dynamic feature map D, the GELU activation function is used to process the value of each pixel. The formula is: in, Represents the value of the j-th pixel in the dynamic feature map D after activation, Represents the value of the jth pixel in the dynamic feature map D, represents the error function; The activation results of all pixels are combined according to the spatial and channel sorting of the dynamic feature map D to obtain the activated dynamic feature map ; Use the standard 3×3 convolution kernel to extract the fixed feature map of the dynamic feature map D, and convert the activated dynamic feature map The fixed feature map is weighted and fused in proportion to obtain the fused feature map, and the fused feature map is reduced in channel dimension by 1×1 convolution to generate the final feature map, which is then batch normalized.
5. The intelligent identification method for pine wood nematode disease according to claim 4, characterized in that: The multi-task learning framework is introduced to construct a pine wood nematode diseased single tree recognition and segmentation model, including: Set subtasks and construct loss functions. The formula is: in, represents the total loss value, represents the classification loss, represents the bounding box regression loss, represents the implementation of segmentation loss, , and Represent the weights of the target classification task, bounding box regression task, and instance segmentation task respectively; Use deep convolutional neural networks as feature extractors and design independent branches for each subtask; The independent branches of the design include: The classification branch predicts the category of the region proposal and outputs the category probability through a fully connected layer; The regression branch predicts the position of the candidate box and outputs the four coordinates of the bounding box through the regression network. The four coordinates are the four parameters of the bounding box, namely the horizontal coordinate of the center of the bounding box, the vertical coordinate of the center of the bounding box, the width of the bounding box, and the height of the bounding box. The segmentation branch generates a binary segmentation mask for each candidate box through a convolutional layer; Build a single tree recognition and segmentation model for pine wood nematode disease, annotate the optimized final feature map and use it as the training set input; The annotation information includes classification labels, bounding box regression labels and segmentation masks; In the training phase, the input training set passes through the shared feature extraction network and outputs three branches. The total loss value is weighted according to the weight of each task and back-propagated to update the weight of the network. The Adam optimizer is used in the training process, and the learning rate decay strategy is adopted. The model performance is evaluated using evaluation indicators on the validation set, and the grid structure is adjusted based on the evaluation results.
6. The intelligent identification method for pine wood nematode disease according to claim 5, characterized in that: The region proposal network is used to extract the diseased area and U-Net is used for segmentation. The final pine wood nematode diseased area is extracted, including: Generate a series of candidate boxes by using a sliding window on the optimized final feature map, each of which includes position coordinates and confidence; The position coordinates include the center coordinates, width and height of the candidate frame; The confidence refers to the probability that the candidate box contains the target; For each sliding window position, the region proposal network generates multiple candidate boxes of different scales; The probability of each candidate box is calculated using the Softmax classifier. During the regression process, the position offset of the candidate box is predicted by the regression network. The regression loss uses the Smooth L1 loss function to calculate the error between the candidate box prediction and the true box. By minimizing the Smooth L1 loss, the regression network optimizes the position and size of the candidate box; For all candidate boxes, sort them according to confidence, select the first N high-confidence candidate boxes, use non-maximum suppression for post-processing, select the candidate box with the largest confidence as the best candidate box, and calculate the loU value of the remaining candidate boxes and the best candidate box. , then remove the candidate box, otherwise, keep the candidate box, repeat the above steps until all candidate boxes are processed and output the candidate box set; The Softmax classifier is used again on the candidate frame set to evaluate the probability that each candidate frame contains the pine wood nematode disease area. Based on the calculated probability, the classification result of the candidate frame is determined by setting the classification threshold: If the probability is greater than the classification threshold, the candidate box is judged to be in the diseased area, otherwise, no operation is performed; According to the classification results, the final pine wood nematode disease area is output, and a binary mask of the diseased area is generated through the instance segmentation network. The mask represents the pixel position of the diseased area. The value of 1 represents the diseased area, and the value of 0 represents the background. Conduct connected component analysis on the generated segmentation mask to remove small diseased areas, filter by area size, retain the diseased areas with the minimum load area threshold, perform edge smoothing on the segmentation mask to reduce the jagged edges of the segmentation, use Gaussian blur to smooth the diseased areas, obtain the processed mask, and extract the final pine wood nematode diseased areas; The accuracy of the segmentation result is evaluated by calculating the overlap between the segmented area and the true annotated area. According to the evaluation results, the weight of the loss function, the candidate box regression parameters and the learning rate of the segmentation grid are adjusted.
7. The intelligent identification method for pine wood nematode disease according to claim 6, characterized in that: The storing and managing of all data in a relational database includes: Select a relational database to store and manage data and its analysis results, design the database table structure to store different types of data, set up regular backup tasks, back up all data in the database, manage the permissions of database users and encrypt and store data.
8. An intelligent identification system for pine wood nematode disease based on the intelligent identification method for pine wood nematode disease according to any one of claims 1 to 7, characterized in that: include, An image acquisition module, used for collecting sawdust samples and photographing them as sample images; Image processing module, used to generate feature maps using the Slim module combined with a composite activation function; Image optimization module, which is used to dynamically calculate the weights of multi-scale convolution kernels and output the final feature map; Model building module, which is used to introduce a multi-task learning framework to build a single tree recognition and segmentation model for pine wood nematode disease; Image segmentation module, used to extract the diseased area using the region proposal network and segment using U-Net to extract the final pine wood nematode diseased area; The data storage module is used to store and manage all data in a relational database.
9. A computer device comprising: A memory and a processor; the memory stores a computer program, wherein the processor implements the steps of the intelligent identification method for pine wood nematode disease according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the intelligent identification method for pine wood nematode disease according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Pest image detection method with similar size enhanced recognition
CN112733614A
Pepper disease and insect pest identification method and system based on hierarchical detection double-task model
CN116612386A
Pest and disease identification method based on artificial intelligence
CN118521899A
Cited By
Unmanned aerial vehicle multi-crop identification method based on Bayesian optimization and lightweight CNN
CN120564036A
Unmanned aerial vehicle pine wood nematode disease detection method based on multi-modal characteristics
CN120976771A
A method for detecting pine wood nematode disease of a drone based on multi-modal features
CN120976771B
Feature extraction method and device, electronic equipment, medium and computer program product
CN121937831A
Feature extraction method and apparatus, electronic device, medium, computer program product
CN121937831B