Pleurotus geesteranus stem length identification and classification method and system based on deep learning

By combining deep learning methods with the backbone module, bypass branch, SPPF module, convolutional block attention module and feature pyramid network, the high false detection rate problem in the identification of Pleurotus geesteranus stem length was solved, and high-precision stem length identification and classification in complex environments was achieved.

CN120673159APending Publication Date: 2025-09-19GUANGXI UNIV FOR NATITIES
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510794605.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-09-19

AI Technical Summary

Technical Problem

Existing target detection technology has problems with high false detection rate and difficulty in achieving high-precision identification in the growth monitoring of Pleurotus geesteranus, especially in the mushroom cluster growth environment. Due to the dense distribution of targets, mutual occlusion, complex and changeable background, and weak color difference between the stem and the background, traditional detection methods are difficult to achieve accurate classification of Pleurotus geesteranus stem length.

Method used

A deep learning-based identification and classification method for the stem length of Pleurotus geesteranus is adopted. Through the combination of trunk module, bypass branch, SPPF module, convolutional block attention module, feature pyramid network and path aggregation network, multi-scale feature extraction, feature fusion and optimization processing are performed to improve the feature expression ability and significantly reduce the false detection rate.

Benefits of technology

Significantly reduce the false detection rate of Pleurotus geesteranus stem length, improve the accuracy and reliability of stem length identification and classification results, and be able to accurately identify Pleurotus geesteranus stem length under complex backgrounds and lighting changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120673159A_ABST
    Figure CN120673159A_ABST
Patent Text Reader

Abstract

The invention discloses a pleurotus geesteranus stem length identification and classification method and system based on deep learning, and relates to the technical field of image processing, and the method comprises the steps: carrying out the preprocessing of a target image of pleurotus geesteranus; performing feature extraction on the preprocessed target image based on a main branch and a bypass branch of a trunk module in the pleurotus geesteranus identification and classification model to obtain multi-scale feature data; processing the multi-scale feature data based on an SPPF module to obtain a target feature map; performing optimization processing on the target feature map based on a convolution block attention module to obtain an optimized target feature map, and performing feature fusion enhancement processing on the optimized target feature map based on a feature pyramid network and a path aggregation network to obtain an enhanced feature map; and identifying and classifying the pleurotus geesteranus stem length based on the enhanced feature map to obtain an identifying and classifying result of the pleurotus geesteranus stem length. According to the method, the false detection rate of the pleurotus geesteranus rod length is remarkably reduced, and the accuracy and reliability of a rod length identification and classification result are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a method and system for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning. Background Art

[0002] With the rapid development of artificial intelligence and computer vision technologies, deep learning-based intelligent agricultural monitoring systems are gradually moving from the laboratory to industrial applications. As an edible mushroom with high economic value, intelligent monitoring of its growth status is crucial for improving yield and quality, reducing labor costs, and achieving precise management. In controlled indoor environments, the growth morphology of P. geesteranus is significantly affected by lighting conditions. When the stem reaches a specific length threshold, timely introduction of light can effectively inhibit excessive stipe elongation and promote full cap development, thereby maintaining an ideal stipe-to-cap ratio. This growth regulation is crucial to the commercial quality of P. geesteranus, as persistent darkness can lead to excessive stipe elongation and underdeveloped cap development, directly reducing its market value. Scientific light management can disrupt this undesirable growth pattern, achieving coordinated stipe-to-cap development and improving product appearance quality and commercial competitiveness. Therefore, identifying the stem length of P. geesteranus is particularly important. However, existing object detection technologies still have significant limitations when addressing the unique challenges of P. geesteranus growth monitoring. While conventional object detection algorithms can achieve good results in scenes with simple backgrounds and large objects, accurate detection becomes extremely challenging in mushroom clusters due to dense object distribution, mutual occlusion, complex and changing backgrounds, and subtle color differences between the stems and the background. This is particularly challenging for accurate classification of mushroom stem length. Due to the subtle length differences between different growth stages, traditional detection methods struggle to achieve high-precision identification, severely hindering the implementation of automated production management. Summary of the Invention

[0003] The purpose of the present invention is to overcome the shortcomings of the existing technology. The present invention provides a method and system for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning, which significantly reduces the false detection rate of the stem length of Pleurotus geesteranus and improves the accuracy and reliability of the stem length identification and classification results.

[0004] In order to solve the above technical problems, the present invention provides a method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning, the method comprising:

[0005] collecting a target image of Pleurotus geesteranus and preprocessing the target image to obtain a preprocessed target image;

[0006] Based on the main branch and bypass branch of the backbone module in the Pleurotus geesteranus identification and classification model, the pre-processed target image is subjected to feature extraction to obtain multi-scale feature data.

[0007] Process the multi-scale feature data based on the SPPF module to obtain the target feature map;

[0008] The target feature map is optimized based on the convolution block attention module to obtain the optimized target feature map, and the optimized target feature map is enhanced by feature fusion based on the feature pyramid network and path aggregation network to obtain the enhanced feature map;

[0009] The identification and classification of Pleurotus geesteranus stem length is performed based on the enhanced feature map, and the identification and classification results of Pleurotus geesteranus stem length are obtained.

[0010] Optionally, the main branch and the bypass branch of the trunk module in the Pleurotus geesteranus identification and classification model perform feature extraction on the preprocessed target image to obtain multi-scale feature data, including:

[0011] Performing preliminary feature extraction on the preprocessed target image to obtain original input features, and dividing the original input features into channel dimensions to obtain a first preliminary feature map and a second preliminary feature map;

[0012] Based on the main branch, the first preliminary feature map is extracted using the stacked bottleneck layer residual blocks to obtain first feature data. The calculation expression of the first feature data is:

