Intelligent lentinus edodes stick grading system and grading method

The intelligent grading system for shiitake mushroom spawn, which combines YOLOv4 and DeepSort algorithms, solves the problem of low efficiency in manual grading and achieves automated and accurate evaluation of the growth quality of the spawn.

CN113902982BActive Publication Date: 2026-07-24HUAZHONG AGRI UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAZHONG AGRI UNIV
Filing Date
2021-09-14
Publication Date
2026-07-24

Smart Images

  • Figure CN113902982B_ABST
    Figure CN113902982B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of lentinus edodes stick intelligent grading system and grading method, the present application is rotated by single-chip microcomputer control electric turntable with stick, by industrial camera real-time collection stick surface image, by infrared temperature sensor real-time collection stick surface temperature and ambient temperature, by computer to all images utilize deep learning neural network YOLOv4 to identify lentinus edodes, utilize improved multi-target tracking algorithm DeepSort to track lentinus edodes, finally obtain lentinus edodes quantity on stick, lentinus edodes overlap rate, lentinus edodes color, lentinus edodes cap average area, stick surface average temperature and environmental average temperature and other characteristic parameters, and these characteristic parameters are input into stick grading model and obtain lentinus edodes stick grade.The present application first proposes and realizes new method of YOLOv4 and DeepSort associated tracking lentinus edodes, successfully establishes first set of full-automatic, multi-parameter and high-precision extraction lentinus edodes stick phenotype parameter and realizes stick intelligent grading system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention pertains to machine vision inspection technology and relates to a system and method for intelligently grading mushroom sticks by dynamically detecting characteristic parameters such as the number of shiitake mushrooms growing on the surface of the sticks, the overlap rate of the shiitake mushrooms, the color of the shiitake mushrooms, the average area of ​​the shiitake mushroom caps, the average temperature of the stick surface, and the average temperature of the stick environment. Based on these parameters, a grading model for the mushroom sticks is established. Background Technology

[0002] The yield and quality of shiitake mushrooms directly impact farmers' income, and numerous scholars have studied the factors influencing shiitake growth during cultivation. Shiitake mushrooms rely on the substrate to provide nutrients for healthy growth. The presence of overlapping mushroom growth on the substrate, the number of mushrooms growing on a single substrate, the average surface temperature of the substrate, the average cap area of ​​a single substrate, and the color of the mushroom caps all significantly affect the yield and quality of shiitake mushrooms. These characteristics also reflect the quality grade of the substrate. Selecting a good substrate as a shiitake mushroom culture medium can reduce overlapping mushroom growth, increase the fruiting rate, and improve the yield and quality of shiitake mushrooms. Currently, the detection of the number of mushrooms on a substrate, the determination of overlapping mushroom growth, and the quality analysis of the mushrooms on the substrate still rely on manual counting. Manual counting methods are inefficient and highly susceptible to subjective factors, making it impossible to accurately grade the quality of substrate growth.

[0003] Wang Wei et al. proposed an intelligent grading method for stemless fresh shiitake mushrooms based on machine vision and designed an automatic grading system. Wang Jingyu et al., based on the characteristics of fresh shiitake mushroom images and grading standards, used computer vision technology and neural network algorithms to automatically detect and grade shiitake mushrooms. They employed techniques such as mask background removal, median filtering, and edge brightness compensation to process the images. They selected the maximum diameter of the shiitake mushroom cap, its roundness, the average hue, and the ratio of the total area of ​​the defective region to the total area of ​​the shiitake mushroom image as feature parameters for grading fresh shiitake mushrooms. However, the above methods all process the shiitake mushrooms after they have been removed, and cannot directly and non-destructively extract the parameter features of the shiitake mushrooms on the substrate during the mushroom growth stage and grade the substrate.

