Self-adaptive temperature control method and system for edible mushroom cultivation
Through artificial intelligence technology, an edible fungi growth stage identification model and an adaptive temperature control model are constructed, which solves the problem of low temperature control efficiency in traditional edible fungi cultivation, and achieves the improvement of dynamic temperature regulation and growth efficiency.
Patent Information
- Application Number
- CN202510248499.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-04
- Publication Date
- 2025-06-20
AI Technical Summary
In traditional edible fungi cultivation, temperature control depends on experience and a fixed management model, making it difficult to adapt to the needs of different growth stages and changes in the external environment, resulting in inefficiency.
Using artificial intelligence technology, dynamic temperature regulation is achieved by collecting growth state images of edible fungi, extracting feature vectors, and building a growth stage identification model and an adaptive temperature control model.
Adaptive temperature control of the edible fungi cultivation environment is achieved, the efficiency and quality of edible fungi growth are improved, and the needs of changes in different growth stages and external environments are adapted.
Smart Images

Figure CN120178968A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of adaptive temperature control monitoring, and particularly to an adaptive temperature control method and system for edible mushroom cultivation. Background Art
[0002] As an important agricultural product, edible mushrooms are widely welcomed due to their rich nutrition and delicious taste. With the improvement of people's living standards, the consumption demand for edible mushrooms has been increasing continuously, which has promoted the progress of its production technology. The cultivation process of edible mushrooms has relatively high requirements for environmental conditions. In particular, temperature is a key factor affecting the growth and development of edible mushrooms. In traditional edible mushroom cultivation, temperature control often relies on experience and fixed management models, and it is difficult to meet the needs of different growth stages and external environmental changes. This method is inefficient. Summary of the Invention
[0003] In view of this, the present invention provides an adaptive temperature control method and system for edible mushroom cultivation, which adaptively controls the temperature according to the growth stage of edible mushrooms through artificial intelligence technology, and realizes the dynamic regulation of the edible mushroom cultivation environment.
[0004] To achieve the above object, an adaptive temperature control method for edible mushroom cultivation provided by the present invention includes the following steps:
[0005] S1: Collect images of the growth state of edible mushrooms and perform feature extraction to obtain a feature vector of the growth state of edible mushrooms;
[0006] S2: Construct an identification model for the growth stage of edible mushrooms, and identify the growth stage of edible mushrooms corresponding to the images of the growth state of edible mushrooms. The identification model for the growth stage of edible mushrooms takes the feature vector of the growth state of edible mushrooms as the input and the discrimination result of the growth stage of edible mushrooms as the output;
[0007] S3: Construct the model structure of an adaptive temperature control model for edible mushrooms, and optimize and solve the model parameters of the adaptive temperature control model for edible mushrooms. Combine the model structure and model parameters to construct an adaptive temperature control model for edible mushrooms. The adaptive temperature control model for edible mushrooms takes the growth stage of edible mushrooms and the feature vector of the growth state of edible mushrooms as the input and the temperature control result of the edible mushroom culture medium as the output, where the improved stochastic gradient descent is the implementation method for the optimization and solution;
[0008] S4: Use the adaptive temperature control model for edible mushrooms to receive the growth stage of edible mushrooms and the feature vector of the growth state of edible mushrooms, and output the temperature control result to perform adaptive temperature control during the edible mushroom cultivation process.
[0009] As a further improvement method of the present invention:
[0010] Optionally, in step S1, collecting the images of the growth state of edible fungi includes:
[0011] Collecting the images of the growth state of edible fungi, where the images of the growth state of edible fungi are the state images of edible fungi at different cultivation times, and the form of the collected images of the growth state of edible fungi is:
[0012] I t =(I t (x,y)) X×Y
[0013]
[0014] Where:
[0015] I t Represents the image of the growth state of edible fungi at the t-th cultivation time, where the image of the growth state of edible fungi is a pixel matrix, and I t (x,y) represents the pixel value of the pixel (x,y) at the x-th row and y-th column in the image of the growth state of edible fungi I t ;
[0016] Represents the color value of the pixel (x,y) in the R, G, B color channels, x ∈ [1, X], y ∈ [1, Y];
[0017] Performing feature extraction on the image I t of the growth state of edible fungi to obtain the feature vector f t of the growth state of edible fungi.
[0018] Optionally, the performing feature extraction on the image I t of the growth state of edible fungi to obtain the feature vector f t of the growth state of edible fungi includes:
[0019] S11: Dividing the image I t of the growth state of edible fungi into 4 equal-sized and non-overlapping image regions Where i ∈ [1, 4], represents the pixel value of the pixel (x in the image region i at the x-th i row and y i ,y i )
[0020]
[0021] S12: Calculating the centroid coordinates of different image regions, where the image region The barycentric coordinates are Among them, the barycentric coordinates The calculation formula is:
[0022]
[0023] Among them:
[0024] Indicates the accumulation of all values of x i The accumulation is performed for all values of Indicates the accumulation of all values of y i The accumulation is performed for all values of
[0025] S13: Calculate the pixel weights of the pixels in the image area according to the barycentric coordinates, and perform weighted processing on the pixel values to obtain the weighted image area; among them, the image area For the pixel (x i , y i ) in, the pixel weight is:
[0026]
[0027] Among them:
[0028] w(x i , y i ) represents the pixel weight of the pixel (x , y i , y i ) in the image area
[0029] exp(·) represents the exponential function with the natural constant as the base, and σ represents the scale parameter; in the embodiment of the present invention, σ is set to 5;
[0030] The image area The corresponding weighted result is
[0031] S14: Construct the image g of the growth state of edible fungi after pixel value weighting t :
[0032]
[0033] S15: Perform global information calculation and processing on the image g of the growth state of edible fungi after pixel value weighting, and calculate the global information t to obtain the global information
[0034]
[0035] Among them:
[0036] Avg(·) represents the average pooling operation, and Max(·) represents the maximum pooling operation;
[0037] Conv 3×3 (·) represents the convolution operation, and the selected convolution weight matrix for the convolution operation is in the form of 3 rows and 3 columns;
[0038] S16: Convert the global information into the feature vector of the edible mushroom growth state
[0039]
[0040] Where:
[0041] ||·||2 represents the L2 norm.
[0042] Optionally, in the step S2 of constructing the edible mushroom growth stage recognition model, it includes:
[0043] Construct an edible mushroom growth stage recognition model to identify the edible mushroom growth stage corresponding to the edible mushroom growth state image. The edible mushroom growth stage recognition model takes the feature vector of the edible mushroom growth state as the input and the edible mushroom growth stage discrimination result as the output. The edible mushroom growth stage recognition model includes an input layer, a multi-scale feature extraction layer, a scale feature weighting layer, a feature fusion layer, and a growth stage recognition layer;
[0044] The input layer is used to receive the feature vector of the edible mushroom growth state corresponding to the edible mushroom growth state image;
[0045] The multi-scale feature extraction layer is a convolutional neural network structure, which is used to perform multi-scale feature extraction on the feature vector of the edible mushroom growth state to obtain feature maps of the feature vector of the edible mushroom growth state at different scales;
[0046] The scale feature weighting layer is used to calculate the scale weights of the feature maps and perform weighted calculation on the feature maps;
[0047] The feature fusion layer is used to perform fusion processing on the weighted feature maps to obtain a fused feature map;
[0048] The growth stage recognition layer is used to perform mapping processing on the fused feature map to obtain the edible mushroom growth stage discrimination result;
[0049] Use the edible mushroom growth stage recognition model to perform edible mushroom growth stage recognition on the edible mushroom growth state image I t to obtain the edible mushroom growth stage discrimination result
[0050] Optionally, the use of the edible mushroom growth stage recognition model to perform edible mushroom growth stage recognition on the edible mushroom growth state image I t includes:
[0051] S21: The input layer receives the edible mushroom growth state image I t The corresponding edible mushroom growth state feature vector
[0052] S22: The multi-scale feature extraction layer performs multi-scale feature extraction on the edible mushroom growth state feature vector where the feature map of the edible mushroom growth state feature vector at the j-th scale is
[0053]
[0054] where:
[0055] W j×j represents the convolution weight matrix of j rows and j columns;
[0056] * represents the convolution operator;
[0057] δ(·) represents the activation function; in the embodiment of the present invention, the activation function is the ReLU function;
[0058] j ∈ [1, J], and J represents the maximum scale;
[0059] S23: The scale feature weighting layer calculates the scale weight of the feature map and performs weighted calculation on the feature map, where the weighted calculation result of the feature map is G t (j); the weighted calculation formula of the feature map is:
[0060]
[0061] where:
[0062] weight t (j) represents the scale weight of the feature map ; ||·|| represents the L1 norm;
[0063] ε represents a preset regulation parameter, and ε is set to 0.1;
[0064] S24: The feature fusion layer performs fusion processing on the weighted feature map to obtain the fused feature map G t :
[0065]
[0066] S25: The growth stage recognition layer performs mapping processing on the fused feature map G t to obtain the discrimination result of the edible mushroom growth stage
[0067]
[0068] Wherein:
[0069] W e represents the mapping matrix corresponding to the growth stage of the e-th edible mushroom, where e ∈ [1, 6], and the growth stages of the first to sixth edible mushrooms are the spore stage, the mycelium stage, the mature mycelium stage, the primordium formation stage, the fruiting body formation stage, and the mature fruiting body stage in sequence;
[0070] represents selecting the e that makes reach the maximum as the discrimination result of the edible mushroom growth stage
[0071] Optionally, the model structure of the self-adaptive temperature control model for edible mushrooms in step S3 includes:
[0072] The model structure of the self-adaptive temperature control model for edible mushrooms takes the growth stage of the edible mushroom and the characteristic vector of the growth state of the edible mushroom as inputs and the temperature control result of the edible mushroom culture medium as the output. The model structure of the self-adaptive temperature control model for edible mushrooms includes an input layer, a growth stage mapping layer, a temperature conversion layer, and a temperature correction layer;
[0073] The input layer is used to receive the growth stage of the edible mushroom and the characteristic vector of the growth state of the edible mushroom;
[0074] The growth stage mapping layer is a neural network used to map the growth stage of the edible mushroom to the characteristic vector of the growth state of the edible mushroom to form a growth characteristic vector of the edible mushroom;
[0075] The temperature conversion layer is a long short-term memory neural network used to convert the growth characteristic vector of the edible mushroom into a temperature state;
[0076] The temperature correction layer corrects the temperature state according to the historical temperature control result and outputs the correction result as the temperature control result of the edible mushroom culture medium;
[0077] Collect U groups of training data to form a training data set data:
[0078]
[0079] Wherein:
[0080] R u represents the u-th group of training data collected, which are in sequence the growth stage of the edible mushroom, the characteristic vector of the growth state of the edible mushroom, and the optimal temperature of the edible mushroom culture medium adjusted manually in the training data R u ;
[0081] Optimize and solve the model parameters of the edible mushroom adaptive temperature control model in combination with the training dataset data, where the improved stochastic gradient descent is the implementation method of the optimization solution, and the edible mushroom adaptive temperature control model is constructed by combining the model structure and model parameters.
[0082] Optionally, the optimizing and solving the model parameters of the edible mushroom adaptive temperature control model, and constructing the edible mushroom adaptive temperature control model by combining the model structure and model parameters, includes:
[0083] S31: Initialize and generate model parameters θ0 = {w0(c), b0(c)|c ∈ [0, C]}, where w0(c) represents the weight parameter used for the c-th iteration in the temperature conversion layer, b0(c) represents the bias parameter used for the c-th iteration in the temperature conversion layer, and C represents the maximum number of iterations in the temperature conversion layer;
[0084] S32: Construct the training loss function L(·) of the model parameters in combination with the training dataset data, where the value of the training loss function corresponding to the model parameters θ0 is:
[0085]
[0086] Where:
[0087] L(θ0) represents the value of the training loss function corresponding to the model parameters θ0;
[0088] s represents the expansion parameter, and dis represents the distance parameter;
[0089] represents the c-th iteration result of the edible mushroom growth feature vector corresponding to the u-th group of training data;
[0090] represents input into the edible mushroom adaptive temperature control model constructed with the model parameters θ0, and the temperature state output by the temperature conversion layer;
[0091] S33: Set the current iteration number of the model parameters as z and the maximum iteration number as Z, then the z-th iteration result of the model parameters is θ z , and the value of the training loss function corresponding to the model parameters θ z is L(θ z ), and the initial value of z is 0;
[0092] S34: Calculate the iteration momentum α z for the iteration of the model parameters θ z+1 :
[0093]
[0094] Wherein:
[0095] represents the model parameter θ z corresponding gradient value of the training loss function; in the embodiment of the present invention, the training loss function L(·) is differentiated with respect to the model parameter as a variable, and the model parameter θ z is substituted into the differentiation result to obtain the gradient value of the training loss function corresponding to the model parameter θ z ;
[0096] β z represents the iteration weight of the z-th iteration;
[0097] S35: Calculate the iteration step size λ z for the iteration of the model parameter θ z+1 :
[0098]
[0099] S36: Iterate on the model parameter θ z :
[0100]
[0101] Wherein:
[0102] rand(0,1) represents a random number between 0 and 1;
[0103] Update the iteration weight:
[0104]
[0105] S37: Let z = z + 1, return to step S35 until the maximum number of iterations is reached, and use the model parameter at this time as the optimization solution result θ = {w(c), b(c)|c ∈ [0, C]}.
[0106] Optionally, in the step S4, the edible mushroom adaptive temperature control model is used to receive the edible mushroom growth stage and the edible mushroom growth state feature vector to perform adaptive temperature control during the edible mushroom cultivation process, including:
[0107] S41: The input layer receives the edible mushroom growth stage and the edible mushroom growth state feature vector
[0108] S42: The growth stage mapping layer maps the edible mushroom growth stage to the edible mushroom growth state feature vector to form the edible mushroom growth feature vector f t :
[0109]
[0110] Among them:
[0111] Indicates the growth stage of edible fungi The corresponding mapping matrix;
[0112] S43: The temperature conversion layer converts the growth feature vector f of edible fungi t into the temperature state R(t); The conversion process of the temperature state R(t) is as follows:
[0113] S431: Set the current iteration number of the temperature state to c, the initial value of c is 0, and the maximum value is C. Then the c-th iteration result of the temperature state is R c (t); R0(t) = δ(w0f t +b0)⊙tanh(f t ), where w0 and b0 are the weight parameter and bias parameter in the temperature conversion layer, and ⊙ represents the Hadamard product;
[0114] S432: Extract the effective information H c (t) of the c-th iteration result R c (t):
[0115]
[0116] S433: Calculate the hidden information h c (t) of the c-th iteration result R c (t):
[0117] h c (t) = δ(w c f t +b c )
[0118] S434: Calculate the (c + 1)-th iteration result:
[0119] R c+1 (t) = h c (t)⊙H c (t)
[0120] S435: Let c = c + 1, return to step S432 until the maximum iteration number is reached, and take the iteration result at this time as the temperature state R(t);
[0121] S44: The temperature correction layer corrects the temperature state R(t) according to the historical temperature control result, and outputs the correction result as the temperature control result of the edible fungi culture medium; The correction formula of the temperature state R(t) is:
[0122]
[0123] Wherein:
[0124] represents the correction result of the temperature state R(t); represents the growth stage of the edible mushroom; the corresponding correction parameter;
[0125] represents the temperature of the edible mushroom culture medium at the (t - 1)-th cultivation moment;
[0126] adjust the temperature of the edible mushroom culture medium at the t-th cultivation moment to
[0127] To solve the above problems, the present invention provides an adaptive temperature control system for edible mushroom cultivation. The system includes:
[0128] A data acquisition module, configured to acquire an image of the growth state of the edible mushroom and perform feature extraction to obtain a feature vector of the growth state of the edible mushroom;
[0129] A growth stage recognition module, configured to construct a recognition model for the growth stage of the edible mushroom and recognize the growth stage of the edible mushroom corresponding to the image of the growth state of the edible mushroom;
[0130] An adaptive temperature control device, configured to construct a model structure of an adaptive temperature control model for the edible mushroom, optimize and solve the model parameters of the adaptive temperature control model for the edible mushroom, construct an adaptive temperature control model for the edible mushroom by combining the model structure and the model parameters, receive the growth stage of the edible mushroom and the feature vector of the growth state of the edible mushroom by using the adaptive temperature control model for the edible mushroom, output a temperature control result, and perform adaptive temperature control during the edible mushroom cultivation process.
[0131] To solve the above problems, the present invention further provides an electronic device. The electronic device includes:
[0132] A memory, storing at least one instruction;
[0133] A communication interface, for realizing the communication of the electronic device; and
[0134] A processor, configured to execute the instruction stored in the memory to implement the above-mentioned adaptive temperature control method for edible mushroom cultivation.
[0135] To solve the above problems, the present invention further provides a computer-readable storage medium. At least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in the electronic device to implement the above-mentioned adaptive temperature control method for edible mushroom cultivation.
[0136] Compared with the prior art, the present invention provides an adaptive temperature control method and system for edible mushroom cultivation, and this technology has the following advantages:
[0137] First, this solution proposes a method for extracting the characteristic vector of the growth state of edible mushrooms and identifying the growth stage. According to the centroid coordinates of different image regions in the growth state image of edible mushrooms, combined with the difference between the pixel coordinates and the centroid coordinates and the pixel values, spatial weights of different pixels are generated for image weighting, which can better capture the local information in the image. And a multi-scale feature extraction is carried out by using the edible mushroom growth stage recognition model. Since edible mushrooms have different scale features in different growth stages, the multi-scale feature extraction method is adopted to capture multi-scale feature maps representing the significant features of different growth stages, so as to realize the identification of the growth stage of edible mushrooms.
[0138] At the same time, this solution proposes an adaptive temperature control method. Taking the similarity degree between the model parameters and the feature vector as the decision distance, a training loss function that enhances the cosine loss is constructed to optimize and solve the model parameters in the edible mushroom adaptive temperature control model. And iterative momentum, iterative weight and iterative step size are introduced in the solving process. The iterative weight changes dynamically according to the current iteration result. A larger iterative weight can significantly increase the iterative step size along the low-curvature direction of the training loss function, while a smaller iterative weight can suppress the oscillation of the model parameters. Then, more stable model parameters are obtained. The edible mushroom adaptive temperature control model receives the growth stage of edible mushrooms and the characteristic vector of the growth state of edible mushrooms, and outputs the temperature control result. Combining with the temperature change rate at the adjacent cultivation time for temperature correction, the adaptive temperature control in the process of edible mushroom cultivation is realized. BRIEF DESCRIPTION OF THE DRAWINGS
[0139] Figure 1 It is a schematic flowchart of an adaptive temperature control method for edible mushroom cultivation provided by an embodiment of the present invention;
[0140] Figure 2 It is a functional module diagram of an adaptive temperature control system for edible mushroom cultivation provided by an embodiment of the present invention;
[0141] Figure 2 In the figure: 100 Adaptive temperature control system for edible mushroom cultivation, 101 Data acquisition module, 102 Growth stage recognition module, 103 Adaptive temperature control device;
[0142] The realization, functional characteristics and advantages of the object of the present invention will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0143] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0144] An embodiment of the present application provides a method for self - adapting temperature control in edible mushroom cultivation. The execution subject of the method for self - adapting temperature control in edible mushroom cultivation includes, but is not limited to, at least one of electronic devices such as a server, a terminal, etc. that can be configured to execute the method provided by the embodiment of the present application. In other words, the method for self - adapting temperature control in edible mushroom cultivation can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server, or a cloud server cluster, etc.
[0145] Embodiment 1:
[0146] S1: Collect images of the growth state of edible mushrooms and perform feature extraction to obtain a feature vector of the growth state of edible mushrooms.
[0147] In the step S1 of collecting images of the growth state of edible mushrooms, it includes:
[0148] Collect images of the growth state of edible mushrooms, where the images of the growth state of edible mushrooms are images of the state of edible mushrooms at different cultivation times, and the form of the collected images of the growth state of edible mushrooms is:
[0149] I t =(I t (x,y)) X×Y
[0150]
[0151] Where:
[0152] I t represents the image of the growth state of edible mushrooms at the t - th cultivation time, where the image of the growth state of edible mushrooms is a pixel matrix, and I t (x,y) represents the pixel value of the pixel (x,y) at the x - th row and y - th column in the image of the growth state of edible mushrooms I t ;
[0153] represents the color value of the pixel (x,y) in the R, G, B color channels, x ∈ [1, X], y ∈ [1, Y];
[0154] Perform feature extraction on the image of the growth state of edible mushrooms I t to obtain a feature vector f t .
[0155] The performing feature extraction on the image of the growth state of edible mushrooms I t to obtain a feature vector f t includes:
[0156] S11: Divide the edible mushroom growth state image I t into 4 equal-sized and non-overlapping image regions where represents the image region and the pixel value of the pixel at the x i -th row and y i -th column in it is (x i , y i );
[0157]
[0158] S12: Calculate the centroid coordinates of different image regions. The centroid coordinates of the image region are where the calculation formula for the centroid coordinates is:
[0159]
[0160] where:
[0161] denotes the accumulation of all values of x i , and denotes the accumulation of all values of y i ;
[0162] S13: Calculate the pixel weights of the pixels in the image region according to the centroid coordinates, and perform weighted processing on the pixel values to obtain the weighted image region. The pixel weight of the pixel (x , y i , y i ) in the image region
[0163]
[0164] where:
[0165] w(x i , y i ) represents the pixel weight of the pixel (x , y i , y i ) in the image region
[0166] exp(·) represents the exponential function with the natural constant as the base, and σ represents the scale parameter;
[0167] The weighted result corresponding to the image region is
[0168] S14: Construct the weighted edible mushroom growth state image gt :
[0169]
[0170] S15: The weighted pixel value of the edible mushroom growth state image g t is subjected to global information calculation and processing to obtain global information
[0171]
[0172] Wherein:
[0173] Avg(·) represents average pooling operation, and Max(·) represents max pooling operation;
[0174] Conv 3×3 (·) represents convolution operation, and the selected convolution weight matrix for convolution operation is in the form of 3 rows and 3 columns;
[0175] S16: Convert the global information into the edible mushroom growth state feature vector
[0176]
[0177] Wherein:
[0178] ||·||2 represents the L2 norm.
[0179] S2: Construct an edible mushroom growth stage recognition model to recognize the edible mushroom growth stage corresponding to the edible mushroom growth state image.
[0180] In the S2 step of constructing the edible mushroom growth stage recognition model, it includes:
[0181] Construct an edible mushroom growth stage recognition model to recognize the edible mushroom growth stage corresponding to the edible mushroom growth state image. The edible mushroom growth stage recognition model takes the edible mushroom growth state feature vector as input and the edible mushroom growth stage discrimination result as output. The edible mushroom growth stage recognition model includes an input layer, a multi-scale feature extraction layer, a scale feature weighting layer, a feature fusion layer, and a growth stage recognition layer;
[0182] The input layer is used to receive the edible mushroom growth state feature vector corresponding to the edible mushroom growth state image;
[0183] The multi-scale feature extraction layer is a convolutional neural network structure, which is used to perform multi-scale feature extraction on the edible mushroom growth state feature vector to obtain feature maps of the edible mushroom growth state feature vector at different scales;
[0184] The scale feature weighting layer is used to calculate the scale weights of the feature maps and perform weighted calculations on the feature maps;
[0185] The feature fusion layer is used to fuse the weighted feature maps to obtain the fused feature maps;
[0186] The growth stage recognition layer is used to map the fused feature maps to obtain the discrimination results of the edible mushroom growth stages;
[0187] Using the edible mushroom growth stage recognition model to recognize the growth state image I of the edible mushroom t to perform the recognition of the edible mushroom growth stages and obtain the discrimination results of the edible mushroom growth stages
[0188] The recognition of the growth state image I of the edible mushroom using the edible mushroom growth stage recognition model t for the recognition of the edible mushroom growth stages includes:
[0189] S21: The input layer receives the edible mushroom growth state feature vector corresponding to the edible mushroom growth state image I t corresponding to the edible mushroom growth state feature vector
[0190] S22: The multi-scale feature extraction layer performs multi-scale feature extraction on the edible mushroom growth state feature vector where the feature map of the edible mushroom growth state feature vector at the j-th scale is at the j-th scale is
[0191]
[0192] where:
[0193] W j×j represents the convolution weight matrix of j rows and j columns;
[0194] * represents the convolution operator;
[0195] δ(·) represents the activation function; in the embodiments of the present invention, the activation function is the ReLU function;
[0196] j ∈ [1, J], J represents the maximum scale;
[0197] S23: The scale feature weighting layer calculates the scale weights of the feature maps and performs weighted calculations on the feature maps, where the weighted calculation result of the feature map is G t (j); the weighted calculation formula of the feature map is:
[0198]
[0199] where:
[0200] weight t (j) represents the scale weight of the feature map ; ||·|| represents the L1 norm;
[0201] ε represents a preset regulation parameter, and ε is set to 0.1;
[0202] S24: The feature fusion layer performs fusion processing on the weighted feature map to obtain the fused feature map G t :
[0203]
[0204] S25: The growth stage recognition layer maps the fused feature map G t to obtain the discrimination result of the edible mushroom growth stage
[0205]
[0206] Where:
[0207] W e represents the mapping matrix corresponding to the e-th edible mushroom growth stage, e ∈ [1, 6], where the 1st - 6th edible mushroom growth stages are the spore stage, the mycelium stage, the mature mycelium stage, the primordium formation stage, the fruiting body formation stage, and the mature fruiting body stage in sequence;
[0208] represents selecting the e that makes reach the maximum as the discrimination result of the edible mushroom growth stage
[0209] S3: Construct the model structure of the edible mushroom adaptive temperature control model, and optimize and solve the model parameters of the edible mushroom adaptive temperature control model. The edible mushroom adaptive temperature control model is constructed by combining the model structure and the model parameters.
[0210] In the step S3, the construction of the model structure of the edible mushroom adaptive temperature control model includes:
[0211] Construct the model structure of the edible mushroom adaptive temperature control model. The edible mushroom adaptive temperature control model takes the edible mushroom growth stage and the edible mushroom growth state feature vector as inputs and the temperature control result of the edible mushroom culture medium as the output. The model structure of the edible mushroom adaptive temperature control model includes an input layer, a growth stage mapping layer, a temperature conversion layer, and a temperature correction layer;
[0212] The input layer is used to receive the edible mushroom growth stage and the edible mushroom growth state feature vector;
[0213] The growth stage mapping layer is a neural network used to map the growth stage of edible fungi to the growth state feature vector of edible fungi, constituting the growth feature vector of edible fungi;
[0214] The temperature conversion layer is a long short-term memory neural network used to convert the growth feature vector of edible fungi into a temperature state;
[0215] The temperature correction layer corrects the temperature state according to the historical temperature control result, and outputs the corrected result as the temperature control result of the edible fungi culture medium;
[0216] Collect U groups of training data to form a training data set data:
[0217]
[0218] Among them:
[0219] R u represents the u-th group of training data collected, The growth stage of edible fungi, the growth state feature vector of edible fungi, and the optimal temperature of the edible fungi culture medium adjusted manually in the training data R u in turn;
[0220] Optimize and solve the model parameters of the edible fungi adaptive temperature control model in combination with the training data set data, and construct the edible fungi adaptive temperature control model by combining the model structure and model parameters.
[0221] The optimization and solution of the model parameters of the edible fungi adaptive temperature control model, and the construction of the edible fungi adaptive temperature control model by combining the model structure and model parameters include:
[0222] S31: Initialize and generate model parameters θ0 = {w0(c), b0(c)|c ∈ [0, C]}, where w0(c) represents the weight parameter used for the c-th iteration in the temperature conversion layer, b0(c) represents the bias parameter used for the c-th iteration in the temperature conversion layer, and C represents the maximum number of iterations in the temperature conversion layer;
[0223] S32: Construct the training loss function L(·) of the model parameters in combination with the training data set data, where the training loss function value corresponding to the model parameters θ0 is:
[0224]
[0225] Among them:
[0226] L(θ0) represents the training loss function value corresponding to the model parameters θ0;
[0227] s represents the expansion parameter, and dis represents the distance parameter;
[0228] It represents the c-th iteration result of the edible mushroom growth feature vector corresponding to the u-th group of training data;
[0229] It represents After inputting into the edible mushroom adaptive temperature control model constructed with the model parameter θ0, the temperature state output by the temperature conversion layer;
[0230] S33: Set the current iteration number of the model parameter as z and the maximum iteration number as Z. Then, the z-th iteration result of the model parameter is θ z , the model parameter θ z The corresponding training loss function value is L(θ z ), and the initial value of z is 0;
[0231] S34: Calculate the iteration momentum α z for the iteration of the model parameter θ z+1 :
[0232]
[0233] Where:
[0234] It represents the gradient value of the training loss function corresponding to the model parameter θ z ; In the embodiment of the present invention, the training loss function L(·) is differentiated with respect to the model parameter as a variable, and the model parameter θ z is substituted into the differentiation result to obtain the gradient value of the training loss function corresponding to the model parameter θ z ;
[0235] β z represents the iteration weight of the z-th iteration;
[0236] S35: Calculate the iteration step size λ z for the iteration of the model parameter θ z+1 :
[0237]
[0238] S36: Iterate the model parameter θ z :
[0239]
[0240] Where:
[0241] rand(0,1) represents a random number between 0 and 1;
[0242] Update the iteration weight:
[0243]
[0244] S37: Let \(z = z + 1\), return to step S35 until the maximum number of iterations is reached, and take the model parameters at this time as the optimized solution \(\theta=\{w(c),b(c)|c\in[0,C]\}\).
[0245] S4: Use the edible mushroom adaptive temperature control model to receive the growth stage of the edible mushroom and the feature vector of the growth state of the edible mushroom, and output the temperature control result to perform adaptive temperature control during the edible mushroom cultivation process.
[0246] In the S4 step, using the edible mushroom adaptive temperature control model to receive the growth stage of the edible mushroom and the feature vector of the growth state of the edible mushroom to perform adaptive temperature control during the edible mushroom cultivation process includes:
[0247] S41: The input layer receives the growth stage of the edible mushroom and the feature vector of the growth state of the edible mushroom
[0248] S42: The growth stage mapping layer maps the growth stage of the edible mushroom to the feature vector of the growth state of the edible mushroom to form the growth feature vector \(f\) of the edible mushroom t :
[0249]
[0250] where:
[0251] represents the mapping matrix corresponding to the growth stage of the edible mushroom ;
[0252] S43: The temperature conversion layer converts the growth feature vector \(f\) of the edible mushroom t into the temperature state \(R(t)\); the conversion process of the temperature state \(R(t)\) is as follows:
[0253] S431: Set the current iteration number of the temperature state to \(c\), the initial value of \(c\) is 0, and the maximum value is \(C\), then the \(c\)th iteration result of the temperature state is \(R\) c (t); \(R_0(t)=\delta(w_0f\) t +b_0)\(\odot\tanh(f\) t ), where \(w_0,b_0\) are the weight parameter and the bias parameter in the temperature conversion layer, and \(\odot\) represents the Hadamard product;
[0254] S432: Extract the effective information \(H\) c (t) of the \(c\)th iteration result \(R\) c (t):
[0255]
[0256] S433: Calculate the c-th iteration result R c The hidden information h of (t) c (t):
[0257] h c (t) = δ(w c f t +b c )
[0258] S434: Calculate the (c + 1)-th iteration result:
[0259] R c+1 (t) = h c (t) ⊙ H c (t)
[0260] S435: Let c = c + 1, return to step S432 until the maximum number of iterations is reached, and take the iteration result at this time as the temperature state R(t);
[0261] S44: The temperature correction layer corrects the temperature state R(t) according to the historical temperature control result, and takes the correction result as the temperature control result of the edible mushroom culture medium and outputs it; the correction formula for the temperature state R(t) is:
[0262]
[0263] Where:
[0264] Represents the correction result of the temperature state R(t), Represents the growth stage of the edible mushroom The corresponding correction parameter;
[0265] Represents the temperature of the edible mushroom culture medium at the (t - 1)-th cultivation moment;
[0266] Adjust the temperature of the edible mushroom culture medium at the t-th cultivation moment to
[0267] Example 2:
[0268] As Figure 2 shown, it is the functional module diagram of the edible mushroom cultivation adaptive temperature control system provided by an embodiment of the present invention, which can implement the edible mushroom cultivation adaptive temperature control method in Embodiment 1.
[0269] The self - adaptive temperature control system 100 for edible mushroom cultivation according to the present invention can be installed in an electronic device. According to the functions achieved, the self - adaptive temperature control system for edible mushroom cultivation can include a data acquisition module 101, a growth stage identification module 102, and a self - adaptive temperature control device 103. The modules in the present invention can also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of an electronic device and can complete fixed functions, and are stored in the memory of the electronic device.
[0270] The data acquisition module 101 is used to collect images of the growth state of edible mushrooms and perform feature extraction to obtain a feature vector of the growth state of edible mushrooms.
[0271] The growth stage identification module 102 is used to construct a growth stage identification model for edible mushrooms and identify the growth stage of edible mushrooms corresponding to the growth state image of edible mushrooms.
[0272] The self - adaptive temperature control device 103 is used to construct the model structure of the self - adaptive temperature control model for edible mushrooms, optimize and solve the model parameters of the self - adaptive temperature control model for edible mushrooms, construct the self - adaptive temperature control model for edible mushrooms by combining the model structure and the model parameters, receive the growth stage of edible mushrooms and the feature vector of the growth state of edible mushrooms by using the self - adaptive temperature control model for edible mushrooms, output the temperature control result, and perform self - adaptive temperature control during the cultivation process of edible mushrooms.
[0273] Specifically, each module in the self - adaptive temperature control system 100 for edible mushroom cultivation in the embodiments of the present invention uses the same technical means as those in the Figure 1 self - adaptive temperature control method for edible mushroom cultivation described above and can produce the same technical effects, which will not be elaborated here.
[0274] It should be understood that the above embodiments are only for illustration purposes and are not limited by this structure in the scope of the patent application.
[0275] It should be noted that the serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments. And the term "including" or "comprising" or any other variant thereof in this article is intended to cover non - exclusive inclusion, so that a process, device, article or method including a series of elements not only includes those elements but also includes other elements not explicitly listed, or further includes elements inherent to such a process, device, article or method. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of another identical element in the process, device, article or method including that element.
[0276] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described example methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. This computer software product is stored in a storage medium as described above (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions for causing a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in various embodiments of the present invention.
[0277] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the specification and drawings of the present invention, or directly or indirectly applied in other related technical fields, shall be equally included in the patent protection scope of the present invention.
Claims
1. An edible fungus cultivation adaptive temperature control method, characterized in that: The method comprises: S1: Collect the image of the growth state of edible fungi and perform feature extraction to obtain the feature vector of the growth state of edible fungi; S2: constructing a model for identifying the growth stage of edible fungi to identify the growth stage of edible fungi corresponding to the growth state image of edible fungi, wherein the model for identifying the growth stage of edible fungi takes the growth state feature vector of edible fungi as input and takes the identification result of the growth stage of edible fungi as output; S3: constructing a model structure of an edible fungus adaptive temperature control model, and optimizing and solving the model parameters of the edible fungus adaptive temperature control model, and constructing an edible fungus adaptive temperature control model by combining the model structure and the model parameters. The edible fungus adaptive temperature control model takes the edible fungus growth stage and the edible fungus growth state feature vector as input, and takes the temperature control result of the edible fungus culture medium as output; S4: Utilize the edible fungus adaptive temperature control model to receive the edible fungus growth stage and edible fungus growth state feature vectors, and output the temperature control result to perform adaptive temperature control during the edible fungus cultivation process.
2. The method for adaptive temperature control of edible fungus cultivation according to claim 1, characterized in that: The step S1 of collecting the growth status image of edible fungi includes: The edible fungus growth state images are collected, wherein the edible fungus growth state images are state images of the edible fungus at different cultivation times, and the collected edible fungus growth state images are in the form of: I t =(I t (x,y)) X×Y in: I t represents the growth state image of edible fungi at the t-th cultivation moment, where the growth state image of edible fungi is a pixel matrix, I t (x,y) represents the growth state image of edible fungi I t The pixel value of the pixel (x, y) at the xth row and yth column in ; Represents the color value of the pixel (x, y) in the R, G, and B color channels at the xth row and yth column. x∈[1,X],y∈[1,Y]; For the growth status image of edible fungi I t Perform feature extraction to obtain the edible fungus growth state feature vector f t .
3. The method for adaptive temperature control of edible fungus cultivation according to claim 2, characterized in that: The edible fungus growth state image I t Perform feature extraction to obtain the edible fungus growth state feature vector f t ,include: S11: The edible fungus growth state image I t Divide into 4 equal-sized and non-overlapping image regions in Represents the image area No. x i Row y i Column pixels (x i ,y i )’s pixel value; S12: Calculate the centroid coordinates of different image regions, where the image region The centroid coordinates are S13: Calculating pixel weights of pixels in the image area according to the barycentric coordinates, performing weighted processing on the pixel values of the pixels to obtain a weighted image area; S14: Constructing a pixel value weighted edible fungus growth state image g t ; S15: edible fungus growth state image g after pixel value weighting t Perform global information calculation and processing to obtain global information S16: Global information Converted into edible fungus growth state feature vector 4. The method for adaptive temperature control of edible fungus cultivation according to claim 1, characterized in that: The step S2 constructs a growth stage recognition model for edible fungi, including: Constructing an edible fungus growth stage recognition model to recognize the edible fungus growth stage corresponding to the edible fungus growth state image, wherein the edible fungus growth stage recognition model takes the edible fungus growth state feature vector as input and takes the edible fungus growth stage discrimination result as output, wherein the edible fungus growth stage recognition model comprises an input layer, a multi-scale feature extraction layer, a scale feature weighting layer, a feature fusion layer and a growth stage recognition layer; The input layer is used to receive the edible fungus growth state feature vector corresponding to the edible fungus growth state image; The multi-scale feature extraction layer is a convolutional neural network structure, which is used to extract multi-scale features of the edible fungus growth state feature vector and obtain feature maps of the edible fungus growth state feature vector at different scales; The scale feature weighting layer is used to calculate the scale weight of the feature map and perform weighted calculation on the feature map; The feature fusion layer is used to fuse the weighted feature maps to obtain a fused feature map; The growth stage recognition layer is used to map the fused feature map to obtain the edible fungus growth stage discrimination result; Using the edible fungus growth stage recognition model to identify the growth state image of edible fungi t Identify the growth stage of edible fungi and obtain the results of the growth stage identification of edible fungi 5. The method for adaptive temperature control of edible fungus cultivation according to claim 4, characterized in that: The edible fungus growth stage recognition model is used to identify the edible fungus growth state image I t Identify the growth stages of edible fungi, including: S21: The input layer receives the edible fungus growth status image I t The corresponding edible fungus growth state feature vector S22: Multi-scale feature extraction layer for edible fungus growth state feature vector Multi-scale feature extraction is performed, where the edible fungus growth state feature vector The feature map at the jth scale is S23: The scale feature weighting layer calculates the scale weight of the feature map and performs weighted calculation on the feature map, where the feature map The weighted calculation result is G t (j); S24: The feature fusion layer fuses the weighted feature maps to obtain a fused feature map G t ; S25: The recognition layer in the growth stage will fuse the feature map G t Mapping is performed to obtain the results of distinguishing the growth stages of edible fungi.
6. The method for adaptive temperature control of edible fungus cultivation according to claim 1, characterized in that: The model structure of the edible fungus adaptive temperature control model constructed in step S3 includes: Constructing a model structure of an edible fungus adaptive temperature control model, wherein the edible fungus adaptive temperature control model takes the edible fungus growth stage and the edible fungus growth state feature vector as input and takes the temperature control result of the edible fungus culture medium as output, wherein the model structure of the edible fungus adaptive temperature control model includes an input layer, a growth stage mapping layer, a temperature conversion layer and a temperature correction layer; The input layer is used to receive the edible fungus growth stage and edible fungus growth state feature vector; The growth stage mapping layer is a neural network, which is used to map the growth stage of edible fungi to the edible fungi growth state feature vector to form the edible fungi growth feature vector; The temperature conversion layer is a long short-term memory neural network, which is used to convert the edible fungus growth feature vector into temperature state; The temperature correction layer corrects the temperature state according to the historical temperature control results, and outputs the correction results as the temperature control results of the edible fungus culture medium; Collect U groups of training data to form the training data set data: in: R u represents the u-th group of training data collected, The training data R u The growth stage of edible fungi, the characteristic vector of edible fungi growth state and the optimal temperature of edible fungi culture medium adjusted manually; The training data set data is used to optimize the model parameters of the edible fungus adaptive temperature control model, and the edible fungus adaptive temperature control model is obtained by combining the model structure and model parameters.
7. The method for adaptive temperature control of edible fungus cultivation according to claim 6, characterized in that: The method of optimizing and solving the model parameters of the edible fungus adaptive temperature control model and constructing the edible fungus adaptive temperature control model in combination with the model structure and the model parameters includes: S31: Initialize the generation model parameters θ0 = {w0(c), b0(c)|c∈[0,C]}, where w0(c) represents the weight parameter for the cth iteration in the temperature conversion layer, b0(c) represents the bias parameter for the cth iteration in the temperature conversion layer, and C represents the maximum number of iterations in the temperature conversion layer; S32: Construct a training loss function L(·) of the model parameters in combination with the training data set data; S33: Set the current iteration number of the model parameter to z, the maximum iteration number to Z, then the zth iteration result of the model parameter is θ z , model parameters θ z The corresponding training loss function value is L(θ z ), the initial value of z is 0; S34: Calculate the model parameter θ z The iterative momentum α for the iteration z+1 ; S35: Calculate the model parameter θ z The iteration step length λ z+1 ; S36: For model parameters θ z Iterate S37: Let z=z+1, and return to step S35 until the maximum number of iterations is reached, and the model parameters at this time are used as the optimization solution result θ={w(c),b(c)|c∈[0,C]}.
8. The method for adaptive temperature control of edible fungus cultivation according to claim 7, characterized in that: In the step S4, the edible fungus adaptive temperature control model is used to receive the edible fungus growth stage and edible fungus growth state feature vectors to perform adaptive temperature control during the edible fungus cultivation process, including: S41: Input layer receives the growth stage of edible fungi and the edible fungus growth state feature vector S42: Growth stage mapping layer maps the growth stages of edible fungi Mapped to the edible fungus growth state feature vector Construct the edible fungus growth feature vector f t ; S43: The temperature conversion layer converts the edible fungus growth feature vector f t Convert to temperature state R(t); S44: The temperature correction layer corrects the temperature state R(t) according to the historical temperature control results, and outputs the correction result as the temperature control result of the edible fungus culture medium.
9. An edible fungus cultivation adaptive temperature control system, characterized in that: The system comprises: The data acquisition module is used to collect the growth state image of edible fungi and perform feature extraction to obtain the growth state feature vector of edible fungi; A growth stage recognition module is used to construct an edible fungus growth stage recognition model to recognize the edible fungus growth stage corresponding to the edible fungus growth state image; An adaptive temperature control device is used to construct a model structure of an edible fungus adaptive temperature control model, and optimize and solve the model parameters of the edible fungus adaptive temperature control model. The edible fungus adaptive temperature control model is obtained by combining the model structure and the model parameters. The edible fungus adaptive temperature control model is used to receive the edible fungus growth stage and edible fungus growth state feature vectors, output the temperature control result, and perform adaptive temperature control during the edible fungus cultivation process, so as to realize an edible fungus cultivation adaptive temperature control method as described in any one of claims 1 to 8.