[0013] ,

[0014] in, is the first feature data, RELU is the activation function, is dilated convolution, is a depth-wise separable convolution, is a convolution with a kernel size of n, is the first preliminary feature map;

[0015] Performing channel compression on the second preliminary feature map based on the bypass branch to obtain second feature data;

[0016] Feature concatenation and residual connection are performed based on the combination of the first feature data and the second feature data to obtain multi-scale feature data.

[0017] Optionally, the calculation expression of the second characteristic data is:

[0018] ,

[0019] in, is the second feature data, is a convolution with a kernel size of n, is the second preliminary feature map;

[0020] The calculation expression of the multi-scale feature data is:

[0021] ,

[0022] Among them, Y is the multi-scale feature data, is the feature splicing operation, is the first feature data, is the second feature data, and X is the original input feature.

[0023] Optionally, the processing of multi-scale feature data based on the SPPF module to obtain a target feature map includes:

[0024] Based on the SPPF module, multi-scale pooling processing, feature splicing processing and convolution processing are performed on the multi-scale feature data to obtain the target feature map.

[0025] Optionally, the target feature map is expressed as:

[0026]

[0027] in, is the target feature map, is a convolution with a kernel size of n, is the feature splicing operation, Y is the multi-scale feature data, The pooling window size is The maximum pooling operation.

[0028] Optionally, the optimizing the target feature map based on the convolution block attention module to obtain the optimized target feature map includes:

[0029] Perform feature aggregation processing of global average pooling and global maximum pooling on the target feature map to obtain a channel description vector. The expression of the channel description vector is:

[0030] ,

[0031] in, is the channel description vector, H is the height of the target feature map, W is the width of the target feature map, is the target feature map;

[0032] The channel description vector is used based on the multi-layer perceptron to generate the channel attention weight matrix. The expression of the channel attention weight matrix is:

[0033] ,

[0034] in, is the channel attention weight matrix, is the activation function, MLP is the multi-layer perceptron, is the channel description vector;

[0035] The target feature map is subjected to channel attention enhancement based on the channel attention weight matrix to obtain the target feature map after channel attention enhancement. The expression of the target feature map after channel attention enhancement is:

[0036] ,

[0037] in, is the target feature map after channel attention enhancement, is the channel attention weight matrix, is the target feature map;

[0038] Perform maximum pooling, average pooling, and feature concatenation on the target feature map after channel attention enhancement to obtain the spatial attention weight matrix;

[0039] Based on the spatial attention weight matrix, the target feature map after channel attention enhancement is spatially enhanced to obtain the target feature map after spatial attention enhancement, and the target feature map after spatial attention enhancement is residually connected with the target feature map to obtain the optimized target feature map.

[0040] Optionally, the expression of the spatial attention weight matrix is:

[0041] ,

[0042] in, is the spatial attention weight matrix, is the activation function, is a convolution with a kernel size of n, is the feature splicing operation, is the maximum pooling operation, is the average pooling operation;

[0043] The expression of the optimization target feature map is:

[0044] ,

[0045] in, To optimize the target feature map, is the spatial attention weight matrix, is the target feature map after channel attention enhancement, is the target feature map.

[0046] Optionally, performing feature fusion enhancement processing on the optimized target feature map based on the feature pyramid network and the path aggregation network to obtain an enhanced feature map includes:

[0047] Based on the feature pyramid network combined with the upsampling operation, the high-level features in the optimized target feature map are scale-matched to obtain the high-level features after scale matching. The expression of the high-level features after scale matching is:

[0048] ,

[0049] in, is the high-level feature after scale matching, is the upsampling operation, For high-level features;

[0050] The high-level features after scale matching are fused with the low-level features in the optimized target feature map to obtain a fused feature map. The expression of the fused feature map is:

[0051] ,

[0052] in, is the fusion feature map, is the convolution operation, is the high-level feature after scale matching, For high-level features;

[0053] A downsampling operation is performed on the fused feature map based on the path aggregation network to obtain a fused feature map after the downsampling operation. The expression of the fused feature map after the downsampling operation is:

[0054] ,

[0055] in, is the fusion feature map after downsampling operation, is the downsampling operation, is the fusion feature map;

[0056] The fused feature map after the downsampling operation is subjected to convolution fusion processing to obtain an enhanced feature map.

[0057] Optionally, the identifying and classifying the stem length of Pleurotus geesteranus based on the enhanced feature map to obtain the identification and classification result of the stem length of Pleurotus geesteranus includes:

[0058] Based on the decoupling head, the enhanced feature map is used to identify and classify the stem length of the Pleurotus geesteranus to obtain the identification and classification results of the Pleurotus geesteranus stem length, wherein the decoupling head includes a classification branch and a regression branch;

[0059] The expression of the classification branch is:

[0060] ,

[0061] in, For classification branches, is a convolution with a kernel size of n, For combined modules, To enhance the feature map;

[0062] The expression of the regression branch is:

[0063] ,

[0064] in, is the regression branch, is a convolution with a kernel size of n, For combined modules, To enhance the feature map;

[0065] The total loss function of the decoupling head is expressed as:

[0066] ,

[0067] ,

[0068] ,

[0069] ,

[0070] Among them, L is the total loss function, is the classification loss function, is the weight coefficient of the classification loss function, is the positioning loss function, is the weight coefficient of the positioning loss function, is the confidence loss function, is the weight coefficient of the confidence loss function, is the number of positive samples, is the number of categories, is the true label, is the prediction probability, CIoU is the complete intersection-over-union loss function, is the prediction box, is the real frame, is the total number of samples, is the confidence level of the prediction.

[0071] In addition, the present invention also provides a deep learning-based identification and classification system for Pleurotus geesteranus stem length, the system comprising:

[0072] Image preprocessing module: used to collect the target image of Pleurotus geesteranus and preprocess the target image to obtain the preprocessed target image;

[0073] Feature extraction module: used to extract features from the pre-processed target image based on the main branch and bypass branch of the main module in the Pleurotus geesteranus identification and classification model to obtain multi-scale feature data;

[0074] Target feature map acquisition module: used to process multi-scale feature data based on the SPPF module to obtain the target feature map;

[0075] Enhanced feature map acquisition module: used to optimize the target feature map based on the convolution block attention module to obtain the optimized target feature map, and perform feature fusion enhancement processing on the optimized target feature map based on the feature pyramid network and path aggregation network to obtain the enhanced feature map;

[0076] Stem length recognition and classification module: used to identify and classify the stem length of Pleurotus geesteranus based on the enhanced feature map, and obtain the recognition and classification results of the stem length of Pleurotus geesteranus.

[0077] In an embodiment of the present invention, feature extraction is performed on the preprocessed target image based on the main branch and bypass branch of the trunk module to obtain multi-scale feature data. The main branch and bypass branch of the trunk module have powerful feature extraction capabilities, providing a rich feature basis for identifying Pleurotus geesteranus of different lengths, enabling the model to simultaneously focus on the local detail features and overall morphological features of the mushroom bag, laying a solid foundation for subsequent accurate classification. The multi-scale feature data is processed based on the SPPF module to obtain a target feature map, which can capture a wider range of contextual information. The target feature map is optimized based on the convolutional block attention module to obtain an optimized target feature map. The expressive power of the feature map is enhanced by jointly enhancing the channel and spatial attention, so that the network pays more attention to the key channels and spatial areas related to the length of the Pleurotus geesteranus stem, effectively suppressing background interference and occlusion noise. The optimized target feature map is enhanced by fusion processing based on a feature pyramid network and a path aggregation network. This generates an enhanced feature map. This network facilitates top-down transfer of high-level semantic information and bottom-up transfer of low-level positioning information, constructing an efficient feature fusion network with global perception, spatial focus, and scale adaptability. This provides more robust and accurate feature support for Pleurotus geesteranus target recognition and stem length classification. The enhanced feature map significantly reduces the false positive rate for Pleurotus geesteranus stem length recognition and improves the accuracy and reliability of stem length recognition and classification results. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 1 is a flow chart of a method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning in an embodiment of the present invention;

[0079] Figure 2 This is a schematic diagram of the structural composition of the deep learning-based Pleurotus geesteranus stem length identification and classification system in an embodiment of the present invention. DETAILED DESCRIPTION

[0080] To further illustrate the technical means and effects employed by this application to achieve its intended purpose, the following detailed description of the specific implementation methods, structures, features, and effects of this application is provided in conjunction with the accompanying drawings and preferred embodiments. In the following description, different references to "one embodiment" or "embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.

[0081] Example 1:

[0082] See also Figure 1 , Figure 1 : is a flow chart of a method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning in an embodiment of the present invention, the method comprising:

[0083] S11: collecting a target image of Pleurotus geesteranus and preprocessing the target image to obtain a preprocessed target image;

[0084] During the implementation of this invention, a camera regularly captures images of the Pleurotus geesteranus mushroom capsules, creating the target images. During acquisition, the camera is positioned at an appropriate height and angle to ensure clear images, a consistent background, and full coverage of the mushroom capsule area. The acquisition period spans from the initial fruiting stage to the later growth stage, when the cap reaches a length of 3–5 cm, fully encompassing the typical growth process of Pleurotus geesteranus. Preprocessing of the target images includes image noise reduction and image enhancement to produce the preprocessed target images.

[0085] S12: Based on the main branch and bypass branch of the main module in the Pleurotus geesteranus identification and classification model, feature extraction is performed on the preprocessed target image to obtain multi-scale feature data;

[0086] In a specific implementation process of the present invention, the main branch and the bypass branch of the trunk module in the Pleurotus geesteranus recognition and classification model perform feature extraction on the preprocessed target image to obtain multi-scale feature data, including: performing preliminary feature extraction on the preprocessed target image to obtain original input features, and dividing the original input features into channel dimensions to obtain a first preliminary feature map and a second preliminary feature map; based on the main branch, using the stacked bottleneck layer residual block to extract features from the first preliminary feature map to obtain first feature data, wherein the calculation expression of the first feature data is:

[0087] ,

[0088] in, is the first feature data, RELU is the activation function, is dilated convolution, is a depth-wise separable convolution, is the convolution with kernel size n, is the first preliminary feature map; based on the bypass branch, the second preliminary feature map is channel compressed to obtain second feature data; based on the combination of the first feature data and the second feature data, feature splicing and residual connection are performed to obtain multi-scale feature data.

[0089] Furthermore, the calculation expression of the second characteristic data is:

[0090] ,

[0091] in, is the second feature data, is the convolution with kernel size n, is the second preliminary feature map;

[0092] The calculation expression of the multi-scale feature data is:

[0093] ,

[0094] Among them, Y is the multi-scale feature data, is the feature splicing operation, is the first feature data, is the second feature data, and X is the original input feature.

[0095] Specifically, the Pleurotus geesteranus identification and classification model utilizes a modified YOLOv8 network, using YOLOv8's native CSPDarknet architecture as its backbone module. The C2f module serves as the core feature extraction module, integrating feature segmentation, cross-stage feature reuse, and a dynamic residual connection mechanism for efficient feature modeling. It integrates depthwise separable convolution and dilated convolution to further optimize computational efficiency and increase the receptive field. Preliminary feature extraction is performed on the preprocessed target image to obtain the original input features. The original input features are then partitioned along the channel dimension into a first preliminary feature map for the main branch and a second preliminary feature map for the bypass branch, resulting in the first and second preliminary feature maps. The main branch then extracts features from the first preliminary feature map using stacked bottleneck layer residual blocks to obtain the first feature data. The main branch is then used for deeper feature extraction. For the Pleurotus geesteranus feature extraction task, the main branch utilizes a stacked multi-layer convolutional neural network structure to extract complex features such as texture and contour, enhancing the model's ability to represent Pleurotus geesteranus at different growth stages. The computational expression for the first feature data is:

[0096] ,

[0097] in, is the first feature data, RELU is the activation function, is dilated convolution, is a depth-wise separable convolution, is the convolution with kernel size n, is the first preliminary feature map. Depthwise separable convolution can efficiently extract spatial features while reducing computational complexity. Dilated convolution expands the receptive field by introducing a dilation rate, thereby capturing a wider range of contextual information. The ReLU activation function introduces nonlinear expression capabilities, which helps enhance the model's expressiveness. Channel compression is performed on the second preliminary feature map based on the bypass branch to obtain the second feature data. This bypass branch performs channel compression on the second preliminary feature map, reducing computational complexity and extracting key features. The calculation expression for the second feature data is:

[0098] ,

[0099] in, is the second feature data, is the convolution with kernel size n, is the second preliminary feature map. Based on the combination of the first feature data and the second feature data, feature splicing and residual connection are performed to obtain multi-scale feature data. Feature splicing and residual connection can enhance the transferability of features and gradient fluidity, thereby optimizing the information propagation efficiency of the deep network. The calculation expression of the multi-scale feature data is:

[0100] ,

[0101] Among them, Y is the multi-scale feature data, is the feature splicing operation, is the first feature data, is the second feature data, and X is the original input feature.

[0102] S13: Process the multi-scale feature data based on the SPPF module to obtain the target feature map;

[0103] In the specific implementation process of the present invention, the multi-scale feature data is processed based on the SPPF module to obtain the target feature map, including: performing multi-scale pooling processing, feature splicing processing and convolution processing on the multi-scale feature data based on the SPPF module to obtain the target feature map.

[0104] Furthermore, the expression of the target feature map is:

[0105]

[0106] in, is the target feature map, is the convolution with kernel size n, is the feature splicing operation, Y is the multi-scale feature data, The pooling window size is The maximum pooling operation.

[0107] Specifically, the Spatial Pyramid Pooling-Fast (SPPF) module performs multi-scale pooling, feature concatenation, and convolution on multi-scale feature data. The SPPF module expands the receptive field of the feature map through multi-scale pooling operations, thereby capturing a wider range of contextual information and obtaining a target feature map. The expression of the target feature map is:

[0108]

[0109] in, is the target feature map, is the convolution with kernel size n, is the feature splicing operation, Y is the multi-scale feature data, The pooling window size is The maximum pooling operation.

[0110] S14: Optimizing the target feature map based on the convolutional block attention module to obtain an optimized target feature map, and performing feature fusion enhancement processing on the optimized target feature map based on the feature pyramid network and the path aggregation network to obtain an enhanced feature map;

[0111] In the specific implementation process of the present invention, the target feature map is optimized based on the convolution block attention module to obtain the optimized target feature map, including: performing feature aggregation processing of global average pooling and global maximum pooling on the target feature map to obtain a channel description vector, and the expression of the channel description vector is:

[0112] ,

[0113] in, is the channel description vector, H is the height of the target feature map, W is the width of the target feature map, is the target feature map; based on the multi-layer perceptron, the channel description vector is used to generate the channel attention weight matrix, and the expression of the channel attention weight matrix is:

[0114] ,

[0115] in, is the channel attention weight matrix, is the activation function, MLP is the multi-layer perceptron, is the channel description vector; based on the channel attention weight matrix, the target feature map is channel-attention enhanced to obtain the target feature map after channel attention enhancement. The expression of the target feature map after channel attention enhancement is:

[0116] ,

[0117] in, is the target feature map after channel attention enhancement, is the channel attention weight matrix, is the target feature map; the target feature map after channel attention enhancement is subjected to maximum pooling, average pooling and feature splicing to obtain a spatial attention weight matrix; based on the spatial attention weight matrix, the target feature map after channel attention enhancement is subjected to spatial attention enhancement to obtain a target feature map after spatial attention enhancement; the target feature map after spatial attention enhancement is subjected to residual connection processing with the target feature map to obtain an optimized target feature map.

[0118] Furthermore, the expression of the spatial attention weight matrix is:

[0119] ,

[0120] in, is the spatial attention weight matrix, is the activation function, is a convolution with a kernel size of n, is the feature splicing operation, is the maximum pooling operation, is the average pooling operation;

[0121] The expression of the optimization target feature map is:

[0122] ,

[0123] in, To optimize the target feature map, is the spatial attention weight matrix, is the target feature map after channel attention enhancement, is the target feature map.

[0124] Furthermore, the feature fusion enhancement processing of the optimized target feature map based on the feature pyramid network and the path aggregation network to obtain the enhanced feature map includes: performing scale matching on the high-level features in the optimized target feature map based on the feature pyramid network combined with the upsampling operation to obtain the high-level features after scale matching, and the expression of the high-level features after scale matching is:

[0125] ,

[0126] in, is the high-level feature after scale matching, is the upsampling operation, is a high-level feature; the high-level feature after scale matching is fused with the low-level feature in the optimized target feature map to obtain a fused feature map. The expression of the fused feature map is:

[0127] ,

[0128] in, is the fusion feature map, is the convolution operation, is the high-level feature after scale matching, is a high-level feature; a downsampling operation is performed on the fused feature map based on the path aggregation network to obtain a fused feature map after the downsampling operation. The expression of the fused feature map after the downsampling operation is:

[0129] ,

[0130] in, is the fusion feature map after downsampling operation, is the downsampling operation, is a fused feature map; the fused feature map after the downsampling operation is subjected to convolution fusion processing to obtain an enhanced feature map.

[0131] Specifically, after being processed by the SPPF module, the target feature map obtained has the ability to express multi-scale features and achieves optimized computational efficiency. However, it is difficult to fully explore key features by relying solely on multi-scale pooling. For this reason, a convolutional block attention module is introduced. The convolutional block attention module adaptively adjusts the importance of different channels in the feature map through the combined effect of channel attention and spatial attention. The channel attention mechanism prioritizes feature channels that are highly correlated with the length of the mushroom bag, enhances the expression of global semantic features while suppressing secondary channel information, and effectively overcomes the feature ambiguity problems caused by occlusion, angle changes, and uneven illumination. The spatial attention mechanism accurately locates core feature areas such as the edge and structural distribution of the mushroom bag, effectively suppresses background interference information, and significantly improves the model's ability to recognize the length characteristics of the Pleurotus geesteranus stem, especially in challenging scenarios such as complex backgrounds, illumination changes, and partial occlusion. The target feature map is subjected to feature aggregation processing using global average pooling and global maximum pooling to obtain a channel description vector. The expression of the channel description vector is:

[0132] ,

[0133] in, is the channel description vector, H is the height of the target feature map, W is the width of the target feature map, is the target feature map, and the channel description vector is used to accurately reflect the importance of the channel. The channel attention weight matrix is ​​generated based on the channel description vector using a multi-layer perceptron. The multi-layer perceptron is a multi-layer perceptron with shared weights. The expression of the channel attention weight matrix is:

[0134] ,

[0135] in, is the channel attention weight matrix, is the activation function, MLP is the multi-layer perceptron, is the channel description vector. Based on the channel attention weight matrix, the target feature map is enhanced with channel attention to obtain the target feature map after channel attention enhancement. The expression of the target feature map after channel attention enhancement is:

[0136] ,

[0137] in, is the target feature map after channel attention enhancement, is the channel attention weight matrix, is the target feature map. The target feature map after channel attention enhancement is subjected to maximum pooling, average pooling and feature concatenation to obtain a spatial attention weight matrix. The expression of the spatial attention weight matrix is:

[0138] ,

[0139] in, is the spatial attention weight matrix, is the activation function, is the convolution with kernel size n, is the feature splicing operation, is the maximum pooling operation, is an average pooling operation. Based on the spatial attention weight matrix, the target feature map after channel attention enhancement is subjected to spatial attention enhancement processing. That is, the spatial attention weight matrix is ​​applied pixel by pixel to the target feature map after channel attention enhancement to obtain the target feature map after spatial attention enhancement. The target feature map after spatial attention enhancement is subjected to residual connection processing with the target feature map to obtain the optimized target feature map. The expression of the optimized target feature map is:

[0140] ,

[0141] in, To optimize the target feature map, is the spatial attention weight matrix, is the target feature map after channel attention enhancement, is the target feature map. The optimized target feature map obtained by the convolution block attention module significantly enhances the key feature expression related to the detection task while retaining the original multi-scale information. This optimized feature representation provides a more accurate input basis for subsequent processing. Then the dual architecture of the feature pyramid network and the path aggregation network is adopted to further optimize the feature fusion process. The feature pyramid network receives the optimized target feature map as input. Its core idea is to use a top-down information transfer mechanism to enable the semantic information of high-level features to propagate in multi-scale space, thereby improving the target detection performance. Based on the feature pyramid network combined with the upsampling operation, the high-level features in the optimized target feature map are scale-matched, that is, the high-level features are scale-matched through the upsampling operation to align them with the low-level features, and the high-level features after scale matching are obtained. The expression of the high-level features after scale matching is:

[0142] ,

[0143] in, is the high-level feature after scale matching, is the upsampling operation, is a high-level feature. The high-level features after scale matching are fused with the low-level features in the optimized target feature map to obtain a fused feature map. Feature fusion is performed through convolution transformation operations, so that the rich semantic information of the high-level features complements the detailed information of the low-level features. The expression of the fused feature map is:

[0144] ,

[0145] in, is the fusion feature map, is the convolution operation, is the high-level feature after scale matching, is a high-level feature. At the same time, the feature pyramid network also constructs a feature pyramid through multi-level feature fusion, so that features of different scales can be effectively combined, and the generated feature set is as follows:

[0146] .

[0147] Based on the path aggregation network, the fused feature map is downsampled to obtain the fused feature map after the downsampling operation. The path aggregation network provides a bottom-up complementary path, which maps the low-level features to the high-level feature scale through the downsampling operation. The expression of the fused feature map after the downsampling operation is:

[0148] ,

[0149] in, is the fusion feature map after downsampling operation, is the downsampling operation, is the fused feature map. The fused feature map after downsampling is subjected to convolution fusion processing to obtain the enhanced feature map. The expression of the enhanced feature map can be:

[0150] ,

[0151] in, To enhance the feature map, Conv is a convolution operation. is the fusion feature map after downsampling operation, The bidirectional feature fusion mechanism combining the feature pyramid network and the path aggregation network ensures the full interaction and utilization of feature information at different levels, significantly improving the overall robustness of Pleurotus geesteranus detection.

[0152] S15: Identify and classify the stem length of Pleurotus geesteranus based on the enhanced feature map to obtain an identification and classification result of the stem length of Pleurotus geesteranus.