[0004] YOLOv4 is an object recognition neural network, an improvement on YOLOv3. The backbone feature extraction network of YOLOv4 was changed from DarkNet53 in YOLOv3 to CSPDarkNet53. In object classification on the ILSVRC2012 (ImageNet) dataset, CSPResNext50 outperformed CSPDarkNet53. However, conversely, for object detection on the MS COCO dataset, CSPDarkNet53 outperformed CSPResNext50. The model with the best classification accuracy is not always the best in terms of detector accuracy. YOLOv4 incorporates improved SPP (Spatial Pyramid Pooling) and PAN (Path Aggregation Network). The authors of YOLOv4 modified SAM from spatial attention to point attention, replaced the shortcut connections in PAN with concatenation, and changed the activation function of DarknetConv2D from LeakyReLU to Mish, and the convolutional block from DarknetConv2D_BN_Leaky to DarknetConv2D_BN_Mish.

[0005] DeepSort is a multi-object tracking algorithm. Before DeepSort, there was a simple online real-time tracking algorithm called SORT, which used the Hungarian method to perform Kalman filtering and frame-by-frame data association in image space and used an association metric that measures bounding box overlap. This simple method achieved good performance at high frame rates. On the MOT challenge dataset, SORT, using a state-of-the-art person detector, achieved an average ranking higher than MHT on standard detection. However, when the tracked target is occluded for a long time, it tends to increase the number of target identity switching, indicating a deficiency in tracking through occlusion. Researchers improved SORT's performance by integrating appearance information. They trained a re-identification dataset offline to learn a deep association metric, incorporating the appearance features of the target information into the inter-frame association to reduce the number of identity switching. Experimental evaluations by the paper's authors showed that training a method to extract the appearance features of the target information reduced the number of identity switching by 45%, improving the overall performance of target tracking. Summary of the Invention

[0006] This invention addresses the problems of the current manual grading method for shiitake mushroom logs by providing an intelligent grading system and method for shiitake mushroom logs. The system can automatically measure characteristic parameters such as the number of shiitake mushrooms on the log, the overlap rate of shiitake mushrooms, the color of shiitake mushrooms, the average area of ​​shiitake mushroom caps, the average surface temperature of the log, and the average ambient temperature.

[0007] The present invention provides an intelligent grading system for shiitake mushroom spawn, characterized in that it includes a dark box, a driver, an electric turntable, a clamping device, an industrial camera, an acrylic plate, a light source, an infrared temperature sensor, a microcontroller, a computer, and a human-computer interaction interface.

[0008] The light source and infrared temperature sensor are respectively installed on both sides of the dark box. The industrial camera is fixed on a transparent acrylic plate and installed in front of the light source. The electric turntable is installed at the bottom of the dark box and located between the industrial camera and the infrared temperature sensor. The clamping device is fixed at the top of the dark box. The computer is connected to the infrared temperature sensor and the microcontroller respectively. The electric turntable and clamping device are used to fix the shiitake mushroom logs. The light source consists of two dimmable lamp tubes to provide uniform illumination for image acquisition. The human-machine interface has functions such as creating, saving, opening, starting, testing, and controlling. It also displays the number of shiitake mushrooms, the number of shiitake mushroom regenerations, the shiitake mushroom regeneration rate, the average temperature of the shiitake mushroom logs, the average ambient temperature, the tracking results, the tracking location information, and the log grade.

[0009] The electric turntable is fixed to the bottom plate of the dark box, and the clamping device is fixed to the top of the dark box. The height between the clamping device and the electric turntable is adjustable according to the length of the mushroom stick. The industrial camera is fixed on a transparent acrylic plate and installed in front of the dimming lamp tube to collect images of the surface of the mushroom stick in real time. The infrared temperature sensor is fixed on one side of the dark box opposite the dimming lamp tube, facing the mushroom stick, to collect the surface temperature of the mushroom stick and the ambient temperature in real time.

[0010] The human-computer interaction interface is encapsulated into an EXE executable file using PyInstaller, which enables the mushroom spawn grading method to be used on any computer without the need to configure a deep learning environment.

[0011] The grading method of the intelligent grading system for shiitake mushroom spawn is characterized by comprising the following steps:

[0012] Step 1: Turn on the light source, microcontroller and darkroom door, fix the shiitake mushroom sticks between the electric turntable and the clamping device, and close the darkroom door;

