Digital twinning method for edible mushroom bottle bag cultivation factorization
Through digital twin technology, the growth process of edible fungi bottle bag plants is monitored and optimized in real time, which solves the problem that traditional manual intervention methods are difficult to achieve accurate and efficient growth regulation, and improves production efficiency and quality.
Patent Information
- Application Number
- CN202510183119.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-19
- Publication Date
- 2025-06-06
AI Technical Summary
Traditional manual intervention methods are difficult to achieve accurate and efficient growth regulation in edible fungi bottle bags, resulting in difficulty in improving production efficiency and quality.
Through digital twin technology, the growth process of edible fungi is divided into five periods, image data and environmental data are collected, geometric models, behavioral models and knowledge models are established, and data analysis and prediction are combined with machine learning algorithms to achieve real-time monitoring and optimization of the growth environment of edible fungi.
Real-time monitoring and optimization of the growth status of edible fungi is achieved, production efficiency and quality are improved, the process stability cycle is shortened, and intelligent management of edible fungi is provided.
Smart Images

Figure CN120107680A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of edible fungi digitalization, and specifically, relates to a digital twin method for factory-based bottle and bag cultivation of edible fungi. Background Art
[0002] Digital twin technology is a technology that models, simulates and optimizes physical entities through digital means. Digital twin technology can be applied to various fields, including smart manufacturing, smart agriculture, smart traffic management, etc.
[0003] The combination of the edible fungus industry and digital twin technology can promote the modernization and intelligent development of agriculture. Through real-time monitoring, data analysis and prediction models, digital twin technology can provide strong support for the prediction and optimization of the growth status of edible fungi. It can create a virtual model of the growth environment of edible fungi, monitor key parameters such as temperature, humidity, light and gas concentration in real time, and achieve advanced regulation of intelligent cultivation by simulating different growth conditions, improve production efficiency and quality, promote the intelligent and precise management of the edible fungus industry, and bring higher efficiency and benefits to the edible fungus industry. Summary of the invention
[0004] The purpose of the present invention is to provide a digital twin method for the factory-based cultivation of edible fungi in bottles and bags. The present invention can realize the advanced regulation of intelligent cultivation by realizing the digital twin of the factory-based cultivation of edible fungi in bottles and bags. Compared with the traditional manual direct intervention method, it greatly improves the accuracy of regulation and shortens the process stability cycle, providing strong support for the intelligentization of edible fungi.
[0005] The technical solution of the present invention is specifically described as follows.
[0006] The present invention provides a digital twin method for factory-based bottle and bag cultivation of edible fungi, comprising the following steps:
[0007] (1) The fruiting management stage of edible fungi cultivated in bottles and bags is divided into five periods: recovery period, bud-inducing period, bud-emerging period, elongation period, and maturity period. Image data of edible fungi in bottles and bags at different growth periods are collected, features are extracted through image processing algorithms, and the growth conditions at different stages are analyzed to establish a corresponding digital twin model. The digital twin model includes a geometric model, a behavioral model, and a knowledge model.
[0008] (2) Collect environmental data from the edible fungus culture room, use machine learning algorithms to analyze and predict data change trends, and establish a corresponding digital twin model; establish a connection between the image processing results of edible fungi and environmental data, establish rules between the knowledge models of the two, and establish a discrete control model through a classification algorithm to realize the digital twin of the factory-based edible fungus bottle and bag cultivation.
[0009] Compared with the prior art, the present invention has the following beneficial effects:
[0010] The present invention provides a digital twin model of bottle-bag-grown edible fungi at different stages of the fruiting management stage of bottle-bag-grown edible fungi, which integrates and works together with geometric models, behavioral models and knowledge models to achieve real-time monitoring, prediction and optimization of physical entities.
[0011] The present invention uses sensors to acquire features to construct a three-dimensional model, and combines the environment with the model algorithm to realize a process in which the digital twin model controls the display device to adjust environmental parameter changes to adapt to growth. Ultimately, the growth detection and control of edible fungi that combines virtual and real can be achieved, thereby improving the production efficiency of edible fungi. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 : Images of edible fungi grown in bottles and bags at different stages; (a) recovery stage, (b) bud-inducing stage, (c) bud-emerging stage, (d) elongation stage, and (e) maturity stage.
[0013] Figure 2 :(a)~(c) are examples of images of mycelium with different degrees of whiteness during the recovery period.
[0014] Figure 3 : TH-ATB grayscale binarization result.
[0015] Figure 4 : The thick and white mycelium performance of the digital twin model under different alpha parameters.
[0016] Figure 5 : Schematic diagram of kink point identification results.
[0017] Figure 6 : Two-dimensional Gaussian fitting result graph.
[0018] Figure 7 : Schematic diagram of the 3D model of the kink point.
[0019] Figure 8 : Schematic diagram of bud primordium identification.
[0020] Fig. 9 : Extract the mask image from the result image recognized by YOLOv8.
[0021] Fig.10 : Schematic diagram of mushroom identification results during the elongation period.
[0022] Fig.11 : Schematic diagram of mature mushroom identification results.
[0023] Fig.12 : Schematic diagram of cubic spline control of mushroom stem.
[0024] Fig.13: Schematic diagram of 3D model mushroom during elongation period.
[0025] Fig.14 : Schematic diagram of 3D model mushrooms at maturity stage.
[0026] Fig.15 : A growth curve model showing the change of mycelium density and whiteness over time during the recovery period.
[0027] Fig.16 : Growth fitting curve with the number of kink points in the budding stage as the growth characteristic value.
[0028] Fig.17 The growth fitting curve takes the number of basic buds in the budding stage as the growth characteristic value.
[0029] Fig.18 : Fitting of characteristic growth curves of mushroom cap (a) and stem size (b) during the elongation period.
[0030] Fig.19 : Workflow diagram of the digital twin system of the present invention. DETAILED DESCRIPTION
[0031] The technical solution of the present invention is described in detail below in conjunction with the accompanying drawings and embodiments.
[0032] Example 1
[0033] 1. Growth characteristics of edible fungi at different stages and establishment of digital twin model
[0034] The management stage of bottle bag cultivation of edible fungi can be roughly divided into five periods: recovery period, bud urging period, bud appearance period, elongation period and maturity period. Figure 1 As shown, it takes about 30 days from entering the culture room to mature harvesting, depending on the variety.
[0035] ① Recovery period
[0036] (1) Characteristic description: refers to the 1st to 6th day after the culture bottle is placed in the culture room. After entering the mushroom room, the mycelium on the surface of the culture medium is damaged due to the scratching operation and needs to be restored. During this period, the mycelium on the surface of the culture medium gradually recovers and the color changes from light white to dark white.
[0037] (2) Image feature value extraction
[0038] During the recovery period, the density of hyphae reflects the degree of recovery of the mycelium of seafood mushrooms. The denser the hyphae, the more fruiting bodies can be promoted to ensure the yield of seafood mushrooms. The degree of white concentration is now used to quantitatively characterize the density of hyphae. The degree of white concentration is evaluated by analyzing the grayscale value (GSV) in the grayscale histogram of the binary hyphae mask. The density of hyphae is positively correlated with the grayscale value. The higher the grayscale value, the greater the density of hyphae and the better the recovery. Therefore, the numerical value of the grayscale histogram can accurately reflect the growth state and recovery degree of hyphae during the recovery period. The calculation process is as follows:
[0039] a. Grayscale
[0040] The original RGB image is grayed out and converted into a grayscale image. The grayscale value is calculated pixel by pixel as follows:
[0041] gray=0.114B+0.587G+0.299R
[0042] b. Binarization
[0043] Threshold processing aims to extract the target object from the image and distinguish the background from the noise. Common methods include fixed threshold binarization (FTB) and adaptive threshold binarization (ATB). FTB uses a fixed threshold T to classify pixels, but its effect is limited in images with uneven illumination. ATB dynamically adjusts the threshold according to the brightness of the local area to better handle brightness changes, thereby improving the accuracy of binarization. The background of the collected data image is greatly affected by the illumination, and adaptive binarization still cannot completely solve the problem of uneven illumination. This causes the plastic border at the bottle mouth to be misjudged as hyphae, affecting the accuracy of the thick white degree judgment. Therefore, this paper introduces the top-hat transformation (Top-Hat) before adaptive binarization, and proposes an improved top-hat adaptive binarization algorithm (Top-Hat Adaptive Thresholding Binarization, TH-ATB). Top-hat transformation is a morphological processing method that can effectively reduce the impact of uneven background light by highlighting brighter objects on a dark background, thereby better preserving foreground details and improving the accuracy of the binarization results. The formula for top-hat transformation is expressed as:
[0044] I TH =I-(I°B)
[0045] Where: I THis the image after top-hat transformation; I is the grayscale image after brightness enhancement; B represents a 15×15 rectangular structure element.
[0046] Next, the top-hat processed image I TH Perform adaptive binarization:
[0047]
[0048] Where: I Blur is the top-hat image after Gaussian blur processing; T(x,y) is the local threshold at the pixel point (x,y); C is the adjustment constant.
[0049] c. Statistics
[0050] GSV=ΣI bin
[0051] (3) Recovery digital twin model
[0052] a. Geometric model: The geometric model of the recovery period is mainly the cylinder of culture medium in the bottle, with the texture map of the culture medium attached.
[0053] b. Behavior model: To add thick and white changes to the 2D texture map of the culture medium,
[0054] The model morphology is controlled by the mycelium growth rate. Here, the thick white color is generated using Perlin white noise and superimposed on the culture texture map, and is controlled by the transparency parameter alpha (0-1), such as Figure 4 shown.
[0055] Among them, the Perlin white noise produces each pixel noise point calculated as follows:
[0056] P(x,y) is a pixel in the two-dimensional texture image, (x0,y0), (x1,y0), (x0,y1), (x1,y1) are the coordinates of the four vertices of the square containing P, and g00, g01, g10, g11 are the gradient vectors of these four vertices respectively.
[0057] 1. Calculate the relative position vector:
[0058] dx00=x-x0,dy00=y-y0
[0059] dx10=x-x1,dy10=y-y0
[0060] dx01=x-x0,dy01=y-y1
[0061] dx11=x-x1,dy11=y-y1
[0062] 2. Calculate the gradient contribution:
[0063] contrib00=g00.x*dx00+g00.y*dy00
[0064] contrib01=g01.x*dx10+g01.y*dy10
[0065] contrib10=g10.x*dx01+g10.y*dy01
[0066] contrib11=g11.x*dx11+g11.y*dy11
[0067] 3. Calculate the interpolation parameters (taking the decimal part of x and y as an example):
[0068] u = fade(x-floor(x))
[0069] v = fade(y-floor(y))
[0070] Where fade(t) is a smooth function, such as a cubic polynomial: fade(t) = t 3 *(6t 2 -15t+10)
[0071] 4. Perform interpolation calculation:
[0072] noise=lerp(lerp(contrib00,contrib10,u),lerp(contrib01,contrib11,u),v)
[0073] Where lerp(a,b,t) is a linear interpolation function: lerp(a,b,t)=a*(1-t)+b*tc. Knowledge model: Establish the mapping relationship between image parameters GSV and alpha, and use the linear normalization method to calculate GSV:
[0074] alpha=(GSV-GSV min ) / (GSV max -GSV min )
[0075] That is, GSV is used to control the alpha of the digital twin model.
[0076] ②Bud-inducing period:
[0077] (1) Feature description
[0078] The bud-inducing period is from the 7th to the 9th day after entering the culture room. After the mycelium gradually "turns white", the physiologically mature mycelium will switch from vegetative growth to reproductive growth through a series of operations such as temperature difference stimulation, increased light and ventilation. Under the influence of the extremely dry and wet environment, the mycelium will fall over and gather into small groups, and under the stimulation of temperature difference, the protoplasm in the cells will shrink, and then the mycelium will gradually twist into white bud primordia.
[0079] (2) Image feature value extraction
[0080] The main task of the budding period is to identify the kink points, which is achieved through the small target recognition algorithm. YOLOv5 and EfficientDet are compared, and the final rotation algorithm recognition results based on YOLOv5 are as follows Figure 5 As shown in the figure, it mainly identifies the quantity, coordinates and dispersion degree, and generates a coordinate array for 3D model generation.
[0081] The network architecture of YOLOv5 consists of four parts:
[0082] Input: The input represents the input image. The input image size of the network is 640*640. This stage usually includes an image preprocessing stage, which is to scale the input image to the network input size and perform normalization and other operations. During the network training stage, YOLOv5 uses Mosaic data enhancement operations to improve the training speed of the model and the accuracy of the network; and proposes an adaptive anchor box calculation and adaptive image scaling method.
[0083] Benchmark network: Benchmark networks are usually some classifiers with excellent performance. This module is used to extract some common feature representations. YOLOv5 not only uses the CSPDarknet53 structure, but also uses the Focus structure as the benchmark network.
[0084] Neck network: Neck network is usually located in the middle of the base network and the head network. It can be used to further improve the diversity and robustness of features. Although YOLOv5 also uses SPP module and FPN+PAN module, the implementation details are somewhat different.
[0085] Head output: Head is used to output the target detection results. For different detection algorithms, the number of branches at the output is different, usually including a classification branch and a regression branch. YOLOv5 uses GIOU_Loss to replace the Smooth L1 Loss function to further improve the detection accuracy of the algorithm.
[0086] The YOLOv5 recognition result is used as the input of the two-dimensional Gaussian fitting.
[0087] In order to obtain the uniformity of the distribution of the kink points of each bottle, it is necessary to fit the positions of the kink points in the image after target detection. Two-dimensional Gaussian fitting is a technique for fitting data using a two-dimensional Gaussian function; two-dimensional Gaussian fitting is a method for fitting a Gaussian distribution model of two-dimensional data points. Gaussian distribution (also called normal distribution) can be expressed in two dimensions as:
[0088]
[0089] Where: A is the amplitude (peak height); (x 0 ,y 0 ) is the center position of the Gaussian distribution; σ x and σ y are the standard deviations in the x and y directions respectively.
[0090] Figure 6 This is the two-dimensional Gaussian fitting result diagram.
[0091] (3) Digital twin model of budding period
[0092] a. Geometric model: The geometric model of the bud-inducing period is mainly a tiny spherical structure formed by the twisting of the white mycelium in the bottle, and the material is pure white.
[0093] b. Behavioral model: During the budding period, only quantity and position are considered, so the identified coordinates are the coordinates of the kink point model, which are expressed as the spatial coordinate position (x, y, z) of the geometric model.
[0094] c. Knowledge model: Due to the deviations in the continuous recognition process, it manifests as misrecognition, missed recognition, etc., but the overall distribution of the recognition results is relatively stable. Therefore, the σ obtained by two-dimensional Gaussian fitting is x and σ y The specific process is to randomly generate or delete the standard deviations that meet σ, while giving priority to ensuring the continuity and consistency of the standard deviation. x and σ y The two-dimensional Gaussian samples (x, y, z) of the distribution, that is, if the number of current detection results is greater than the previous number, they will be deleted, otherwise they will be supplemented until σ x and σ y Continuous and stable.
[0095] That is, through σ x and σ y To control the number and location distribution of digital twin models; the results of generating kink points in the model are shown as follows Figure 7 shown.
[0096] ③Bud stage:
[0097] (1) Feature description
[0098] From the 10th to 13th day after entering the culture room, the number of kink points (bud primordia) increases and becomes clearly visible. The shape gradually changes from fish roe-like at the beginning to a slender triangular primordium about 0.5 cm high, with various growth directions.
[0099] (2) Image feature value extraction
[0100] During the budding stage, the main task is to identify the bud primordium, and use the instance segmentation algorithm to obtain the bud morphology. After comparing YOLOv5 and YOLOv8, YOLOv8 was finally selected for instance segmentation, as the segmentation boundary of YOLOv8 is clearer. Figure 8 Schematic diagram for identification of bud primordium; Fig. 9 To extract the mask image from the result image recognized by YOLOv8.
[0101] YOLOv8 has achieved significant improvements in various indicators, especially in terms of accuracy, which is significantly improved compared to YOLOv5, surpassing the existing target detection and instance segmentation models. It draws on the design advantages of models such as YOLOv 5, YOLOv 6, and YOLOX, and comprehensively improves the structure of YOLOv 5 while retaining the engineering simplicity and ease of use of YOLOv 5. The V8 model also has many innovations. First, YOLOv 8 introduces a new SOTA model, including a target detection network with P5 640 and P6 1280 resolutions and an instance segmentation model based on YOLACT. Then, in terms of the backbone network, YOLOv 8 continues to use the idea of the CSP module, but replaces the C3 module in YOLOv5 with the C2f module, thereby achieving further lightweighting. In addition, it continues the SPPF module in YOLOv5 and carefully fine-tunes the models of different scales, no longer using a single parameter setting, which significantly improves the model performance. And the head part has been greatly changed compared to YOLOv5. YOLOv8 adopts the current mainstream decoupled-head structure, separating the classification and detection heads.
[0102] The instance segmentation result is the pixel points at the edge of the bud primordium. The major and minor axis a and b sizes are identified by fitting the pixels with an ellipse.
[0103] The general equation of an ellipse is:
[0104] Ax 2 +Bxy+Cy 2 +Dx+Ey+F=0
[0105] Convert this to a standard ellipse equation:
[0106]
[0107] Among them, A, B, C, D, E, F are the parameters of the ellipse and satisfy the constraint condition B 2 -4AC<0, a and b are the major and minor axes, and θ is the rotation angle of the major axis of the ellipse (relative to the x-axis).
[0108] Specifically, the pixel coordinates (x i ,y i ) into the ellipse equation to construct a linear system of equations; use the least squares method to solve the parameters A, B, C, D, E, F; calculate the center coordinates (h, k)
[0109]
[0110] The rotation angle θ of the ellipse is obtained by the following formula
[0111]
[0112] Major and minor axes a and b
[0113]
[0114]
[0115] The bud primordia with a / b>2 are considered to be effective buds, which will grow into mature mushrooms in the future.
[0116] (3) Digital twin model of budding period
[0117] a. Geometric model: The geometric model of the budding stage is mainly manifested as a geometric body composed of a cylinder (the body of the bud primordium) and a cone (the head of the bud primordium) formed by the thickening and elongation of the kink point in the bottle, and the material is pure white.
[0118] b. Behavioral model: The main parameters of the geometry are the radius and height R of the cylindrical part cylinder , H cylinder , the radius and height R of the conical part cone , H cone , as well as the basic coordinates (x, y, z) and directions (α, β, γ) of the geometric body. Here, the bud primordium is small in size and can be approximately considered as a rigid body. Among them, α is the rotation angle around the Z axis (yaw angle, Yaw); β is the rotation angle around the Y axis (pitch angle, Pitch); γ is the rotation angle around the X axis (roll angle, Roll).
[0119] c. Knowledge model: Establish the relationship between the fitting major and minor axes and the parameters of the digital twin model, where R cylinder =b, H cylinder= 2a-b,R cone =b, H cone= b. The coordinates (x, y, z) are identification coordinates, where Z = 0, and the direction angles (α, β, γ), α = 0, β = θ, γ = 90° - θ.
[0120] ④Elongation and maturity period
[0121] (1) Feature description
[0122] The elongation period is the longest period in the fruiting management stage, which is the 14th to 23rd day in the bottle cultivation mode. Bottle bag cultured edible fungi, like other edible fungi, are phototropic. Proper light can promote the primordia that originally have different directions to grow upward, and the mushroom stems will also elongate and thicken. During the elongation period, the mushroom buds grow rapidly, and a small mushroom cap appears on the tip of the bud. Gradually, the mushroom cap increases in size and thickens, and a reticular pattern appears.
[0123] Days 24 to 30 are the last period - the maturity period, during which environmental parameters are mainly adjusted to keep the size ratio of the mushroom cap and stem consistent, allowing rapid growth until reaching the mature harvest standard.
[0124] (2) Image feature value extraction
[0125] In the elongation stage, the stem begins to elongate and the cap appears. The main task in this period is to identify the stem and the small cap. In the mature stage, the identification task is the stem and the cap. The side view can be used to identify the stem. The algorithm uses an instance segmentation algorithm that is suitable for small targets. After comparing YOLOv5, YOLOv8, MTGAN, SOLOv2 and other algorithms, YOLOv8 was finally selected.
[0126] For the elongation period, the parameters chosen are: batch size 16, iteration number 300, and learning rate 0.001.
[0127] For the maturity stage, the parameters are selected as,batch size 8, number of iterations 5000, learning rate 0.01, and optimizer as SGD.
[0128] The output is the target coordinates, segmentation contour pixel point set, mushroom cap size, etc.
[0129] Schematic diagram of the identification results of mushrooms in the elongation period Fig.10 The schematic diagram of the identification results of mature mushrooms is shown in Fig.11 shown.
[0130] (3) Extended digital twin model
[0131] a. Geometric model: The geometric model of the elongation stage and the maturity stage is mainly manifested as the geometric body representing the bud primordium in the bottle is transformed from the cylindrical part (the body of the bud primordium) and the conical part (the head of the bud primordium) into a rotation body with the spline as the axis (the body of the bud primordium becomes the mushroom stem) and a hemisphere (the head of the bud primordium becomes the mushroom cap), and the material is white with yellowish white or pure white.
[0132] b. Behavioral model: The rotation axis of the geometric body is calculated by cubic spline, which is 0 ,P 1 ,…,P n Points are constructed, where P i (x i ,y i ,z i ) of (x i ,y i ) is determined by YOLOv8 recognition coordinates, z i Determined by a growth curve based on environmental and visual recognition features (see Section 3). The specific process is as follows:
[0133] A cubic spline is composed of piecewise cubic polynomials, where each piece is a cubic function:
[0134] S i (t) = a i +b i t+c i t 2 +d i t 3 S i (t) is the parametric equation of the i-th segment of the curve; a i ,b i ,c i ,d i is a coefficient vector (a 3×1 vector in three-dimensional space); t is a parameter, usually normalized to the interval [0,1].
[0135] Construct the system of equations according to the following conditions:
[0136] Interpolation conditions:
[0137] S i (t i )=P i , S i (t i+1 )=P i+1
[0138] Continuity conditions:
[0139] S′ i (t i+1 ) = S′ i+1 (t i+1 ), S″ i (t i+1 )=S″ i+1 (t i+1 )
[0140] Boundary conditions:
[0141] S″ 0 (t 0 )=S″ n-1 (t n )=0
[0142] By solving the linear equations, we can get the coefficient a of each curve segment. i ,b i ,c i ,d i . To achieve the effect of mushroom stem Fig.12 (a) Fig.12 (b) and Fig.12 (c) as shown.
[0143] The radius of the mushroom cap is the radius of the circumscribed circle of the mushroom cap contour, and the height of the mushroom cap is 1 / 2 to 1 / 5 of the mushroom cap radius. Fig.13 , Fig.14 shown.
[0144] c. Knowledge model: Establish the relationship between the identification results of mushroom stems and mushroom caps and the parameters of the digital twin model, where P i (x i ,y i ,z i ) of (x i ,y i ) is determined by the pixel coordinates identified by YOLOv8, z i The growth curve y is determined by fitting the recognition features three times, where z i =y*k, where k is the proportional coefficient, which is a constant and represents the relationship between the mushroom stem spline construction points and the growth curve; the mushroom cap radius adopts the circumscribed circle radius of the mushroom cap contour, and the mushroom cap height is 1 / 2 to 1 / 5 of the mushroom cap radius.
[0145] 2. Growth curve fitting for each period
[0146] A cubic curve regression is performed for the growth characteristic indicators corresponding to each stage. In different growth cycles, the growth of edible fungi obeys a certain growth curve model, and the growth state of edible fungi can be fitted through the growth curve. The growth curve of edible fungi reflects the corresponding relationship between the growth state and time of seafood mushrooms to a certain extent. After comparing the growth model, exponential model, compound logistic model, linear function, quadratic curve, cubic curve, these representative growth function models, the cubic curve fitting effect is the best, and its expression is y=ax 3 +bx 2 +cx+d (where a, b, c, d are constants), the growth curve can be used to control the smooth transition of changes in the digital twin model.
[0147] Fig.15It is a growth curve model in which the whiteness of mycelium changes with time during the recovery period. Fig.16 The growth fitting curve takes the number of kink points in the bud initiation period as the growth characteristic value. Fig.17 The growth fitting curve is the number of basic buds in the budding period as the growth characteristic value. The corresponding growth characteristic data of the elongation period and the maturity period are the size of the mushroom head and the length of the mushroom stem, which can well fit the growth characteristics at this time. Taking the elongation period as an example, the fitting growth curve results are as follows Fig.18 shown.
[0148] 3. Establishment of the knowledge model of the relationship between edible fungi and mushroom house environment
[0149] The knowledge modeling of edible fungi grown in bottles and bags also includes the modeling of their interactions with the environment and their own growth characteristics. For example, high humidity promotes mycelium growth but inhibits kink points, light is used to control the ratio of mushroom cap to mushroom stem, and low temperature inhibits growth rate. These all need to be quantified and analyzed using machine learning technology, thereby achieving the core of a virtual model that approaches the physical entity.
[0150] The traditional classification algorithm is used to achieve short-term prediction and classification, determine the stage of the current growth state (growth potential) (the day when the current growth state is the standard state), and perform control output. The following algorithms are compared: support vector machine (SVM), decision tree algorithm (DT), random forest (RF). Environmental parameters and related growth state monitoring indicators in the growth cycle of bottle-grown edible fungi are selected as data samples, and the data required for each stage are collected on site, and a total of 5 cycles are collected.
[0151] ① The input data of the recovery period data set consists of humidity, temperature, carbon dioxide concentration, light intensity, number of days and mycelium density and whiteness (GSV), and the output is the corresponding control mode.
[0152] ②The input data of the bud-inducing period dataset consists of humidity, temperature, carbon dioxide concentration, light intensity, number of kink points, uniformity, number of days and basic bud quantity, and the output is the corresponding control mode.
[0153] ③The input data of the budding period dataset consists of humidity, temperature, carbon dioxide concentration, light intensity, number of days, effective bud quantity and number of small mushroom caps, and the output is the corresponding control mode.
[0154] ④The input data of the elongation period dataset consists of humidity, temperature, carbon dioxide concentration, light intensity, number of days, number of small mushroom caps, consistency of mushroom caps and stems, proportion and dispersion of the five stages, and the output is the corresponding control mode.
[0155] ⑤The input data of the maturity data set consists of humidity, temperature, carbon dioxide concentration, light intensity, number of days, consistency of mushroom caps and stems, the proportion and dispersion of the five stages, and the output is the corresponding control mode.
[0156] The above data is divided into training set and test set in a ratio of 9:1.
[0157] Table 1 Comparison of evaluation indicators of different algorithm test sets in different periods
[0158]
[0159] The RF model performed best in most stages, especially in the elongation and maturity stages, with an accuracy of 99.2% and 79.7% respectively, showing its strong generalization ability and stability. The DT model followed closely behind, also performing well in most stages, but slightly inferior to the RF model in some stages. In contrast, the SVM model performed relatively averagely in many stages, especially in the maturity stage, with an accuracy of only 62.5%, which was significantly lower than the other two models. The specific algorithm of RF is as follows:
[0160] Data sampling: Randomly extract n samples (with replacement) from the training set to form a new subset; repeat T times to generate T subsets.
[0161] Construct a decision tree: train a decision tree for each subset; at each node split in the tree, randomly select m features (m is usually the square root of the total number of features).
[0162] For the classification task of judging the number of days of the current growth state, the majority voting method is used to determine the final result.
[0163] The mushroom house equipment with output control function includes 4 air coolers, 4 humidifiers, 2 air inlet fans, and 4 lighting control groups. The temperature of the mushroom house is adjusted by the air cooler, the carbon dioxide concentration is adjusted by the air inlet fan, the space humidity is adjusted by the humidifier, and the light intensity is adjusted by starting and stopping the blue light strip.
[0164] The overall process of the digital twin system is as follows: first, use the visual sensor to collect images, classify the periods through the classification algorithm, and determine which of the five periods it belongs to; extract features from the images, determine the current growth state, and generate a pre-regulation strategy; extract features from the continuous time image sequence, fit the growth curve in combination with environmental data and pre-regulation strategies, determine the future growth state, use the classification model (preferably the RF model) for prediction and classification based on the future growth state and regulation strategy as input, and produce the execution regulation strategy. The current growth state and future growth state can be visualized in three dimensions.
[0165] In summary, the present invention describes the process of using sensors to acquire features and construct a three-dimensional model. It also describes the process of using a digital twin model to control the display device to adjust environmental parameter changes to adapt to growth based on the environment and model algorithms, ultimately achieving virtual-real growth detection and control.
Claims
1. A digital twin method for factory-based bottle and bag cultivation of edible fungi, characterized in that: The following steps are involved: (1) The fruiting management stage of edible fungi cultivated in bottles and bags is divided into five periods: recovery period, bud-inducing period, bud-emerging period, elongation period, and maturity period. Image data of edible fungi in bottles and bags at different growth periods are collected, features are extracted through image processing algorithms, and the growth conditions at different stages are analyzed to establish a corresponding digital twin model. The digital twin model includes a geometric model, a behavioral model, and a knowledge model. (2) Collect environmental data from the edible fungus culture room, use machine learning algorithms to analyze and predict data change trends, and establish a corresponding digital twin model; establish a connection between the image processing results of edible fungi and environmental data, establish rules between the knowledge models of the two, and establish a discrete control model through a classification algorithm to realize the digital twin of the factory-based edible fungus bottle and bag cultivation.
2. The digital twin method according to claim 1, characterized in that: In step (1), the recovery period, budding period, bud appearance period, elongation period and maturity period are respectively the 1st to 6th day, the 7th to 9th day, the 10th to 13th day, the 14th to 23rd day and the 24th to 30th day after the culture bottle is placed in the culture room.
3. The digital twin method according to claim 1, characterized in that: In step (1), during the recovery period, the mycelium on the surface of the culture medium gradually recovers, and the grayscale histogram I of the binary mycelium mask is analyzed using the improved top hat adaptive binarization algorithm. bin The grayscale value GSV in the image is used to evaluate the degree of whiteness that quantitatively represents the density of hyphae for image feature extraction: GSV=ΣI bin The digital twin model for the recovery phase includes: Geometry model: mainly the cylinder of culture medium in the bottle, with additional texture map of culture medium; Behavior model: Add thick white changes to the two-dimensional texture map of the culture medium, and control the morphological changes of the model through the growth rate of mycelium. The thick white is generated using Perlin white noise and superimposed on the culture medium texture map, and is controlled by the transparency parameter alpha (0-1); Knowledge model: Establish the mapping relationship between image parameters GSV and alpha, and use the linear normalization method to calculate GSV: alpha=(GSV-GSV min ) / (GSV max -GSV min ) That is, GSV is used to control the alpha of the digital twin model.
4. The digital twin method according to claim 1, characterized in that: In step (1), the main task of the budding period is to identify the kink points. Through the small target recognition algorithm, the number and coordinates of the kink points are mainly identified to generate a coordinate array. The result of the small target recognition algorithm is used as the input of the two-dimensional Gaussian fitting. In order to obtain the uniformity of the distribution of the kink points of each bottle, the position of the kink points in the image after target detection is fitted. The Gaussian distribution in the two-dimensional case is expressed as: Where: A is the amplitude; (x0, y0) is the center position of the Gaussian distribution; σ x and σ y are the standard deviations in the x and y directions, respectively; The digital twin model of the budding period includes: Geometric model: It is mainly a tiny spherical structure formed by the twisting of white mycelium in the bottle, and the material is pure white; Behavioral model: only considers the number and position of kinks, so the identified coordinates are the coordinates of the kink point model, which are expressed as the spatial coordinate position (x, y, z) of the geometric model; the knowledge model is obtained by two-dimensional Gaussian fitting. x and σ y To suppress deviation; Knowledge model: Under the premise of giving priority to ensuring the continuity and consistency of standard deviation, randomly generate or delete x and σ y The two-dimensional Gaussian samples (x, y, z) of the distribution, that is, if the number of current detection results is greater than the previous number, they will be deleted, otherwise they will be supplemented until σ x and σ y Continuous stability, that is, through σ x and σ y To control the number and location distribution of digital twin models.
5. The digital twin method according to claim 1, characterized in that: In step (1), the bud primordium is mainly identified during the budding stage, and the bud morphology is obtained by using an instance segmentation algorithm. The instance segmentation result is the pixel points at the edge of the bud primordium. The major and minor axis a and b sizes are identified by using ellipse fitting on the pixel points. The bud primordium with a / b>2 is considered to be a valid bud, which will grow into a mature mushroom in the future. The digital twin model in the current stage includes: Geometric model: It is mainly manifested as a geometric body composed of a cylinder, which is the body of the bud primordium, formed by the thickening and elongation of the kink point in the bottle, and a cone, which is the head of the bud primordium. The material is pure white. Behavior model: The main parameters of the geometry are the radius and height R of the cylindrical part cylinder , H cylinder , the radius and height R of the conical part cone , H cone , as well as the base coordinates (x, y, z) and directions (α, β, γ) of the geometric body. Here, the bud primordium is approximately considered to be a rigid body; where α is the rotation angle around the Z axis; β is the rotation angle around the Y axis; γ is the rotation angle around the X axis; Knowledge model: Establish the relationship between the fitting major and minor axes a and b and the parameters of the digital twin model, where R cylinder =b, H cylinder= 2a-b,R cone =b, H cone =b, the coordinates (x, y, z) are the identification coordinates, where Z = 0, the direction angles (α, β, γ), α = 0, β = θ, γ = 90°-θ.
6. The digital twin method according to claim 1, characterized in that: In step (1), the main task of the elongation and maturity stages is to identify the stem and cap. The instance segmentation algorithm is used, and the output includes the target coordinates, the segmentation contour pixel point set and the size of the cap. The digital twin model of the elongation and maturity stages includes: Geometric model: It is mainly manifested as the geometric body representing the bud primordium in the bottle is transformed from the cylindrical part of the bud primordium body and the conical part of the bud primordium head to a rotation body with the spline of the bud primordium body turning into the mushroom stem as the axis and the hemispherical body of the bud primordium head turning into the mushroom cap. The material is white with yellowish color or pure white. Behavioral model: The rotation axis of the geometric body is calculated by cubic spline, which is composed of P0, P1, ..., P n Points are constructed, where P i (x i ,y i ,z i ) of (x i ,y i ) is determined by the coordinates identified by the instance segmentation algorithm, z i Determined by a growth curve based on environmental and visual recognition features; the specific process is as follows: A cubic spline is composed of piecewise cubic polynomials, where each piece is a cubic function: S i (t)=a i +b i t+c i t 2 +d i t 3 S i (t) is the parametric equation of the i-th segment of the curve; a i ,b i ,c i ,d i is the coefficient vector, which is a 3×1 vector in three-dimensional space; t is a parameter, normalized to the interval [0,1]; Construct the system of equations according to the following conditions: Interpolation conditions: S i (t i )=P i ,S i (t i+1 )=P i+1 Continuity conditions: S′ i (t i+1 )=S′ i+1 (t i+1 ),S″ i (t i+1 )=S″ i+1 (t i+1 ) Boundary conditions: S″0(t0)=S″ n-1 (t n )=0 By solving the linear equations, we can get the coefficient a of each curve segment. i ,b i ,c i ,d i ; The cap radius uses the radius of the circumscribed circle that identifies the cap contour, and the cap height is 1 / 2 to 1 / 5 of the cap radius to generate a 3D model. Knowledge model: Establish the relationship between the identification results of mushroom stems and mushroom caps and the parameters of the digital twin model, where P i (x i ,y i ,z i ) of (x i ,y i ) is determined by the pixel coordinates identified by the instance segmentation algorithm, z i The growth curve y is determined by fitting the recognition features three times, where z i =y*k, where k is the proportional coefficient, which is a constant and represents the relationship between the mushroom stem spline construction points and the growth curve; the mushroom cap radius adopts the circumscribed circle radius of the mushroom cap contour, and the mushroom cap height is 1 / 2 to 1 / 5 of the mushroom cap radius.
7. The digital twin method according to claim 1, characterized in that: For the five periods of the edible fungus fruiting management stage, cubic curve regression was performed for the corresponding growth characteristic indicators. The growth state of the edible fungi was fit by the growth curve, which was used to control the smooth transition of the digital twin model changes in each period.
8. The digital twin method according to claim 1, characterized in that: In step (2), a traditional classification algorithm is used to implement short-term prediction classification, determine the stage of the current growth state, that is, the day when the current growth state is the standard state, and perform control output.