[0153] In a specific implementation of the present invention, the identification and classification of the stem length of Pleurotus geesteranus based on the enhanced feature map to obtain the identification and classification result of the stem length of Pleurotus geesteranus includes: using the enhanced feature map based on the decoupling head to identify and classify the stem length of Pleurotus geesteranus to obtain the identification and classification result of the stem length of Pleurotus geesteranus, wherein the decoupling head includes a classification branch and a regression branch; the expression of the classification branch is:

[0154] ,

[0155] in, For classification branches, is the convolution with kernel size n, For combined modules, To enhance the feature map;

[0156] The expression of the regression branch is:

[0157] ,

[0158] in, is the regression branch, is the convolution with kernel size n, For combined modules, To enhance the feature map;

[0159] The total loss function of the decoupling head is expressed as:

[0160] ,

[0161] ,

[0162] ,

[0163] ,

[0164] Among them, L is the total loss function, is the classification loss function, is the weight coefficient of the classification loss function, is the positioning loss function, is the weight coefficient of the positioning loss function, is the confidence loss function, is the weight coefficient of the confidence loss function, is the number of positive samples, is the number of categories, is the true label, is the prediction probability, CIoU is the complete intersection-over-union loss function, is the prediction box, is the real frame, is the total number of samples, is the confidence level of the prediction.

[0165] Specifically, based on the decoupling head, the enhanced feature map is used to identify and classify the stem length of Pleurotus geesteranus, and the identification and classification results of the stem length of Pleurotus geesteranus are obtained. The decoupling head structure is used to separate the classification task from the positioning task, effectively alleviating the conflict problem of feature expression and improving the accuracy of Pleurotus geesteranus classification and detection. The decoupling head includes a classification branch and a regression branch; the expression of the classification branch is:

[0166] ,

[0167] in, For classification branches, is a convolution with a kernel size of n, For combined modules, To enhance the feature map, This is a combined module consisting of Conv+BatchNorm+SiLu functions. The decoupling head uses independent feature extraction paths, allowing the classification branch to focus on learning the categorical features of Pleurotus geesteranus, including stem length categories of 0 cm, 1-3 cm, and 3-5 cm. A length of 0 cm indicates that the Pleurotus geesteranus has not yet grown; a length of 1-3 cm indicates that the Pleurotus geesteranus is in the early stages of growth; and a length of 3-5 cm indicates that the Pleurotus geesteranus has entered the late growth stage, when manual intervention with lighting is often required to inhibit further stem growth and promote normal cap development. Control measures at this stage have a significant impact on the appearance quality and ultimate yield of Pleurotus geesteranus. The regression branch, on the other hand, focuses on accurately locating the position and boundaries of the Pleurotus geesteranus.

[0168] The expression of the regression branch is:

[0169] ,

[0170] in, is the regression branch, is a convolution with a kernel size of n, For combined modules, To enhance the feature map, the regression branch generates predictions related to the target location, including target confidence (indicating the probability of an Oyster Mushroom at that location) and bounding box offsets (the spatial offset relative to the pre-set anchor points). Simultaneously, the classification branch outputs class probabilities, indicating the probability distribution of the detected target belonging to each stem length category, including 0 cm, 1-3 cm, and 3-5 cm. This dual-branch design significantly improves the accuracy of Oyster Mushroom stem length detection by decoupling the localization and classification tasks. The regression branch ensures accurate spatial localization, while the classification branch focuses on distinguishing stem length intervals. The two branches work together to improve the accuracy of Oyster Mushroom stem length identification and classification. Furthermore, based on the decoupled head architecture, the classification and regression branches are applied separately at each feature level, forming a complete multi-scale prediction network. Each output scale feature map is processed by the corresponding decoupled head, enabling detection and classification of Oyster Mushrooms at different resolutions. Given the large size variation of Oyster Mushrooms at different growth stages (ranging from 0 cm to 3-5 cm), single-scale detection is difficult to address across all sizes. Therefore, a multi-scale prediction strategy was adopted, rationally utilizing the multi-level feature maps of the feature pyramid network to perform detection at different resolutions. For each feature map, a specific set of anchor points was designed to accommodate Pleurotus geesteranus targets of varying sizes. To fully leverage the advantages of the decoupling head, a decoupling loss function matching the network structure was employed to optimize the outputs of the classification and regression branches, respectively. The total loss function of the decoupling head is expressed as:

[0171] ,

[0172] ,

[0173] ,

[0174] ,

[0175] Among them, L is the total loss function, is the classification loss function, is the weight coefficient of the classification loss function, is the positioning loss function, is the weight coefficient of the positioning loss function, is the confidence loss function, is the weight coefficient of the confidence loss function, is the number of positive samples, is the number of categories, is the true label, is the prediction probability, CIoU is the complete intersection-over-union loss function, is the prediction box, is the real frame, is the total number of samples, is the confidence level of the prediction.

[0176] The classification loss is calculated only for positive samples containing P. geesteranus, ensuring that the classification branch focuses on learning distinguishing features between different stem length categories. CIoU takes into account factors such as bounding box overlap area, center point distance, and aspect ratio, enabling a more comprehensive assessment of the quality of bounding box predictions. The localization loss is calculated only for positive samples, allowing the regression branch to focus on optimizing bounding box coordinate predictions. The confidence loss is calculated for all samples, helping the model distinguish between background and P. geesteranus targets. This decoupled loss function design is highly compatible with the decoupling head architecture, enabling the network to separately optimize classification accuracy and localization accuracy, avoiding mutual interference between different tasks and thereby improving the overall performance of P. geesteranus stem length detection and classification.