[0013] Step 2: Open the computer and human-computer interaction interface, start the system, and the operator sends instructions to the microcontroller through the human-computer interaction interface. The microcontroller controls the electric turntable to clamp the mushroom sticks and rotate through the driver. At the same time, the industrial camera continuously collects images of the surface of the mushroom sticks, and the infrared temperature sensor continuously collects the surface temperature of the mushroom sticks and the ambient temperature.

[0014] Step 3: The computer receives image data in real time. The image processing method uses the YOLOv4 deep learning neural network to identify the shiitake mushrooms on the mushroom sticks. The DeepSort multi-target tracking algorithm is used to track each identified shiitake mushroom. During the identification and tracking, feature parameters such as shiitake mushroom area, shiitake mushroom color, shiitake mushroom overlap rate, mushroom stick surface temperature, and ambient temperature are extracted in real time.

[0015] Step 4: After the electric turntable rotates once, it stops. All the data obtained in Step 3 are further processed to obtain characteristic parameters such as the number of shiitake mushrooms on the mushroom log, the overlap rate of shiitake mushrooms, the color of shiitake mushrooms, the average area of ​​shiitake mushroom caps, the average surface temperature of the mushroom log, and the average ambient temperature. The processed characteristic parameters are then input into the mushroom log grading model to calculate the grade of the shiitake mushroom log.

[0016] Step 5: Display the feature parameters obtained in Step 4 on the human-computer interaction interface and save them to the specified EXCEL file;

[0017] In step 3, the activation function of the CSPDarkNet53 network in YOLOv4 is LeakyRelu, and the code for displaying the neural network is removed; the image processing speed of the network before the improvement is 0.339s / frame, and the image processing speed of the network after the improvement is 0.227s / frame; experiments show that the improved network processes video faster.

[0018] In step 3, in the DeepSort tracking algorithm, the track_id of the track box marked as confirmed is reassigned in the tracker module. If the number of track boxes marked as confirmed is n, the id is redefined as 1-n+1. The track_id is reassigned every time there is an update. Experiments have shown that this method can prevent the mushroom ID from jumping.

[0019] In step 3, in the DeepSort tracking algorithm, when the number of all tracked targets is less than 7, multiple tracking boxes can be initialized in the same update. When the number of all tracked targets exceeds 7, each update adds at most one new ID. The pre-initialized tracking box is matched with all the pre-stored tracking boxes marked as confirmed by the intersection-union ratio (WIOU) of the bottom edges of the two boxes. If the WIOU is less than a certain threshold T1, the pre-initialized tracking box is determined to be a new tracking box, and a new ID is generated. Based on the special characteristics of tracking mushrooms using rotation, T1 before 100 frames is set to 0.8, and T1 after 100 frames is set to 0.4. Experiments show that this method can suppress repeated tracking of the same mushroom, that is, suppress the generation of 2 or more IDs for the same mushroom.

[0020] In step 3, the DeepSort tracking algorithm calculates the IOU between the position coordinates of track_idx in the previous frame and the position coordinates of track_idx to be updated. If the probability of overlap is greater than a certain threshold T2, it is determined that the ID has not been shifted, and the position is updated. If the probability is less than the threshold, it is determined that the ID box has been shifted, and the position is not updated. T2 is 0.2 before 100 frames and 0.5 after 100 frames. Experiments have shown that this method can prevent the phenomenon of mushroom ID change.

[0021] In step 4, the total number of shiitake mushrooms is calculated by counting the number of shiitake mushroom ID numbers after the electric turntable rotates once to obtain the number of shiitake mushrooms on the mushroom log.

[0022] In step 4, the overlap rate of shiitake mushrooms is calculated by calculating the overlap area of ​​each pair of shiitake mushroom target recognition boxes in each frame of the image to obtain the overlap rate of each pair of shiitake mushrooms; after the electric turntable rotates once, the overlap rate of shiitake mushrooms on the entire mushroom stick is calculated based on the overlap rate of shiitake mushrooms in each frame of the image.

[0023] In step 4, the calculation of the shiitake mushroom color involves calculating the median of the RGB three channels of the shiitake mushroom within a certain range of the center of each target recognition box in each frame image. After the electric turntable rotates once, the median of the RGB three channels of the shiitake mushroom images in all the acquired images is averaged to obtain the average RGB values ​​R, G, and B of all shiitake mushrooms on the mushroom log; then, the formula Brightness = 0.3 is used. R+0.6 G+0.1 B yields the color depth value of the shiitake mushroom;

