Method and device for determining the breeding grade of lentinula edodes mushroom sticks
By using deep learning and image processing technologies, the phenotypic characteristics of shiitake mushroom spawn can be automatically identified and analyzed, solving the problems of subjectivity and low efficiency in traditional manual evaluation, and realizing the standardization and efficient evaluation of shiitake mushroom spawn breeding grades.
Patent Information
- Application Number
- CN202410568202.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2044-05-09
AI Technical Summary
Traditional manual evaluation of shiitake mushroom spawn breeding grades suffers from strong subjectivity, difficulty in standardization, and results in large discrepancies and low efficiency.
Using deep learning and image processing technologies, the system acquires multi-angle images of the outer surface of shiitake mushroom logs, performs semantic segmentation using the U-net network to identify the log area and background area, performs image stitching and binarization, calculates Euclidean distance, and automatically determines the breeding grade by combining preset association relationships.
The standardization and automated evaluation of shiitake mushroom spawn breeding grades have been achieved, improving the accuracy and efficiency of breeding grade determination and reducing human intervention and oversight.
Smart Images

Figure CN118691872B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of deep learning technology, and in particular to a method and apparatus for determining the breeding grade of shiitake mushroom spawn. Background Technology
[0002] This section is intended to provide background or context for the embodiments of the invention set forth in the claims. The description herein is not an admission that it is prior art simply because it is included in this section.
[0003] Shiitake mushroom logs are the substrate for shiitake mushroom growth. Under different environmental conditions, the mycelium on the surface of the logs exhibits different states, showing differences in color depth and color uniformity. Therefore, in order to accurately obtain phenotypic data of shiitake mushroom logs for judging the breeding grade of shiitake mushroom logs, an efficient and intelligent data collection and analysis system is needed.
[0004] Traditional methods of measurement mainly rely on sensory evaluation to assess and record the phenotype of shiitake mushroom spawn, thereby manually determining the breeding grade of shiitake mushroom spawn. This method suffers from strong subjectivity and difficulty in standardization, leading to potentially large differences in evaluation results. Furthermore, the inherent limitations of manual methods, such as oversights and low efficiency, result in low accuracy and efficiency in determining the breeding grade of shiitake mushroom spawn. Summary of the Invention
[0005] This invention provides a method for determining the breeding grade of shiitake mushroom spawn, thereby improving the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn. The method includes:
[0006] Acquire multiple images of the outer surface of the target shiitake mushroom log from various angles;
[0007] Each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image.
[0008] Image stitching is performed on the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching is based on the same image features between the target mushroom stick images from adjacent angles.
[0009] The unfolded image of the outer surface of the mushroom stick is binarized to determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; the Euclidean distance between the first average coordinates and the second average coordinates is calculated.
[0010] Based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn.
[0011] This invention also provides a device for determining the breeding grade of shiitake mushroom spawn, to improve the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn. The device includes:
[0012] The outer surface image acquisition module is used to acquire outer surface images from multiple angles around the target shiitake mushroom log;
[0013] The annotation data determination module is used to take each outer surface image as a target image and determine the target annotation data corresponding to the target image based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image.
[0014] The image stitching processing module is used to stitch together the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is based on the same image features between the target mushroom stick images from adjacent angles.
[0015] The binarization module is used to perform binarization processing on the unfolded image of the outer surface of the mushroom stick, determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; and calculate the Euclidean distance between the first average coordinates and the second average coordinates.
[0016] The breeding grade determination module is used to determine the breeding grade of the target shiitake mushroom log based on the Euclidean distance of the target shiitake mushroom log, according to the pre-set correlation between different Euclidean distances and different shiitake mushroom log breeding grades.
[0017] This invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the above-described method for determining the breeding grade of shiitake mushroom spawn.
[0018] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for determining the breeding grade of shiitake mushroom spawn.
[0019] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for determining the breeding grade of shiitake mushroom spawn.
[0020] In this embodiment of the invention, multiple outer surface images of a target shiitake mushroom log are acquired from surrounding angles. Each outer surface image is used as a target image, and target annotation data corresponding to that target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom log area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom log area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom log image corresponding to the target image. Image stitching processing is performed on the target mushroom log images of the outer surface images from different angles to obtain the unfolded image of the outer surface of the target shiitake mushroom log. The image stitching processing is based on the same image features between the target mushroom log images of the outer surface images from adjacent angles. The unfolded image of the outer surface of the mushroom log is binarized to determine the first average coordinates of the first color value pixels and the mushroom log in the unfolded image of the outer surface of the mushroom log. The second average coordinates of all pixels in the unfolded image of the outer surface are calculated; the Euclidean distance between the first average coordinates and the second average coordinates is calculated; based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn. Compared with the existing technology that manually determines the breeding grade of shiitake mushroom spawn, this invention is based on deep learning technology and image processing technology, and uses the U-net network to perform semantic segmentation on the outer surface image of shiitake mushroom spawn. It can objectively identify and analyze the phenotypic characteristics of shiitake mushroom spawn, realize the standardization of the evaluation process, and automatically execute the image acquisition, processing and analysis process. It reduces manual intervention, improves the level of automation and intelligence, solves the problems of omissions and low efficiency caused by manual labor in the existing technology, and improves the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. In the drawings:
[0022] Figure 1 This is a flowchart illustrating a method for determining the breeding grade of shiitake mushroom spawn in an embodiment of the present invention.
[0023] Figure 2This is a specific example diagram of a method for determining the breeding grade of shiitake mushroom spawn in an embodiment of the present invention;
[0024] Figure 3 This is a specific example diagram of a method for determining the breeding grade of shiitake mushroom spawn in an embodiment of the present invention;
[0025] Figure 4 This is a specific example diagram of a method for determining the breeding grade of shiitake mushroom spawn in an embodiment of the present invention;
[0026] Figure 5 This is a specific example diagram of a method for determining the breeding grade of shiitake mushroom spawn in an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram of a device for determining the breeding grade of shiitake mushroom spawn in an embodiment of the present invention;
[0028] Figure 7 This is a schematic diagram of a computer device used to determine the breeding grade of shiitake mushroom spawn in an embodiment of the present invention. Detailed Implementation
[0029] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.
[0030] In this document, the term "and / or" merely describes a relationship, indicating that three relationships can exist. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Furthermore, the term "at least one" in this document means any combination of at least two of any one or more elements. For example, including at least one of A, B, and C can mean including any one or more elements selected from the set consisting of A, B, and C.
[0031] In the description of this specification, the terms "comprising," "including," "having," and "containing" are open-ended terms, meaning that they include but are not limited to. The terms "an embodiment," "a specific embodiment," "some embodiments," and "for example," etc., refer to specific features, structures, or characteristics described in connection with that embodiment or example that are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. The order of steps involved in the various embodiments is used to illustrate the implementation of this application, and the order of steps is not limited and can be adjusted appropriately as needed.
[0032] The acquisition, storage, use, and processing of data in this application comply with relevant national laws and regulations. The information collected in this application is authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant national and regional laws, regulations, and standards, and necessary confidentiality measures have been taken. This application does not violate public order and good morals, and provides corresponding access points for users to choose to authorize or refuse. In addition, this application provides users with corresponding access points to choose to agree to or refuse automated decision-making results. If the user chooses to refuse, the process proceeds to the expert decision-making stage.
[0033] Shiitake mushroom logs are the substrate for shiitake mushroom growth. Under different environmental conditions, the mycelium on the surface of the logs exhibits different states, showing differences in color depth and color uniformity. Therefore, in order to accurately obtain phenotypic data of shiitake mushroom logs for judging the breeding grade of shiitake mushroom logs, an efficient and intelligent data collection and analysis system is needed.
[0034] Traditional methods of measurement mainly rely on sensory evaluation to assess and record the phenotype of shiitake mushroom spawn, thereby manually determining the breeding grade of shiitake mushroom spawn. This method suffers from strong subjectivity and difficulty in standardization, leading to potentially large differences in evaluation results. Furthermore, the inherent limitations of manual methods, such as oversights and low efficiency, result in low accuracy and efficiency in determining the breeding grade of shiitake mushroom spawn.
[0035] To address the aforementioned problems, this invention provides a method for determining the breeding grade of shiitake mushroom spawn, thereby improving the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn. (See also...) Figure 1 The method may include:
[0036] Step 101: Acquire multiple images of the outer surface of the target shiitake mushroom log from various angles;
[0037] Step 102: Take each outer surface image as the target image, and determine the target annotation data corresponding to the target image based on deep learning technology; the annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image; according to the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, remove the target background image in the target image to obtain the target mushroom stick image corresponding to the target image.
[0038] Step 103: Perform image stitching processing on the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is based on the same image features between the target mushroom stick images from adjacent angles.
[0039] Step 104: Perform binarization processing on the unfolded image of the outer surface of the mushroom stick to determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; calculate the Euclidean distance between the first average coordinates and the second average coordinates;
[0040] Step 105: Based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, determine the breeding grade of the target shiitake mushroom spawn based on the Euclidean distance of the target shiitake mushroom spawn.
[0041] In this embodiment of the invention, multiple outer surface images of a target shiitake mushroom log are acquired from surrounding angles. Each outer surface image is used as a target image, and target annotation data corresponding to that target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom log area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom log area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom log image corresponding to the target image. Image stitching processing is performed on the target mushroom log images of the outer surface images from different angles to obtain the unfolded image of the outer surface of the target shiitake mushroom log. The image stitching processing is based on the same image features between the target mushroom log images of the outer surface images from adjacent angles. The unfolded image of the outer surface of the mushroom log is binarized to determine the first average coordinates of the first color value pixels and the mushroom log in the unfolded image of the outer surface of the mushroom log. The second average coordinates of all pixels in the unfolded image of the outer surface are calculated; the Euclidean distance between the first average coordinates and the second average coordinates is calculated; based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn. Compared with the existing technology that manually determines the breeding grade of shiitake mushroom spawn, this invention is based on deep learning technology and image processing technology, and uses the U-net network to perform semantic segmentation on the outer surface image of shiitake mushroom spawn. It can objectively identify and analyze the phenotypic characteristics of shiitake mushroom spawn, realize the standardization of the evaluation process, and automatically execute the image acquisition, processing and analysis process. It reduces manual intervention, improves the level of automation and intelligence, solves the problems of omissions and low efficiency caused by manual labor in the existing technology, and improves the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn.
[0042] In practice, the first step is to acquire images of the outer surface of the target shiitake mushroom log from multiple angles.
[0043] In this embodiment, this step can be achieved by using a fixed or movable imaging device, such as a circular imaging platform or a multi-angle photography system, to capture images of the shiitake mushroom logs from all angles. The device is equipped with multiple cameras and can automatically or manually adjust the shooting angles to ensure that detailed features of the logs are captured from different directions.
[0044] When acquiring images, it is necessary to ensure consistent lighting conditions and a simple background to reduce interference during image processing. Furthermore, to guarantee image quality, the camera's resolution and shooting parameters (such as focal length, shutter speed, and ISO sensitivity) need to be optimized based on the actual size and surface characteristics of the shiitake mushroom logs.
[0045] The acquired image data is then transmitted to a processing system that has image storage, management, and preprocessing capabilities. During image preprocessing, basic operations such as noise reduction, contrast enhancement, and color correction can be performed to improve the accuracy and efficiency of subsequent image processing by deep learning models.
[0046] In the above embodiments, after acquiring multiple images of the outer surface of the target shiitake mushroom log from various angles, these images are first preprocessed, including adjusting image size, enhancing contrast, and normalizing colors, to ensure that the image data input into the deep learning model has consistency and high quality. This step is crucial for improving the model's recognition accuracy.
[0047] Next, each outer surface image is used as the target image and input into a trained deep learning model. In this embodiment, a semantic segmentation model based on the U-net architecture is used. This model has been trained on a large number of precisely labeled images of shiitake mushroom logs and can effectively identify and segment the log region and the background region. The model's output is a segmentation map of the same size as the input image, where each pixel is labeled as belonging to either the log region or the background region.
[0048] To obtain accurate boundary coordinate data, image post-processing techniques, such as edge detection algorithms, were employed in this embodiment to identify and extract the precise boundary between the mushroom stick region and the background region in the segmentation image. This coordinate data was used to remove the background from the original image, retaining only the mushroom stick region, thus obtaining a clean image of the target mushroom stick. This step is crucial for subsequent morphological analysis and breeding grade evaluation.
[0049] In the process of background removal, image fusion technology may also be used to merge the segmentation results of the same mushroom stick area in adjacent images to eliminate segmentation inconsistencies caused by changes in shooting angle or lighting, and to ensure that the obtained mushroom stick image is accurate and continuous.
[0050] In specific implementation, after acquiring multiple outer surface images of the target shiitake mushroom stick from various angles, each outer surface image is used as the target image. Based on deep learning technology, target annotation data corresponding to the target image is determined. The annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image.
[0051] In one embodiment, each outer surface image is used as a target image, and target annotation data corresponding to that target image is determined based on deep learning technology, including:
[0052] Each outer surface image is used as the target image, and the target image is input into the mushroom stick region image semantic segmentation model to obtain the target annotation data corresponding to the target image; the mushroom stick region image semantic segmentation model is obtained by training the U-net network deep learning model with historical mushroom stick outer surface annotation data as the training set; the historical mushroom stick outer surface annotation data includes historical data of different outer surface images and historical annotation data corresponding to the historical data of each outer surface image.
[0053] For example, consider the "target image of the target mushroom stick". Figure 3 As shown:
[0054] Figure 3 The left image shows a black background image containing only the mushroom stick area after semantic segmentation. The right image is labeled as the left... Figure 2 The image after value reduction shows that the white areas in the left image are covered by pure white pixels, while the brown and black areas are covered by pure black pixels.
[0055] The above embodiments may involve the following detailed steps:
[0056] 1. Image preprocessing:
[0057] Before inputting the outer surface image into the deep learning model, a series of preprocessing operations are performed, such as adjusting the image size, standardizing pixel values, and enhancing image contrast, in order to improve the efficiency and accuracy of the model in processing images.
[0058] 2. Establishment and training of the semantic segmentation model:
[0059] The U-net network architecture is used, which is a deep learning model designed specifically for image segmentation tasks and is widely used due to its excellent performance and effectiveness.
[0060] Using historical images of the outer surface of mushroom logs and their corresponding labeled data as the training set, the U-net model was trained through supervised learning. During training, the model learned how to distinguish between the mushroom log region and the background region, thus enabling accurate semantic segmentation.
[0061] 3. Generation of target annotation data:
[0062] The trained U-net model is used to process each outer surface image, and the segmentation results output by the model are the target annotation data, which details the coordinates of the boundary line between the mushroom stick area and the background area.
[0063] 4. Extraction of the mushroom substrate area:
[0064] Based on the target annotation data, image processing techniques, such as thresholding or region growing algorithms, are used to separate the mushroom stick region from the original image. This step removes background interference, resulting in a clean image of the target mushroom stick.
[0065] 5. Post-processing and optimization:
[0066] To further improve the accuracy of segmentation, post-processing of the segmentation results may be necessary, such as removing small noise areas and filling in unsegmented mushroom stick areas.
[0067] These optimization steps ensure that the obtained mushroom stick images are highly accurate and usable, providing a solid foundation for subsequent analysis and evaluation.
[0068] In this embodiment, the entire process is automated, enabling rapid processing of large numbers of shiitake mushroom spawn images and significantly improving data processing efficiency. Furthermore, through continuous optimization of deep learning technology and iterative model updates, the system can adapt to image segmentation tasks under various complex conditions, ensuring accurate identification and analysis of shiitake mushroom spawn at different growth stages and in different environments.
[0069] In one embodiment, it also includes:
[0070] Using historical mushroom stick outer surface annotation data of a predetermined proportion as validation and test sets, the trained U-net network deep learning model is validated and tested to obtain a mushroom stick region image semantic segmentation model that has passed validation and testing.
[0071] Each outer surface image is used as the target image. This target image is input into the semantic segmentation model of the mushroom stick region image to obtain the target annotation data corresponding to the target image, including:
[0072] Each outer surface image is used as the target image. The target image is then input into the semantic segmentation model of the mushroom stick area image after verification and testing to obtain the target annotation data corresponding to the target image.
[0073] For example, validation and test sets can be divided from historical data labeled on the outer surface of mushroom sticks according to a preset ratio (e.g., 70% for training, 15% for validation, and 15% for testing).
[0074] The validation set is used as an intermediate checkpoint during model training to monitor whether the model is overfitting and to adjust model parameters (such as learning rate, regularization term, etc.).
[0075] The test set is used to evaluate the final performance of the model after training, ensuring that the model can maintain good segmentation performance on unseen data.
[0076] In the above embodiments, after acquiring multiple images of the outer surface of the target shiitake mushroom log from various angles, these images are first preprocessed, including adjusting image size, enhancing contrast, and normalizing colors, to ensure that the image data input into the deep learning model has consistency and high quality. This step is crucial for improving the model's recognition accuracy.
[0077] Next, each outer surface image is used as the target image and input into a trained deep learning model. In this embodiment, a semantic segmentation model based on the U-net architecture is used. This model has been trained on a large number of precisely labeled images of shiitake mushroom logs and can effectively identify and segment the log region and the background region. The model's output is a segmentation map of the same size as the input image, where each pixel is labeled as belonging to either the log region or the background region.
[0078] To obtain accurate boundary coordinate data, image post-processing techniques, such as edge detection algorithms, were employed in this embodiment to identify and extract the precise boundary between the mushroom stick region and the background region in the segmentation image. This coordinate data was used to remove the background from the original image, retaining only the mushroom stick region, thus obtaining a clean image of the target mushroom stick. This step is crucial for subsequent morphological analysis and breeding grade evaluation.
[0079] In the process of background removal, image fusion technology may also be used to merge the segmentation results of the same mushroom stick area in adjacent images to eliminate segmentation inconsistencies caused by changes in shooting angle or lighting, and to ensure that the obtained mushroom stick image is accurate and continuous.
[0080] Ultimately, the resulting series of target mushroom log images will be used for further analysis, such as calculating features like shape, size, and surface texture, as well as performing binarization and Euclidean distance calculations. These are all important parameters for evaluating the breeding grade of shiitake mushroom logs. Through these advanced image processing and analysis techniques, the precise evaluation of shiitake mushroom logs can be automated, greatly improving the efficiency and accuracy of breeding work.
[0081] Here is an example of constructing a semantic segmentation model for mushroom stick region images, such as... Figure 2 As shown, the steps may include:
[0082] 1. Use LabelMe software to perform precise pixel-level annotation on the collected shiitake mushroom log images and generate corresponding JSON format annotation data.
[0083] 2. Convert the original JPG image data to PNG format to ensure image quality and facilitate subsequent processing.
[0084] 3. Convert the JSON labeled data generated by the labelme software into the VOC dataset format, which is suitable for training deep learning models.
[0085] 4. Divide the converted dataset into a training set and a validation set in a 4:1 ratio to ensure that the training set contains more samples to learn features.
[0086] 5. Construct the U-net network model, which includes downsampling and upsampling structures, as well as necessary convolutional layers, pooling layers, and deconvolutional layers.
[0087] 6. Import the training set data into the U-net network to begin the model training process.
[0088] 7. Use Miou (mean intersection-union ratio) as an evaluation metric to perform statistical analysis and plotting of the model prediction results on the validation set.
[0089] 8. If the Miou value is less than 95%, adjust the network parameters, such as the learning rate, the number or size of convolutional layers, and the regularization term, and then retrain the model.
[0090] 9. If the Miou value is greater than 95%, a high-performance deep learning model is obtained.
[0091] 10. Apply the trained model to actual shiitake mushroom log image data to perform semantic segmentation and obtain accurate segmentation results for the log region.
[0092] 11. Based on the model's performance in practical applications, perform necessary iterative optimizations to adapt to possible changes in data distribution or new application scenarios.
[0093] In specific implementation, each outer surface image is used as a target image. Based on deep learning technology, target annotation data corresponding to the target image is determined. Then, according to the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image. After that, the target mushroom stick images of the outer surface images from different angles are subjected to image stitching processing to obtain the unfolded image of the outer surface of the target shiitake mushroom stick. The image stitching processing is based on the same image features between the target mushroom stick images of the outer surface images from adjacent angles.
[0094] In one embodiment, image stitching is performed on target mushroom log images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom log, including:
[0095] Extract feature points from the target mushroom stick image of the outer surface image at each angle;
[0096] By using a feature matching algorithm, feature points in the target mushroom stick images of the outer surface images from adjacent angles are matched to determine the matching feature point pairs between the target mushroom stick images of the outer surface images from adjacent angles.
[0097] Using perspective transformation technology, the target mushroom stick image of the outer surface image at each angle is image registered to obtain the registered image.
[0098] Based on the matching feature point pairs, multiple registered images are stitched together to obtain an unfolded image of the outer surface of the target shiitake mushroom log.
[0099] For example, Figure 5 As shown, Figure 5 This example demonstrates an image stitching process. The leftmost image shows the two images to be stitched together; the middle image shows the images after feature detection, where identical feature points are connected by line segments; and the rightmost image shows the result after the two images have been stitched together.
[0100] In the above embodiments, image stitching is a key step in realizing the unfolded image of the outer surface of the shiitake mushroom log, and involves the following detailed stages:
[0101] 1. Feature Point Extraction: For the target mushroom stick image at each angle, advanced feature point extraction algorithms (such as SIFT, SURF, or ORB) are used to identify and extract key feature points in the image. These feature points are usually salient locations in the image, such as the edges of the mushroom stick, texture centers, or other unique visual patterns.
[0102] 2. Feature Matching: Using feature matching algorithms, such as homology matching or descriptor-based nearest neighbor matching, feature points in one image angle are matched with feature points in adjacent images at different angles. This step aims to find corresponding feature point pairs across images, providing a foundation for subsequent image alignment and stitching.
[0103] 3. Perspective Transformation and Image Registration: Perspective transformation technology is used to correct the image from each angle to eliminate visual distortion and ensure that the mushroom stick image maintains a consistent scale and orientation across different angles. Image registration aligns the corrected images to a common coordinate system, ensuring that the mushroom stick areas in different images can be accurately stitched together.
[0104] 4. Image Stitching: Based on image registration, image stitching algorithms (such as multi-band mixing, Poisson fusion, etc.) are used to seamlessly stitch the mushroom stick regions of multiple images into a complete unfolded image. This step requires handling the fusion problem of overlapping image areas to ensure that the stitched result is visually natural and without obvious seams.
[0105] 5. Post-processing and optimization: The stitched images may require further post-processing, such as removing stitching marks, smoothing transition areas, and enhancing image quality, in order to improve the quality and usability of the final unfolded image.
[0106] These optimization steps ensure that the obtained images of the outer surface of the mushroom logs are highly accurate and clear, providing reliable data support for subsequent morphological analysis and breeding grade evaluation.
[0107] In this embodiment, the entire process is automated, enabling rapid processing of large numbers of shiitake mushroom spawn images and significantly improving data processing efficiency. Furthermore, through continuous optimization of deep learning technology and iterative model updates, the system can adapt to image stitching tasks under various complex conditions, ensuring accurate identification and analysis of shiitake mushroom spawn at different growth stages and in different environments.
[0108] In the above embodiments, after acquiring the target mushroom log image, the next step is to effectively stitch together these images taken from different angles to form a complete image of the outer surface of the shiitake mushroom log. This step is crucial for comprehensively analyzing the morphological characteristics of the log and conducting accurate breeding grade assessment.
[0109] First, feature point detection is performed on each target mushroom stick image. These feature points should be unique and easily identifiable points in the image, such as the unevenness of the mushroom stick surface, texture centers, or edge points. Feature point detection algorithms, such as SIFT, SURF, or ORB, can be used to identify these key points in each image.
[0110] Once feature points are detected, the next step is to use a feature matching algorithm to find corresponding feature points across different images. This can be achieved by comparing the descriptors of the feature points, which are methods that encode the local information of feature points into high-dimensional vectors, enabling accurate matching even from different viewpoints.
[0111] The matched feature point pairs will be used for perspective transformation and image registration between images. Perspective transformation is a geometric transformation that adjusts the angle and position of images based on the matching relationship of feature points, allowing the mushroom stick regions in different images to be precisely aligned. Image registration involves superimposing the transformed images to form a seamless panoramic image.
[0112] During image stitching, issues such as occlusion and inconsistent lighting may need to be addressed. To solve these problems, image fusion techniques, such as multi-band mixing, Poisson fusion, or other advanced fusion algorithms, can be used to smoothly transition stitching edges and maintain the visual coherence of the image.
[0113] After image stitching, an unfolded, continuous image of the outer surface of the shiitake mushroom logs is obtained. This image shows the entire log and provides a foundation for subsequent binarization processing, Euclidean distance calculation, and breeding grade evaluation. This advanced image processing technology allows for more accurate analysis of the morphological characteristics of shiitake mushroom logs, thus providing a scientific basis for breeding and improving the production quality and efficiency of shiitake mushrooms.
[0114] In specific implementation, after image stitching processing is performed on the target mushroom stick images from different angles to obtain the unfolded image of the outer surface of the target shiitake mushroom stick, the unfolded image of the outer surface of the mushroom stick is binarized to determine the first average coordinates of the first color value pixel points in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; the Euclidean distance between the first average coordinates and the second average coordinates is calculated.
[0115] In one embodiment, binarizing the unfolded image of the outer surface of the mushroom stick to determine the first average coordinates of the first color value pixels in the unfolded image and the second average coordinates of all pixels in the unfolded image includes:
[0116] Based on a preset color value threshold, the unfolded image of the outer surface of the mushroom stick is binarized to determine the first color value pixel and the second color value pixel in the unfolded image of the outer surface of the mushroom stick.
[0117] Calculate the first average coordinates of the first color value pixel and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick.
[0118] For example, Figure 4In the diagram, point A represents the average coordinates of the white pixels; point B represents the average coordinates of all pixels in the mushroom substrate area. The pixel distance between the two points is the Euclidean distance.
[0119] In the above embodiments, binarization is a key step in image analysis. It converts a color or grayscale image into an image containing only two colors (usually black and white) to make it easier to identify and process specific regions in the image. The following are the detailed steps of the binarization process in the embodiments:
[0120] 1. Color Value Threshold Setting: Based on the specific characteristics of the shiitake mushroom logs and the image preprocessing results, a suitable color value threshold is set. This threshold is used to distinguish the log area from the background area, and is usually based on the histogram distribution of the image or the optimal value determined experimentally.
[0121] 2. Binarization operation: Apply a binarization algorithm, such as global thresholding or local thresholding, to classify each pixel in the unfolded image of the outer surface of the mushroom stick into either the mushroom stick region (first color value pixel, such as white) or the background region (second color value pixel, such as black).
[0122] 3. Average Coordinate Calculation: For the binarized image, calculate the coordinates of all pixels with the first color value to obtain the average coordinates of the mushroom stick region. This can be achieved by averaging the (x, y) coordinates of all pixels belonging to the mushroom stick region.
[0123] At the same time, the coordinates of all pixels in the entire image are calculated to obtain the average coordinates of the entire image, which includes the mushroom stick area and the background area.
[0124] 4. Euclidean distance calculation: The distance between two average coordinates is calculated using the Euclidean distance formula. This distance can be used as an indicator to evaluate the morphological characteristics of the mushroom log, such as its size, shape, or growth status.
[0125] In one embodiment, it also includes:
[0126] Determine the first area of the first color value pixel in the unfolded image of the outer surface of the mushroom stick, and the second area of all pixels in the unfolded image of the outer surface of the mushroom stick; calculate the ratio between the first area and the second area.
[0127] For example, after successfully obtaining an unfolded image of the outer surface of a shiitake mushroom spawn, the next step is to binarize this image. Binarization is a common technique in image analysis; it converts an image into one containing only two colors (usually black and white) to make it easier to analyze and process specific features within the image.
[0128] First, a suitable threshold is selected to binarize the unfolded image. This threshold can be automatically determined based on image histogram analysis or a fixed value set empirically. During binarization, all pixels will be classified according to the threshold as belonging to the mushroom stick region (e.g., white) or the background region (e.g., black).
[0129] After binarization, the average coordinates of all pixels marked as mushroom stick regions (first color value pixels) are calculated. This can be achieved by averaging the (x, y) coordinates of all these pixels. Simultaneously, the coordinates of all pixels in the entire image, including the mushroom stick regions and the background region (second average coordinates), are also calculated to determine the image's center position.
[0130] Next, in this embodiment, the Euclidean distance formula will be used to calculate the distance between the first average coordinate and the second average coordinate. In two-dimensional space, the Euclidean distance is the straight-line distance between two points.
[0131] The calculated Euclidean distance allows for the quantitative analysis of the morphological characteristics of shiitake mushroom spawn. For example, the Euclidean distance can serve as an indicator for evaluating the shape, size, and growth status of the spawn. Furthermore, this distance can be combined with preset breeding grade standards to automatically determine the breeding grade of shiitake mushroom spawn, thus providing a scientific basis for the cultivation and selection of shiitake mushrooms.
[0132] Furthermore, the binarized image can be further analyzed in the embodiments, such as calculating the area, perimeter, and texture features of the mushroom log region, and this data can be combined with Euclidean distance to obtain more comprehensive phenotypic information about the mushroom log. This information is of great value for optimizing breeding strategies and improving the yield and quality of shiitake mushrooms.
[0133] In specific implementation, after calculating the Euclidean distance between the first average coordinate and the second average coordinate, the breeding grade of the target shiitake mushroom stick is determined according to the Euclidean distance of the target shiitake mushroom stick based on the pre-set correlation between different Euclidean distances and different shiitake mushroom stick breeding grades.
[0134] In this embodiment, after calculating the Euclidean distance between the first and second average coordinates, the breeding grade of the target shiitake mushroom spawn can be determined using a pre-established correlation model between the Euclidean distance and the breeding grade of the shiitake mushroom spawn. This correlation model is based on a large amount of historical data and experimental results, and can map the value of the Euclidean distance to a specific breeding grade.
[0135] First, this association model can be retrieved from a database or obtained by analyzing historical datasets. This model can be a machine learning-based classifier, such as a support vector machine (SVM), decision tree, or neural network, all trained based on the morphological characteristics of the shiitake mushroom spawn and known breeding grades. During training, the model learns the correspondence between different Euclidean distance ranges and specific breeding grades.
[0136] Next, the calculated Euclidean distance is input into this correlation model. Based on the learned mapping relationship, the model outputs a predicted breeding grade. This grade reflects the quality and growth status of the target shiitake mushroom spawn, and is of great significance for breeding decisions and yield prediction.
[0137] Furthermore, the embodiment may include a feedback mechanism for continuous optimization and adjustment of the correlation model. As new data is continuously collected and analyzed, the model will be updated periodically to improve its predictive accuracy and reliability. This dynamic update mechanism ensures that the system can adapt to changes in the morphological characteristics of shiitake mushroom substrate and advancements in breeding technology.
[0138] Finally, the determined breeding grade will be recorded in the electronic file of the target shiitake mushroom spawn and can be used to guide subsequent breeding, cultivation, and management decisions. Furthermore, this information can be displayed to end users, such as shiitake mushroom growers or researchers, through a user interface to help them better understand and manage the shiitake mushroom growth process.
[0139] By employing this method based on deep learning and image analysis, the system in this embodiment not only improves the accuracy and efficiency of evaluating the breeding grade of shiitake mushroom spawn, but also provides strong technical support for the sustainable development of the shiitake mushroom industry.
[0140] In specific implementation, the method for determining the breeding grade of shiitake mushroom spawn provided in this embodiment of the invention may further include: recording and analyzing the growth habits and environmental adaptability of the spawn. By analyzing a large amount of image data of shiitake mushroom spawn, the growth patterns of spawn at different breeding grades and their responses to environmental changes can be identified. This information is crucial for understanding the growth requirements of shiitake mushrooms and optimizing breeding strategies.
[0141] For example, the present invention can also be used to:
[0142] 1. Growth Habit Analysis: Deep learning models are used to analyze the growth patterns of the mushroom logs, such as growth rate, mycelial density, and distribution. By tracking the growth changes of the same mushroom log over a long period, a growth model can be established to predict the maturity time and yield of the logs.
[0143] 2. Environmental Adaptability Assessment: Based on environmental monitoring data, assess the adaptability of different breeding grades of mushroom spawn to environmental factors such as temperature, humidity, and light. Analyze the growth performance of the spawn under different environmental conditions to provide a basis for selecting breeding grades suitable for specific environments.
[0144] 3. Breeding Decision Support: Based on the analysis of the growth habits and environmental adaptability of the mushroom spawn, decision support is provided to breeders to help them select the best breeding strategies. By predicting the yield and quality of mushroom spawn of different breeding grades, breeders are guided in variety selection and planting plans.
[0145] 4. Cultivation Management Optimization: Utilize the analysis results to optimize cultivation management measures, such as adjusting irrigation, fertilization, and pest and disease control strategies, to improve the overall yield and quality of shiitake mushrooms. Provide growers with personalized management suggestions, adjusting cultivation measures according to the actual growth status of the mushroom logs.
[0146] The following is a specific embodiment to illustrate the application of the method of the present invention. This specific embodiment provides a deep learning-based system for collecting and analyzing phenotypic data of shiitake mushroom spawn. In specific applications, it can be implemented according to the following steps:
[0147] Step 1: Image Acquisition: Use a fixed imaging device to acquire side images of the shiitake mushroom logs under different environmental conditions, covering multiple angles;
[0148] Step 2, Deep Learning Training: Using 100-300 images and their labeled data, train the U-net network to generate an efficient semantic segmentation model;
[0149] Step 3: Semantic segmentation: Perform semantic segmentation on the entire dataset to extract image information of the mushroom stick region;
[0150] Step 4: Image stitching: Multiple images of the same mushroom log are seamlessly stitched together using image stitching technology to form a panoramic image;
[0151] Step 5, Image Data Calculation: Binarize the image to obtain the area ratio of the brown and white regions of the mushroom stick; calculate the average coordinates of the white pixels in the image, the average coordinates of all pixels in the mushroom stick region, and calculate the Euclidean distance between the two coordinates;
[0152] Step 6: Save the data: Save the data in a txt file.
[0153] Compared with existing technologies, this invention employs deep learning-based image processing technology, improving the intelligent recognition and accurate discrimination of phenotypic traits of shiitake mushroom logs. Image stitching technology is used to fully preserve the true morphology of the logs. Training with a U-net network yields a deep learning model with high accuracy and strong generalization ability. This method has broad application prospects in the field of shiitake mushroom log phenotypic data collection and analysis, with advantages including improved data collection accuracy, faster analysis speed, and the provision of new technical means for related research.
[0154] The specific steps above are explained below:
[0155] 1. Image Acquisition:
[0156] Using a fixed shooting device (including a camera and a tripod), multiple angle images of the side of the shiitake mushroom logs were acquired under different environmental conditions to ensure a consistent background and anti-reflective properties, thus preventing localized exposure issues.
[0157] 2. Image annotation and conversion:
[0158] The collected images were labeled using the labelme software, generating .json format annotation files, and these files were then converted into VOC data format.
[0159] 3. Dataset partitioning:
[0160] The labeled data is randomly divided into a training set, a validation set, and a test set, with the validation set and the test set being equal in size.
[0161] 4. U-net network construction and training:
[0162] The U-net network is constructed, including downsampling (four units, each with three effective convolutions and one max pooling) and upsampling (four units, each with one deconvolution).
[0163] Adjust network parameters such as input size, activation function, loss function, optimizer, learning rate, batch size, and pre-trained weight model.
[0164] Specifically, the following are the steps for constructing the U-net deep learning model:
[0165] 1) Downsampling (encoder):
[0166] The downsampling part of the U-net network, also known as the encoder, is responsible for capturing contextual information and features in the image.
[0167] During downsampling, the image size is gradually reduced through a series of convolutional and pooling layers, while the feature depth is increased.
[0168] Each downsampling unit contains three effective convolutional layers, which are used to extract features from the image.
[0169] A max pooling operation is then performed after each convolutional layer to reduce the spatial dimension of the image and increase the model's robustness to small changes.
[0170] After four such units, the image size and feature depth reach the final state of downsampling.
[0171] 2) Upsampling (decoder):
[0172] The upsampling part of the U-net network, also known as the decoder, is responsible for mapping the features extracted by the encoder back to the spatial dimensions of the original image.
[0173] During upsampling, the image size is gradually increased through a series of deconvolutional layers (also known as transposed convolutional layers) while the feature depth is reduced.
[0174] Each upsampling unit performs a deconvolution operation once to recover the spatial information of the image.
[0175] To better integrate the upsampled image with the feature map from the downsampled process, skip connections are typically used after the deconvolution layer.
[0176] 3) Feature map cascading:
[0177] By concatenating the feature maps from the downsampling process with the corresponding feature maps from the upsampling process, high-level semantic information can be combined with low-level detailed information.
[0178] Cascading is typically achieved using 1x1 convolutional kernels. This convolutional operation can adjust the depth of the feature map while keeping the spatial dimensions unchanged.
[0179] 4) Output layer:
[0180] Finally, the final output is achieved through a 1x1 convolutional layer, which transforms the feature map into an output relevant to the target task, such as the class probability of each pixel in a semantic segmentation task.
[0181] The design of the output layer depends on the specific application scenario. For example, in the image analysis of shiitake mushroom sticks, the output layer may output the probability of whether each pixel belongs to the stick region.
[0182] The U-net network constructed through the above steps can effectively perform semantic segmentation of images, extracting precise regions of shiitake mushroom spawn, providing important basis for subsequent phenotypic data analysis and breeding grade evaluation. Due to its excellent image segmentation performance and symmetrical network structure, U-net has been widely used in fields such as medical image processing and agricultural image analysis.
[0183] Specifically, the following provides an example of the parameters for a semantic segmentation model of the mushroom stick region image:
[0184] 1) Image annotation and data format conversion:
[0185] The labelme software was used to accurately annotate the collected images of shiitake mushroom logs to generate .json format annotation files.
[0186] Convert the .json format annotation file to VOC data format, which is suitable for training deep learning models.
[0187] 2) Dataset partitioning:
[0188] The labeled dataset is randomly divided into three parts: training set, validation set, and test set.
[0189] In particular, the validation set and the test set are equal in this model, which means they have the same number of data samples.
[0190] 3) Network parameter adjustment:
[0191] Setting the input image size to 512*512 pixels helps the model better capture the detailed features of the mushroom logs.
[0192] ReLU was chosen as the activation function because it effectively solves the vanishing gradient problem and accelerates model convergence.
[0193] Using Cos as the loss function may help optimize the model's performance in classification or regression tasks.
[0194] Adam was chosen as the optimizer because it combines the advantages of RMSProp and Momentum, adaptively adjusting the learning rate.
[0195] Setting the learning rate to 0.001 is a commonly used initial learning rate, which helps the model learn stably in the early stages of training.
[0196] Setting the Batch Size to 2 means that the network will process two samples simultaneously in each iteration.
[0197] Using a pre-trained weight model, unet_vgg_voc.pth, as the initial weights helps the model utilize features learned on similar tasks.
[0198] Freeze_Epoch is set to 50, which means that the pre-trained weights are frozen for the first 50 training epochs, and only newly added layers are trained.
[0199] Setting `unFreeze_Epoch` to 100 means gradually unfreezing the pre-trained weights over 50 to 100 training epochs, allowing the model to fine-tune the pre-trained layers. Train the model, freezing the weights for the first 50 epochs during training, then unfreezing them for fine-tuning. Save the training results as a .pth file.
[0200] 4) Model training and performance evaluation:
[0201] Train the model until satisfactory performance is achieved.
[0202] During training, monitor the model's performance on the training and validation sets to ensure that the model does not overfit.
[0203] After training is complete, the model performance results are visualized, and the trained model parameters are saved as a .pth file for subsequent model deployment and application.
[0204] 5. Semantic segmentation:
[0205] The trained U-net model is used to perform semantic segmentation on the image, predicting all pixels in the mushroom stick area and turning other pixels black, resulting in an image containing only the mushroom stick area and a black background.
[0206] 6. Image stitching:
[0207] Multiple images of the same mushroom log are seamlessly stitched together, including feature extraction, feature matching, perspective transformation, and image fusion, to form an unfolded image of the outer surface of the mushroom log.
[0208] 7. Binarization processing:
[0209] The unfolded image is binarized, and the area ratio of the brown and white regions of the mushroom sticks is calculated.
[0210] Calculate the average coordinates of the white pixels in the image and the average coordinates of all pixels in the mushroom stick region.
[0211] Specifically, binarization processing may include the following steps:
[0212] 1) Image Binarization: First, a binarization algorithm is applied to the mushroom stick image after semantic segmentation. This step typically uses tools such as the cv2.threshold function to set the pixel values in the image to one of two predefined thresholds, thereby converting the image into a black-and-white binary image.
[0213] 2) Threshold Setting: Choosing an appropriate threshold is crucial during binarization. The document mentions using 100 as the threshold, setting pixel values less than 100 to 0 (black) and pixel values greater than 100 to 255 (white). This threshold setting helps distinguish between the brown and white areas of the mushroom log.
[0214] 3) Contour Extraction: After binarization, white pixels in the image represent the brown areas of the mushroom sticks, while black pixels represent the background or other non-mushroom stick areas. Using tools such as the cv2.findContours function, contour information can be extracted from the binary image.
[0215] 4) Coordinate Calculation: Analyze the extracted contours and calculate the average coordinates of all white pixels, as well as the average coordinates of all pixels in the mushroom stick area. This can be achieved using functions in mathematical libraries such as NumPy, such as np.column_stack and np.mean.
[0216] 5) Euclidean Distance Calculation: Finally, calculate the Euclidean distance between the average coordinates of the white pixels and the coordinates of the center point of the mushroom stick area. This step can be accomplished by calculating the straight-line distance between the two points, using np.sqrt and mathematical operations.
[0217] 8. Euclidean distance calculation:
[0218] Calculate the Euclidean distance between the two average coordinates mentioned above.
[0219] 9. Data storage:
[0220] Save the processed data as a txt file, including the image file name, the percentage of white pixels, the percentage of black pixels, and the Euclidean distance.
[0221] 10. Enhanced model generalization ability:
[0222] To enhance the generalization ability of the U-Net network, the training data should include images of mushroom sticks at different stages from 50 to 120 days, ensuring that the model can adapt to diverse real-world application scenarios.
[0223] Of course, it is understood that there may be other variations of the above detailed process, and all such variations should fall within the protection scope of this invention.
[0224] In this embodiment of the invention, multiple outer surface images of a target shiitake mushroom log are acquired from surrounding angles. Each outer surface image is used as a target image, and target annotation data corresponding to that target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom log area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom log area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom log image corresponding to the target image. Image stitching processing is performed on the target mushroom log images of the outer surface images from different angles to obtain the unfolded image of the outer surface of the target shiitake mushroom log. The image stitching processing is based on the same image features between the target mushroom log images of the outer surface images from adjacent angles. The unfolded image of the outer surface of the mushroom log is binarized to determine the first average coordinates of the first color value pixels and the mushroom log in the unfolded image of the outer surface of the mushroom log. The second average coordinates of all pixels in the unfolded image of the outer surface are calculated; the Euclidean distance between the first average coordinates and the second average coordinates is calculated; based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn. Compared with the existing technology that manually determines the breeding grade of shiitake mushroom spawn, this invention is based on deep learning technology and image processing technology, and uses the U-net network to perform semantic segmentation on the outer surface image of shiitake mushroom spawn. It can objectively identify and analyze the phenotypic characteristics of shiitake mushroom spawn, realize the standardization of the evaluation process, and automatically execute the image acquisition, processing and analysis process. It reduces manual intervention, improves the level of automation and intelligence, solves the problems of omissions and low efficiency caused by manual labor in the existing technology, and improves the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn.
[0225] This invention also provides a device for determining the breeding grade of shiitake mushroom spawn, as described in the following embodiments. Since the principle by which this device solves the problem is similar to the method for determining the breeding grade of shiitake mushroom spawn, the implementation of this device can refer to the implementation of the method for determining the breeding grade of shiitake mushroom spawn; repeated details will not be elaborated further.
[0226] This invention also provides a device for determining the breeding grade of shiitake mushroom spawn, thereby improving the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn. Figure 6 As shown, the device includes:
[0227] The outer surface image acquisition module 601 is used to acquire outer surface images from multiple angles around the target shiitake mushroom log;
[0228] The annotation data determination module 602 is used to take each outer surface image as a target image and determine the target annotation data corresponding to the target image based on deep learning technology; the annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image; according to the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image.
[0229] The image stitching processing module 603 is used to perform image stitching processing on the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is based on the same image features between the target mushroom stick images from adjacent angles.
[0230] The binarization processing module 604 is used to perform binarization processing on the unfolded image of the outer surface of the mushroom stick, determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; and calculate the Euclidean distance between the first average coordinates and the second average coordinates.
[0231] The breeding grade determination module 605 is used to determine the breeding grade of the target shiitake mushroom log based on the Euclidean distance of the target shiitake mushroom log, according to the pre-set correlation between different Euclidean distances and different shiitake mushroom log breeding grades.
[0232] In one embodiment, each outer surface image is used as a target image, and target annotation data corresponding to that target image is determined based on deep learning technology, including:
[0233] Each outer surface image is used as the target image, and the target image is input into the mushroom stick region image semantic segmentation model to obtain the target annotation data corresponding to the target image; the mushroom stick region image semantic segmentation model is obtained by training the U-net network deep learning model with historical mushroom stick outer surface annotation data as the training set; the historical mushroom stick outer surface annotation data includes historical data of different outer surface images and historical annotation data corresponding to the historical data of each outer surface image.
[0234] In one embodiment, it also includes:
[0235] Using historical mushroom stick outer surface annotation data of a predetermined proportion as validation and test sets, the trained U-net network deep learning model is validated and tested to obtain a mushroom stick region image semantic segmentation model that has passed validation and testing.
[0236] Each outer surface image is used as the target image. This target image is input into the semantic segmentation model of the mushroom stick region image to obtain the target annotation data corresponding to the target image, including:
[0237] Each outer surface image is used as the target image. The target image is then input into the semantic segmentation model of the mushroom stick area image after verification and testing to obtain the target annotation data corresponding to the target image.
[0238] In one embodiment, image stitching is performed on target mushroom log images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom log, including:
[0239] Extract feature points from the target mushroom stick image of the outer surface image at each angle;
[0240] By using a feature matching algorithm, feature points in the target mushroom stick images of the outer surface images from adjacent angles are matched to determine the matching feature point pairs between the target mushroom stick images of the outer surface images from adjacent angles.
[0241] Using perspective transformation technology, the target mushroom stick image of the outer surface image at each angle is image registered to obtain the registered image.
[0242] Based on the matching feature point pairs, multiple registered images are stitched together to obtain an unfolded image of the outer surface of the target shiitake mushroom log.
[0243] In one embodiment, binarizing the unfolded image of the outer surface of the mushroom stick to determine the first average coordinates of the first color value pixels in the unfolded image and the second average coordinates of all pixels in the unfolded image includes:
[0244] Based on a preset color value threshold, the unfolded image of the outer surface of the mushroom stick is binarized to determine the first color value pixel and the second color value pixel in the unfolded image of the outer surface of the mushroom stick.
[0245] Calculate the first average coordinates of the first color value pixel and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick.
[0246] In one embodiment, it also includes:
[0247] Determine the first area of the first color value pixel in the unfolded image of the outer surface of the mushroom stick, and the second area of all pixels in the unfolded image of the outer surface of the mushroom stick; calculate the ratio between the first area and the second area.
[0248] This invention provides an embodiment of a computer device for implementing all or part of the above-described method for determining the breeding grade of shiitake mushroom spawn. The computer device specifically includes the following components:
[0249] The computer device comprises a processor, memory, a communications interface, and a bus; wherein the processor, memory, and communications interface communicate with each other via the bus; the communications interface is used to realize information transmission between related devices; the computer device can be a desktop computer, tablet computer, or mobile terminal, etc., and this embodiment is not limited to these. In this embodiment, the computer device can be implemented with reference to the embodiments for implementing the method for determining the breeding grade of shiitake mushroom spawn and the embodiments for implementing the device for determining the breeding grade of shiitake mushroom spawn, the contents of which are incorporated herein, and repeated parts will not be described again.
[0250] Figure 7 This is a schematic block diagram illustrating the system configuration of the computer device 1000 according to an embodiment of this application. Figure 7 As shown, the computer device 1000 may include a central processing unit 1001 and a memory 1002; the memory 1002 is coupled to the central processing unit 1001. It is worth noting that... Figure 7 This is an example; other types of structures can also be used to supplement or replace this structure to achieve telecommunications functions or other functions.
[0251] In one embodiment, the function of determining the breeding grade of shiitake mushroom spawn can be integrated into a central processing unit 1001. The central processing unit 1001 can be configured to perform the following control:
[0252] Acquire multiple images of the outer surface of the target shiitake mushroom log from various angles;
[0253] Each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image.
[0254] Image stitching is performed on the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching is based on the same image features between the target mushroom stick images from adjacent angles.
[0255] The unfolded image of the outer surface of the mushroom stick is binarized to determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; the Euclidean distance between the first average coordinates and the second average coordinates is calculated.
[0256] Based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn.
[0257] In another embodiment, the device for determining the breeding grade of shiitake mushroom spawn can be configured separately from the central processing unit 1001. For example, the device for determining the breeding grade of shiitake mushroom spawn can be configured as a chip connected to the central processing unit 1001, and the function of determining the breeding grade of shiitake mushroom spawn can be realized through the control of the central processing unit.
[0258] like Figure 7 As shown, the computer device 1000 may further include: a communication module 1003, an input unit 1004, an audio processor 1005, a display 1006, and a power supply 1007. It is worth noting that the computer device 1000 does not necessarily need to include... Figure 7 All components shown; in addition, the computer device 1000 may also include Figure 7 For components not shown, please refer to existing technologies.
[0259] like Figure 7 As shown, the central processing unit 1001, sometimes also referred to as a controller or operation control, may include a microprocessor or other processor device and / or logic device. The central processing unit 1001 receives input and controls the operation of various components of the computer device 1000.
[0260] The memory 1002 may be, for example, one or more of a cache, flash memory, hard drive, removable medium, volatile memory, non-volatile memory, or other suitable device. It may store the aforementioned failure-related information, and also store a program for executing that information. The central processing unit 1001 may execute the program stored in the memory 1002 to perform information storage or processing, etc.
[0261] Input unit 1004 provides input to central processing unit 1001. This input unit 1004 may be, for example, a keypad or touch input device. Power supply 1007 provides power to computer device 1000. Display 1006 displays images, text, and other display objects. This display may be, for example, an LCD display, but is not limited to this.
[0262] The memory 1002 can be a solid-state memory, such as a read-only memory (ROM), random access memory (RAM), a SIM card, etc. It can also be a memory that retains information even when power is off, can be selectively erased, and contains more data; examples of this type of memory are sometimes referred to as EPROMs, etc. The memory 1002 can also be some other type of device. The memory 1002 includes a buffer memory 1021 (sometimes referred to as a buffer). The memory 1002 may include an application / function storage unit 1022 for storing application programs and function programs or processes for executing operations of the computer device 1000 via the central processing unit 1001.
[0263] The memory 1002 may also include a data storage unit 1023 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the computer device. The driver storage unit 1024 of the memory 1002 may include various drivers for the computer device for communication functions and / or for performing other functions of the computer device (such as messaging applications, address book applications, etc.).
[0264] The communication module 1003 is a transmitter / receiver 1003 that transmits and receives signals via the antenna 1008. The communication module (transmitter / receiver) 1003 is coupled to the central processing unit 1001 to provide input signals and receive output signals, which can be the same as in a conventional mobile communication terminal.
[0265] Based on different communication technologies, multiple communication modules 1003 can be configured in the same computer device, such as cellular network modules, Bluetooth modules, and / or wireless LAN modules. The communication module (transmitter / receiver) 1003 is also coupled to a speaker 1009 and a microphone 1010 via an audio processor 1005 to provide audio output via the speaker 1009 and receive audio input from the microphone 1010, thereby realizing typical telecommunications functions. The audio processor 1005 may include any suitable buffer, decoder, amplifier, etc. Furthermore, the audio processor 1005 is also coupled to a central processing unit 1001, enabling on-device recording via the microphone 1010 and on-device playback of stored sound via the speaker 1009.
[0266] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for determining the breeding grade of shiitake mushroom spawn.
[0267] This invention also provides a computer program product, which includes a computer program that, when executed by a processor, implements the above-described method for determining the breeding grade of shiitake mushroom spawn.
[0268] In this embodiment of the invention, multiple outer surface images of a target shiitake mushroom log are acquired from surrounding angles. Each outer surface image is used as a target image, and target annotation data corresponding to that target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom log area and the background area in the outer surface image. Based on the coordinate data of the boundary line between the mushroom log area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom log image corresponding to the target image. Image stitching processing is performed on the target mushroom log images of the outer surface images from different angles to obtain the unfolded image of the outer surface of the target shiitake mushroom log. The image stitching processing is based on the same image features between the target mushroom log images of the outer surface images from adjacent angles. The unfolded image of the outer surface of the mushroom log is binarized to determine the first average coordinates of the first color value pixels and the mushroom log in the unfolded image of the outer surface of the mushroom log. The second average coordinates of all pixels in the unfolded image of the outer surface are calculated; the Euclidean distance between the first average coordinates and the second average coordinates is calculated; based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn. Compared with the existing technology that manually determines the breeding grade of shiitake mushroom spawn, this invention is based on deep learning technology and image processing technology, and uses the U-net network to perform semantic segmentation on the outer surface image of shiitake mushroom spawn. It can objectively identify and analyze the phenotypic characteristics of shiitake mushroom spawn, realize the standardization of the evaluation process, and automatically execute the image acquisition, processing and analysis process. It reduces manual intervention, improves the level of automation and intelligence, solves the problems of omissions and low efficiency caused by manual labor in the existing technology, and improves the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn.
[0269] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0270] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0271] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0272] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0273] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for determining the breeding grade of shiitake mushroom spawn, characterized in that, include: Acquire multiple images of the outer surface of the target shiitake mushroom log from various angles; Each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image; based on the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image. Image stitching is performed on the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching is based on the same image features between the target mushroom stick images from adjacent angles. The unfolded image of the outer surface of the mushroom stick is binarized to determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; the Euclidean distance between the first average coordinates and the second average coordinates is calculated. Based on the pre-set correlation between different Euclidean distances and different shiitake mushroom spawn breeding grades, the breeding grade of the target shiitake mushroom spawn is determined according to the Euclidean distance of the target shiitake mushroom spawn.
2. The method as described in claim 1, characterized in that, Each outer surface image is used as the target image. Based on deep learning technology, target annotation data corresponding to the target image is determined, including: Each outer surface image is used as the target image, and the target image is input into the mushroom stick region image semantic segmentation model to obtain the target annotation data corresponding to the target image; the mushroom stick region image semantic segmentation model is obtained by training the U-net network deep learning model with historical mushroom stick outer surface annotation data as the training set; the historical mushroom stick outer surface annotation data includes historical data of different outer surface images and historical annotation data corresponding to the historical data of each outer surface image.
3. The method as described in claim 2, characterized in that, Also includes: Using historical mushroom stick outer surface annotation data of a predetermined proportion as validation and test sets, the trained U-net network deep learning model is validated and tested to obtain a mushroom stick region image semantic segmentation model that has passed validation and testing. Each outer surface image is used as the target image. This target image is input into the semantic segmentation model of the mushroom stick region image to obtain the target annotation data corresponding to the target image, including: Each outer surface image is used as the target image. The target image is then input into the semantic segmentation model of the mushroom stick area image after verification and testing to obtain the target annotation data corresponding to the target image.
4. The method as described in claim 1, characterized in that, Image stitching is performed on the target mushroom log images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom log, including: Extract feature points from the target mushroom stick image of the outer surface image at each angle; By using a feature matching algorithm, feature points in the target mushroom stick images of the outer surface images from adjacent angles are matched to determine the matching feature point pairs between the target mushroom stick images of the outer surface images from adjacent angles. Using perspective transformation technology, the target mushroom stick image of the outer surface image at each angle is image registered to obtain the registered image. Based on the matching feature point pairs, multiple registered images are stitched together to obtain an unfolded image of the outer surface of the target shiitake mushroom log.
5. The method as described in claim 1, characterized in that, The unfolded image of the outer surface of the mushroom stick is binarized to determine the first average coordinates of the first color value pixels in the unfolded image and the second average coordinates of all pixels in the unfolded image, including: Based on a preset color value threshold, the unfolded image of the outer surface of the mushroom stick is binarized to determine the first color value pixel and the second color value pixel in the unfolded image of the outer surface of the mushroom stick. Calculate the first average coordinates of the first color value pixel and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick.
6. The method as described in claim 1, characterized in that, Also includes: Determine the first area of the first color value pixel in the unfolded image of the outer surface of the mushroom stick, and the second area of all pixels in the unfolded image of the outer surface of the mushroom stick; Calculate the ratio between the first area and the second area.
7. A device for determining the breeding grade of shiitake mushroom spawn, characterized in that, include: The outer surface image acquisition module is used to acquire outer surface images from multiple angles around the target shiitake mushroom log; The annotation data determination module is used to take each outer surface image as a target image and determine the target annotation data corresponding to the target image based on deep learning technology. The annotation data is the coordinate data of the boundary line between the mushroom stick area and the background area in the outer surface image; based on the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, the target background image in the target image is removed to obtain the target mushroom stick image corresponding to the target image. The image stitching processing module is used to stitch together the target mushroom stick images from different angles to obtain an unfolded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is based on the same image features between the target mushroom stick images from adjacent angles. The binarization module is used to perform binarization processing on the unfolded image of the outer surface of the mushroom stick, determine the first average coordinates of the first color value pixel in the unfolded image of the outer surface of the mushroom stick and the second average coordinates of all pixels in the unfolded image of the outer surface of the mushroom stick; and calculate the Euclidean distance between the first average coordinates and the second average coordinates. The breeding grade determination module is used to determine the breeding grade of the target shiitake mushroom log based on the Euclidean distance of the target shiitake mushroom log, according to the pre-set correlation between different Euclidean distances and different shiitake mushroom log breeding grades.
8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method of any one of claims 1 to 6.