[0177] In an embodiment of the present invention, feature extraction is performed on the preprocessed target image based on the main branch and bypass branch of the trunk module to obtain multi-scale feature data. The main branch and bypass branch of the trunk module have powerful feature extraction capabilities, providing a rich feature basis for identifying Pleurotus geesteranus of different lengths, enabling the model to simultaneously focus on the local detail features and overall morphological features of the mushroom bag, laying a solid foundation for subsequent accurate classification. The multi-scale feature data is processed based on the SPPF module to obtain a target feature map, which can capture a wider range of contextual information. The target feature map is optimized based on the convolutional block attention module to obtain an optimized target feature map. The expressive power of the feature map is enhanced by jointly enhancing the channel and spatial attention, so that the network pays more attention to the key channels and spatial areas related to the length of the Pleurotus geesteranus stem, effectively suppressing background interference and occlusion noise. The optimized target feature map is enhanced by fusion processing based on a feature pyramid network and a path aggregation network. This generates an enhanced feature map. This network facilitates top-down transfer of high-level semantic information and bottom-up transfer of low-level positioning information, constructing an efficient feature fusion network with global perception, spatial focus, and scale adaptability. This provides more robust and accurate feature support for Pleurotus geesteranus target recognition and stem length classification. The enhanced feature map significantly reduces the false positive rate for Pleurotus geesteranus stem length recognition and improves the accuracy and reliability of stem length recognition and classification results.

[0178] Example 2:

[0179] See also Figure 2 , Figure 2 : is a schematic diagram of the structure of a deep learning-based identification and classification system for Pleurotus geesteranus stem length in an embodiment of the present invention, the system comprising:

[0180] Image preprocessing module 21: used for collecting the target image of Pleurotus geesteranus and preprocessing the target image to obtain the preprocessed target image;

[0181] Feature extraction module 22: used to extract features from the pre-processed target image based on the main branch and bypass branch of the main module in the Pleurotus geesteranus identification and classification model to obtain multi-scale feature data;

[0182] Target feature map acquisition module 23: used to process the multi-scale feature data based on the SPPF module to obtain a target feature map;

[0183] Enhanced feature map acquisition module 24: used to optimize the target feature map based on the convolution block attention module to obtain an optimized target feature map, and perform feature fusion enhancement processing on the optimized target feature map based on the feature pyramid network and the path aggregation network to obtain an enhanced feature map;

[0184] The stem length recognition and classification module 25 is used to recognize and classify the stem length of Pleurotus geesteranus based on the enhanced feature map, and obtain the recognition and classification results of the stem length of Pleurotus geesteranus.

[0185] In the specific implementation process of the present invention, the specific implementation methods of the system items can be referred to the above embodiments, which will not be repeated here.

[0186] In an embodiment of the present invention, feature extraction is performed on the preprocessed target image based on the main branch and bypass branch of the trunk module to obtain multi-scale feature data. The main branch and bypass branch of the trunk module have powerful feature extraction capabilities, providing a rich feature basis for identifying Pleurotus geesteranus of different lengths, enabling the model to simultaneously focus on the local detail features and overall morphological features of the mushroom bag, laying a solid foundation for subsequent accurate classification. The multi-scale feature data is processed based on the SPPF module to obtain a target feature map, which can capture a wider range of contextual information. The target feature map is optimized based on the convolutional block attention module to obtain an optimized target feature map. The expressive power of the feature map is enhanced by jointly enhancing the channel and spatial attention, so that the network pays more attention to the key channels and spatial areas related to the length of the Pleurotus geesteranus stem, effectively suppressing background interference and occlusion noise. The optimized target feature map is enhanced by fusion processing based on a feature pyramid network and a path aggregation network. This generates an enhanced feature map. This network facilitates top-down transfer of high-level semantic information and bottom-up transfer of low-level positioning information, constructing an efficient feature fusion network with global perception, spatial focus, and scale adaptability. This provides more robust and accurate feature support for Pleurotus geesteranus target recognition and stem length classification. The enhanced feature map significantly reduces the false positive rate for Pleurotus geesteranus stem length recognition and improves the accuracy and reliability of stem length recognition and classification results.

[0187] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, which may include: a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0188] In addition, the above is a detailed introduction to a deep learning-based Pleurotus geesteranus stem length identification and classification method and system provided in an embodiment of the present invention. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

[0189] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present application should be included in the scope of protection of the present application.

Claims

1. A method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning, characterized in that: The method comprises: collecting a target image of Pleurotus geesteranus and preprocessing the target image to obtain a preprocessed target image; Based on the main branch and bypass branch of the backbone module in the Pleurotus geesteranus identification and classification model, the pre-processed target image is subjected to feature extraction to obtain multi-scale feature data. Process the multi-scale feature data based on the SPPF module to obtain the target feature map; The target feature map is optimized based on the convolution block attention module to obtain the optimized target feature map, and the optimized target feature map is enhanced by feature fusion based on the feature pyramid network and path aggregation network to obtain the enhanced feature map; The identification and classification of Pleurotus geesteranus stem length is performed based on the enhanced feature map, and the identification and classification results of Pleurotus geesteranus stem length are obtained.

2. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 1, characterized in that: The main branch and the bypass branch of the trunk module in the Pleurotus geesteranus identification and classification model extract features from the preprocessed target image to obtain multi-scale feature data, including: Performing preliminary feature extraction on the preprocessed target image to obtain original input features, and dividing the original input features into channel dimensions to obtain a first preliminary feature map and a second preliminary feature map; Based on the main branch, the first preliminary feature map is extracted using the stacked bottleneck layer residual blocks to obtain first feature data. The calculation expression of the first feature data is: , in, is the first feature data, RELU is the activation function, is dilated convolution, is a depth-wise separable convolution, is a convolution with a kernel size of n, is the first preliminary feature map; Performing channel compression on the second preliminary feature map based on the bypass branch to obtain second feature data; Feature concatenation and residual connection are performed based on the combination of the first feature data and the second feature data to obtain multi-scale feature data.

3. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 2, characterized in that: The calculation expression of the second characteristic data is: , in, is the second feature data, is a convolution with a kernel size of n, is the second preliminary feature map; The calculation expression of the multi-scale feature data is: , Among them, Y is the multi-scale feature data, is the feature splicing operation, is the first feature data, is the second feature data, and X is the original input feature.

4. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 1, characterized in that: The SPPF module is used to process the multi-scale feature data to obtain a target feature map, including: Based on the SPPF module, multi-scale pooling processing, feature splicing processing and convolution processing are performed on the multi-scale feature data to obtain the target feature map.

5. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 4, characterized in that: The expression of the target feature map is: in, is the target feature map, is a convolution with a kernel size of n, is the feature splicing operation, Y is the multi-scale feature data, The pooling window size is The maximum pooling operation.

6. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 1, characterized in that: The target feature map is optimized based on the convolution block attention module to obtain the optimized target feature map, including: Perform feature aggregation processing of global average pooling and global maximum pooling on the target feature map to obtain a channel description vector. The expression of the channel description vector is: , in, is the channel description vector, H is the height of the target feature map, W is the width of the target feature map, is the target feature map; The channel description vector is used based on the multi-layer perceptron to generate the channel attention weight matrix. The expression of the channel attention weight matrix is: , in, is the channel attention weight matrix, is the activation function, MLP is the multi-layer perceptron, is the channel description vector; The target feature map is subjected to channel attention enhancement based on the channel attention weight matrix to obtain the target feature map after channel attention enhancement. The expression of the target feature map after channel attention enhancement is: , in, is the target feature map after channel attention enhancement, is the channel attention weight matrix, is the target feature map; Perform maximum pooling, average pooling, and feature concatenation on the target feature map after channel attention enhancement to obtain the spatial attention weight matrix; Based on the spatial attention weight matrix, the target feature map after channel attention enhancement is spatially enhanced to obtain the target feature map after spatial attention enhancement, and the target feature map after spatial attention enhancement is residually connected with the target feature map to obtain the optimized target feature map.

7. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 6, characterized in that: The expression of the spatial attention weight matrix is: , in, is the spatial attention weight matrix, is the activation function, is a convolution with a kernel size of n, is the feature splicing operation, is the maximum pooling operation, is the average pooling operation; The expression of the optimization target feature map is: , in, To optimize the target feature map, is the spatial attention weight matrix, is the target feature map after channel attention enhancement, is the target feature map.

8. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 1, characterized in that: The feature fusion enhancement processing of the optimized target feature map based on the feature pyramid network and the path aggregation network to obtain the enhanced feature map includes: Based on the feature pyramid network combined with the upsampling operation, the high-level features in the optimized target feature map are scale-matched to obtain the high-level features after scale matching. The expression of the high-level features after scale matching is: , in, is the high-level feature after scale matching, is the upsampling operation, For high-level features; The high-level features after scale matching are fused with the low-level features in the optimized target feature map to obtain a fused feature map. The expression of the fused feature map is: , in, is the fusion feature map, is the convolution operation, is the high-level feature after scale matching, For high-level features; A downsampling operation is performed on the fused feature map based on the path aggregation network to obtain a fused feature map after the downsampling operation. The expression of the fused feature map after the downsampling operation is: , in, is the fusion feature map after downsampling operation, is the downsampling operation, is the fusion feature map; The fused feature map after the downsampling operation is subjected to convolution fusion processing to obtain an enhanced feature map.

9. The method for identifying and classifying the stem length of Pleurotus geesteranus based on deep learning according to claim 1, characterized in that: The identification and classification of the stem length of Pleurotus geesteranus based on the enhanced feature map to obtain the identification and classification result of the stem length of Pleurotus geesteranus includes: Based on the decoupling head, the enhanced feature map is used to identify and classify the stem length of the Pleurotus geesteranus to obtain the identification and classification results of the Pleurotus geesteranus stem length, wherein the decoupling head includes a classification branch and a regression branch; The expression of the classification branch is: , in, For classification branches, is a convolution with a kernel size of n, For combined modules, To enhance the feature map; The expression of the regression branch is: , in, is the regression branch, is a convolution with a kernel size of n, For combined modules, To enhance the feature map; The total loss function of the decoupling head is expressed as: , , , , Among them, L is the total loss function, is the classification loss function, is the weight coefficient of the classification loss function, is the positioning loss function, is the weight coefficient of the positioning loss function, is the confidence loss function, is the weight coefficient of the confidence loss function, is the number of positive samples, is the number of categories, is the true label, is the prediction probability, CIoU is the complete intersection-over-union loss function, is the prediction box, is the real frame, is the total number of samples, is the confidence level of the prediction.

10. A corresponding system using the deep learning-based identification and classification method for Pleurotus geesteranus stem length according to any one of claims 1 to 9, characterized in that: The system comprises: Image preprocessing module: used to collect the target image of Pleurotus geesteranus and preprocess the target image to obtain the preprocessed target image; Feature extraction module: used to extract features from the pre-processed target image based on the main branch and bypass branch of the main module in the Pleurotus geesteranus identification and classification model to obtain multi-scale feature data; Target feature map acquisition module: used to process multi-scale feature data based on the SPPF module to obtain the target feature map; Enhanced feature map acquisition module: used to optimize the target feature map based on the convolution block attention module to obtain the optimized target feature map, and perform feature fusion enhancement processing on the optimized target feature map based on the feature pyramid network and path aggregation network to obtain the enhanced feature map; Stem length recognition and classification module: used to identify and classify the stem length of Pleurotus geesteranus based on the enhanced feature map, and obtain the recognition and classification results of the stem length of Pleurotus geesteranus.