[0024] In step 4, the average area of ​​the shiitake mushroom cap is calculated by calculating the area of ​​each shiitake mushroom in each frame of the image and extracting the area of ​​the shiitake mushroom when it is facing the industrial camera as the area of ​​a single shiitake mushroom. After the electric turntable rotates once, the average area of ​​all the shiitake mushrooms is calculated as the average area of ​​the shiitake mushroom cap.

[0025] In step 4, the average surface temperature of the mushroom sticks and the average ambient temperature are calculated by using an infrared temperature sensor to collect the surface temperature of the mushroom sticks and the ambient temperature in each frame of the image. After the electric turntable rotates once, the average humidity of the mushroom sticks and the ambient humidity in all frames of the image are calculated respectively.

[0026] In step 4, the mushroom stick grading model uses the parameters processed in step 4 as input to the SVM model, and the output of the SVM model is the grade of the mushroom stick.

[0027] The beneficial effects of this invention are:

[0028] 1) The computationally complex Mish activation function in CSPDarkNet53 was replaced with the computationally simpler LeakyRelu activation function, and the neural network display code was removed; the processing speed of the network before the improvement was 0.339s / frame, and the processing speed of the network after the improvement was 0.227s / frame, that is, the improved network has a faster processing speed;

[0029] 2) The DeepSort multi-target tracking algorithm has been improved. Specifically, in the tracker module, the track_id of the confirmed tracking boxes is reassigned. If the number of confirmed tracking boxes is n, the id is redefined from 1 to n+1. The track_id is reassigned with each update. When the total number of tracked targets is less than 7, multiple tracking boxes can be initialized in the same update. When the total number of tracked targets exceeds 7, each update adds at most one new ID. The pre-initialized tracking box is matched with all pre-stored confirmed tracking boxes using the intersection-union ratio (WIOU) of their bottom edges. If the WIOU is less than a certain threshold T1, the pre-initialized tracking box is confirmed. A new tracking box is generated, and a new ID is created. Based on the specific characteristics of tracking shiitake mushrooms using rotation, T1 is set to 0.8 before frame 100 and 0.4 after frame 100. The IOU is calculated between the position coordinates of the previous frame in track_idx and the position coordinates of track_idx to be updated. If the probability of overlap is greater than a certain threshold T2, it is determined that the ID has not shifted, and a position update is performed. If the probability is less than the threshold, it is determined that the ID box has shifted, and no position update is performed. T2 is 0.2 before frame 100 and 0.5 after frame 100. Experiments show that the improved DeepSort multi-target tracking algorithm ensures that, during the rotation of the mushroom log by the electric turntable, the ID number of the shiitake mushroom does not increment, each shiitake mushroom does not generate a duplicate ID number, and the ID number of each shiitake mushroom remains unchanged.

[0030] 3) This invention proposes and implements a novel method for tracking shiitake mushrooms in association with YOLOv4 and DeepSort without losing track of them. It successfully establishes the first fully automatic, multi-parameter, and high-precision system for extracting phenotypic parameters of shiitake mushroom logs and realizing intelligent grading of the logs.

[0031] 4) The neural network and tracking algorithm are packaged together into an EXE executable file, which can be opened and used directly on any computer, saving the time of reconfiguring the environment when changing computers to use the neural network. Attached Figure Description

[0032] Figure 1 Design diagram for a hierarchical system;

[0033] In the picture: 1. Dark box; 2. Driver; 3. Electric turntable; 4. Clamping device; 5. Industrial camera; 6. Acrylic sheet; 7. Light source; 8. Infrared temperature sensor; 9. Microcontroller; 10. Computer; 11. Shiitake mushroom spawn.

[0034] Figure 2 A physical image of the hierarchical system;

[0035] Figure 3 A flowchart for digital image processing and analysis;

[0036] Figure 4 For the human-computer interaction interface of the hierarchical system;

[0037] Figure 5 A comparison chart showing the difference between mushroom ID numbers that increment and those that do not.

