A lentinus edodes number and maturity classification and identification method and system based on YOLO-ALM
By improving the YOLO-ALM model and systematic identification methods, the problem of automating the statistics of shiitake mushroom quantity and maturity was solved, achieving efficient and accurate shiitake mushroom detection and improving the level of intelligence and digitalization in production management.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QINGDAO AGRI UNIV
- Filing Date
- 2026-03-25
- Publication Date
- 2026-06-05
AI Technical Summary
In existing technologies, the statistics on the number and maturity of shiitake mushrooms mainly rely on manual methods, which leads to low efficiency, susceptibility to subjective experience, and large errors. It is difficult to achieve stable and reliable automatic identification of densely distributed, significantly scaled, and partially obscured shiitake mushroom targets.
An improved YOLO-ALM target detection model is adopted. By optimizing the backbone structure, introducing an adaptive downsampling module and a multi-scale feature enhancement mechanism, and combining the MPDIoU loss function, the detection capability of densely distributed, small-scale and partially occluded mushroom targets is improved. A recognition system integrating image acquisition, edge computing and cloud management is constructed.
It enables precise and automatic identification of the quantity and maturity of shiitake mushrooms, improves the accuracy and stability of detection, provides a reliable basis for scientific harvesting decisions, enhances production efficiency and management level, and promotes the digital upgrade of the edible fungi industry.
Smart Images

