Edible mushroom stick inoculation parameter detection and analysis method and detection and analysis system
Through multi-source heterogeneous data collection and hybrid adaptive learning detection model, the data fusion problem in the edible mushroom stick inoculation process was solved, and high-precision inoculation parameter prediction and optimization control were achieved, which significantly reduced the pollution rate and energy consumption and improved production efficiency.
Patent Information
- Application Number
- CN202511327254.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-17
- Publication Date
- 2025-10-21
AI Technical Summary
Existing technologies lack effective data fusion and analysis methods during the inoculation of edible mushroom sticks, resulting in frequent inoculation failures despite environmental parameters meeting standards. Traditional soft measurement technology also exhibits unstable performance during dynamic changes, high maintenance costs, and a high contamination rate.
Multi-source heterogeneous data collection and multi-dimensional data preprocessing are adopted to build a hybrid adaptive learning detection model. Real-time parameter detection and analysis are performed through the industrial Internet of Things and attention mechanism neural network. Combined with microservice architecture and incremental learning mechanism, accurate prediction and optimized control of vaccination parameters can be achieved.
The accuracy of inoculation parameter prediction was improved from 64.7% to 92.3%, the contamination rate of mushroom sticks was reduced from 9.8% to 3.5%, the mycelium development cycle was shortened, energy consumption was reduced, and dependence on manual experience was reduced, thereby improving the traceability and comparability of production.
Smart Images