[0038] Figure 6 A comparison chart showing the same shiitake mushroom being tracked repeatedly and not tracked repeatedly;

[0039] Figure 7 A comparison image showing the mushroom ID number changed (Switch) and unchanged. Detailed Implementation

[0040] This invention provides an intelligent grading system for shiitake mushroom spawn, the design of which is shown in the figure. Figure 1 The actual product made according to the design drawings is shown below. Figure 2The system includes a dark box 1, a driver 2, an electric turntable 3, a clamping device 4, an industrial camera 5, an acrylic plate 6, a light source 7, an infrared temperature sensor 8, a microcontroller 9, a computer 10, and a human-machine interface. The light source 7 and the infrared temperature sensor 8 are respectively installed on both sides of the dark box 1. The industrial camera 5 is fixed to the transparent acrylic plate 6 and installed in front of the light source 7. The electric turntable 3 is installed at the bottom of the dark box 1 and located between the industrial camera 5 and the infrared temperature sensor 8. The clamping device 4 is fixed to the top of the dark box 1. The computer 10 is connected to the infrared temperature sensor 8 and the microcontroller 9 respectively. The electric turntable 3 and the clamping device 4 are used to fix the mushroom spawn 11. The dark box 1 is custom-made from a semi-transparent black acrylic sheet, measuring 80cm x 40cm x 60cm (length x width x height), to block interference from external light. The front of the dark box 1 has a door measuring 20cm x 45cm (length x height) for the entry and exit of mushroom spawn. The light source 7 consists of two parallel dimmable tubes to provide uniform illumination for image acquisition. The clamping device 4 is fixed to the top of the dark box 1 using studs and long nuts. The height between the clamping device 4 and the electric turntable 3 is adjustable according to the length of the spawn 11 using studs and long nuts. The industrial camera 5 is fixed in place. On the upper part of the transparent acrylic plate 6, the industrial camera 5 is a 12-megapixel distortion-free wide-angle monocular camera used to acquire images of the mushroom log surface in real time, ultimately measuring the characteristic parameters of the shiitake mushroom log. The transparent acrylic plate 6 does not affect the lighting when the industrial camera 5 acquires images. The infrared temperature sensor 8 is fixed on one side of the dark box 1 opposite the dimming lamp tube 7, facing the mushroom log 11. The distance between the infrared temperature sensor and the surface of the mushroom log is about 15cm. It is connected to the computer 10 via a serial port for real-time measurement of the surface temperature of the mushroom log and the ambient temperature. The human-machine interface is shown below. Figure 3 It has functions such as creating, saving, opening, starting, testing, and controlling, and is used to display information such as the number of shiitake mushrooms, the number of shiitake mushroom regenerations, the shiitake mushroom regeneration rate, the average temperature of the shiitake mushroom logs, the average ambient temperature, tracking results, tracking location information, and the grade of the logs.

[0041] In addition, during measurement, the shiitake mushroom log 11 is fixed in the clamping device 4 and the electric turntable 3. The height between the clamping device 4 and the electric turntable 3 is adjustable, and the adjustment range is suitable for shiitake mushroom logs with a height of 35cm to 45cm.

[0042] The grading method of the intelligent grading system for shiitake mushroom logs is carried out in the following steps: (1) Turn on the light source, microcontroller and dark box door, fix the shiitake mushroom logs between the electric turntable and the clamping device, and close the dark box door; (2) Turn on the computer and human-computer interaction interface, start the system, and the operator sends instructions to the microcontroller through the human-computer interaction interface. The microcontroller controls the electric turntable to clamp the logs and rotate through the driver. At the same time, the industrial camera continuously collects images of the log surface, and the infrared temperature sensor continuously collects the log surface temperature and the ambient temperature; (3) The computer receives the image data in real time, performs digital image processing and analysis, and obtains the shiitake mushroom area, shiitake mushroom color, and shiitake mushroom... Overlap rate, surface temperature of mushroom sticks, ambient temperature and other characteristic parameters; at the same time, the computer reads the surface temperature of mushroom sticks and ambient temperature collected by the infrared temperature sensor in real time; (4) after the electric turntable rotates once, it stops, and all the data obtained in step 3 above are further processed to obtain characteristic parameters such as the number of shiitake mushrooms on the mushroom sticks, the overlap rate of shiitake mushrooms, the color of shiitake mushrooms, the average area of ​​shiitake mushroom caps, the average surface temperature of mushroom sticks and the average ambient temperature, and the above processed characteristic parameters are input into the mushroom stick grading model to calculate the grade of shiitake mushroom sticks; (5) the characteristic parameters obtained in step 4 are displayed on the human-computer interaction interface and saved to the specified EXCEL file;

