Method and device for determining breeding grade of mushroom sticks
Through deep learning technology and image processing technology, multi-angle images are used for semantic segmentation, splicing and binarization, and Euclidean distance is calculated, which solves the problems of subjectivity and low efficiency of traditional sensory evaluation, and realizes the level of mushroom stick breeding. Efficient and accurate judgment.
Patent Information
- Application Number
- CN202410568202.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-09
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-05-09
AI Technical Summary
It is difficult to standardize the traditional method through sensory evaluation, which leads to the problems of strong subjectivity, low accuracy and low efficiency in judging the grade of mushroom stick breeding.
Deep learning technology and image processing technology are used to obtain multi-angle external surface images of Lentinus edodes mushroom sticks, perform semantic segmentation, image splicing and binarization processing, and calculate Euclidean distance to determine the breeding level.
The standardization and automation of mushroom stick breeding levels have been achieved, the accuracy and efficiency of judgment have been improved, manual intervention has been reduced, and the accuracy and efficiency of determining breeding levels have been improved.
Smart Images

Figure CN118691872A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a method and device for determining the breeding grade of shiitake mushroom sticks. Background Art
[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No description herein is admitted to be prior art by inclusion in this section.
[0003] Shiitake mushroom sticks are the substrate for the growth of shiitake mushrooms. Under different environmental conditions, the mycelium on the surface of the sticks has different states, showing differences in color depth and color uniformity. Therefore, in order to accurately obtain the phenotypic data of shiitake mushroom sticks and judge the breeding grade of shiitake mushroom sticks, an efficient and intelligent collection and analysis system is needed.
[0004] The traditional measurement method mainly uses sensory evaluation to evaluate and record the phenotype of shiitake mushroom sticks, and then manually judge the breeding grade of shiitake mushroom sticks. This is highly subjective and difficult to standardize, which may lead to large differences in the evaluation results. It is also difficult to avoid omissions and low efficiency due to manual work, which leads to low accuracy and efficiency in determining the breeding grade of shiitake mushroom sticks. Summary of the invention
[0005] The embodiment of the present invention provides a method for determining the breeding grade of shiitake mushroom spawn sticks, so as to improve the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn sticks. The method comprises:
[0006] Acquire outer surface images taken at multiple angles around the target shiitake mushroom stick;
[0007] Taking each outer surface image as a target image, determining target annotation data corresponding to the target image based on deep learning technology; the annotation data is coordinate data of a boundary line between a mushroom stick area and a background area in the outer surface image; removing the target background image in the target image according to the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, and obtaining a target mushroom stick image corresponding to the target image;
[0008] Performing image stitching processing on target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between target mushroom stick images of outer surface images at adjacent angles;
[0009] Binarization is performed on the expanded image of the outer surface of the mushroom stick to determine the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and the Euclidean distance between the first average coordinate and the second average coordinate is calculated;
[0010] According to the association relationship between different preset Euclidean distances and different shiitake mushroom spawn stick breeding grades, the breeding grade of the target shiitake mushroom spawn stick is determined according to the Euclidean distance of the target shiitake mushroom spawn stick.
[0011] The embodiment of the present invention further provides a device for determining the breeding grade of shiitake mushroom spawn sticks, which is used to improve the accuracy and efficiency of determining the breeding grade of shiitake mushroom spawn sticks. The device includes:
[0012] An outer surface image acquisition module is used to acquire outer surface images taken at multiple angles around a target mushroom stick;
[0013] A labeling data determination module is used to take each outer surface image as a target image, and determine target labeling data corresponding to the target image based on deep learning technology; the labeling data is coordinate data of a boundary line between a mushroom stick area and a 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 labeling data, a target background image in the target image is removed to obtain a target mushroom stick image corresponding to the target image;
[0014] An image stitching processing module is used to stitch target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between target mushroom stick images of outer surface images at adjacent angles;
[0015] A binarization processing module is used to perform binarization processing on the expanded image of the outer surface of the mushroom stick, determine the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and calculate the Euclidean distance between the first average coordinate and the second average coordinate;
[0016] The breeding grade determination module is used to determine the breeding grade of the target shiitake mushroom stick according to the association relationship between different preset Euclidean distances and different breeding grades of shiitake mushroom sticks and the Euclidean distance of the target shiitake mushroom stick.
[0017] An embodiment of the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned method for determining the breeding grade of shiitake mushroom sticks when executing the computer program.
[0018] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for determining the breeding grade of shiitake mushroom spawn is implemented.
[0019] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for determining the breeding grade of shiitake mushroom sticks is implemented.
[0020] In an embodiment of the present invention, outer surface images taken at multiple angles around a target shiitake mushroom stick are obtained; each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on a deep learning technology; the annotation data is coordinate data for annotating a boundary line between a mushroom stick area and a 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 a target mushroom stick image corresponding to the target image; image stitching processing is performed on the target mushroom stick images of the outer surface images at different angles to obtain an expanded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is performed based on the same image features between the target mushroom stick images of the outer surface images at adjacent angles; the expanded 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 expanded image of the outer surface of the mushroom stick and the The invention discloses a method for determining the breeding grade of a target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick, and a method for determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick. The method is characterized in that the method comprises the following steps: first, a second average coordinate of all pixel points in the outer surface unfolded image; calculating the Euclidean distance between the first average coordinate and the second average coordinate; determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick according to the correlation between different preset Euclidean distances and different breeding grades of the shiitake mushroom sticks. Compared with the technical scheme of manually determining the breeding grade of the shiitake mushroom sticks in the prior art, the present invention is based on deep learning technology and image processing technology, and uses a U-net network to perform semantic segmentation on the outer surface image of the shiitake mushroom stick, so as to objectively identify and analyze the phenotypic characteristics of the shiitake mushroom sticks, realize standardization of the evaluation process, automatically execute the image acquisition, processing and analysis process, reduce manual intervention, improve the level of automation and intelligence, solve the problems of omissions and low manual efficiency that are difficult to avoid in the prior art, and improve the accuracy and efficiency of determining the breeding grade of the shiitake mushroom sticks. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0022] Figure 1 A schematic diagram of a process for determining the breeding grade of shiitake mushroom sticks according to an embodiment of the present invention;
[0023] Figure 2A specific example diagram of a method for determining the breeding grade of shiitake mushroom sticks in an embodiment of the present invention;
[0024] Figure 3 A specific example diagram of a method for determining the breeding grade of shiitake mushroom sticks in an embodiment of the present invention;
[0025] Figure 4 A specific example diagram of a method for determining the breeding grade of shiitake mushroom sticks in an embodiment of the present invention;
[0026] Figure 5 A specific example diagram of a method for determining the breeding grade of shiitake mushroom sticks in an embodiment of the present invention;
[0027] Figure 6 This is a schematic diagram of the structure of a device for determining the breeding grade of shiitake mushroom sticks according to an embodiment of the present invention;
[0028] Figure 7 Schematic diagram of a computer device for determining the breeding grade of shiitake mushroom sticks in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary 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] The term "and / or" herein only describes an association relationship, indicating that three relationships may exist. For example, A and / or B may represent the following three situations: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C may represent 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 "include", "including", "have", "contain", etc. are all open terms, which mean including but not limited to. The descriptions with reference to the terms "one embodiment", "a specific embodiment", "some embodiments", "for example", etc. mean that the specific features, structures or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. The order of steps involved in each embodiment is used to schematically illustrate the implementation of the present application, and the order of steps is not limited and can be appropriately adjusted as needed.
[0032] The acquisition, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. The information collected in this application is information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure, and application of relevant data are in compliance with the relevant laws, regulations, and standards of relevant countries and regions, and necessary confidentiality measures are taken, which do not violate public order and good customs, and provide corresponding operation entrances for users to choose to authorize or refuse. In addition, this application provides users with corresponding operation entrances for users to choose to agree or refuse the results of automated decision-making. If the user chooses to refuse, they can enter the expert decision-making process.
[0033] Shiitake mushroom sticks are the substrate for the growth of shiitake mushrooms. Under different environmental conditions, the mycelium on the surface of the sticks has different states, showing differences in color depth and color uniformity. Therefore, in order to accurately obtain the phenotypic data of shiitake mushroom sticks and judge the breeding grade of shiitake mushroom sticks, an efficient and intelligent collection and analysis system is needed.
[0034] The traditional measurement method mainly uses sensory evaluation to evaluate and record the phenotype of shiitake mushroom sticks, and then manually judge the breeding grade of shiitake mushroom sticks. This is highly subjective and difficult to standardize, which may lead to large differences in the evaluation results. It is also difficult to avoid omissions and low efficiency due to manual work, which leads to low accuracy and efficiency in determining the breeding grade of shiitake mushroom sticks.
[0035] In order to solve the above problems, the embodiment of the present invention provides a method for determining the breeding grade of shiitake mushroom sticks, so as to improve the accuracy and efficiency of determining the breeding grade of shiitake mushroom sticks, see Figure 1 , the method may include:
[0036] Step 101: Acquire outer surface images taken at multiple angles around a target shiitake mushroom stick;
[0037] Step 102: taking each outer surface image as a target image, and determining target annotation data corresponding to the target image based on deep learning technology; the annotation data is coordinate data of a boundary line between a mushroom stick area and a 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, removing the target background image in the target image, and obtaining a target mushroom stick image corresponding to the target image;
[0038] Step 103: performing image stitching processing on the target mushroom stick images of the outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between the target mushroom stick images of the outer surface images at adjacent angles;
[0039] Step 104: binarizing the expanded image of the outer surface of the mushroom stick, determining the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and calculating the Euclidean distance between the first average coordinate and the second average coordinate;
[0040] Step 105: According to the association relationship between different preset Euclidean distances and different breeding grades of shiitake mushroom spawn sticks, and according to the Euclidean distance of the target shiitake mushroom spawn stick, the breeding grade of the target shiitake mushroom spawn stick is determined.
[0041] In an embodiment of the present invention, outer surface images taken at multiple angles around a target shiitake mushroom stick are obtained; each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on a deep learning technology; the annotation data is coordinate data for annotating a boundary line between a mushroom stick area and a 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 a target mushroom stick image corresponding to the target image; image stitching processing is performed on the target mushroom stick images of the outer surface images at different angles to obtain an expanded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is performed based on the same image features between the target mushroom stick images of the outer surface images at adjacent angles; the expanded 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 expanded image of the outer surface of the mushroom stick and the The invention discloses a method for determining the breeding grade of a target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick, and a method for determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick. The method is characterized in that the method comprises the following steps: first, a second average coordinate of all pixel points in the outer surface unfolded image; calculating the Euclidean distance between the first average coordinate and the second average coordinate; determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick according to the correlation between different preset Euclidean distances and different breeding grades of the shiitake mushroom sticks. Compared with the technical scheme of manually determining the breeding grade of the shiitake mushroom sticks in the prior art, the present invention is based on deep learning technology and image processing technology, and uses a U-net network to perform semantic segmentation on the outer surface image of the shiitake mushroom stick, so as to objectively identify and analyze the phenotypic characteristics of the shiitake mushroom sticks, realize standardization of the evaluation process, automatically execute the image acquisition, processing and analysis process, reduce manual intervention, improve the level of automation and intelligence, solve the problems of omissions and low manual efficiency that are difficult to avoid in the prior art, and improve the accuracy and efficiency of determining the breeding grade of the shiitake mushroom sticks.
[0042] In a specific implementation, firstly, the outer surface images taken at multiple angles around the target shiitake mushroom stick are obtained.
[0043] In an embodiment, this step can be achieved by using a fixed or movable shooting device, such as a ring-shaped shooting platform or a multi-angle photography system, to achieve all-round image acquisition of the shiitake mushroom sticks. The device is equipped with multiple cameras, which can automatically or manually adjust the shooting angle to ensure that the detailed features of the mushroom sticks are captured from different directions.
[0044] When collecting images, it is necessary to ensure that the lighting conditions are consistent and the background is simple in order to reduce interference factors in the image processing process. In addition, in order to ensure image quality, the camera resolution and shooting parameters (such as focal length, shutter speed, ISO sensitivity, etc.) need to be optimized according to the actual size and surface characteristics of the mushroom sticks.
[0045] The collected image data is then transferred to a processing system that has image storage, management, and preprocessing capabilities. During the image preprocessing stage, some basic operations such as denoising, contrast enhancement, and color correction can be performed to improve the accuracy and efficiency of subsequent deep learning models when processing images.
[0046] In the above embodiment, after obtaining the outer surface images taken at multiple angles around the target shiitake mushroom stick, these images are first preprocessed, including adjusting the image size, contrast enhancement, and color standardization, to ensure that the image data input to the deep learning model is consistent and high quality. This step is crucial to improving the recognition accuracy of the model.
[0047] Next, each outer surface image is used as a target image and input into a well-trained deep learning model. In this embodiment, a semantic segmentation model based on the U-net architecture is used. The model is trained with a large number of precisely annotated shiitake mushroom stick images and can effectively identify and segment the mushroom stick area and the background area. The output of the model is a segmentation map of the same size as the input image, in which each pixel is labeled as belonging to the mushroom stick area or the background area.
[0048] In order to obtain accurate boundary coordinate data, the embodiment uses image post-processing technology, such as edge detection algorithm, to identify and extract the precise boundary between the mushroom stick area and the background area in the segmentation map. These coordinate data are used to remove the background from the original image and retain only the mushroom stick area, thereby obtaining a pure target mushroom stick image. This step is very critical for subsequent morphological analysis and breeding grade evaluation.
[0049] In the process of background removal, image fusion technology may also be used to fuse the segmentation results of the same mushroom stick area in adjacent images to eliminate segmentation inconsistencies caused by shooting angles or lighting changes, ensuring that the obtained mushroom stick images are accurate and continuous.
[0050] In a specific implementation, after obtaining outer surface images taken at multiple angles around a target shiitake mushroom stick, 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 coordinate data for annotating a boundary line between a mushroom stick area and a background area in the outer surface image; based on the coordinate data of the boundary line between a mushroom stick area and a background area in the target annotation data, the target background image in the target image is removed to obtain a 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 the target image is determined based on deep learning technology, including:
[0052] Each outer surface image is taken as a target image, and the target image is input into a semantic segmentation model of a mushroom stick region image to obtain target annotation data corresponding to the target image; the semantic segmentation model of the mushroom stick region image is obtained by training a U-net network deep learning model using historical mushroom stick outer surface annotation data as a training set; the historical mushroom stick outer surface annotation data includes historical data of different outer surface images and historical annotation data corresponding to each outer surface image historical data.
[0053] Take an example of a "target bacteria stick image of a target image", such as Figure 3 As shown:
[0054] Figure 3 The left image in the middle shows a black background image containing only the mushroom stick area after semantic segmentation. The right image shows the left Figure 2 The image after valuating, where the white area on the left is covered by pure white pixels, and the brown and black areas are covered by pure black.
[0055] In the above embodiment, the following detailed steps may be involved:
[0056] 1. Image preprocessing:
[0057] Before the outer surface image is input into the deep learning model, a series of preprocessing operations are first performed, such as adjusting the image size, standardizing the pixel value, and enhancing the image contrast, to improve the efficiency and accuracy of the model in processing the image.
[0058] 2. Establishment and training of semantic segmentation model:
[0059] Use the U-net network architecture, which is a deep learning model designed specifically for image segmentation tasks and is widely used due to its excellent performance and effects.
[0060] The U-net model is trained by supervised learning using historical mushroom stick surface images and their corresponding annotated data as training sets. During the training process, the model learns how to distinguish between the mushroom stick area and the background area, so that it can accurately perform semantic segmentation.
[0061] 3. Generation of target annotation data:
[0062] The trained U-net model is used to process each external surface image, and the segmentation results output by the model are the target annotation data, which detail the coordinates of the dividing line between the mushroom stick area and the background area.
[0063] 4. Extraction of mushroom stick area:
[0064] According to the target annotation data, image processing techniques such as threshold segmentation or region growing algorithm are used to separate the mushroom stick area from the original image. This step will remove background interference and obtain a pure target mushroom stick image.
[0065] 5. Post-processing and optimization:
[0066] In order to further improve the accuracy of segmentation, it may be necessary to post-process the segmentation results, such as removing small noise areas, filling unsegmented mushroom stick areas, etc.
[0067] Through these optimization steps, the obtained mushroom stick images are ensured to be highly accurate and usable, providing a solid foundation for subsequent analysis and evaluation.
[0068] In the embodiment, the whole process is automated, and a large number of shiitake mushroom stick images can be processed quickly, greatly improving the efficiency of data processing. In addition, through the continuous optimization of deep learning technology and iterative updating of the model, the system can adapt to image segmentation tasks under various complex conditions, ensuring accurate identification and analysis of shiitake mushroom sticks in different growth stages and environments.
[0069] In one embodiment, it further includes:
[0070] The preset proportion of historical mushroom stick outer surface annotation data is used as the validation set and test set to verify and test the trained U-net network deep learning model, and the semantic segmentation model of the mushroom stick area image is obtained after verification and testing;
[0071] Each outer surface image is used as a 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, including:
[0072] Each outer surface image is taken as a target image, and the target image is 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, the historical mushroom stick outer surface annotation data can be divided into a validation set and a test set according to a preset ratio (for example, 70% for training, 15% for validation, and 15% for testing).
[0074] The validation set is used as an intermediate checkpoint in the model training process 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 model training is completed to ensure that the model can maintain good segmentation effects on unseen data.
[0076] In the above embodiment, after obtaining the outer surface images taken at multiple angles around the target shiitake mushroom stick, these images are first preprocessed, including adjusting the image size, contrast enhancement, and color standardization, to ensure that the image data input to the deep learning model is consistent and high quality. This step is crucial to improving the recognition accuracy of the model.
[0077] Next, each outer surface image is used as a target image and input into a well-trained deep learning model. In this embodiment, a semantic segmentation model based on the U-net architecture is used. The model is trained with a large number of precisely annotated shiitake mushroom stick images and can effectively identify and segment the mushroom stick area and the background area. The output of the model is a segmentation map of the same size as the input image, in which each pixel is labeled as belonging to the mushroom stick area or the background area.
[0078] In order to obtain accurate boundary coordinate data, the embodiment uses image post-processing technology, such as edge detection algorithm, to identify and extract the precise boundary between the mushroom stick area and the background area in the segmentation map. These coordinate data are used to remove the background from the original image and retain only the mushroom stick area, thereby obtaining a pure target mushroom stick image. This step is very critical for subsequent morphological analysis and breeding grade evaluation.
[0079] In the process of background removal, image fusion technology may also be used to fuse the segmentation results of the same mushroom stick area in adjacent images to eliminate segmentation inconsistencies caused by shooting angles or lighting changes, ensuring that the obtained mushroom stick images are accurate and continuous.
[0080] Finally, the obtained series of target mushroom stick images will be used for further analysis, such as calculating the shape, size, surface texture and other characteristics of the mushroom sticks, as well as performing binarization processing and Euclidean distance calculation, which are important parameters for evaluating the breeding grade of shiitake mushroom sticks. Through these advanced image processing and analysis technologies, accurate evaluation of shiitake mushroom sticks can be performed automatically, greatly improving the efficiency and accuracy of breeding work.
[0081] Take an example of building a semantic segmentation model for mushroom stick area images, such as Figure 2 As shown, the steps may include:
[0082] 1. Use labelme software to accurately annotate the collected mushroom stick images at the pixel level 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 annotation 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 training set and validation set in a ratio of 4:1 to ensure that the training set contains more samples to learn features.
[0086] 5. Build a U-net network model, which includes downsampling and upsampling structures, as well as necessary convolutional layers, pooling layers, and deconvolution layers.
[0087] 6. Import the training set data into the U-net network to start the model training process.
[0088] 7. Use Miou (mean intersection over union) as the evaluation indicator to count and plot the model prediction results on the validation set.
[0089] 8. If the Miou value is less than 95%, adjust the network parameters such as learning rate, number or size of convolutional layers, regularization terms, etc., and then retrain the model.
[0090] 9. If the Miou value is greater than 95%, a good performing deep learning model is obtained.
[0091] 10. Apply the trained model to the actual shiitake mushroom stick image data for semantic segmentation to obtain accurate segmentation results of the mushroom stick area.
[0092] 11. Based on the performance of the model in actual applications, necessary iterative optimization should be carried out to adapt to possible changes in data distribution or new application scenarios.
[0093] In a specific implementation, each outer surface image is taken as a target image, target annotation data corresponding to the target image is determined based on deep learning technology, and the target background image in the target image is removed according to the coordinate data of the dividing line between the mushroom stick area and the background area in the target annotation data. After obtaining the target mushroom stick image corresponding to the target image, the target mushroom stick images of the outer surface images at different angles are subjected to image stitching processing to obtain the mushroom stick outer surface expanded image of the target shiitake mushroom stick; the image stitching processing is performed based on the same image features between the target mushroom stick images of the outer surface images at adjacent angles.
[0094] In one embodiment, the target mushroom stick images of the outer surface images at different angles are subjected to image stitching processing to obtain the expanded image of the outer surface of the target shiitake mushroom stick, including:
[0095] Extract the characteristic points of the target mushroom stick image of the outer surface image at each angle;
[0096] By using a feature matching algorithm, feature points in target mushroom stick images of outer surface images at adjacent angles are matched to determine matching feature point pairs between target mushroom stick images of outer surface images at adjacent angles;
[0097] Perspective transformation technology is used to perform image registration on the target mushroom stick image of the outer surface image at each angle to obtain the registered image;
[0098] According to the matching feature point pairs, multiple registered images are stitched to obtain an expanded image of the outer surface of the target shiitake mushroom stick.
[0099] For example, Figure 5 As shown, Figure 5 An example of the image stitching process is shown, in which the leftmost image shows the two images that need to be stitched together; the middle image shows the same feature points connected by lines after feature detection; the rightmost image shows the effect of the two images after stitching.
[0100] In the above embodiment, image stitching processing is a key step in realizing the unfolded image of the outer surface of the mushroom stick, which involves the following detailed stages:
[0101] 1. Feature point extraction: For each target mushroom stick image at each angle, use advanced feature point extraction algorithms (such as SIFT, SURF or ORB) to identify and extract key feature points in the image. These feature points are usually prominent locations in the image, such as the edge of the mushroom stick, the center of the texture, or other unique visual patterns.
[0102] 2. Feature matching: Through feature matching algorithms, such as homography matching or nearest neighbor matching based on descriptors, the feature points of an image at one angle are matched with the feature points of an image at an adjacent angle. This step aims to find corresponding feature point pairs across images, providing a basis for subsequent image alignment and stitching.
[0103] 3. Perspective transformation and image registration: Perspective transformation technology is used to correct the images at each angle to eliminate perspective distortion and keep the mushroom stick images consistent in proportion and direction at different angles. Image registration is to align the corrected images into a common coordinate system to ensure that the mushroom stick areas between different images can be accurately spliced together.
[0104] 4. Image stitching: Based on image registration, use image stitching algorithms (such as multi-band blending, Poisson fusion, etc.) to seamlessly stitch the mushroom stick areas of multiple images into a complete expanded image. This step requires processing the fusion problem of overlapping areas of the images to ensure that the stitching result is visually natural and has no obvious seams.
[0105] 5. Post-processing and optimization: The stitched images may require further post-processing, such as removing stitching marks, smoothing transition areas, enhancing image quality, etc., to improve the quality and usability of the final unfolded image.
[0106] Through these optimization steps, the obtained image of the outer surface of the mushroom stick is ensured to be highly accurate and clear, providing reliable data support for subsequent morphological analysis and breeding grade evaluation.
[0107] In the embodiment, the whole process is automated, and a large number of shiitake mushroom stick images can be processed quickly, greatly improving the efficiency of data processing. In addition, through the continuous optimization of deep learning technology and iterative updating of the model, the system can adapt to image stitching tasks under various complex conditions, ensuring accurate identification and analysis of shiitake mushroom sticks in different growth stages and environments.
[0108] In the above embodiment, after the target mushroom stick image is acquired, the next step is to effectively stitch these images taken from different angles to form a complete image of the outer surface of the mushroom stick. This step is crucial for comprehensively analyzing the morphological characteristics of the mushroom stick and conducting accurate breeding grade evaluation.
[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, the center of the texture, or the edge point. Using feature point detection algorithms such as SIFT, SURF, or ORB, these key points can be identified in each image.
[0110] Once the feature points are detected, a feature matching algorithm is used to find the corresponding feature points between different images. This can be achieved by comparing the descriptors of the feature points, which is a method of encoding the local information of the feature points into a high-dimensional vector, so that they can be accurately matched even under different viewing angles.
[0111] The matched feature point pairs will be used for perspective transformation and image registration between images. Perspective transformation is a geometric transformation that can adjust the angle and position of the image according to the matching relationship of the feature points, so that the mushroom stick areas in different images can be accurately aligned. The image registration principle is to superimpose the transformed images together to form a seamless panoramic image.
[0112] In the process of image stitching, it may be necessary to solve problems such as occlusion and inconsistent lighting. To solve these problems, image fusion techniques such as multi-band blending, Poisson fusion or other advanced fusion algorithms can be used to smoothly transition the stitching edges and maintain the visual coherence of the image.
[0113] After the image stitching is completed, an expanded, continuous image of the outer surface of the mushroom stick will be obtained, which shows the full picture of the mushroom stick and provides a basis for subsequent binarization processing, Euclidean distance calculation and breeding grade evaluation. Through this advanced image processing technology, the morphological characteristics of the mushroom stick can be analyzed more accurately, thus providing a scientific basis for breeding and improving the production quality and efficiency of the mushroom.
[0114] In a specific implementation, after image stitching processing is performed on target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target shiitake mushroom stick, the expanded 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 expanded image of the outer surface of the mushroom stick and the second average coordinates of all pixel points in the expanded image of the outer surface of the mushroom stick; and the Euclidean distance between the first average coordinate and the second average coordinate is calculated.
[0115] In one embodiment, the expanded 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 expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick, including:
[0116] Based on a preset color value threshold, the expanded image of the outer surface of the mushroom stick is binarized to determine a first color value pixel point and a second color value pixel point in the expanded image of the outer surface of the mushroom stick;
[0117] The first average coordinates of the first color value pixel points and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick are calculated respectively.
[0118] For example, Figure 4In the figure, point A represents the average coordinates of the white pixels; point B represents the average coordinates of all pixels in the mushroom stick area. The pixel distance between two points is the Euclidean distance.
[0119] In the above embodiment, binarization is a key step in the image analysis process, which converts a color or grayscale image into an image containing only two colors (usually black and white) so that specific areas in the image can be more easily identified and processed. The following are the detailed steps of binarization in the embodiment:
[0120] 1. Color value threshold setting: According to the specific characteristics of the mushroom sticks and the preprocessing results of the image, set a suitable color value threshold. This threshold is used to distinguish the mushroom stick area from the background area, and is usually based on the histogram distribution of the image or the optimal value determined by experiments.
[0121] 2. Binarization operation: Apply a binarization algorithm, such as a global threshold or a local threshold method, to classify each pixel in the expanded image of the outer surface of the mushroom stick as belonging to the mushroom stick area (pixel of the first color value, such as white) or the background area (pixel of the second color value, such as black).
[0122] 3. Average coordinate calculation: For the binarized image, calculate the coordinates of all pixels of the first color value to obtain the average coordinates of the mushroom stick area. This can be achieved by averaging the (x, y) coordinates of all pixels belonging to the mushroom stick area.
[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 sticks, for example, to evaluate the size, shape or growth status of the mushroom sticks.
[0125] In one embodiment, it further includes:
[0126] Determine a first area of a pixel point of a first color value in an expanded image of the outer surface of a mushroom stick and a second area of all pixel points in the expanded image of the outer surface of a mushroom stick; and calculate a ratio between the first area and the second area.
[0127] For example, after successfully acquiring an image of the outer surface of a shiitake mushroom stick, the next step is to perform binarization on the image. Binarization is a common technique in image analysis that converts an image into an image containing only two colors (usually black and white) to make it easier to analyze and process specific features in the image.
[0128] First, a suitable threshold is selected to binarize the expanded image. This threshold can be automatically determined based on image histogram analysis or a fixed value set based on experience. During the binarization process, all pixels will be classified as belonging to the mushroom stick area (e.g., white) or the background area (e.g., black) according to the threshold.
[0129] After binarization, the average coordinates of all pixels marked as mushroom stick areas (first color value pixels) are calculated, which can be achieved by averaging the (x, y) coordinates of all these pixels. At the same time, the coordinates of all pixels in the entire image, including the mushroom stick area and the background area (second average coordinates), are also calculated to obtain the center position of the image.
[0130] Next, in the embodiment, the Euclidean distance formula is used to calculate the distance between the first average coordinate and the second average coordinate. In a two-dimensional space, the Euclidean distance is the straight-line distance between two points.
[0131] The calculated Euclidean distance can be used to quantitatively analyze the morphological characteristics of shiitake mushroom sticks. For example, the Euclidean distance can be used as an indicator to evaluate the shape, size and growth status of mushroom sticks. In addition, this distance can be combined with the preset breeding grade standard to automatically determine the breeding grade of shiitake mushroom sticks, thereby providing a scientific basis for the cultivation and selection of shiitake mushrooms.
[0132] In addition, the binary image can be further analyzed in the embodiment, such as calculating the area, perimeter, texture characteristics, etc. of the mushroom stick area, and combining these data with the Euclidean distance to obtain more comprehensive mushroom stick phenotypic information. 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, according to the association between different preset Euclidean distances and different breeding grades of shiitake mushroom sticks, the breeding grade of the target shiitake mushroom stick is determined according to the Euclidean distance of the target shiitake mushroom stick.
[0134] In the embodiment, after calculating the Euclidean distance between the first average coordinate and the second average coordinate, the breeding grade of the target shiitake mushroom spawn can be determined using a pre-established association model between the Euclidean distance and the breeding grade of the shiitake mushroom spawn. This association model is established 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, the association model can be retrieved from a database or obtained by analyzing historical data sets. This model can be a machine learning based classifier, such as a support vector machine (SVM), a decision tree, or a neural network, all of which are trained based on the morphological characteristics of shiitake mushroom sticks and known breeding grades. During the training process, the model learns the correspondence between different Euclidean distance ranges and specific breeding grades.
[0136] Next, the calculated Euclidean distance is input into the association model. The model will output a predicted breeding grade based on the learned mapping relationship. This grade reflects the quality and growth status of the target shiitake mushroom sticks, which is of great significance for breeding decisions and yield prediction.
[0137] In addition, embodiments may include a feedback mechanism for continuously optimizing and adjusting the association model. As new data is continuously collected and analyzed, the model will be regularly updated to improve the accuracy and reliability of its predictions. This dynamic update mechanism ensures that the system can adapt to changes in the morphological characteristics of shiitake mushroom sticks and advances in breeding technology.
[0138] Finally, the determined breeding grade will be recorded in the electronic archive of the target shiitake mushroom logs and can be used to guide subsequent breeding, planting and management decisions. In addition, this information can be presented to end users, such as shiitake mushroom growers or researchers, through a user interface to help them better understand and manage the growth process of shiitake mushrooms.
[0139] Through this method based on deep learning and image analysis, the system in the embodiment not only improves the accuracy and efficiency of mushroom spawn breeding grade assessment, but also provides strong technical support for the sustainable development of the mushroom industry.
[0140] In specific implementation, the method for determining the breeding grade of shiitake mushroom sticks provided by the embodiment of the present invention may also include: recording and analyzing the growth habits and environmental adaptability of the sticks. By analyzing the image data of a large number of shiitake mushroom sticks, the growth patterns and responses to environmental changes of sticks of different breeding grades 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 performed:
[0142] 1. Growth habit analysis: Use deep learning models to analyze the growth pattern of mushroom sticks, such as the growth rate of mushroom sticks, the density and distribution of hyphae, etc. By tracking the growth changes of the same mushroom sticks for a long time, a growth model can be established to predict the maturity time and yield of the mushroom sticks.
[0143] 2. Environmental adaptability assessment: Combined with environmental monitoring data, evaluate the adaptability of different breeding grades of mushroom sticks to environmental factors such as temperature, humidity, and light. Analyze the growth performance of mushroom sticks under different environmental conditions to provide a basis for selecting breeding grades suitable for specific environments.
[0144] 3. Breeding decision support: Based on the growth habits and environmental adaptability analysis results of mushroom sticks, we provide decision support for breeders to help them choose the best breeding strategy. By predicting the yield and quality of mushroom sticks of different breeding grades, we guide breeders in variety selection and planting plans.
[0145] 4. Cultivation management optimization: Use the analysis results to optimize cultivation management measures, such as adjusting irrigation, fertilization, and pest control strategies to improve the overall yield and quality of shiitake mushrooms. Provide growers with personalized management suggestions and adjust cultivation measures according to the actual growth conditions of mushroom sticks.
[0146] A specific embodiment is given below to illustrate the specific application of the method of the present invention. The specific embodiment provides a mushroom stick phenotypic data collection and analysis system based on deep learning. The specific application can be implemented according to the following steps:
[0147] Step 1: Image acquisition: Use a fixed camera to obtain images of the side of the mushroom sticks under different environmental conditions, covering multiple angles;
[0148] Step 2: Deep learning training: Use 100-300 images and their annotation data to train in the U-net network to generate an efficient semantic segmentation model;
[0149] Step 3: Semantic segmentation: Perform semantic segmentation in all data sets to extract image information of the mushroom stick area;
[0150] Step 4: Image stitching: stitch multiple images of the same mushroom stick seamlessly through 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 area and the white area 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 area, and calculate the Euclidean distance between the two coordinates;
[0152] Step 6. Data saving: Save the data in a txt file.
[0153] Compared with the existing technology, the present invention adopts image processing technology based on deep learning to improve the intelligent recognition and accurate discrimination ability of phenotypic traits of shiitake mushroom sticks. The image splicing technology is adopted to fully retain the true morphology of the mushroom sticks. The U-net network is used for training to obtain a deep learning model with good accuracy and strong generalization ability. The method has broad application prospects in the field of phenotypic data collection and analysis of shiitake mushroom sticks. Its advantages include improving data collection accuracy, accelerating analysis speed, and providing new technical means for related research.
[0154] The above steps are expanded as follows:
[0155] 1. Image acquisition:
[0156] Use a fixed shooting device (including a camera and a bracket) to obtain multiple angle images of the side of the shiitake mushroom sticks under different environmental conditions, ensuring that the background is consistent and anti-reflective to prevent local exposure problems.
[0157] 2. Image annotation and conversion:
[0158] Use labelme software to annotate the collected images, generate annotation files in .json format, and convert these files into VOC data format.
[0159] 3. Dataset division:
[0160] The labeled data is randomly divided into a training set, a validation set, and a test set, where the validation set and the test set are equal.
[0161] 4. U-net network construction and training:
[0162] Construct a U-net network, including downsampling (four units, each unit has 3 effective convolutions and one max pooling) and upsampling (four units, each unit performs one deconvolution).
[0163] Adjust network parameters such as input size, activation function, loss function, optimizer, learning rate, batch size, pre-trained weight model, etc.
[0164] Specifically, the steps for building the U-net network deep learning model are given below:
[0165] 1) Downsampling (encoder):
[0166] The downsampling part of the U-net network is also called the encoder, which is responsible for capturing contextual information and features in the image.
[0167] During downsampling, the image is passed through a series of convolutional and pooling layers to gradually reduce its size while increasing its feature depth.
[0168] Each downsampling unit contains 3 effective convolutional layers, which are used to extract image features.
[0169] A maximum pooling operation is performed immediately after each convolutional layer to reduce the spatial dimension of the image and increase the robustness of the model 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 is also called the decoder, which is responsible for mapping the features extracted by the encoder back to the spatial dimensions of the original image.
[0173] During upsampling, the size of the image is gradually increased while reducing the feature depth through a series of deconvolution layers (also called transposed convolution layers).
[0174] Each upsampling unit performs a deconvolution operation to restore the spatial information of the image.
[0175] In order to better fuse the upsampled image with the feature map in the downsampling process, skip connections are usually used after the deconvolution layer.
[0176] 3) Feature map cascade:
[0177] The feature maps in the downsampling process are cascaded with the corresponding feature maps in the upsampling process, so that high-level semantic information can be combined with low-level detail information.
[0178] Cascading is usually implemented through a 1x1 convolution kernel, which can adjust the depth of the feature map while keeping the spatial dimension unchanged.
[0179] 4) Output layer:
[0180] Finally, the final output is completed through a 1x1 convolutional layer, which converts the feature map into an output related to the target task, such as outputting the category probability of each pixel in the semantic segmentation task.
[0181] The design of the output layer depends on the specific application scenario. For example, in the analysis of mushroom stick images, the output layer may output the probability of whether each pixel belongs to the mushroom stick area.
[0182] The U-net network constructed through the above steps can effectively perform semantic segmentation of images and extract the precise area of shiitake mushroom sticks, providing an important basis for subsequent phenotypic data analysis and breeding grade evaluation. U-net has been widely used in medical image processing and agricultural image analysis due to its excellent image segmentation performance and symmetrical network structure.
[0183] Specifically, the following is an example of the parameters of the semantic segmentation model of the mushroom stick area image:
[0184] 1) Image annotation and data format conversion:
[0185] Use labelme software to accurately annotate the collected shiitake mushroom stick images to generate annotation files in .json format.
[0186] Convert the .json annotation file to the VOC data format, which is suitable for training deep learning models.
[0187] 2) Dataset division:
[0188] The labeled dataset is randomly divided into three parts: training set, validation set and test set.
[0189] In particular, the validation set and test set are equal in this model, which means they have the same number of data samples.
[0190] 3) Network parameter adjustment:
[0191] The size of the input image is set to 512*512 pixels, which helps the model better capture the detailed features of the mushroom sticks.
[0192] ReLU is chosen as the activation function because it can effectively solve the gradient vanishing problem and accelerate the convergence of the model.
[0193] Adopting Cos as the loss function may help optimize the performance of the model in classification or regression tasks.
[0194] Adam is chosen as the optimizer because it combines the advantages of RMSProp and Momentum and adjusts the learning rate adaptively.
[0195] The learning rate is set to 0.001, which is a commonly used starting learning rate that helps the model learn stably in the early stages of training.
[0196] The Batch Size is set to 2, which means that the network processes two samples simultaneously in each iteration.
[0197] Use the pre-trained weight model unet_vgg_voc.pth as the initial weights, which helps the model leverage 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 cycles and only the newly added layers are trained.
[0199] unFreeze_Epoch is set to 100, which means that the pre-trained weights are gradually unfrozen over 50 to 100 training cycles, allowing the model to fine-tune the pre-trained layers. Train the model and freeze the weights for the first 50 Epochs during training, then unfreeze 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 performance of the model on the training set and validation set to ensure that the model is not overfitting.
[0203] After training is completed, 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, predict all pixels of the mushroom stick part, and turn other pixels into black to obtain an image containing only the mushroom stick area and the black background.
[0206] 6. Image stitching:
[0207] Multiple images of the same mushroom stick are seamlessly spliced, including feature extraction, feature matching, perspective transformation and image fusion, to form an expanded image of the outer surface of the mushroom stick.
[0208] 7. Binarization processing:
[0209] The expanded image was binarized and the area ratios of the brown and white areas of the mushroom sticks were calculated.
[0210] Calculate the average coordinates of the white pixels in the image and the average coordinates of all pixels in the mushroom stick area.
[0211] Specifically, the binarization process 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 usually uses tools such as cv2.threshold function to set the pixel value in the image to one of two predefined thresholds, thereby converting the image into a black and white binary image.
[0213] 2) Threshold setting: In the binarization process, choosing a suitable threshold is the key. The document mentions using 100 as the threshold, setting pixel values less than 100 to 0 (black), and setting pixel values greater than 100 to 255 (white). Such a threshold setting helps to distinguish the brown and white areas of the mushroom stick.
[0214] 3) Contour extraction: After binary processing, the white pixels in the image represent the brown area of the mushroom stick, while the black pixels represent the background or other non-mushroom stick areas. Using tools such as cv2.findContours function, the contour information in the binary image can be extracted.
[0215] 4) Coordinate calculation: Analyze the extracted contours and calculate the average coordinates of all white pixels and the average coordinates of all pixels in the mushroom stick area. This can be achieved through 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 completed by calculating the straight-line distance between the two points, using np.sqrt and mathematical operations.
[0217] 8. Euclidean distance calculation:
[0218] Compute the Euclidean distance between the two mean coordinates above.
[0219] 9. Data preservation:
[0220] Save the processed data as a txt file, including the image file name, white pixel ratio, black pixel ratio and Euclidean distance.
[0221] 10. Enhanced model generalization ability:
[0222] In order to enhance the generalization ability of the U-Net network, the training data should contain mushroom stick images of different periods ranging from 50 days to 120 days to ensure that the model can adapt to a variety of practical application scenarios.
[0223] Of course, it is understandable that the above detailed process may have other variations, and the relevant variations should all fall within the protection scope of the present invention.
[0224] In an embodiment of the present invention, outer surface images taken at multiple angles around a target shiitake mushroom stick are obtained; each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on a deep learning technology; the annotation data is coordinate data for annotating a boundary line between a mushroom stick area and a 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 a target mushroom stick image corresponding to the target image; image stitching processing is performed on the target mushroom stick images of the outer surface images at different angles to obtain an expanded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is performed based on the same image features between the target mushroom stick images of the outer surface images at adjacent angles; the expanded 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 expanded image of the outer surface of the mushroom stick and the The invention discloses a method for determining the breeding grade of a target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick, and a method for determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick. The method is characterized in that the method comprises the following steps: first, a second average coordinate of all pixel points in the outer surface unfolded image; calculating the Euclidean distance between the first average coordinate and the second average coordinate; determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick according to the correlation between different preset Euclidean distances and different breeding grades of the shiitake mushroom sticks. Compared with the technical scheme of manually determining the breeding grade of the shiitake mushroom sticks in the prior art, the present invention is based on deep learning technology and image processing technology, and uses a U-net network to perform semantic segmentation on the outer surface image of the shiitake mushroom stick, so as to objectively identify and analyze the phenotypic characteristics of the shiitake mushroom sticks, realize standardization of the evaluation process, automatically execute the image acquisition, processing and analysis process, reduce manual intervention, improve the level of automation and intelligence, solve the problems of omissions and low manual efficiency that are difficult to avoid in the prior art, and improve the accuracy and efficiency of determining the breeding grade of the shiitake mushroom sticks.
[0225] The present invention also provides a device for determining the breeding grade of shiitake mushroom spawn sticks, as described in the following embodiments. Since the principle of the device to solve the problem is similar to the method for determining the breeding grade of shiitake mushroom spawn sticks, the implementation of the device can refer to the implementation of the method for determining the breeding grade of shiitake mushroom spawn sticks, and the repeated parts will not be repeated.
[0226] The embodiment of the present invention also provides a device for determining the breeding grade of shiitake mushroom sticks, which is used to improve the accuracy and efficiency of determining the breeding grade of shiitake mushroom sticks. Figure 6 As shown, the device comprises:
[0227] The outer surface image acquisition module 601 is used to acquire outer surface images taken at multiple angles around the target mushroom stick;
[0228] The annotation data determination module 602 is used to take each outer surface image as a target image and determine target annotation data corresponding to the target image based on deep learning technology; the annotation data is coordinate data of a boundary line between a mushroom stick area and a 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 a target mushroom stick image corresponding to the target image;
[0229] An image stitching processing module 603 is used to stitch target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between target mushroom stick images of outer surface images at adjacent angles;
[0230] A binarization processing module 604 is used to perform binarization processing on the expanded image of the outer surface of the mushroom stick, determine the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and calculate the Euclidean distance between the first average coordinate and the second average coordinate;
[0231] The breeding grade determination module 605 is used to determine the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick based on the association relationship between different preset Euclidean distances and different shiitake mushroom stick breeding grades.
[0232] In one embodiment, 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, including:
[0233] Each outer surface image is taken as a target image, and the target image is input into a semantic segmentation model of a mushroom stick region image to obtain target annotation data corresponding to the target image; the semantic segmentation model of the mushroom stick region image is obtained by training a U-net network deep learning model using historical mushroom stick outer surface annotation data as a training set; the historical mushroom stick outer surface annotation data includes historical data of different outer surface images and historical annotation data corresponding to each outer surface image historical data.
[0234] In one embodiment, it further includes:
[0235] The preset proportion of historical mushroom stick outer surface annotation data is used as the validation set and test set to verify and test the trained U-net network deep learning model, and the semantic segmentation model of the mushroom stick area image is obtained after verification and testing;
[0236] Each outer surface image is used as a 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, including:
[0237] Each outer surface image is taken as a target image, and the target image is 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, the target mushroom stick images of the outer surface images at different angles are subjected to image stitching processing to obtain the expanded image of the outer surface of the target shiitake mushroom stick, including:
[0239] Extract the characteristic points of the target mushroom stick image of the outer surface image at each angle;
[0240] By using a feature matching algorithm, feature points in target mushroom stick images of outer surface images at adjacent angles are matched to determine matching feature point pairs between target mushroom stick images of outer surface images at adjacent angles;
[0241] Perspective transformation technology is used to perform image registration on the target mushroom stick image of the outer surface image at each angle to obtain the registered image;
[0242] According to the matching feature point pairs, multiple registered images are stitched to obtain an expanded image of the outer surface of the target shiitake mushroom stick.
[0243] In one embodiment, the expanded 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 expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick, including:
[0244] Based on a preset color value threshold, the expanded image of the outer surface of the mushroom stick is binarized to determine a first color value pixel point and a second color value pixel point in the expanded image of the outer surface of the mushroom stick;
[0245] The first average coordinates of the first color value pixel points and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick are calculated respectively.
[0246] In one embodiment, it further includes:
[0247] Determine a first area of a pixel point of a first color value in an expanded image of the outer surface of a mushroom stick and a second area of all pixel points in the expanded image of the outer surface of a mushroom stick; and calculate a ratio between the first area and the second area.
[0248] The embodiment of the present invention provides an embodiment of a computer device for implementing all or part of the content of the above-mentioned method for determining the breeding grade of shiitake mushroom sticks. The computer device specifically includes the following content:
[0249] A processor, a memory, a communications interface and a bus; wherein the processor, the memory and the communications interface communicate with each other through the bus; the communications interface is used to realize information transmission between related devices; the computer device can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the computer device can be implemented with reference to the embodiment of the method for determining the breeding grade of shiitake mushroom spawn sticks and the embodiment of the device for determining the breeding grade of shiitake mushroom spawn sticks, and the contents thereof are incorporated herein, and the repeated parts are not repeated.
[0250] Figure 7 FIG. 1 is a schematic block diagram of the system structure of the computer device 1000 according to an embodiment of the present application. Figure 7 As shown, the computer device 1000 may include a central processor 1001 and a memory 1002; the memory 1002 is coupled to the central processor 1001. It is worth noting that Figure 7 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0251] In one embodiment, the function of determining the breeding grade of shiitake mushroom sticks may be integrated into the central processor 1001. The central processor 1001 may be configured to perform the following control:
[0252] Acquire outer surface images taken at multiple angles around the target shiitake mushroom stick;
[0253] Taking each outer surface image as a target image, determining target annotation data corresponding to the target image based on deep learning technology; the annotation data is coordinate data of a boundary line between a mushroom stick area and a background area in the outer surface image; removing the target background image in the target image according to the coordinate data of the boundary line between the mushroom stick area and the background area in the target annotation data, and obtaining a target mushroom stick image corresponding to the target image;
[0254] Performing image stitching processing on target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between target mushroom stick images of outer surface images at adjacent angles;
[0255] Binarization is performed on the expanded image of the outer surface of the mushroom stick to determine the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and the Euclidean distance between the first average coordinate and the second average coordinate is calculated;
[0256] According to the association relationship between different preset Euclidean distances and different shiitake mushroom spawn stick breeding grades, the breeding grade of the target shiitake mushroom spawn stick is determined according to the Euclidean distance of the target shiitake mushroom spawn stick.
[0257] In another embodiment, the device for determining the breeding grade of shiitake mushroom sticks can be configured separately from the central processor 1001. For example, the device for determining the breeding grade of shiitake mushroom sticks can be configured as a chip connected to the central processor 1001, and the function of determining the breeding grade of shiitake mushroom sticks can be realized through the control of the central processor.
[0258] like Figure 7 As shown, the computer device 1000 may also 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 have to include Figure 7 In addition, the computer device 1000 may also include Figure 7 For components not shown, reference may be made to the prior art.
[0259] like Figure 7 As shown, the central processor 1001 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor devices and / or logic devices. The central processor 1001 receives inputs and controls the operations of various components of the computer device 1000 .
[0260] The memory 1002 may be, for example, a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices, or one or more thereof. The above-mentioned information related to the failure may be stored, and a program for executing the related information may also be stored. The central processing unit 1001 may execute the program stored in the memory 1002 to implement information storage or processing, etc.
[0261] The input unit 1004 provides input to the CPU 1001. The input unit 1004 is, for example, a key or a touch input device. The power supply 1007 is used to provide power to the computer device 1000. The display 1006 is used to display display objects such as images and text. The display may be, for example, an LCD display, but is not limited thereto.
[0262] The memory 1002 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 1002 may 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, which is used to store application programs and function programs or processes for executing the operation of the computer device 1000 through the central processor 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 executing 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 sends and receives signals via the antenna 1008. The communication module (transmitter / receiver) 1003 is coupled to the central processor 1001 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.
[0265] Based on different communication technologies, multiple communication modules 1003 may be provided in the same computer device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) 1003 is also coupled to a speaker 1009 and a microphone 1010 via an audio processor 1005 to provide an audio output via the speaker 1009 and receive an audio input from the microphone 1010, thereby realizing a common telecommunication function. The audio processor 1005 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 1005 is also coupled to the central processor 1001, so that recording can be performed on the local machine through the microphone 1010, and the sound stored on the local machine can be played through the speaker 1009.
[0266] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned method for determining the breeding grade of shiitake mushroom spawn is implemented.
[0267] An embodiment of the present invention further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method for determining the breeding grade of shiitake mushroom sticks is implemented.
[0268] In an embodiment of the present invention, outer surface images taken at multiple angles around a target shiitake mushroom stick are obtained; each outer surface image is used as a target image, and target annotation data corresponding to the target image is determined based on a deep learning technology; the annotation data is coordinate data for annotating a boundary line between a mushroom stick area and a 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 a target mushroom stick image corresponding to the target image; image stitching processing is performed on the target mushroom stick images of the outer surface images at different angles to obtain an expanded image of the outer surface of the target shiitake mushroom stick; the image stitching processing is performed based on the same image features between the target mushroom stick images of the outer surface images at adjacent angles; the expanded 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 expanded image of the outer surface of the mushroom stick and the The invention discloses a method for determining the breeding grade of a target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick, and a method for determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick. The method is characterized in that the method comprises the following steps: first, a second average coordinate of all pixel points in the outer surface unfolded image; calculating the Euclidean distance between the first average coordinate and the second average coordinate; determining the breeding grade of the target shiitake mushroom stick according to the Euclidean distance of the target shiitake mushroom stick according to the correlation between different preset Euclidean distances and different breeding grades of the shiitake mushroom sticks. Compared with the technical scheme of manually determining the breeding grade of the shiitake mushroom sticks in the prior art, the present invention is based on deep learning technology and image processing technology, and uses a U-net network to perform semantic segmentation on the outer surface image of the shiitake mushroom stick, so as to objectively identify and analyze the phenotypic characteristics of the shiitake mushroom sticks, realize standardization of the evaluation process, automatically execute the image acquisition, processing and analysis process, reduce manual intervention, improve the level of automation and intelligence, solve the problems of omissions and low manual efficiency that are difficult to avoid in the prior art, and improve the accuracy and efficiency of determining the breeding grade of the shiitake mushroom sticks.
[0269] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented 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] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0271] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0272] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0273] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is 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 in the scope of protection of the present invention.
Claims
1. A method for determining the breeding grade of shiitake mushroom sticks, It is characterized in that include: Acquire outer surface images taken at multiple angles around the target shiitake mushroom stick; Taking each outer surface image as a target image, determining target annotation data corresponding to the target image based on deep learning technology; The annotation data is coordinate data of a boundary line between a mushroom stick region and a background region in the outer surface image; according to the coordinate data of a boundary line between a mushroom stick region and a background region in the target annotation data, a target background image in the target image is removed to obtain a target mushroom stick image corresponding to the target image; Performing image stitching processing on target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between target mushroom stick images of outer surface images at adjacent angles; Binarization is performed on the expanded image of the outer surface of the mushroom stick to determine the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and the Euclidean distance between the first average coordinate and the second average coordinate is calculated; According to the association relationship between different preset Euclidean distances and different shiitake mushroom spawn stick breeding grades, the breeding grade of the target shiitake mushroom spawn stick is determined according to the Euclidean distance of the target shiitake mushroom spawn stick.
2. The method according to claim 1, It is characterized in that Each outer surface image is used as a target image, and the target annotation data corresponding to the target image is determined based on deep learning technology, including: Each outer surface image is taken as a target image, and the target image is input into a semantic segmentation model of a mushroom stick region image to obtain target annotation data corresponding to the target image; the semantic segmentation model of the mushroom stick region image is obtained by training a U-net network deep learning model using historical mushroom stick outer surface annotation data as a training set; the historical mushroom stick outer surface annotation data includes historical data of different outer surface images and historical annotation data corresponding to each outer surface image historical data.
3. The method according to claim 2, It is characterized in that Also includes: The preset proportion of historical mushroom stick outer surface annotation data is used as the validation set and test set to verify and test the trained U-net network deep learning model, and the semantic segmentation model of the mushroom stick area image is obtained after verification and testing; Each outer surface image is used as a 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, including: Each outer surface image is taken as a target image, and the target image is 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 according to claim 1, It is characterized in that The target mushroom stick images of the outer surface images at different angles are subjected to image stitching processing to obtain the mushroom stick outer surface unfolded image of the target shiitake mushroom stick, including: Extract the characteristic points of the target mushroom stick image of the outer surface image at each angle; By using a feature matching algorithm, feature points in target mushroom stick images of outer surface images at adjacent angles are matched to determine matching feature point pairs between target mushroom stick images of outer surface images at adjacent angles; Perspective transformation technology is used to perform image registration on the target mushroom stick image of the outer surface image at each angle to obtain the registered image; According to the matching feature point pairs, multiple registered images are stitched to obtain an expanded image of the outer surface of the target shiitake mushroom stick.
5. The method according to claim 1, It is characterized in that The expanded 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 expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick, including: Based on a preset color value threshold, the expanded image of the outer surface of the mushroom stick is binarized to determine a first color value pixel point and a second color value pixel point in the expanded image of the outer surface of the mushroom stick; The first average coordinates of the first color value pixel points and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick are calculated respectively.
6. The method according to claim 1, It is characterized in that Also includes: Determine a first area of a pixel point of a first color value in the expanded image of the outer surface of the mushroom stick, and a second area of all pixel points in the expanded image of the outer surface of the mushroom stick; A ratio between the first area and the second area is calculated.
7. A device for determining the breeding grade of shiitake mushroom sticks, It is characterized in that include: An outer surface image acquisition module is used to acquire outer surface images taken at multiple angles around a target mushroom stick; A labeling data determination module, used to take each outer surface image as a target image and determine target labeling data corresponding to the target image based on deep learning technology; The annotation data is coordinate data of a boundary line between a mushroom stick region and a background region in the outer surface image; according to the coordinate data of a boundary line between a mushroom stick region and a background region in the target annotation data, a target background image in the target image is removed to obtain a target mushroom stick image corresponding to the target image; An image stitching processing module is used to stitch target mushroom stick images of outer surface images at different angles to obtain an expanded image of the outer surface of the target mushroom stick; the image stitching processing is performed based on the same image features between target mushroom stick images of outer surface images at adjacent angles; A binarization processing module is used to perform binarization processing on the expanded image of the outer surface of the mushroom stick, determine the first average coordinates of the first color value pixel points in the expanded image of the outer surface of the mushroom stick and the second average coordinates of all the pixel points in the expanded image of the outer surface of the mushroom stick; and calculate the Euclidean distance between the first average coordinate and the second average coordinate; The breeding grade determination module is used to determine the breeding grade of the target shiitake mushroom stick according to the association relationship between different preset Euclidean distances and different breeding grades of shiitake mushroom sticks and the Euclidean distance of the target shiitake mushroom stick.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
10. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Intelligent grading system and grading method for Lentinus edodes sticks
CN113902982A
Three-dimensional space visual positioning method, system and device based on non-integrity mushroom image
CN114359403A
Mushroom quality grading method based on deep learning
CN115115880A
Factory mushroom picking robot and vision-based graded picking method
CN117694184A
Method for spatio-temporal prediction of growth state of mushrooms
WO2024045749A1