Figure CN120822005A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of parameter detection, and in particular, relates to a method and a system for detecting and analyzing edible mushroom stick inoculation parameters. Background Art
[0002] Inoculation of the strain is the core link in the cultivation of edible fungus sticks; in the factory production process of edible fungi, the quality of the strain inoculation directly determines the success or failure of the subsequent edible fungus cultivation and production; the unsuitability of the pH value, C / N ratio, moisture content, etc. in the edible fungus sticks and improper control of the light, oxygen content, carbon dioxide concentration, temperature, humidity and other conditions of the sticks after inoculation will result in an undesirable growth environment for the strains; thereby, the physiological activities of the strains are inhibited, and the hyphae cannot grow rapidly to occupy the space in the entire stick, creating conditions for the invasion and reproduction of miscellaneous bacteria; in the traditional production model, the sticks are generally cooled for more than three days after high-temperature sterilization. At this time, the temperature in the center of the stick is about 20°C, and inoculation begins with the inoculation tent; before inoculation, a plastic film is covered on the cooled sticks, leaving a certain amount of space. The height is for employees to operate; after the inoculation tent is set up, it is compacted on all sides and disinfected with aerosol disinfectant. On the second day, a corner of the inoculation tent will be opened. After the smell of the aerosol disinfectant has dissipated, the employees can enter for inoculation; to ensure the air in the inoculation tent is clean, the vaccinators cannot enter and exit the inoculation tent at will during the inoculation process; during inoculation, one person uses an electric drill to drill holes, and three people inoculate, each person is responsible for one inoculation hole, and they inoculate in turn. The number of inoculations is determined by the number of inoculation holes for each mushroom stick; after each layer of mushroom sticks is connected, the inoculation holes are covered with plastic film to reduce contamination; after the inoculation is completed, the inoculation tent is directly lowered and covered on the pile of inoculated mushroom sticks until the pile is turned over to dissipate heat; during the entire inoculation process, the various parameters and indicators that affect the quality of inoculation are partly judged by the experience of the inoculators; some parameters and indicators that cannot be directly obtained through the operator's senses may even be directly ignored; With the continuous development of microcomputers and sensors in recent years, parameters such as the ambient temperature and humidity of edible mushroom sticks after inoculation can now be monitored and controlled in real time. However, these physical quantities only reflect partial information about the environment in which the mushroom sticks are located. The actual conditions of the mycelium, such as metabolic intensity and nutrient substrate consumption rate, remain unknown. As a result, this can lead to the paradox of "environmental parameters meeting standards but inoculation failure" during production. In recent years, with the continuous development of digital imaging technology, this technology has also been used in the field of edible fungus cultivation; for example, by taking pictures of the mycelium and analyzing the data, the phenotypes such as the size, density, color and growth rate of the mycelium in a single culture dish are obtained; through image recognition technology, the fruiting body of Flammulina velutipes is analyzed to obtain phenotypic information such as the shape, area, attachment position, color and stipe length, width, color; but in the process of mushroom stick inoculation, there is still a gap in using digital imaging technology to improve the inoculation quality; at the same time, due to the heterogeneity of data sources in the factory; such as sensor time series data, mushroom stick image video streams, production equipment operation logs, laboratory test reports, etc., are often stored in independent systems in a scattered manner, lacking effective spatiotemporal alignment mechanisms and feature fusion methods; and traditional data analysis mostly uses single variable regression or simple multivariate statistical models, which makes it difficult to capture the nonlinear coupling relationship implicit in high-dimensional data; for example, the growth rate of mycelium is not only dynamically related to the temperature and humidity of its environment, but also has a dynamic relationship with the temperature and humidity of its environment. The soft measurement technology currently used in bioprocess monitoring generally adopts shallow neural networks or support vector machine models with fixed structures. Because mushroom stick production has the characteristics of a time-varying system (such as seasonal environmental disturbances and drift of genetic characteristics of mushroom strains), there are various problems in using support vector machines or neural networks for soft measurement of bioprocess monitoring. For example, the performance of support vector machines is highly dependent on the selection of kernel functions and parameters, and mushroom stick production is a dynamic process. Therefore, in order to maintain a high performance of the support vector machine, frequent parameter adjustments are required, resulting in high maintenance costs. At the same time, the use of neural networks for soft measurement of bioprocess monitoring has problems such as large data requirements and easy overfitting, limited dynamic time series modeling capabilities, poor interpretability, and difficulty in online updates. According to relevant experimental studies, in normal production, if the parameters of the prediction model corresponding to the soft measurement are not adjusted, the contamination rate of the mushroom sticks can reach as high as 18.1% over time, resulting in a large amount of waste. Summary of the Invention
[0003] In response to the problems in the related art, the present invention proposes a method and system for detecting and analyzing the inoculation parameters of edible mushroom sticks to overcome the above-mentioned technical problems existing in the existing related art.
[0004] To solve the above technical problems, the present invention is achieved through the following technical solutions: The present invention provides a method for detecting and analyzing inoculation parameters of edible mushroom sticks, comprising the following steps: S1. Collect data from the inoculation workshop, the operation of the inoculation equipment, the inoculation process, the raw material ratio data, and the strain characteristics data, and perform protocol conversion; after conversion, upload it to the data pool in the cloud server in JSON format; S2, performs timestamp synchronization and preprocessing operations on the data uploaded in S1; S3, extracting features from the vaccination data after the timestamp synchronization operation and preprocessing operation in S2; and then constructing a trained hybrid adaptive learning detection model based on the extracted feature data; S4, after deploying and adjusting the trained hybrid adaptive learning detection model, the inoculation data after the timestamp synchronization operation and preprocessing operation in S2 and the feature data collected in S3 are used as historical data to detect the inoculation parameters of the mushroom sticks to obtain real-time inoculation parameter detection data; S5. Analyze the real-time vaccination parameter detection data.
[0005] Preferably, the S1 comprises the following steps: S11. Deploy multiple sensors in the edible mushroom stick inoculation workshop to obtain data inside the inoculation workshop and on the operation of the inoculation equipment, and obtain an inoculation workshop environment data matrix and an inoculation equipment operation data matrix; Then, data from the inoculation process, raw material ratio data, and strain characteristic data are collected to obtain an inoculation process data matrix, a raw material ratio data matrix, and a strain characteristic data matrix; the data from the inoculation process includes hyphae expansion image data on the surface of the mushroom stick and near-infrared spectrum data; S12. Use the industrial Internet of Things gateway to perform protocol conversion on the collected inoculation workshop environment data matrix, inoculation equipment operation data matrix, inoculation process data matrix, raw material ratio data matrix and strain characteristic data matrix; after conversion, upload them to the data pool in the cloud server in JSON format to obtain the uploaded inoculation workshop environment data matrix, uploaded inoculation equipment operation data matrix, uploaded inoculation process data matrix, uploaded raw material ratio data matrix and uploaded strain characteristic data matrix.
[0006] Preferably, said S2 comprises the following steps: S21, construct a time alignment matrix, and synchronize the uploaded inoculation workshop environment data matrix, the uploaded inoculation equipment operation data matrix, and the uploaded inoculation process data matrix with the device master clock as the benchmark, to obtain the synchronized inoculation workshop environment data matrix, the synchronized inoculation equipment operation data matrix, and the synchronized inoculation process data matrix; S22, pre-processing operations are performed on the post-synchronization inoculation workshop environment data matrix, the post-synchronization inoculation equipment operation data matrix, the post-synchronization inoculation process data matrix, and the uploaded raw material ratio data matrix.
[0007] Preferably, the S22 includes the following steps: S221, performing sliding window anomaly detection on the post-synchronization vaccination workshop environment data matrix and the post-synchronization vaccination equipment operation data matrix; during the sliding window anomaly detection process, a dynamic threshold algorithm based on an improved Z-score is used to identify outliers in the data. When three consecutive data points exceed the threshold, a linear interpolation compensation algorithm is triggered to obtain the post-processing vaccination workshop environment data matrix and the post-processing vaccination equipment operation data matrix: The CLAHE algorithm is used to enhance the contrast of the hyphae edge in the image data of the synchronized post-inoculation process data matrix until the hyphae edge can be clearly distinguished from the background, and then the HSV color space conversion method is used to eliminate light interference to obtain the enhanced post-inoculation process data matrix; A standardized coding rule for the raw material ratio data is established, and then the uploaded raw material ratio data matrix is coded according to the standardized coding rule to obtain the coded raw material ratio data matrix.
[0008] Preferably, the step S3 includes the following steps: S31, extracting the time domain features and frequency domain features from the processed inoculation workshop environment data matrix to obtain the inoculation workshop environment time domain feature matrix and the inoculation workshop environment frequency domain feature matrix; Then, fault-related features are extracted from the equipment vibration data in the post-process inoculation equipment operation data matrix to obtain an equipment fault-related feature matrix; hyphae extension features are extracted from the mushroom stick images in the post-enhanced inoculation process data matrix to obtain a hyphae extension feature matrix; then, biochemical features of hyphae are extracted from the near-infrared spectrum in the post-enhanced inoculation process data matrix to obtain a hyphae biochemical feature matrix; then, 15-dimensional feature variables that are strongly correlated with hyphae activity are screened out using the Pearson correlation coefficient to obtain a hyphae activity feature vector matrix X∈R^(n×15), where R represents a real number set, indicating that all elements in the feature vector matrix X are real numbers; and n represents the number of samples, which refers to the number of independent observations in the data set. S32. Construct a dual-channel neural network model based on the attention mechanism, and predict the activity indicators of mycelium (biomass, health status) and the type and probability of equipment failure by using the equipment failure correlation feature matrix and the mycelium activity feature vector matrix; the structure of the mycelium activity channel adopts LSTM plus cross-modal attention, where the activation function of LSTM is Tanh, the activation function of cross-modal attention is Softmax, and the activation function of Dense is ReLU; in the equipment failure channel, a 1D CNN plus Transformer structure is adopted, where the parameters of Conv2D are configured as 16 filters, 3×3 kernel, stride=2, and the activation function is ReLU, the parameters of MaxPooling2D are configured as pool_size = 2×2, the parameters of Conv2D are configured as 32 filters, 3×3 kernel, stride=1, and the activation function is ReLU, the hidden layer of the Transformer block is 64 layers, and the activation function is GELU; the loss function is set to L=λ1×L 生物量 +λ2×L 健康状态 +λ3×L 故障类型 +λ4×L RUL , where L 生物量 represents mycelial biomass; L 健康状态 Indicates the health status of mycelium; L 故障类型 Indicates the type of equipment failure; L RUL represents the loss function used to optimize the equipment remaining useful life prediction task; λ1 = 1.0; λ2 = 0.8; λ3 = 1.2; and λ4 = 0.5. The dual-channel neural network model is trained and tested. After training and testing, a trained hybrid adaptive learning detection model is obtained.
[0009] Preferably, the S4 comprises the following steps: S41, deploying the trained hybrid adaptive learning detection model in a detection system of a microservice architecture; S42. After the deployment is completed, the inoculation parameters of the mushroom sticks are detected according to the uploaded strain characteristic data matrix, the inoculation workshop environment data matrix after treatment, the inoculation equipment operation data matrix after treatment, the inoculation process data matrix after enhancement, the raw material ratio data matrix after encoding, the inoculation workshop environment time domain feature matrix, the inoculation workshop environment frequency domain feature matrix, the equipment fault correlation feature matrix, the mycelium extension feature matrix, the mycelium biochemical feature matrix and the mycelium activity feature vector matrix, and the detection system of the microservice architecture is used to obtain real-time inoculation parameter detection data.
[0010] Preferably, the detection system of the microservice architecture includes data access service, feature calculation service, detection service, model update service and visualization panel; the model update service adopts an incremental learning mechanism; when the prediction error MAE of 100 consecutive data is greater than 0.15, the model retraining process is automatically triggered, and the elastic weight solidification algorithm (EWC) is used to prevent catastrophic forgetting.
[0011] Preferably, the S5 comprises the following steps: S51, setting an inoculation parameter prediction threshold; when there are three consecutive real-time inoculation parameter detection data that are all less than the inoculation parameter prediction threshold, triggering a temperature adjustment instruction and a humidity adjustment instruction; and obtaining the optimal environmental parameters of the inoculation workshop through a fuzzy PID algorithm; When the mycelium expansion characteristic matrix shows that the mycelium expansion speed is abnormal, the speed of the conveyor belt on the production line will be slowed down; manual review process, manual sampling test and secondary inspection process are carried out according to the real-time inoculation parameter detection data; S52. Establish a historical archive. When it is detected that the similarity between the current situation and the historical failure case exceeds 85%, start the sterilization equipment in advance to perform sterilization. S53. Generate a parameter optimization recommendation report every week; and use SHAP value analysis to reveal the influence weight of each characteristic variable on the real-time inoculation parameter detection data to optimize the process parameters.
[0012] Preferably, the manual review process, manual sampling test and secondary inspection process according to the real-time vaccination parameter detection data in S51 include the following steps: S511, calculating the 95% confidence interval width of the real-time vaccination parameter detection data, and starting the manual review process when the confidence interval width exceeds a preset threshold; S512: Deploy an abnormal detection isolation zone; perform manual sampling and testing on mushroom sticks predicted to be abnormal, and feed the test results back to the correction module; S513. Establish an expert system to trigger a secondary inspection process when the real-time vaccination parameter detection data conflicts with the empirical rules; use blockchain technology to store key operation logs.
[0013] The present invention also discloses a big data-based soft prediction accuracy control method for edible mushroom stick inoculation parameters using the above-mentioned method. After analyzing the real-time inoculation parameter detection data, the speed of the conveyor belt on the production line is adjusted, a manual review process, manual sampling detection, a secondary inspection process, sterilization treatment and process parameter optimization are performed according to the analysis results.
[0014] The present invention also discloses an edible fungus stick inoculation parameter detection and analysis system, which includes an edible fungus inoculation data acquisition module, an inoculation data upload module, an inoculation data preprocessing module, an inoculation data feature extraction module, a prediction model training module, an inoculation parameter detection module and an inoculation parameter detection data analysis module.
[0015] Preferably, the speed adjustment of the conveyor belt on the production line, manual review process, manual sampling inspection, secondary inspection process, sterilization treatment and optimization of process parameters are carried out according to the analysis results.
[0016] The present invention has the following beneficial effects: 1. By acquiring multi-source heterogeneous data, preprocessing multi-dimensional data, establishing a soft sensor feature engineering system, training a hybrid adaptive learning detection model, establishing a multi-objective optimization control strategy, and building a credibility assessment and manual verification mechanism, the present invention improved the accuracy of inoculation parameter prediction from 64.7% (using traditional methods) to 92.3%, reduced the contamination rate of mushroom sticks from 9.8% to 3.5%, and shortened the mycelial development period from 17.3 days to 12.1 days. Particularly during high humidity seasons (when the ambient RH exceeds 85%), the system successfully reduced contamination risk by 62% by pre-adjusting the puncture interval (from 10 mm to 12 mm) and increasing the spawn injection volume (+15%). The absolute error of 90% of the prediction points was within ±0.1, significantly exceeding the ±0.3 fluctuation range of the control group. These empirical data fully demonstrate the practicality of the present invention in complex production environments.
[0017] 2. The present invention realizes the standardized integration of multi-source heterogeneous data from equipment operating parameters to strain characteristics, and constructs a digital twin system covering the entire production cycle.
[0018] 3. The real-time prediction capability based on the hybrid adaptive model in the present invention can dynamically adjust the conveyor belt speed and sterilization parameters, reducing energy consumption by more than 15%; through the secondary inspection mechanism driven by feature data, the quality problem identification node is advanced from the finished product inspection to the inoculation stage.
[0019] 4. The present invention provides a traceable analytical benchmark for process improvement through a JSON structured data pool, reducing the deviation caused by reliance on manual experience; in addition, timestamp synchronization technology improves the comparability of bacterial strain characteristic data across different batches, supporting rapid switching of product categories.
[0020] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions of the embodiments of the invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1 This is a system architecture diagram of the present invention; Figure 2 This is a data processing flow chart of the present invention; Figure 3 This is a diagram of the hybrid model architecture of the present invention; Figure 4 It is the soft sensor logic diagram of the present invention; Figure 5 This is a closed-loop control flow chart of the present invention; Figure 6 (a) and (b) are electron microscopic images of the hyphae edges of the present invention. DETAILED DESCRIPTION
[0023] The following will clearly and completely describe the technical solutions in the embodiments of the invention in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of the invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.
[0024] Example 1
[0025] This embodiment is a method for detecting and analyzing edible mushroom stick inoculation parameters, comprising the following steps: Step 1: Multi-source heterogeneous data collection To obtain environmental information during inoculation, various environmental sensors, including temperature, humidity, CO2 concentration, and light intensity sensors, are deployed in the inoculation workshop. To obtain real-time data within the inoculation workshop, all sensors collect data every 10 seconds.
[0026] At the same time, in order to obtain real-time information on the operation of the inoculation equipment, it is also necessary to install an equipment operation monitoring module in the inoculation workshop, which mainly includes steam sterilization pressure sensors, inoculation machine vibration sensors, conveyor belt speed encoders, etc.
[0027] To perform soft measurements of various data during the inoculation process, a machine vision module, primarily equipped with a near-infrared spectral camera and an industrial CCD camera, is installed in the inoculation workshop. This equipment primarily captures images of mycelial expansion and near-infrared spectral data from the mushroom stick surface every five minutes. Furthermore, to record information such as raw material ratio parameters (sawdust type, wheat bran ratio, moisture content) and fungus characteristics (strain number), a manual data entry terminal is installed in the workshop, where operators manually input this information. This manually entered information complements the data automatically collected by the sensors, creating an organically complementary data format.
[0028] All of the above devices together form a distributed sensor network within the vaccination workshop. Finally, all information is converted to a protocol via the Industrial IoT gateway. After conversion, it is uploaded to a data pool on a cloud server in JSON format.
[0029] Step 2: Multi-dimensional data preprocessing The distributed sensor network installed in the inoculation workshop monitors the environment in real time and transmits a large amount of data. Before data processing, a designed streaming data processing framework is required to clean and integrate the data. The main process of this link is as follows: 1. Perform sliding window anomaly detection on real-time data collected by sensors. A dynamic threshold algorithm based on an improved Z-score is used to identify outliers. When three consecutive data points exceed the threshold, a linear interpolation compensation algorithm is triggered. 2. Enhance the real-time image captured by the machine vision module: Use the CLAHE algorithm to enhance the contrast of the hyphae edge until the hyphae edge can be clearly distinguished from the background, the details of the hyphae in the dark area are enhanced, and the originally adhered hyphae branches can be distinguished (such as Figure 6 As shown in Figure 2, this method can improve the accuracy of hyphae edge extraction from 78% with manual parameter adjustment to 93%; the HSV color space conversion method is used to eliminate light interference; 3. Establish standardized coding rules for raw material ratio data, converting unstructured descriptions such as "birch sawdust 80%" into feature vector descriptions; 4. Build a time alignment matrix, using the device master clock as the benchmark to synchronize timestamps for heterogeneous data from different sensor devices, thereby ensuring the spatiotemporal consistency of multi-source data.
[0030] Step 3: Establish a soft sensing feature engineering system For data that cannot be directly measured during the inoculation process, such as the mycelial activity index Y, a multi-scale feature extraction strategy is designed. The details are as follows: 1. Extract time domain features from preprocessed environmental data: 24-hour sliding mean, diurnal temperature fluctuation coefficient; frequency domain features: high-frequency energy ratio obtained through wavelet transform decomposition; 2. Extract fault-related features from pre-processed equipment vibration data: use the energy entropy of the IMF components obtained by EDM decomposition; 3. Extract hyphae extension features from mushroom stick images: colony coverage area growth rate calculated based on the U-Net segmentation network; 4. Extract the biochemical characteristics of mycelium from the near-infrared spectrum: Use principal component analysis to extract the first three principal component scores in the 900-1700nm band.
[0031] Afterwards, 15-dimensional feature variables that are strongly correlated with mycelial activity are screened out using the Pearson correlation coefficient to construct the feature vector matrix X∈R^(n×15), where R represents the set of real numbers, indicating that all elements in the feature vector matrix X are real numbers; n represents the number of samples, which refers to the number of independent observations in the data set.
[0032] Step 4: Train the hybrid adaptive learning detection model To accurately predict relevant parameters after mushroom stick inoculation, a dual-channel neural network model based on the attention mechanism was constructed. The equipment failure correlation feature matrix and the mycelium activity feature vector matrix were used to predict mycelium activity indicators (biomass, health status) and the type and probability of equipment failure. The equipment failure correlation feature matrix and the mycelium activity feature vector matrix were used to train and test the dual-channel neural network model based on the attention mechanism. The dual-channel neural network model based on the attention mechanism was used to predict mycelium activity indicators (biomass, health status) and the type and probability of equipment failure. 1. A stacked LSTM structure is used in the time series feature pipeline to process environmental and device data. A total of 64 hidden units are set up in this process, and a dropout layer is inserted after each LSTM layer to prevent overfitting. 2. A lightweight CNN structure (an improved version of MobileNetV3) is used in the image feature channel to process the mushroom stick visual data. This module outputs a 128-dimensional feature vector. 3. By using a multi-head attention layer to calculate the cross-attention weights of temporal features and image features, cross-modal feature fusion is achieved; 4. Integrate soft measurement features and hard measurement data in the fully connected layer, and finally output the predicted value of mycelial activity index At the same time, the Bayesian optimization algorithm is used to adjust the hyperparameters and the learning rate is set in the range [1e -4 , 1e -3 ] in the adaptive adjustment.
[0033] Step 5: Deploy the online prediction and model update system Deploy the trained hybrid adaptive learning detection model in the detection system with a microservices architecture: 1. To achieve real-time ingestion of high-concurrency data streams, the data access service uses Apache Kafka; 2. Deploy the pre-trained PCA model and image processing model in the feature calculation service for online feature extraction; 3. Load the hybrid deep learning model in the detection service and output the prediction results at a cycle of 1 minute; 4. Adopt an incremental learning mechanism in the model update service. When the prediction error MAE of 100 consecutive data exceeds 0.15, the model retraining process will be automatically triggered. And the elastic weight consolidation algorithm (EWC) is used to prevent catastrophic forgetting. At the same time, a visualization panel is established to display the prediction parameter curves and abnormal alarm information of each inoculation production line in real time.
[0034] Step 6: Establish a multi-objective optimization control strategy Perform closed-loop control on the inoculation workshop according to the predicted results: 1. If the predicted value is lower than the set threshold three times consecutively, temperature adjustment instructions and humidity adjustment instructions will be triggered. Obtain the optimal environmental parameters of the inoculation workshop through the fuzzy PID algorithm; 2. Determine whether the hyphal growth rate is abnormal by the deviation between the current hyphal growth rate and the historical benchmark rate. When the current hyphal growth rate v < μ - 3σ, it is determined that the hyphal growth rate is abnormal, where μ represents the speed mean and σ represents the standard deviation. When the image feature detects that the hyphal growth rate is abnormal, the speed of the conveyor belt on the production line will be slowed down. Specifically, when the hyphal growth rate satisfies 0.5μ < v < μ - 3σ, the conveyor belt speed is reduced to 70% of the conveyor belt benchmark speed; when the hyphal growth rate satisfies v < 0.5μ, the conveyor belt speed is reduced to 30% of the benchmark speed. In this way, the cultivation time is extended to ensure that the hyphae have enough time to grow; 3. At the same time, establish a historical archive. When the similarity between the detected current situation and the equipment operation indicators, hyphal activity indicators, and environmental parameters in the historical failure cases exceeds 85%, the sterilization equipment will be started in advance for sterilization treatment; 4. Finally, generate a parameter optimization suggestion report every week. And use SHAP value analysis to reveal the influence weights of each feature variable on the prediction results, so as to optimize the process parameters.
[0035] Step 7: Build a credibility evaluation and manual verification mechanism Design a detection index for the prediction results to reflect the detection accuracy: 1. Calculate the 95% confidence interval width of the real-time prediction value and initiate the manual review process when the confidence interval width exceeds the preset threshold; 2. Deploy an abnormal detection isolation zone. Manual sampling and testing are performed on mushroom sticks predicted to be abnormal, and the test results are fed back to the correction module; 3. Establish an expert system. When the real-time inoculation parameter detection data conflicts with empirical rules such as the positive correlation between mycelium expansion speed and ambient temperature, the need to start the sterilization procedure due to vibration exceeding the limit, and the need to stop production and adjust the environmental monitoring data continuously exceeding the standard, the secondary inspection process is triggered. Among them, the secondary inspection process is to use offline instruments for retesting and confirm whether there are any abnormalities in the prediction through a manual review interface. When it is confirmed that the prediction is abnormal, the operation is corrected and blockchain evidence is stored. Blockchain technology is used to store key operation logs such as equipment operation logs, mycelium culture process logs, quality inspection logs, environmental logs, and rule conflict logs to ensure data traceability and process auditability. The following is an analysis of the inoculation process in the King Oyster Mushroom production process. The specific operations are as follows: First, if Figure 1 As shown, a distributed sensor network is deployed in the inoculation workshop to obtain various production plant information. Environmental monitoring nodes are placed every two meters along the mushroom stick conveyor belt. Each environmental monitoring node consists of a PT100 temperature sensor, an SHT35 humidity sensor, and a CO2 infrared sensor. A hyperspectral imager is installed 1.5 meters above the inoculation station to capture images of the mushroom stick surface every 30 seconds.
[0036] All sensor data is converted to a protocol by the Industrial IoT gateway and uploaded to a central server using the OPC UA protocol. Simultaneously, equipment operating parameters are read in real time from the PLC controller via the Modbus TCP protocol. These parameters primarily include data from the inoculation needle displacement encoder and pressure sensor readings.
[0037] Afterwards, enter Figure 2The data stream processing stage shown. Deploy the Apache Kafka cluster and build a three-level data cache layer. The receiving layer can receive about 1,500 sensor raw data streams per second. And use the sliding window mechanism (window length 60 seconds, step length 10 seconds) to clean the data. Apply the 3σ criterion to eliminate abnormal data, and use the cubic spline interpolation method to fill in the missing data. In the preprocessing layer, the temperature data is processed by 60-second moving average and the coefficient of variation is calculated; the humidity data is differentially processed to eliminate baseline drift; and the hyperspectral image is preprocessed in the feature layer. First, the contrast is enhanced by the CLAHE algorithm; then the histogram of the H component in the HSV color space and the LBP texture features are extracted; then the equipment operating parameters are decomposed by wavelet packets to extract the energy proportion characteristics of each frequency band; finally, the mRMR algorithm is used to screen out 32-dimensional key feature vectors including core indicators such as temperature variation coefficient, mycelium texture entropy, and inoculation needle pressure band energy ratio; During the model building and training phase, Figure 3 The dual-channel deep neural network shown in Figure 1 is used. A TCN network is used in the temporal processing channel, with six dilated convolutional layers. Each dilated convolutional layer contains 32 convolution kernels and is layer-normalized. A modified ResNet-18 module is used in the spatial processing channel. The input layer is resized to a 128×128×3 HSV image input, and a SE attention module is added before the fully connected layer. An attention mechanism is incorporated into the gating of the dual-channel features, with initial weights set to 0.6 for the temporal channel and 0.4 for the spatial channel, and a dynamic adjustment range of ±0.2. The output layer is connected to an XGBoost regressor with a learning rate of 0.005, a maximum depth of 6, and a subsampling ratio of 0.8. Training is performed using historical data, which is partitioned into an 80% training set, a 15% validation set, and a 5% test set. After 50 epochs of training, the model achieves an RMSE of 0.12 on the test set, outperforming the 0.21 of a single LSTM model and the 0.35 of a traditional BP network.
[0038] When implementing soft sensor parameter calculation, three core indicator calculation models are established. The overall soft sensor logic is as follows: Figure 4As shown. The mycelial activity index (MAI) is calculated by weighting the hyperspectral image features (reflectance in the 630nm band (R630), texture contrast (Tc)) and the CO2 release rate (VCO2). The formula is: MAI=0.4×R630+0.3×Tc+0.3×VCO2. The substrate metabolic state (SMS) index is calculated using a fuzzy inference system. The input of the fuzzy inference system includes the pH value change gradient of the substrate, the temperature integral, and the humidity fluctuation frequency; the output of the fuzzy inference system is divided into 5 levels. The contamination risk index (CRC) is obtained through a logistic regression model. The characteristic parameters of this index include the number of temperature mutations (ΔT>1℃ / min), the proportion of the area of foreign bacterial plaques, and the abnormal vibration duration of the equipment. When the CRC is greater than 0.7, a red alert will be triggered.
[0039] In the closed-loop control stage, the prediction model output is connected to the PLC control system. The control process of the closed-loop control stage is as follows: Figure 5 As shown. The model predictive control module (MPC) produces a parameter adjustment sequence with a cycle of 15 minutes. This parameter sequence mainly includes the inoculation depth set value, the bacterial strain injection volume baseline value, etc. In the optimization layer, an improved particle swarm algorithm is used, and the population size is set to 50, the number of iterations is 100, the inertia weight decreases linearly from 0.9 to 0.4, the cognitive factor c1=1.2, and the social factor c2=1.6. When the ambient temperature suddenly changes by more than 2°C / min, the emergency control strategy is activated: the inoculation needle travel speed is immediately reduced to 70% of the rated value, and the bacterial strain injection pressure is increased by 10% to compensate for the change in puncture depth. The digital twin module synchronizes the equipment status data of the inoculation workshop in real time, builds a three-dimensional virtual production line in the Unity3D environment, performs collision detection and motion trajectory simulation on the new parameter settings, and ensures that the adjusted parameters will not cause equipment interference.
[0040] At the interactive visualization level, a B / S architecture monitoring platform was developed. The front-end uses WebGL technology for three-dimensional rendering. The left side of the main interface displays a heat map of mushroom stick growth, mapping the mycelium density distribution with a color gradient (blue → red). The central area displays parameter prediction curves for the next six hours, allowing users to click any time point to view detailed predictions. The right panel presents a topological diagram of the equipment status, with abnormal nodes flashing red as a warning. Mobile devices integrate an alert function through WeChat Enterprise. When key parameters exceed thresholds, a formatted message containing the abnormality type, location, and recommended actions is automatically sent to the responsible engineer. The historical database is stored in a time series database (InfluxDB). Each production batch contains complete process parameter records, prediction logs, and control instructions, supporting multi-dimensional retrieval and analysis by strain type, production date, and other factors.
[0041] After three months of field testing, this system improved the accuracy of inoculation parameter prediction from 64.7% using traditional methods to 92.3%, reduced the contamination rate of mushroom sticks from 9.8% to 3.5%, and shortened the mycelial development cycle from 17.3 days to 12.1 days. Particularly during high humidity seasons (when the ambient RH exceeds 85%), the system successfully reduced contamination risk by 62% by preemptively adjusting the puncture interval (from 10mm to 12mm) and increasing the amount of spawn injected (+15%). Figure 5 The prediction error distribution diagram in the figure shows that the absolute error of 90% of the prediction points is controlled within the range of ±0.1, which is significantly better than the ±0.3 fluctuation range of the control group. These empirical data fully verify the practicality of this invention in complex production environments.
[0042] Example 2
[0043] See also Figure 4 This embodiment discloses a system for detecting and analyzing edible mushroom stick inoculation parameters. The system can implement the method of the above embodiment and includes an edible mushroom inoculation data acquisition module, an inoculation data upload module, an inoculation data preprocessing module, an inoculation data feature extraction module, a prediction model training module, an inoculation parameter detection module, and an inoculation parameter detection data analysis module. The edible fungus inoculation data acquisition module collects data in the inoculation workshop, data on the operation of the inoculation equipment, data during the inoculation process, raw material ratio data, and strain characteristic data; The vaccination data uploading module performs protocol conversion on the collected data; after conversion, it is uploaded to the data pool in the cloud server in JSON format; The vaccination data preprocessing module performs timestamp synchronization and preprocessing operations on the data in the data pool uploaded to the cloud server in S1; The inoculation data feature extraction module extracts the time domain features and frequency domain features in the inoculation workshop environment data, the fault correlation features in the equipment operation data, the hyphae extension features extracted from the mushroom stick image, the biochemical features of the hyphae in the near infrared spectrum, and 15 dimensional features strongly related to the hyphae activity based on the inoculation data after the timestamp synchronization operation and the preprocessing operation in S2; The prediction model training module trains and tests the constructed dual-channel neural network model based on the attention mechanism according to the extracted feature data to obtain a trained hybrid adaptive learning detection model; After the inoculation parameter detection module deploys and adjusts the trained hybrid adaptive learning detection model, it uses the inoculation data after the timestamp synchronization operation and preprocessing operation in S2 and the feature data collected in S3 as historical data to detect the inoculation parameters of the mushroom sticks and obtain real-time inoculation parameter detection data; The inoculation parameter detection data analysis module analyzes the real-time inoculation parameter detection data and can adjust the speed of the conveyor belt on the production line, perform manual review process, manual sampling inspection, secondary inspection process, sterilization treatment and optimize process parameters according to the analysis results.
[0044] Throughout this specification, references to terms such as "one embodiment," "example," or "specific example" indicate that the specific features, structures, materials, or characteristics described in conjunction with that embodiment or example are included in at least one embodiment or example of the invention. In this specification, schematic representations of these terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
[0045] The preferred embodiments of the invention disclosed above are intended only to help illustrate the invention. These preferred embodiments do not exhaust all details, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and variations are possible based on the content of this specification. These embodiments are selected and described in detail in this specification to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention.
Claims
1. A method for detecting and analyzing inoculation parameters of edible mushroom sticks, characterized in that: The following steps are involved: S1. Deploy multiple sensors to collect data from the inoculation workshop, the operation of the inoculation equipment, the inoculation process, the raw material ratio data, and the characteristics of the bacterial strain, and perform protocol conversion. After conversion, the data is uploaded to the data pool in the cloud server in JSON format. S2, performs timestamp synchronization and preprocessing operations on the data uploaded in S1; S3, extracting features from the vaccination data after the timestamp synchronization operation and preprocessing operation in S2; Then, a trained hybrid adaptive learning detection model is constructed based on the extracted feature data; S4, after deploying and adjusting the trained hybrid adaptive learning detection model, the inoculation data after the timestamp synchronization operation and preprocessing operation in S2 and the feature data collected in S3 are used as historical data to detect the inoculation parameters of the mushroom sticks to obtain real-time inoculation parameter detection data; S5. Analyze the real-time vaccination parameter detection data.
2. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 1, characterized in that: Said S1 comprises the following steps: S11. Deploy multiple sensors in the edible mushroom stick inoculation workshop to obtain data inside the inoculation workshop and on the operation of the inoculation equipment, and obtain an inoculation workshop environment data matrix and an inoculation equipment operation data matrix; Then, data from the inoculation process, raw material ratio data, and strain characteristic data are collected to obtain an inoculation process data matrix, a raw material ratio data matrix, and a strain characteristic data matrix; the data from the inoculation process includes hyphae expansion image data on the surface of the mushroom stick and near-infrared spectrum data; S12. Use the industrial Internet of Things gateway to perform protocol conversion on the collected inoculation workshop environment data matrix, inoculation equipment operation data matrix, inoculation process data matrix, raw material ratio data matrix and strain characteristic data matrix; after conversion, upload them to the data pool in the cloud server in JSON format to obtain the uploaded inoculation workshop environment data matrix, uploaded inoculation equipment operation data matrix, uploaded inoculation process data matrix, uploaded raw material ratio data matrix and uploaded strain characteristic data matrix.
3. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 2, characterized in that: The S2 comprises the following steps: S21, construct a time alignment matrix, and synchronize the uploaded inoculation workshop environment data matrix, the uploaded inoculation equipment operation data matrix, and the uploaded inoculation process data matrix with the device master clock as the benchmark, to obtain the synchronized inoculation workshop environment data matrix, the synchronized inoculation equipment operation data matrix, and the synchronized inoculation process data matrix; S22, pre-processing operations are performed on the post-synchronization inoculation workshop environment data matrix, the post-synchronization inoculation equipment operation data matrix, the post-synchronization inoculation process data matrix, and the uploaded raw material ratio data matrix.
4. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 3, characterized in that: The S22 includes the following steps: S221, performing sliding window anomaly detection on the post-synchronization vaccination workshop environment data matrix and the post-synchronization vaccination equipment operation data matrix; during the sliding window anomaly detection process, a dynamic threshold algorithm based on an improved Z-score is used to identify outliers in the data. When three consecutive data points exceed the threshold, a linear interpolation compensation algorithm is triggered to obtain the post-processing vaccination workshop environment data matrix and the post-processing vaccination equipment operation data matrix: The CLAHE algorithm is used to enhance the contrast of the hyphae edge in the image data of the synchronized post-inoculation process data matrix until the hyphae edge can be clearly distinguished from the background, and then the HSV color space conversion method is used to eliminate light interference to obtain the enhanced post-inoculation process data matrix; A standardized coding rule for the raw material ratio data is established, and then the uploaded raw material ratio data matrix is coded according to the standardized coding rule to obtain the coded raw material ratio data matrix.
5. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 4, characterized in that: The S3 includes the following steps: S31, extracting the time domain features and frequency domain features from the processed inoculation workshop environment data matrix to obtain the inoculation workshop environment time domain feature matrix and the inoculation workshop environment frequency domain feature matrix; Then, fault-related features are extracted from the equipment vibration data in the post-process inoculation equipment operation data matrix to obtain an equipment fault-related feature matrix; hyphae extension features are extracted from the mushroom stick images in the post-enhanced inoculation process data matrix to obtain a hyphae extension feature matrix; then, biochemical features of hyphae are extracted from the near-infrared spectrum in the post-enhanced inoculation process data matrix to obtain a hyphae biochemical feature matrix; then, 15-dimensional feature variables that are strongly correlated with hyphae activity are screened out using the Pearson correlation coefficient to obtain a hyphae activity feature vector matrix X∈R^(n×15), where R represents a real number set, indicating that all elements in the feature vector matrix X are real numbers; and n represents the number of samples, which refers to the number of independent observations in the data set. S32. Construct a dual-channel neural network model based on the attention mechanism; train and test the dual-channel neural network model, and after the training and testing are completed, obtain a trained hybrid adaptive learning detection model.
6. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 5, characterized in that: The S4 comprises the following steps: S41, deploying the trained hybrid adaptive learning detection model in a detection system of a microservice architecture; S42. After the deployment is completed, the inoculation parameters of the mushroom sticks are detected according to the uploaded strain characteristic data matrix, the inoculation workshop environment data matrix after treatment, the inoculation equipment operation data matrix after treatment, the inoculation process data matrix after enhancement, the raw material ratio data matrix after encoding, the inoculation workshop environment time domain feature matrix, the inoculation workshop environment frequency domain feature matrix, the equipment fault correlation feature matrix, the mycelium extension feature matrix, the mycelium biochemical feature matrix and the mycelium activity feature vector matrix, and the detection system of the microservice architecture is used to obtain real-time inoculation parameter detection data.
7. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 6, characterized in that: The S5 comprises the following steps: S51, setting an inoculation parameter prediction threshold; when there are three consecutive real-time inoculation parameter detection data that are all less than the inoculation parameter prediction threshold, triggering a temperature adjustment instruction and a humidity adjustment instruction; and obtaining the optimal environmental parameters of the inoculation workshop through a fuzzy PID algorithm; When the mycelium expansion characteristic matrix shows that the mycelium expansion speed is abnormal, the speed of the conveyor belt on the production line will be slowed down; manual review process, manual sampling test and secondary inspection process are carried out according to the real-time inoculation parameter detection data; S52. Establish a historical archive. When it is detected that the similarity between the current situation and the historical failure case exceeds 85%, start the sterilization equipment in advance to perform sterilization. S53. Generate a parameter optimization recommendation report every week; and use SHAP value analysis to reveal the influence weight of each characteristic variable on the real-time inoculation parameter detection data to optimize the process parameters.
8. The method for detecting and analyzing edible mushroom stick inoculation parameters according to claim 7, characterized in that: The manual review process, manual sampling test and secondary inspection process according to the real-time vaccination parameter detection data in S51 include the following steps: S511, calculating the 95% confidence interval width of the real-time vaccination parameter detection data, and starting the manual review process when the confidence interval width exceeds a preset threshold; S512: Deploy an abnormal detection isolation zone; perform manual sampling and testing on mushroom sticks predicted to be abnormal, and feed the test results back to the correction module; S513. Establish an expert system to trigger a secondary inspection process when the real-time vaccination parameter detection data conflicts with the empirical rules; use blockchain technology to store key operation logs.
9. A method for controlling the soft prediction accuracy of edible mushroom stick inoculation parameters based on big data using the method according to any one of claims 1 to 8, characterized in that: After analyzing the real-time inoculation parameter detection data, the speed adjustment of the conveyor belt on the production line, manual review process, manual sampling detection, secondary inspection process, sterilization treatment and process parameter optimization are carried out according to the analysis results.
10. A system for implementing the method for detecting and analyzing edible mushroom stick inoculation parameters according to any one of claims 1 to 8.