[0043] See the flowchart for digital image processing and analysis. Figure 4 The following aspects are included: (1) Using the YOLOv4 neural network to identify shiitake mushrooms on the mushroom stick in real time, and using the improved DeepSort multi-target tracking algorithm to track each shiitake mushroom on the mushroom stick; (2) Calculation of the number of shiitake mushrooms. After the electric turntable rotates once, the number of shiitake mushroom ID numbers is calculated to obtain the number of shiitake mushrooms on the mushroom stick; (3) Measurement of shiitake mushroom overlap rate. The overlap rate of each pair of shiitake mushrooms is obtained by calculating the overlap area of ​​each pair of shiitake mushroom target recognition boxes in each frame image; after the electric turntable rotates once, the overlap rate of shiitake mushrooms on the entire mushroom stick is calculated based on the overlap rate of shiitake mushrooms in each frame image; (4) Measurement of shiitake mushroom color. The median of the three RGB channels of shiitake mushrooms within a certain range of the center of a single target recognition box in each frame image is calculated respectively. After the electric turntable rotates once, the median of the three RGB channels of shiitake mushroom images in all the collected images is averaged to obtain the average RGB values ​​R, G, and B of all shiitake mushrooms on the mushroom stick; using the formula Brightness=0.3 R+0.6 G+0.1 B. Obtain the color depth of the shiitake mushroom; (5) Measure the average area of ​​the shiitake mushroom cap. Calculate the area of ​​each shiitake mushroom in each frame and extract the area of ​​the shiitake mushroom facing the industrial camera as the area of ​​a single shiitake mushroom. After the electric turntable rotates once, calculate the average area of ​​all shiitake mushroom areas as the average area of ​​the shiitake mushroom cap; (6) Calculate the average surface temperature of the mushroom log and the average ambient temperature. Use an infrared temperature sensor to collect the surface temperature of the mushroom log and the ambient temperature in each frame. After the electric turntable rotates once, calculate the average humidity of the mushroom log surface and the ambient humidity in all frames; (7) Measure the grade of the shiitake mushroom log. Use the number of shiitake mushrooms, the overlap rate of shiitake mushrooms, the color of shiitake mushrooms, the average area of ​​the shiitake mushroom cap, the average surface temperature of the mushroom log and the average ambient temperature as inputs to the SVM model. The output of the SVM model is the grade of the mushroom log.

[0044] Based on the existing DeepSort multi-target tracking algorithm, the following improvements were made: (1) In the DeepSort tracking algorithm, the track_id of the tracking box marked as confirmed is reassigned in the tracker module. If the number of tracking boxes marked as confirmed is n, the id is redefined as 1-n+1. The track_id is reassigned every time there is an update. Experiments have shown that this method can prevent the mushroom ID from jumping. Figure 5 To improve the comparison of results before and after. (2) In the DeepSort tracking algorithm, when the number of all tracked targets is less than 7, multiple tracking boxes can be initialized in the same update. When the number of all tracked targets exceeds 7, each update adds at most a new ID. The pre-initialized tracking box is matched with the pre-stored tracking boxes marked as confirmed by the intersection-union ratio (WIOU) of the bottom edge positions of the two boxes. If the WIOU is less than a certain threshold T1, the pre-initialized tracking box is determined to be a new tracking box and a new ID is generated. According to the special characteristics of tracking mushrooms by rotation, T1 before 100 frames is set to 0.8, and T1 after 100 frames is set to 0.4. Experiments show that this method can suppress repeated tracking of the same mushroom, that is, suppress the generation of 2 or more IDs for the same mushroom. Figure 6 To improve the comparison of results before and after. (3) In the DeepSort tracking algorithm, the position coordinates of track_idx in the previous frame and the position coordinates of track_idx to be updated are calculated using IOU. If the probability of overlap is greater than a certain threshold T2, it is determined that the ID has not been shifted, and the position is updated. If the probability is less than the threshold, it is determined that the ID box has been shifted, and the position is not updated. T2 is 0.2 before 100 frames and 0.5 after 100 frames. Experiments show that this method can prevent the phenomenon of mushroom ID change. Figure 7A comparison chart showing the results before and after improvement.

