Lentinus edodes pileus analysis system and method, electronic equipment and storage medium
By designing a shiitake cap analysis system, using the FlashAttention-U²NET segmentation network to segment and phenotypic indication analysis of the shiitake cap image, the problem that shiitake cap phenotype evaluation in the prior art is solved, and efficient and automated phenotype analysis is achieved.
Patent Information
- Application Number
- CN202411873424.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-05-16
AI Technical Summary
In the prior art, phenotype evaluation of shiitake fruiting body caps depends on artificial experience, is subjective and not efficient, and lacks objective and efficient evaluation methods.
A shiitake cap analysis system is designed, including image acquisition equipment, flexible lamps, background boards and industrial control machines. The shiitake cap images are segmented and phenotypic indicators are analyzed using the FlashAttention-U²NET segmentation network to extract the shape and color characteristics of the shiitake caps.
The automation and accuracy of phenotype analysis of shiitake caps is achieved, reducing the subjectivity of manual operations, and improving the speed of data processing and evaluation efficiency.
Smart Images

Figure CN120013858A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a mushroom cap analysis system, method, electronic equipment and storage medium. Background Art
[0002] The mushroom industry has significant economic value worldwide, and its products are favored by consumers for their high nutritional value and unique taste. With the popularization of the concept of healthy eating, the demand for mushrooms is growing.
[0003] The fruiting body of shiitake mushrooms is the main edible and medicinal part for humans. The cap of shiitake mushrooms is an important part of the fruiting body, and its morphological characteristics directly affect the appearance quality of shiitake mushrooms. The cap is an important part of the fruiting body, and its size, thickness, color, etc. are all important indicators for evaluating the quality of shiitake mushrooms. However, the traditional phenotypic evaluation method of shiitake mushrooms mainly relies on manual experience, which is not only highly subjective but also inefficient. Therefore, the development of a device that can objectively and efficiently evaluate the cap phenotype of shiitake mushroom fruiting bodies is crucial to enhancing the competitiveness of the entire industry. Summary of the invention
[0004] The present invention provides a mushroom cap analysis system, method, electronic equipment and storage medium, which are used to solve the problem of how to objectively and efficiently evaluate the mushroom fruiting body cap phenotype in the prior art.
[0005] The present invention provides a mushroom cap analysis system, comprising: an image acquisition device, a flexible lamp, a background plate, and an industrial control computer; the image acquisition device and the flexible lamp are arranged above the background plate, and the industrial control computer is respectively connected to the image acquisition device and the flexible lamp for communication; Wherein, the background board is used to place mushroom caps, and the flexible lamp is used to provide supplementary light for the area where the background board is located; Wherein, the image acquisition device is used to acquire the image of the mushroom cap placed on the background plate, and send the image of the mushroom cap to the industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image, and performs phenotypic indication analysis on the mushroom segmentation image to obtain phenotypic indication data of the mushroom cap; Among them, the FlashAttention-U²NET segmentation network introduces the FlashAttention module in the key layers of the encoder and decoder to increase the segmentation network's attention to the key areas in the image.
[0006] According to a mushroom cap analysis system provided by the present invention, the device further comprises: a weighing sensor, the weighing sensor being arranged below the background plate; The weighing processor is used to weigh the mushroom caps, obtain the weight information of the mushroom caps, and send the weight information of the mushroom caps to the industrial computer.
[0007] According to a mushroom cap analysis system provided by the present invention, the device further comprises: an interaction module, the interaction module being communicatively connected with the industrial computer; The interactive module is used to receive the phenotypic indication data of the mushroom cap sent by the industrial computer and generate phenotypic indication data display information.
[0008] According to a mushroom cap analysis system provided by the present invention, the industrial computer is further used for: After performing image denoising on the mushroom cap image, brightness equalization is adjusted by using a histogram equalization technique to obtain an adjusted mushroom cap image; After the adjusted shiitake mushroom cap image is size normalized and color enhanced, the shiitake mushroom cap image for inputting the FlashAttention-U²NET segmentation network is obtained.
[0009] According to a mushroom cap analysis system provided by the present invention, the industrial computer is further used for: Extracting the mean values of the R, G, and B color channels in the shiitake mushroom segmentation image to obtain the color features of the shiitake mushroom cap; Binarizing the mushroom segmentation image to extract the maximum edge feature of the binary mushroom segmentation image; The cap circumference, cap circularity, cap area, cap major axis length and cap minor axis length of the shiitake mushroom cap are determined according to the maximum edge feature to obtain phenotypic indicator data of the shiitake mushroom cap.
[0010] According to a shiitake mushroom cap analysis system provided by the present invention, the image acquisition device includes: a lens and a camera, and the distance between the lens and the background plate is 315mm-345mm.
[0011] The present invention also provides a method for analyzing mushroom caps based on any one of the mushroom cap analysis systems described above, comprising: The image acquisition device acquires the image of the mushroom cap placed on the background plate, and sends the image of the mushroom cap to the industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image; wherein the FlashAttention-U²NET segmentation network introduces a FlashAttention module in the key layers of the encoder and the decoder to increase the segmentation network's attention to the key areas in the image; The industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap.
[0012] According to the method for analyzing mushroom caps provided by the present invention, the industrial computer performs phenotypic indication analysis on the segmented image of the mushroom to obtain phenotypic indication data of the mushroom caps, including: Extracting the mean values of the R, G, and B color channels in the shiitake mushroom segmentation image to obtain the color features of the shiitake mushroom cap; Binarizing the mushroom segmentation image to extract the maximum edge feature of the binary mushroom segmentation image; The cap circumference, cap circularity, cap area, cap major axis length and cap minor axis length of the shiitake mushroom cap are determined according to the maximum edge feature to obtain phenotypic indicator data of the shiitake mushroom cap.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the above-mentioned methods for analyzing mushroom caps is implemented.
[0014] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned methods for analyzing mushroom caps is implemented.
[0015] The present invention also provides a computer program product, comprising a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned methods for analyzing mushroom caps is implemented.
[0016] The mushroom cap analysis system, method, electronic device and storage medium provided by the present invention are arranged to place the mushroom cap on a background plate, use a flexible lamp to fill in the light of the area where the background plate is located, ensure that the image of the mushroom cap is clear, reduce shadows and reflections, and the image acquisition device takes the image of the mushroom cap and sends the image data to the industrial control computer. The industrial control computer uses the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to segment the mushroom cap image to obtain a segmented image. It is introduced in the key layer of the network to enhance the network's recognition ability of key features in the image and improve the accuracy of segmentation. Finally, the segmented mushroom cap image is analyzed for phenotypic indications to extract the phenotypic data of the mushroom cap. The present invention makes the phenotypic analysis of the mushroom cap more automated and accurate through the mushroom cap analysis system, which helps to improve the efficiency and accuracy of mushroom breeding and quality evaluation. Through the application of machine vision technology, the subjectivity of manual operation can be reduced and the speed of data processing can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work: Figure 1 It is a structural schematic diagram of the mushroom cap analysis system provided by the present invention; Figure 2 A schematic diagram of the image detection effect under a red background board provided in an embodiment of the present application; Figure 3 A schematic diagram of the image detection effect under a green background board provided in an embodiment of the present application; Figure 4 An internal power supply and model flow chart of a mushroom cap analysis system provided in an embodiment of the present application; Figure 5 A schematic diagram of the process of analyzing mushroom caps provided by the present invention; Figure 6 A schematic diagram of mushroom cap segmentation provided by the present invention; Figure 7 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] Figure 1 Schematic diagram of the structure of the mushroom cap analysis system provided by the present invention. Figure 1 As shown, it includes: an image acquisition device 11, a flexible light 12, a background plate 13, and an industrial computer 14; the image acquisition device and the flexible light are arranged above the background plate, and the industrial computer is respectively connected to the image acquisition device 11 and the flexible light 12 for communication; The background plate 13 is used to place mushroom caps, and the flexible lamp 12 is used to provide supplementary light for the area where the background plate 13 is located; The image acquisition device 11 is used to acquire the image of the mushroom cap placed on the background plate, and send the image of the mushroom cap to the industrial computer 14; The industrial computer 14 performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image, and performs phenotypic indication analysis on the mushroom segmentation image to obtain phenotypic indication data of the mushroom cap; Among them, the FlashAttention-U²NET segmentation network introduces the FlashAttention module in the key layers of the encoder and decoder to increase the segmentation network's attention to the key areas in the image.
[0020] In the present invention, the image acquisition device may include a lens and a camera, wherein the camera is used to capture a high-definition image of the mushroom cap. The lens and the camera are used together to ensure the clarity and focus of the image, wherein the camera lens is 330 mm away from the background plate, and can be plus or minus 15 mm, in order to ensure that a clear and accurate cap image is obtained.
[0021] In the present invention, the image acquisition device (including industrial camera and lens) and the flexible light are arranged above the background plate. This arrangement helps to uniformly capture the image of the mushroom cap from above and provide sufficient lighting.
[0022] The background plate is located at the bottom and is used to place the mushroom caps to ensure that the caps are in the center of the field of view of the image acquisition device. The color and texture of the background plate help the image processing algorithm to better distinguish the caps from the background.
[0023] In the present invention, the industrial computer is connected to the image acquisition device via wired or wireless communication. This connection allows the industrial computer to send control instructions to the image acquisition device (for example, adjust camera settings, trigger shutter, etc.) and receive image data transmitted from the image acquisition device.
[0024] The industrial computer is also connected to the flexible light in communication, which enables the industrial computer to control the brightness and switching of the flexible light to adapt to different shooting conditions and analysis requirements.
[0025] In the present invention, the industrial computer sends instructions to the image acquisition device to control the camera to capture a high-definition image of the mushroom cap. According to the needs of image acquisition, the industrial computer adjusts the brightness of the flexible lamp to ensure that the image of the mushroom cap can obtain sufficient lighting and optimal visual contrast under different conditions.
[0026] The image data captured by the image acquisition device is transmitted to the industrial computer through a communication connection. After receiving the image data, the industrial computer stores and performs subsequent image processing, such as image segmentation and phenotypic indication analysis.
[0027] In the present invention, the FlashAttention-U²NET segmentation network combined with the FlashAttention mechanism is particularly applied to the segmentation of mushroom fruiting body cap images. When processing images of mushroom caps with rich details and irregular shapes, traditional image segmentation methods are difficult to achieve ideal segmentation effects due to the diversity of data samples, and deep learning algorithms are difficult to apply and deploy due to their large amount of calculation. The algorithm provided by the present invention reduces the amount of calculation while taking into account accuracy.
[0028] In the present invention, FlashAttention-U²NET is a deep learning network, which introduces the FlashAttention mechanism based on U²NET to enhance the network's attention to key areas of the image, thereby improving the accuracy and efficiency of segmentation.
[0029] The U²NET network structure has a nested U-shaped structure, which can achieve fast image segmentation while maintaining high accuracy. The FlashAttention mechanism further improves the segmentation effect by increasing the attention to key features.
[0030] In this paper, the U²NET network consists of two parts: an encoder and a decoder. The encoder is responsible for extracting image features, while the decoder is responsible for reconstructing the segmentation results. The network receives high-resolution cap images as input. After the encoder extracts deep features, the FlashAttention module further enhances the representation ability of these features.
[0031] In the decoder stage, upsampling and feature fusion are combined with the attention weighting of the FlashAttention module to finally output accurate cap segmentation results.
[0032] In the present invention, the FlashAttention-U²NET segmentation network not only improves the accuracy of cap image segmentation, but also significantly improves the processing speed, so that the network can adapt to real-time or near real-time image segmentation requirements.
[0033] In the present invention, after obtaining the segmented image of the shiitake mushroom, further phenotypic indicator analysis can be performed to finally obtain the phenotypic indicator data of the shiitake mushroom cap.
[0034] In the present invention, by placing the mushroom cap on a background plate, a flexible lamp is used to fill light in the area where the background plate is located to ensure that the image of the mushroom cap is clear and reduce shadows and reflections. The image acquisition device captures the image of the mushroom cap and sends the image data to the industrial computer. The industrial computer uses the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to segment the mushroom cap image to obtain a segmented image. It is introduced in the key layer of the network to enhance the network's ability to recognize key features in the image and improve the accuracy of segmentation. Finally, the segmented mushroom cap image is analyzed for phenotypic indications to extract the phenotypic data of the mushroom cap. The present invention makes the phenotypic analysis of the mushroom cap more automated and accurate through the mushroom cap analysis system, which helps to improve the efficiency and accuracy of mushroom breeding and quality assessment. Through the application of machine vision technology, the subjectivity of manual operation can be reduced and the speed of data processing can be improved.
[0035] Optionally, the device further comprises: an interaction module, the interaction module being communicatively connected to the industrial computer; The interactive module is used to receive the phenotypic indication data of the mushroom cap sent by the industrial computer and generate phenotypic indication data display information.
[0036] In the present application, the interaction module may include a display device, such as a touch screen display, a computer screen or a mobile device screen, for displaying phenotypic indication data display information; it may also include an input device such as a keyboard, a mouse or a touch screen for user interaction with the system.
[0037] After the industrial computer processes the image and weight data of the mushroom cap, it sends the phenotypic indicator data to the interactive module. After receiving the data, the interactive module converts it into graphics, charts or text and displays it to the user.
[0038] Users can interact with the interactive module through input devices, such as viewing detailed data, requesting specific analysis, or adjusting system parameters. Users can send instructions or feedback to the industrial computer through the interactive module, such as adjusting image acquisition parameters or weighing sensor settings. The interactive module can also generate reports based on user needs, including phenotypic indicator data of the mushroom cap and other relevant information.
[0039] In the present invention, by integrating the interactive module, not only can the data of shiitake mushroom caps be automatically collected and analyzed, but also an intuitive user interface can be provided, making the display and interaction of data more convenient and efficient.
[0040] Optionally, the industrial computer is further used for: After performing image denoising on the mushroom cap image, brightness equalization is adjusted by using a histogram equalization technique to obtain an adjusted mushroom cap image; After the adjusted shiitake mushroom cap image is size normalized and color enhanced, the shiitake mushroom cap image for inputting the FlashAttention-U²NET segmentation network is obtained.
[0041] In the present invention, the noise in the image is removed to improve the image quality and provide clearer image data for subsequent processing. A variety of denoising algorithms can be used, such as Gaussian filtering, median filtering or more advanced deep learning denoising technology.
[0042] In the present invention, the contrast of the image is enhanced, especially for images with uneven brightness, so that the brightness distribution of the image is more uniform. By adjusting the histogram distribution of the image, the brightness level of the image is more balanced, and the visibility of the details in the image is improved.
[0043] You can also resize images of different sizes to a uniform size to meet the input requirements of deep learning models. Images are scaled according to the network's input size requirements to ensure that all input images have the same resolution and size.
[0044] In the present invention, the color features of the image are enhanced to make the color information more vivid, which is helpful to improve the performance of the segmentation network. Specifically, the color features can be enhanced by adjusting the color space (such as converting from RGB to Lab color space) or applying a color correction algorithm.
[0045] In this invention, the industrial computer ensures that the mushroom cap image input to the FlashAttention-U²NET segmentation network has the best quality and features, laying a solid foundation for subsequent accurate segmentation and phenotypic indication analysis. Optionally, the industrial computer is further used for: Extracting the mean values of the R, G, and B color channels in the shiitake mushroom segmentation image to obtain the color features of the shiitake mushroom cap; Binarizing the mushroom segmentation image to extract the maximum edge feature of the binary mushroom segmentation image; The cap circumference, cap circularity, cap area, cap major axis length and cap minor axis length of the shiitake mushroom cap are determined according to the maximum edge feature to obtain phenotypic indicator data of the shiitake mushroom cap.
[0046] In the present invention, three color channels, R (red), G (green), and B (blue), are extracted from the segmented image of shiitake mushrooms, and the pixel value mean of each color channel is calculated to obtain the color characteristics of the shiitake mushroom cap.
[0047] Apply threshold processing or other binarization algorithms to convert the mushroom segmentation image into a binary image so that the object in the image is separated from the background, so that the edge and shape features of the cap can be more clearly identified.
[0048] In the present invention, the maximum edge feature is extracted from the binary mushroom segmentation image, which usually involves an edge detection algorithm, such as Canny edge detection.
[0049] The circumference, circularity, area, and major and minor axis lengths of the cap of Lentinula edodes were determined, which are key phenotypic data describing the shape and size of the cap.
[0050] Cap circumference: calculate the total length of the edge of the mushroom cap; Cap circularity: evaluate the degree to which the cap shape is close to a circle, usually calculated by comparing the actual circumference with the circumference of a circle with the same area; Cap area: calculate the size of the two-dimensional space occupied by the mushroom cap; Cap major and minor axis lengths: determine the major and minor axis lengths of the cap based on the minimum circumscribed ellipse of the cap.
[0051] In the present invention, the industrial computer can extract rich phenotypic indicator data from the segmented image of shiitake mushrooms, providing important technical support for the research, breeding and quality control of shiitake mushroom caps.
[0052] Figure 2 This is a schematic diagram of the image detection effect under the red background board provided in the embodiment of the present application. Figure 3 A schematic diagram of the image detection effect under a green background board provided in an embodiment of the present application.
[0053] Figure 4 The internal power supply and model flow chart of the mushroom cap analysis system provided in the embodiment of the present application is as follows: Figure 4 As shown, after turning on the button switch, the power adapter and AC-DC module will connect to the current, thereby powering the industrial computer as well as the camera, fan equipment, force measurement display module, weighing sensor and LED controller.
[0054] Figure 5 A schematic diagram of the process of analyzing mushroom caps provided by the present invention is shown in FIG. Figure 5 As shown, including: Step 510, the image acquisition device acquires the image of the mushroom cap placed on the background plate, and sends the image of the mushroom cap to the industrial computer; Step 520, the industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image; wherein the FlashAttention-U²NET segmentation network introduces a FlashAttention module in the key layers of the encoder and the decoder to increase the segmentation network's attention to the key areas in the image; Step 530: the industrial computer performs phenotypic indicator analysis on the segmented image of the shiitake mushroom to obtain phenotypic indicator data of the shiitake mushroom cap.
[0055] In the present invention, an image acquisition device (such as a high-resolution camera) is used to photograph the mushroom caps placed on the background plate, and the photographed mushroom cap image data is sent to an industrial computer for further processing.
[0056] In the present invention, the industrial computer uses the FlashAttention-U²NET segmentation network combined with the FlashAttention mechanism to segment the mushroom cap image. The FlashAttention-U²NET segmentation network includes an encoder and a decoder, where the encoder is responsible for extracting image features and the decoder is responsible for reconstructing the segmentation results. The FlashAttention module is introduced in the key layers of the encoder and decoder to enhance the network's attention to key areas in the image (such as the edge and texture of the cap) and improve the segmentation accuracy.
[0057] Through this process, the segmented image of the mushroom cap is obtained, laying the foundation for the subsequent phenotypic indication analysis. Figure 6 A schematic diagram of mushroom cap segmentation provided by the present invention.
[0058] In the present invention, the mean values of the R, G, and B color channels are extracted from the segmented image of shiitake mushrooms to obtain the color features of the shiitake mushroom caps. The segmented image of shiitake mushrooms is binarized to extract the maximum edge features of the image. The perimeter, circularity, area, and major and minor axis lengths of the shiitake mushroom caps are determined based on the maximum edge features. Based on the above analysis, the phenotypic indicator data of the shiitake mushroom caps are obtained, which can be used for various applications such as quality evaluation and breeding selection.
[0059] In the present invention, by placing the mushroom cap on a background plate, a flexible lamp is used to fill light in the area where the background plate is located to ensure that the image of the mushroom cap is clear and reduce shadows and reflections. The image acquisition device captures the image of the mushroom cap and sends the image data to the industrial computer. The industrial computer uses the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to segment the mushroom cap image to obtain a segmented image. It is introduced in the key layer of the network to enhance the network's ability to recognize key features in the image and improve the accuracy of segmentation. Finally, the segmented mushroom cap image is analyzed for phenotypic indications to extract the phenotypic data of the mushroom cap. The present invention makes the phenotypic analysis of the mushroom cap more automated and accurate through the mushroom cap analysis system, which helps to improve the efficiency and accuracy of mushroom breeding and quality assessment. Through the application of machine vision technology, the subjectivity of manual operation can be reduced and the speed of data processing can be improved.
[0060] Optionally, the industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap, including: Extracting the mean values of the R, G, and B color channels in the shiitake mushroom segmentation image to obtain the color features of the shiitake mushroom cap; Binarizing the mushroom segmentation image to extract the maximum edge feature of the binary mushroom segmentation image; The cap circumference, cap circularity, cap area, cap major axis length and cap minor axis length of the shiitake mushroom cap are determined according to the maximum edge feature to obtain phenotypic indicator data of the shiitake mushroom cap.
[0061] In the present invention, three color channels of R (red), G (green), and B (blue) are extracted from the segmented image of shiitake mushrooms, and the pixel value mean of each color channel is calculated to obtain the color characteristics of the shiitake mushroom cap.
[0062] Apply threshold processing or other binarization algorithms to convert the mushroom segmentation image into a binary image so that the object in the image is separated from the background, so that the edge and shape features of the cap can be more clearly identified.
[0063] In the present invention, the maximum edge feature is extracted from the binary mushroom segmentation image, which usually involves an edge detection algorithm, such as Canny edge detection.
[0064] The circumference, circularity, area, and major and minor axis lengths of the cap of Lentinula edodes were determined, which are key phenotypic data describing the shape and size of the cap.
[0065] In an optional embodiment, the present application can obtain a cap sample image carrying a maximum edge feature label, and then amplify the cap sample image by rotation and mirroring to construct a cap sample data set, and then use the cap sample data set to train the original FlashAttention—U²NET segmentation network to obtain a FlashAttention—U²NET segmentation network that can effectively realize image segmentation.
[0066] In an optional embodiment, the Canny algorithm, HED algorithm, RCF algorithm and the FlashAttention-U²NET algorithm of the present invention are verified respectively, and the results show that the algorithm of the present invention has the highest detection accuracy, which can reach 91.2% in the red background data set and 95.1% in the green background data set, and the detection speed can reach up to 1.5s.
[0067] Table 1 Comparison of different edge detection algorithms
[0068] Figure 7 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 7 As shown, the electronic device may include: a processor 710, a communication interface 720, a memory 730 and a communication bus 740, wherein the processor 710, the communication interface 720 and the memory 730 communicate with each other through the communication bus 740. The processor 710 may call the logic instructions in the memory 730 to execute the mushroom cap analysis method, which includes: an image acquisition device acquires an image of a mushroom cap placed on a background plate, and sends the image of the mushroom cap to an industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image; wherein the FlashAttention-U²NET segmentation network introduces a FlashAttention module in the key layers of the encoder and the decoder to increase the segmentation network's attention to the key areas in the image; The industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap.
[0069] In addition, the logic instructions in the above-mentioned memory 730 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0070] On the other hand, the present invention further provides a computer program product, the computer program product includes a computer program, the computer program can be stored in a non-transitory computer-readable storage medium, when the computer program is executed by a processor, the computer can execute the mushroom cap analysis method provided by the above methods, the method includes: an image acquisition device acquires an image of a mushroom cap placed on a background plate, and sends the image of the mushroom cap to an industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image; wherein the FlashAttention-U²NET segmentation network introduces a FlashAttention module in the key layers of the encoder and the decoder to increase the segmentation network's attention to the key areas in the image; The industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap.
[0071] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for analyzing mushroom caps provided by the above methods is implemented, the method comprising: an image acquisition device acquires an image of a mushroom cap placed on a background plate, and sends the image of the mushroom cap to an industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image; wherein the FlashAttention-U²NET segmentation network introduces a FlashAttention module in the key layers of the encoder and the decoder to increase the segmentation network's attention to the key areas in the image; The industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap.
[0072] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.
[0073] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0074] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A mushroom cap analysis system, characterized in that: include: Image acquisition equipment, flexible lights, background boards, industrial computers; The image acquisition device and the flexible lamp are arranged above the background plate, and the industrial computer is respectively connected to the image acquisition device and the flexible lamp for communication; Wherein, the background board is used to place mushroom caps, and the flexible lamp is used to provide supplementary light for the area where the background board is located; The image acquisition device is used to acquire the image of the mushroom cap placed on the background plate, and send the image of the mushroom cap to the industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image, and performs phenotypic indication analysis on the mushroom segmentation image to obtain phenotypic indication data of the mushroom cap; Among them, the FlashAttention-U²NET segmentation network introduces the FlashAttention module in the key layers of the encoder and decoder to increase the segmentation network's attention to the key areas in the image.
2. The mushroom cap analysis system according to claim 1, characterized in that: The device further comprises: a weighing sensor, wherein the weighing sensor is arranged below the background plate; The weighing processor is used to weigh the mushroom caps, obtain the weight information of the mushroom caps, and send the weight information of the mushroom caps to the industrial computer.
3. The mushroom cap analysis system according to claim 1, characterized in that: The device further comprises: an interaction module, the interaction module being communicatively connected with the industrial computer; The interactive module is used to receive the phenotypic indication data of the mushroom cap sent by the industrial computer and generate phenotypic indication data display information.
4. The mushroom cap analysis system according to claim 1, characterized in that: The industrial computer is also specifically used for: After performing image denoising on the mushroom cap image, brightness equalization is adjusted by using a histogram equalization technique to obtain an adjusted mushroom cap image; After the adjusted shiitake mushroom cap image is size normalized and color enhanced, the shiitake mushroom cap image for inputting the FlashAttention-U²NET segmentation network is obtained.
5. The mushroom cap analysis system according to claim 1, characterized in that: The industrial computer is also specifically used for: Extracting the mean values of the R, G, and B color channels in the shiitake mushroom segmentation image to obtain the color features of the shiitake mushroom cap; Binarizing the mushroom segmentation image to extract the maximum edge feature of the binary mushroom segmentation image; The cap circumference, cap circularity, cap area, cap major axis length and cap minor axis length of the shiitake mushroom cap are determined according to the maximum edge feature to obtain phenotypic indicator data of the shiitake mushroom cap.
6. The mushroom cap analysis system according to claim 1, characterized in that: The image acquisition device comprises: a lens and a camera, and the distance between the lens and the background plate is 315mm-345mm.
7. A method for analyzing mushroom caps based on the mushroom cap analysis system according to any one of claims 1 to 6, characterized in that: include: The image acquisition device acquires the image of the mushroom cap placed on the background plate, and sends the image of the mushroom cap to the industrial computer; The industrial computer performs image segmentation on the mushroom cap image through the FlashAttention-U²NET segmentation network combined with the FlashAttention attention mechanism to obtain a mushroom segmentation image; wherein the FlashAttention-U²NET segmentation network introduces a FlashAttention module in the key layers of the encoder and the decoder to increase the segmentation network's attention to the key areas in the image; The industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap.
8. The method for analyzing mushroom caps according to claim 7, characterized in that: The industrial computer performs phenotypic indication analysis on the segmented image of the shiitake mushroom to obtain phenotypic indication data of the shiitake mushroom cap, including: Extracting the mean values of the R, G, and B color channels in the shiitake mushroom segmentation image to obtain the color features of the shiitake mushroom cap; Binarizing the mushroom segmentation image to extract the maximum edge feature of the binary mushroom segmentation image; The cap circumference, cap circularity, cap area, cap major axis length and cap minor axis length of the shiitake mushroom cap are determined according to the maximum edge feature to obtain phenotypic indicator data of the shiitake mushroom cap.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the method for analyzing the mushroom caps according to any one of claims 7 to 8 is implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method for analyzing the mushroom cap according to any one of claims 7 to 8 is implemented.