Figure CN122157246A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of shiitake mushroom cultivation technology, and more specifically, to a method and system for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM. Background Technology
[0002] Shiitake mushrooms, as one of my country's traditional advantageous edible fungi varieties, have a long cultivation history and widespread market demand. With the continuous improvement of agricultural modernization, edible fungi production is gradually developing towards large-scale, standardized, and factory-like operations. Optimizing shiitake mushroom production models and strengthening the application of information and intelligent technologies in the production process can effectively improve production efficiency and unit yield, reduce labor costs, and mitigate management risks caused by human error. Among numerous intelligent vision technologies, the YOLO series of algorithms, due to its end-to-end detection framework structure and high real-time inference performance, has become one of the most widely used target detection methods in industrial visual inspection and agricultural intelligent sensing.
[0003] The YOLO algorithm possesses excellent generalization ability and strong adaptability, enabling efficient identification and localization of different target categories through training on specific datasets. Therefore, this type of algorithm has achieved satisfactory application results in various fields such as traffic monitoring, industrial inspection, crop identification, and pest and disease monitoring. With the continuous development of deep learning technology, improved models based on the YOLO framework are constantly emerging, demonstrating significant advantages in improving detection accuracy, optimizing model structure, and enhancing the ability to identify small targets, providing a technological foundation for intelligent agricultural production.
[0004] Currently, in shiitake mushroom production, the determination of growth stages and the statistical analysis of yield still rely primarily on manual methods. This method is not only cumbersome and inefficient, but also susceptible to subjective biases in large-scale production environments, leading to statistical errors and consuming significant human resources. Since shiitake mushrooms typically exhibit dense distribution, significant scale variations, and partial occlusion, traditional manual or simple image processing methods struggle to achieve stable and reliable automatic identification. Therefore, effectively applying target detection algorithms to shiitake mushroom maturity identification and automatic quantity counting, achieving a balance between detection accuracy and real-time performance, and improving the intelligence and operational efficiency of shiitake mushroom production management, has become a pressing technical problem. To address this, we propose a YOLO-ALM-based method and system for classifying and identifying the number and maturity of shiitake mushrooms. Summary of the Invention
[0005] 1. Technical problems to be solved The purpose of this invention is to provide a method and system for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM, so as to solve the problems mentioned in the background art.
[0006] 2. Technical Solution This invention is achieved through the following technical solution: A method and system for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM, including As an optional solution to the technical solution in this application, 3. Beneficial effects Compared with the prior art, the beneficial effects of the present invention are: 1) This application uses an improved YOLO-ALM target detection model to perform number statistics and maturity classification on the acquired images. By optimizing the backbone structure, introducing an adaptive downsampling module and a multi-scale feature enhancement mechanism, the detection capability of densely distributed, small-scale and partially occluded shiitake mushroom targets is significantly improved. At the same time, the MPDIoU loss function is used to enhance the accuracy of bounding box regression, so as to achieve fine classification and accurate positioning of shiitake mushrooms at different growth stages, thereby improving the accuracy and stability of statistical results, providing a reliable basis for scientific harvesting decisions, and thus improving the production efficiency of shiitake mushrooms.
[0007] 2) This application constructs a system for classifying and recognizing the number and maturity of shiitake mushrooms by integrating image acquisition, edge computing and cloud management. Through image acquisition terminals, edge computing units and data transmission modules deployed in mushroom sheds, continuous image acquisition and preprocessing of shiitake mushroom growth areas are realized. By stably acquiring high-quality image data, the detection accuracy and data reliability are improved from the source, providing a stable data foundation for subsequent intelligent recognition.
[0008] 3) This application realizes the transformation of the shiitake mushroom production process from traditional manual statistics to intelligent and automated management mode. Through continuous monitoring and accumulation of shiitake mushroom growth data, it can provide data support for yield prediction, production rhythm optimization and resource allocation, enhance the controllability and traceability of the factory planting process, and has significant practical application value for promoting the digital upgrading of the edible fungi industry. Attached Figure Description
[0009] Figure 1 This is a schematic diagram of the Mamba-YOLO network model structure; Figure 2 This is a schematic diagram of the YOLO-ALM network model structure; Figure 3 This is a schematic diagram of the ADown structure; Figure 4 This is a schematic diagram of the SPPF_LSKA structure; Figure 5 This is a schematic diagram of the XSSBlock structure; Figure 6This is a performance comparison chart of the YOLO-ALM network model and Mamba-YOLO in different categories of mushroom detection tasks; Figure 7 This is a graph showing the results of the YOLO-ALM network model in identifying the maturity of shiitake mushrooms. Detailed Implementation
[0010] This solution is based on the Mamba-YOLO network model as its framework, such as Figure 1 As shown. The Mamba-YOLO network model adopts a classic single-stage object detector architecture, consisting of three main parts that form an end-to-end detection process, including: The backbone network comprises Simple Stem, VSSBlock, Vision Clue Merge, and SPPF modules. This backbone network is used to extract features from the input shiitake mushroom image, and through layer-by-layer feature learning and fusion, it achieves the gradual expression and enhancement of the image's semantic information.
[0011] The Path Aggregation Feature Pyramid Network (PAFPN network) is used to construct the feature pyramid structure. In this part, the ODSSBlock module, upsampling, feature concatenation, and convolutional layers are combined to achieve effective fusion and optimization between features of different scales, thereby improving the model's ability to represent multi-scale targets.
[0012] A prediction head network is used to define the structure of a detection head, which includes different detection layers for small, medium and large targets to achieve accurate detection of targets at multiple scales.
[0013] The technical solution of the present invention will now be clearly and completely described in conjunction with the accompanying drawings.
[0014] Example 1: Please see Figure 2 This invention provides a method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM, comprising the following steps: Images of the shiitake mushroom growth environment are acquired, and the images are preprocessed, including size scaling, pixel normalization, and data format conversion. The preprocessed image is input into the YOLO-ALM target detection model for target detection and maturity classification, and the bounding box of the shiitake mushroom target, category information and confidence score are output. The recognition results are statistically analyzed in terms of total quantity and classification. The output includes images of shiitake mushrooms with visual detection boxes, as well as statistical information on the number of shiitake mushrooms and the maturity categories. The YOLO-ALM object detection model is based on the Mamba-YOLO network model. The number of repetitions of the VSSBlock module in each stage of its backbone structure is [5, 5, 7, 3]. The downsampling module is the ADown adaptive downsampling module. The SPPF module is replaced with the SPPF_LSKA module. The ODSSBlock module in the PAFPN feature fusion structure is replaced with the XSSBlock module. The bounding box regression loss function is the MPDIoU loss function.
[0015] This scheme deepens and restructures the original network backbone, adjusting the number of repetitions of the VSSBlock module in each stage from the original configuration [3, 3, 9, 3] to [5, 5, 7, 3]. In the first and second stages, the module stacking depth is increased to enhance the shallow feature extraction capability. In the third stage, the number of stacks is moderately compressed to control the parameter scale while maintaining high expressive power. In the fourth stage, three stacks are maintained to stabilize the high-level semantic expression, thereby improving the sufficiency of feature extraction while ensuring that the computational complexity of the model is controllable.
[0016] like Figure 3 As shown, the ADown adaptive downsampling module includes a convolutional path and a feature reconstruction path. The convolutional path uses a convolution operation with a stride of 2 to halve the spatial size. The feature reconstruction path preserves the original detailed information by grouping or rearranging the input features in the channel dimension. The outputs of the two paths are fused in the channel dimension to output the next-level feature map, so as to achieve more stable feature scale compression with stronger information preservation ability, thereby reducing information loss while completing downsampling and improving the ability to preserve the edge and texture details of the mushroom.
[0017] like Figure 4 As shown, the SPPF_LSKA module has 1024 output channels, a kernel size of 5, and maintains the same size as the backbone network feature map.
[0018] In the PAFPN feature fusion structure, the C5 feature map output from the Backbone structure is upsampled by 2x and concatenated with the C3 feature map output from the Backbone structure in the channel dimension. Then, it is processed by the XSSBlock module three times to obtain the intermediate feature. The intermediate feature is then upsampled by 2x and concatenated with the C2 feature map output from the Backbone structure. Finally, it is processed by the XSSBlock module three times to obtain the P3 target detection feature map. The P3 target detection feature map is downsampled using the ADown module and concatenated with the intermediate features. The P4 target detection feature map is obtained by passing the XSSBlock module three times. The P4 target detection feature map is downsampled by the ADown module and concatenated with the C5 feature map output from the Backbone structure. The P5 target detection feature map is obtained by passing the XSSBlock module three times.
[0019] like Figure 5 As shown, the XSSBlock module includes a cross-scale feature extraction unit and a residual connection unit. The input features are first compressed and linearly transformed through 1×1 convolution. Then, multiple stacked SS2D modules are used for feature extraction, so that the features undergo multiple rounds of selective scanning and state space transformation to capture contextual information of different directions and scales. During the feature extraction process, the correlation between response regions of different scales is enhanced through a cross-scale information interaction mechanism, thereby improving the detection capability of densely distributed mushroom targets with significant scale changes.
[0020] The dimensions of the P3 target detection feature map, P4 target detection feature map, and P5 target detection feature map are 1 / 8, 1 / 16, and 1 / 32 of the size of the input detection image of the YOLO-ALM target detection model, respectively.
[0021] The detection head performs category prediction and bounding box regression prediction on the three-scale P3 target detection feature maps, P4 target detection feature maps and P5 target detection feature maps, respectively.
[0022] The YOLO-ALM object detection model is obtained through the following training steps: Obtain several sets of shiitake mushroom growth images and construct a shiitake mushroom growth period dataset. The shiitake mushroom growth period dataset was annotated using a graphical annotation tool; The labeled dataset is randomly divided into training, validation and test sets. Construct a YOLO-ALM object detection model, input the training set into the model for iterative training, and update the model weight parameters; The model performance is evaluated on the validation set, and the training parameters are adjusted based on the evaluation results. Final performance verification was performed on the test set to obtain the optimal model weights.
[0023] The ratio of training set, validation set, and test set can be set to 7:2:1; replace the CIoU bounding box regression loss function in the original network with the MPDIoU loss function; The MPDIoU loss function, while considering the intersection-union ratio (IU) between the predicted and ground truth bounding boxes, introduces a multi-dimensional penalty term based on the difference in center point distance and aspect ratio. By modeling the minimum point distance between the predicted and ground truth bounding boxes, it enhances the constraint on geometric relationships during bounding box regression, thereby improving localization accuracy and convergence speed in dense target scenes. The mathematical definition of MPDIoU is as follows:
[0024]
[0025]
[0026] in, and These represent the distances between the top-left and bottom-right corners of the ground truth bounding box A and the predicted bounding box B, respectively. and The width and height of the input image; and These represent the coordinates of the top left and bottom right corners of the prediction box, respectively. and These represent the coordinates of the top-left and bottom-right corners of the actual bounding box, respectively.
[0027] like Figure 6 As shown, the performance of the Mamba-YOLO and YOLO-ALM models in different categories of shiitake mushroom detection tasks was compared and analyzed. The metrics in the figure are explained as follows: P (Precision) represents the proportion of truly positive samples among those predicted as positive by the model; R (Recall) represents the proportion of all truly positive samples correctly detected by the model; mAP@50 (Mean Average Precision @ loU=0.5) refers to the mean precision calculated when the loU (cross-union ratio) is 0.5. The categories are explained as follows: Raw (immature) refers to immature shiitake mushrooms; Mature (mature) refers to mature shiitake mushrooms that have reached the harvesting standard; Defective (defective mushrooms) refers to shiitake mushrooms with diseases, damage, or appearance defects; Log (log) refers to the shiitake mushroom logs used for cultivation. Mamba-YOLO refers to the baseline model before improvement, and YOLO-ALM(ours) is the improved model described in this paper. The results show that YOLO-ALM achieved superior detection performance in most categories, particularly excelling in shiitake mushroom maturity discrimination and deformed shiitake mushroom identification. In immature shiitake mushroom detection, YOLO-ALM achieved an mAP@50 of 96.6%, a 0.2% improvement over Mamba-YOLO, while precision and recall increased to 95.5% and 93.8%, respectively, indicating that the model enhanced its ability to detect immature shiitake mushrooms while maintaining high accuracy. For mature shiitake mushrooms, YOLO-ALM's mAP@50 improved to 97.6%, a 0.9% improvement over the baseline model, demonstrating stronger feature representation and detection stability in the shiitake mushroom maturity discrimination task, thus enabling more accurate differentiation of shiitake mushroom growth stages. Notably, YOLO-ALM showed the most significant performance improvement in deformed shiitake mushroom detection, with an mAP@50 of 89.4%, an 8.7% improvement over Mamba-YOLO. This result demonstrates that the introduced improvement strategy significantly enhances the model's ability to model complex features such as morphological anomalies, blurred edges, and irregular appearances, making the model more sensitive to anomalous features during training and thus effectively improving the accuracy of identifying deformed shiitake mushrooms. This advantage is significant in practical production scenarios, effectively reducing the probability of deformed shiitake mushrooms mixed with commercial mushrooms, thereby reducing economic losses caused by quality issues. Furthermore, in the log category, both models achieved near-saturation detection performance, with YOLO-ALM achieving 99.5% mAP@50, consistent with Mamba-YOLO. This indicates that in target detection tasks with clear structures and stable features, the improved model maintains good generalization ability without sacrificing original performance. In summary, the above analysis shows that YOLO-ALM outperforms Mamba-YOLO in multi-category shiitake mushroom detection tasks, especially demonstrating significant advantages in maturity classification and deformed shiitake mushroom identification, validating the effectiveness and practical value of the proposed improved method in factory-scale edible fungi detection tasks.
[0028] like Figure 7 As shown, the YOLO-ALM network model can accurately distinguish and locate shiitake mushrooms at different maturity stages, with complete detection box coverage, clear category labeling, and high overall recognition accuracy. Simultaneously, the system can also identify deformed shiitake mushrooms that affect commercial value, enabling effective labeling and statistical analysis of abnormal individuals. This recognition result provides production managers with intuitive and reliable data support, transforming the traditional manual verification of shiitake mushroom quantity and maturity assessment into automated identification and summary analysis. This not only significantly improves statistical efficiency but also effectively reduces human error and missed detections, thereby lowering labor costs in the production process and improving overall management level and economic benefits.
[0029] Example 2: This embodiment provides a YOLO-ALM-based system for classifying and identifying the number and maturity of shiitake mushrooms, including: The image acquisition module is used to acquire images of the shiitake mushroom growth environment; The image preprocessing module is used to perform size scaling, pixel normalization, and data format conversion on the acquired images. The model inference module is equipped with a YOLO-ALM object detection model, which is used to perform object detection and maturity classification on the preprocessed image, and output the bounding box of the mushroom target, category information and confidence score. The results statistics module is used to perform total quantity statistics and classification statistics on the recognition results; The results output module is used to output images of shiitake mushrooms with visual detection boxes, as well as statistical information on the number of shiitake mushrooms and each maturity category. The YOLO-ALM target detection model is the model used in the method described in Example 1.
Claims
1. A method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM, characterized in that: Includes the following steps: Images of the shiitake mushroom growth environment are acquired, and the images are preprocessed, including size scaling, pixel normalization, and data format conversion. The preprocessed image is input into the YOLO-ALM target detection model for target detection and maturity classification, and the bounding box of the shiitake mushroom target, category information and confidence score are output. The recognition results are statistically analyzed in terms of total quantity and classification. The output includes images of shiitake mushrooms with visual detection boxes, as well as statistical information on the number of shiitake mushrooms and the maturity categories. The YOLO-ALM object detection model is based on the Mamba-YOLO network model. The number of repetitions of the VSSBlock module in each stage of its backbone structure is [5, 5, 7, 3]. The downsampling module is the ADown adaptive downsampling module. The SPPF module is replaced with the SPPF_LSKA module. The ODSSBlock module in the PAFPN feature fusion structure is replaced with the XSSBlock module. The bounding box regression loss function is the MPDIoU loss function.
2. The method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM according to claim 1, characterized in that: The ADown adaptive downsampling module includes a convolution path and a feature reconstruction path; the convolution path uses a convolution operation with a stride of 2 to halve the spatial size; the feature reconstruction path preserves the original detailed information by grouping or rearranging the input features in the channel dimension; the outputs of the two paths are fused in the channel dimension to output the next level feature map.
3. The method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM according to claim 1, characterized in that: The SPPF_LSKA module has 1024 output channels, a kernel size of 5, and maintains the same size as the backbone network feature map.
4. The method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM according to claim 1, characterized in that: In the PAFPN feature fusion structure, the C5 feature map output from the Backbone structure is upsampled by 2x and concatenated with the C3 feature map output from the Backbone structure in the channel dimension. Then, it is processed by the XSSBlock module three times to obtain the intermediate feature. The intermediate feature is then upsampled by 2x and concatenated with the C2 feature map output from the Backbone structure. Finally, it is processed by the XSSBlock module three times to obtain the P3 target detection feature map. The P3 target detection feature map is downsampled using the ADown module and concatenated with the intermediate features. The P4 target detection feature map is obtained by passing the XSSBlock module three times. The P4 target detection feature map is downsampled by the ADown module and concatenated with the C5 feature map output from the Backbone structure. The P5 target detection feature map is obtained by passing the XSSBlock module three times.
5. The method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM according to claim 1, characterized in that: The XSSBlock module includes a cross-scale feature extraction unit and a residual connection unit. The input features are first compressed and linearly transformed by 1×1 convolution. Then, multiple stacked SS2D modules are used for feature extraction, so that the features undergo multiple rounds of selective scanning and state space transformation to capture contextual information of different directions and scales. During feature extraction, a cross-scale information exchange mechanism is used to enhance the correlation between response regions at different scales.
6. The method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM according to claim 4, characterized in that: The dimensions of the P3, P4, and P5 target detection feature maps are 1 / 8, 1 / 16, and 1 / 32 of the size of the input detection image of the YOLO-ALM target detection model, respectively.
7. The method for classifying and identifying the number and maturity of shiitake mushrooms based on YOLO-ALM according to claim 1, characterized in that: The YOLO-ALM object detection model is obtained through the following training steps: Obtain several sets of shiitake mushroom growth images and construct a shiitake mushroom growth period dataset. The shiitake mushroom growth period dataset was annotated using a graphical annotation tool; The labeled dataset is randomly divided into training, validation and test sets. Construct a YOLO-ALM object detection model, input the training set into the model for iterative training, and update the model weight parameters; The model performance is evaluated on the validation set, and the training parameters are adjusted based on the evaluation results. Final performance verification was performed on the test set to obtain the optimal model weights.
8. A YOLO-ALM-based system for classifying and identifying the number and maturity of shiitake mushrooms, characterized in that: include: The image acquisition module is used to acquire images of the shiitake mushroom growth environment; The image preprocessing module is used to perform size scaling, pixel normalization, and data format conversion on the acquired images. The model inference module is equipped with a YOLO-ALM object detection model, which is used to perform object detection and maturity classification on the preprocessed image, and output the bounding box of the mushroom target, category information and confidence score. The results statistics module is used to perform total quantity statistics and classification statistics on the recognition results; The results output module is used to output images of shiitake mushrooms with visual detection boxes, as well as statistical information on the number of shiitake mushrooms and each maturity category. The YOLO-ALM target detection model is the model used in the method described in any one of claims 1-7.