[0045] More specifically, the infrared temperature sensor in step L is model GY-MCU90614-DCI, the communication method is serial communication, and the measurement range is ambient temperature: -40 to +125℃, target temperature: -70 to +280℃.

Claims

1. A grading method for an intelligent grading system for shiitake mushroom spawn, characterized in that, Includes the following steps: Step 1: Turn on the light source, microcontroller and darkroom door, fix the shiitake mushroom sticks between the electric turntable and the clamping device, and close the darkroom door; Step 2: Open the computer and human-computer interaction interface, start the system, and the operator sends instructions to the microcontroller through the human-computer interaction interface. The microcontroller controls the electric turntable to clamp the mushroom sticks and rotate through the driver. At the same time, the industrial camera continuously collects images of the surface of the mushroom sticks, and the infrared temperature sensor continuously collects the surface temperature of the mushroom sticks and the ambient temperature. Step 3: The computer receives image data in real time. The image processing method uses the YOLOv4 deep learning neural network to identify the shiitake mushrooms on the mushroom sticks. The DeepSort multi-target tracking algorithm is used to track each identified shiitake mushroom. During the identification and tracking, the shiitake mushroom area, shiitake mushroom color, shiitake mushroom overlap rate, mushroom stick surface temperature, and ambient temperature feature parameters are extracted in real time. In the DeepSort tracking algorithm in step 3, the track_id of the track box marked as confirmed is reassigned in the tracker module. If the number of track boxes marked as confirmed is n, the id is redefined from 1 to n+1. The track_id is reassigned every time there is an update. Step 4: After the electric turntable rotates once, it stops. All the data obtained in Step 3 are further processed to obtain characteristic parameters such as the number of shiitake mushrooms on the mushroom log, the overlap rate of shiitake mushrooms, the color of shiitake mushrooms, the average area of ​​shiitake mushroom caps, the average surface temperature of the mushroom log, and the average ambient temperature. The processed characteristic parameters are then input into the mushroom log grading model to calculate the grade of the shiitake mushroom log. Step 5: Display the feature parameters obtained in Step 4 on the human-computer interaction interface and save them to the specified EXCEL file; The intelligent grading system for shiitake mushroom spawn includes a dark box, driver, electric turntable, clamping device, industrial camera, acrylic plate, light source, infrared temperature sensor, microcontroller, computer, and human-machine interface. The light source and infrared temperature sensor are respectively installed on both sides of the dark box. The industrial camera is fixed on a transparent acrylic plate and installed in front of the light source. The electric turntable is installed at the bottom of the dark box and located between the industrial camera and the infrared temperature sensor. The clamping device is fixed at the top of the dark box. The computer is connected to the infrared temperature sensor and the microcontroller respectively. The electric turntable and clamping device are used to fix the shiitake mushroom logs. The light source consists of two dimmable lamp tubes to provide uniform illumination for image acquisition. The human-machine interface has functions of creating, saving, opening, starting, testing, and controlling. It also displays the number of shiitake mushrooms, the number of shiitake mushroom regenerations, the shiitake mushroom regeneration rate, the average temperature of the shiitake mushroom logs, the average ambient temperature, the tracking result, the tracking location information, and the log grade.

2. The grading method of the intelligent grading system for shiitake mushroom spawn according to claim 1, characterized in that: In step 3, the activation function of the CSPDarkNet53 network in YOLOv4 is LeakyRelu, and the code for displaying the neural network is removed; the processing speed of the network before the improvement is 0.339s / frame, and the processing speed of the network after the improvement is 0.227s / frame.

3. The grading method of the intelligent grading system for shiitake mushroom spawn according to claim 1, characterized in that: In the DeepSort tracking algorithm in step 3, when the number of all tracked targets is less than 7, multiple tracking boxes are initialized in the same update. When the number of all tracked targets exceeds 7, each update adds at most one new ID. The pre-initialized tracking box is matched with all the pre-stored tracking boxes marked as confirmed by the intersection-union ratio of the bottom edges of the two boxes. If the intersection-union ratio is less than a certain threshold T1, the pre-initialized tracking box is determined to be a new tracking box and a new ID is generated. According to the special characteristics of tracking mushrooms by rotation, T1 before 100 frames is set to 0.8, and T1 after 100 frames is set to 0.

4.

4. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: In the DeepSort tracking algorithm in step 3, the position coordinates of track_idx in the previous frame and the position coordinates of track_idx to be updated are calculated using IOU. If the probability of overlap is greater than a certain threshold T2, it is determined that the ID has not been shifted, and the position is updated. If the probability is less than the threshold, it is determined that the ID box has been shifted, and the position is not updated. T2 is 0.2 before 100 frames and 0.5 after 100 frames.

5. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: In step 4, the number of shiitake mushrooms is calculated by counting the number of shiitake mushroom IDs after the electric turntable rotates once.

6. The grading method of the intelligent grading system for shiitake mushroom spawn according to claim 1, characterized in that: The calculation of the shiitake mushroom overlap rate in step 4 is obtained by calculating the overlap area of ​​each pair of shiitake mushroom target recognition boxes in each frame image to obtain the overlap rate of each pair of shiitake mushrooms; after the electric turntable rotates once, the overlap rate of shiitake mushrooms on the entire mushroom stick is calculated based on the overlap rate of shiitake mushrooms in each frame image.

7. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: In step 4, the calculation of the shiitake mushroom color involves calculating the median of the three RGB channels of the shiitake mushroom within a certain range of the center of a single target recognition box in each frame image. After the electric turntable rotates once, the median of the three RGB channels of the shiitake mushroom image in all the collected images is averaged to obtain the average RGB values ​​R, G, and B of all shiitake mushrooms on the mushroom stick. Use the formula Brightness=0.3 R+0.6 G+0.1 B yields the color depth value of the shiitake mushroom.

8. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: In step 4, the average area of ​​the shiitake mushroom cap is calculated by calculating the area of ​​each shiitake mushroom in each frame of the image and extracting the area of ​​the shiitake mushroom when it is facing the industrial camera as the area of ​​a single shiitake mushroom. After the electric turntable rotates once, the average area of ​​all the shiitake mushrooms is calculated as the average area of ​​the shiitake mushroom cap.

9. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: In step 4, the average surface temperature of the mushroom sticks and the average ambient temperature are calculated by using an infrared temperature sensor to collect the surface temperature of the mushroom sticks and the ambient temperature in each frame of the image. After the electric turntable rotates once, the average humidity of the mushroom sticks and the ambient humidity in all frames of the image are calculated respectively.

10. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: The mushroom stick grading model in step 4 uses the parameters processed in step 4 as input to the SVM model, and the output of the SVM model is the grade of the mushroom stick.

11. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: The electric turntable is fixed to the bottom plate of the dark chamber, and the clamping device is fixed to the top of the dark chamber. The height between the clamping device and the electric turntable is adjustable according to the length of the mushroom stick. The industrial camera is fixed on a transparent acrylic plate and installed in front of the dimming lamp tube to collect images of the surface of the mushroom stick in real time. The infrared temperature sensor is fixed on one side of the dark chamber opposite the dimming lamp tube, facing the mushroom stick, to collect the surface temperature of the mushroom stick and the ambient temperature in real time.

12. The grading method of the intelligent grading system for shiitake mushroom logs according to claim 1, characterized in that: The human-computer interaction interface is encapsulated into an EXE executable file using PyInstaller, enabling the shiitake mushroom spawn grading method to be used on any computer without requiring a deep learning environment.

Citation Information

Patent Citations

  • CN112634327A

  • CN113016506A