Traditional Chinese medicine fermentation method and system

By analyzing traditional Chinese medicine fermentation data using a multimodal large model, the fermentation process can be optimized in real time, solving the problems of inaccurate prediction of fermentation quality and low content of effective components in traditional Chinese medicine, and achieving rapid and accurate fermentation control and component enhancement.

CN122012820APending Publication Date: 2026-05-12HANGZHOU ZHENGMING INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU ZHENGMING INFORMATION TECHNOLOGY CO LTD
Filing Date
2026-01-23
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing traditional Chinese medicine fermentation technologies lack the ability to predict quality and dynamically optimize processes driven by artificial intelligence, resulting in insufficient precision and stability in fermentation process control, low accuracy in predicting fermentation quality, and low content of effective components.

Method used

A multimodal large model is used to analyze real-time fermentation data, combining sensor time-series data, microbial image data, and process text data. Fermentation quality is scored and parameter adjustment suggestions are made through attention mechanism and tree structure algorithm to optimize the fermentation process in real time.

Benefits of technology

It achieves rapid and accurate prediction of the fermentation quality of traditional Chinese medicine, increases the content of effective components, shortens the fermentation cycle, and improves the precision and stability of the fermentation process control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122012820A_ABST
    Figure CN122012820A_ABST
Patent Text Reader

Abstract

The invention discloses a traditional Chinese medicine fermentation method and system, and belongs to the technical field of traditional Chinese medicine fermentation. Wherein the real-time fermentation data comprises sensor time sequence data, microorganism image data and process text data; analyzing the real-time fermentation data through a multi-modal large model to obtain a fermentation quality score and a parameter adjustment suggestion; and adjusting the traditional Chinese medicine fermentation process of the fermentation tank according to the fermentation quality score and the parameter adjustment suggestion. According to the method, the real-time fermentation data is analyzed through the multi-modal large model, the fermentation quality score and the parameter adjustment suggestion can be quickly and accurately obtained, and the problems that the existing traditional Chinese medicine fermentation quality prediction accuracy is low, and the content of effective components is low after existing traditional Chinese medicine fermentation are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of traditional Chinese medicine fermentation technology, and in particular relates to a method and system for fermenting traditional Chinese medicine. Background Technology

[0002] The Chinese medicine fermentation tank is a core piece of equipment specifically designed for the fermentation process of Chinese medicine. Its key functions include precise control of temperature and humidity in the fermentation environment, efficient sterilization, and automated operation. It can support a wide range of applications, from small-scale laboratory experiments to large-scale industrial production.

[0003] Currently, existing traditional Chinese medicine fermentation technologies generally employ preset, fixed process parameters, relying primarily on manual adjustments based on operator experience during actual production. The systems can only monitor basic environmental parameters such as temperature and pH, lacking AI-based quality prediction and dynamic process optimization capabilities. Key decisions are still largely based on human judgment, leading to a high error rate and significant deficiencies in the precision and stability of fermentation process control.

[0004] Therefore, there is an urgent need to develop a method and system for fermenting traditional Chinese medicine to solve the problems in the existing technology. Summary of the Invention

[0005] The purpose of this invention is to provide a method and system for fermenting traditional Chinese medicine. By analyzing real-time fermentation data through a multimodal large model, fermentation quality scores and parameter adjustment suggestions can be obtained quickly and accurately. Based on the fermentation quality scores and parameter adjustment suggestions, the fermentation process of traditional Chinese medicine can be adjusted in real time, solving the problems of low accuracy in predicting the quality of fermented traditional Chinese medicine and low content of effective components after fermentation.

[0006] To solve the above-mentioned technical problems, the specific technical solution of the present invention is as follows:

[0007] A method for fermenting traditional Chinese medicine includes the following steps:

[0008] Acquire real-time fermentation data; wherein, the real-time fermentation data includes sensor time-series data, microbial image data, and process text data;

[0009] By analyzing real-time fermentation data using a multimodal large model, fermentation quality scores and parameter adjustment suggestions are obtained.

[0010] Based on the fermentation quality score and parameter adjustment suggestions, the fermentation process of traditional Chinese medicine in the fermenter was adjusted.

[0011] Furthermore, the analysis of real-time fermentation data using a multimodal large model includes the following steps:

[0012] The real-time fermentation data is numerically encoded, visually encoded, and textually encoded to obtain encoded feature data; wherein, the encoded feature data includes temporal feature vectors, image feature matrices, and textual semantic vectors;

[0013] The attention mechanism is used to calculate the feature association weights of the encoded feature data, and the multimodal feature tensor is output based on the feature association weights.

[0014] By combining a tree-structured algorithm with knowledge rules in the fermentation field, multimodal feature tensors are inferred to obtain intermediate inference results; wherein, the intermediate inference results include the current fermentation quality status and parameter optimization direction;

[0015] The intermediate inference results were transformed into fermentation quality scores and parameter adjustment suggestions.

[0016] Furthermore, the multimodal large model includes the Qwen model and the Vision Transformer model;

[0017] The visual encoding is based on the Vision Transformer model; the text encoding is based on the Qwen model.

[0018] The tree structure algorithm is a decision tree algorithm, and the fermentation domain knowledge rules are fermentation domain knowledge graphs.

[0019] Furthermore, the multimodal large model includes the LLaMA model and the Swing Transformer model;

[0020] The visual encoding is based on the Swing Transformer model; the text encoding is based on the LLaMA model.

[0021] The attention mechanism is a cross-attention mechanism; the feature association weights are fine-grained associations between features of different modalities.

[0022] The tree structure algorithm is the random forest algorithm, and the fermentation domain knowledge rules are the fermentation domain rule base.

[0023] Furthermore, before outputting the fermentation quality score, the following steps are also included:

[0024] Compare whether the text semantic vectors extracted by the LLaMA model match the image feature matrix extracted by the Swing Transformer model.

[0025] Furthermore, the training of the multimodal large model includes the following steps:

[0026] Multiple batches of fermentation data of Chinese medicinal materials were collected; each batch of fermentation data included sensor time-series data, microbial image data, process text data, and the final detection results of effective ingredient content.

[0027] Clean up multiple batches of fermentation data;

[0028] Based on the final results of the effective ingredient content test, a fermentation quality score is marked for each batch of fermentation data;

[0029] The fermentation data from multiple batches were divided into training set, validation set, and test set;

[0030] Train a multimodal large model using the training set, validation set, and test set.

[0031] Furthermore, after acquiring real-time fermentation data, it also includes:

[0032] Preprocessing is performed on sensor time-series data, microbial image data, and process text data;

[0033] The preprocessing includes the following steps:

[0034] Remove outliers from the data;

[0035] Fill in missing values ​​in the data.

[0036] A traditional Chinese medicine fermentation system includes a computer device, the computer device including a memory, a processor and a computer program stored in the memory, the processor executing the computer program to implement the steps of the method.

[0037] Furthermore, it also includes:

[0038] Fermentation tank;

[0039] The Internet of Things (IoT) sensor is connected to the fermenter and communicates with a computer device to acquire sensor time-series data.

[0040] An optical detection module, which communicates with a computer device, is used to acquire microbial image data;

[0041] The temperature control system, located outside the fermentation tank and connected to a computer device, is used to regulate the fermentation temperature.

[0042] The pH adjustment system is connected to the fermenter and communicates with a computer device to adjust the fermentation pH.

[0043] The stirring system, located inside the fermentation tank, is connected to a computer device to adjust the stirring speed.

[0044] A computer program product includes a computer program that, when executed by a processor, implements the steps of the method.

[0045] The present invention has the following advantages:

[0046] This application uses a multimodal large model to analyze real-time fermentation data, which can quickly and accurately obtain fermentation quality scores and parameter adjustment suggestions. Based on the fermentation quality scores and parameter adjustment suggestions, the fermentation process of traditional Chinese medicine can be adjusted in real time, solving the problems of low accuracy in predicting the fermentation quality of traditional Chinese medicine and low content of effective components after fermentation.

[0047] Among them, the large-scale model combining the Qwen model and the Vision Transformer model in this application, compared with the Qwen model alone, achieved a prediction accuracy of 95.2% for the fermentation quality prediction task of five kinds of Chinese medicinal materials, while the Qwen model achieved 82.6%, representing an improvement of 12.6 percentage points in accuracy. Compared with traditional fermentation control methods, the content of effective components in Nardostachys jatamansi fermentation increased by 30%, and the fermentation cycle of Cinnamomum cassia was shortened by 20%; compared with the fermentation control method using the Qwen model, the content of effective components in Nardostachys jatamansi fermentation increased by 12%, and the fermentation cycle of Cinnamomum cassia was shortened by 5%.

[0048] The large model combining the LLaMA model and the Swin Transformer model in this application, compared with the large model combining the Qwen model and the Vision Transformer model, shows a 25% improvement in inference speed, from 100ms to 75ms, and a 1.2 percentage point reduction in the quality score error rate, from 2.5% to 1.3%.

[0049] Other features and advantages of the present invention will be disclosed in detail in the following detailed description and accompanying drawings. Attached Figure Description

[0050] Figure 1 This is a schematic diagram of the overall process of the present invention;

[0051] Figure 2 This is a schematic diagram of the structure of the data processing layer, model inference layer, and application service layer of the present invention;

[0052] Figure 3 This is a schematic diagram showing the interface of this application. Detailed Implementation

[0053] To better understand the purpose, structure, and function of this invention, the invention will be described in further detail below with reference to the accompanying drawings.

[0054] Example 1

[0055] A method for fermenting traditional Chinese medicine, such as Figure 1 As shown, it includes the following steps:

[0056] Acquire real-time fermentation data; wherein, the real-time fermentation data includes sensor time-series data, microbial image data, and process text data;

[0057] By analyzing real-time fermentation data using a multimodal large model, fermentation quality scores and parameter adjustment suggestions are obtained.

[0058] Based on the fermentation quality score and parameter adjustment suggestions, the fermentation process of traditional Chinese medicine in the fermenter was adjusted.

[0059] In this embodiment, the sensor time-series data includes temperature, pH, aeration rate, etc., which are collected by the sensor according to experience and needs, once per minute; the microbial image data is acquired by the CCD camera at the optical detection port of the fermenter; the process text data includes the types of Chinese medicinal materials and historical fermentation process parameter documents.

[0060] The multimodal large model includes an encoding layer, a fusion layer, an inference layer, and an output layer; the analysis of real-time fermentation data using the multimodal large model includes the following steps:

[0061] S1: The coding layer performs numerical coding, visual coding, and text coding on the real-time fermentation data to obtain coded feature data; wherein, the sensor time-series data, microbial image data, and process text data are respectively numerically coded, visually coded, and text-coded to obtain standardized time-series feature vectors, image feature matrices, and text semantic vectors.

[0062] S2: The fusion layer calculates the feature association weights of the encoded feature data through an attention mechanism, and outputs a multimodal feature tensor based on the feature association weights;

[0063] S3: The inference layer uses a tree structure algorithm combined with fermentation domain knowledge rules to infer multimodal feature tensors to obtain intermediate inference results; wherein, the intermediate inference results include the current fermentation quality status and parameter optimization direction;

[0064] S4: The output layer transforms intermediate inference results into fermentation quality scores and parameter adjustment suggestions.

[0065] Specifically, the multimodal large model includes the Qwen model and the Vision Transformer model.

[0066] S1 includes the following steps:

[0067] S11: Numerical encoding: Standardize the sensor time series data and output a standardized time series feature vector; in this embodiment, the data is mapped to the [0,1] interval to eliminate the influence of dimensions.

[0068] S12: Visual Encoding: Based on the Vision Transformer model, the microbial image data is segmented and embedded to extract the number and morphological features of microorganisms in the image and output the image feature matrix.

[0069] S13: Text Encoding: Based on the Qwen model, the process text data is segmented and semantically encoded to extract key information on the characteristics of Chinese medicinal materials and historical processes, such as the differentiated attributes of nardostachys and cinnamon, and output text semantic vectors.

[0070] The key information on historical processes includes the processing methods used for various types of Chinese medicinal materials in history, as well as the resulting data.

[0071] In this embodiment, a database of Chinese medicinal herb characteristics is constructed. A dedicated database of characteristics for each Chinese medicinal herb is pre-established, recording the optimal fermentation environment range, microbial preferences, and sensitive parameters for active ingredients for each herb. The optimal fermentation environment range includes suitable temperatures for Nardostachys jatamansi (28℃-32℃, pH 5.8-6.2) and Cinnamomum cassia (32℃-38℃, pH 6.5-7.0), etc. Microbial preferences include the requirement for dominant bacteria "yeast" for Nardostachys jatamansi fermentation and "lactic acid bacteria" for Cinnamomum cassia fermentation, etc. Sensitive parameters for active ingredients include the sensitivity of ginsenoside synthesis to aeration rate, which needs to be controlled within 0.7 vvm-0.9 vvm, etc.

[0072] S2 includes the following steps:

[0073] An attention mechanism is used to calculate the association weights of three types of encoded feature data, and a multimodal feature tensor is output based on the feature association weights; wherein, the association weights include the degree of association between temperature time series features and microbial image features.

[0074] The association weight is the contribution of each type of encoded feature; the higher the contribution, the greater the weight.

[0075] S3 includes the following steps:

[0076] By combining a knowledge graph in the fermentation field with a decision tree algorithm, multimodal feature tensors are analyzed to infer the current fermentation quality status and parameter optimization direction, and intermediate inference results are output. The fermentation field knowledge graph includes the optimal parameter range for traditional Chinese medicine fermentation and association rules between microbial activity and environmental parameters. The fermentation field knowledge graph is automatically extracted using knowledge graph extraction software, which is existing technology and will not be elaborated upon in this application.

[0077] S4 includes the following steps:

[0078] The results of the inference layer are transformed into intuitive information—fermentation quality score, process optimization suggestions, and anomaly diagnosis report; in this embodiment, the fermentation quality score is out of 100 points and is calculated based on indicators such as effective ingredient content and microbial activity.

[0079] In this embodiment, the process optimization suggestions include slightly adjusting the cinnamon fermentation temperature from 35℃ to 36℃. The anomaly diagnosis report, such as indicating a pH abnormality, will suggest "possibly due to a faulty acid / alkali addition pump." In case of an anomaly, an alarm will be triggered, and the system will immediately shut down if the temperature exceeds 40℃.

[0080] The fermentation quality score is calculated using the following formula:

[0081] S=α×S EC +β×S MA +γ×S EP ;

[0082] in, For the final fermentation quality score, To score the content of active ingredients, To score microbial activity, Assign a score to the stability of environmental parameters; These are the weighting coefficients. In this embodiment, , , The formula can be adjusted according to the type of Chinese medicinal material; for example, it can be set for Chinese medicinal materials that are dependent on microorganisms. .

[0083] The score for the content of active ingredients is calculated based on the results of high-performance liquid chromatography (HPLC) combined with standard values ​​from the database of Chinese medicinal materials characteristics.

[0084] ;

[0085] in, The measured content of active ingredients in the current fermentation batch is expressed in mg / g, such as the active ingredient "narisin" in spikenard. The standard content of the effective components of the fermented Chinese medicinal material is obtained from the Chinese medicinal material characteristics database. For example, the standard value of Nardostachys jatamansi is 1.2 mg / g. If the measured value exceeds the standard value, it is counted as 100 points to avoid excessive pursuit of high content leading to imbalance of other indicators.

[0086] The microbial activity score is a composite score based on three indicators: the number of microorganisms, morphological integrity, and the proportion of dominant bacteria. The specific formula is as follows:

[0087] S MA =0.4×S MN +0.3×S MF +0.3×S MD ;

[0088] Among them, S MA S represents the score for microbial activity; MN Score for the number of microorganisms; S MF Score for microbial morphological integrity; MD The score is based on the percentage of dominant bacteria.

[0089] The microbial count score is calculated using the following formula:

[0090] ;

[0091] in, Current microbial concentration, unit: CFU / mL, obtained by image counting method; The optimal microbial concentration for fermenting this Chinese medicinal material, such as the optimal concentration of Nardostachys jatamansi fermentation yeast, is... CFU / mL.

[0092] Microbial morphological integrity score is calculated using the following formula:

[0093] ;

[0094] in, The number of morphologically normal microorganisms (without rupture or distortion); The total number of observed microorganisms is obtained from image features extracted based on the Vision Transformer model.

[0095] The percentage of dominant bacteria is calculated using the following formula:

[0096] ;

[0097] in, This represents the percentage of dominant bacteria in the current fermentation system. This refers to the minimum standard percentage of dominant bacteria, such as ≥80%, derived from knowledge and rules in the fermentation field. Dominant bacteria include yeast (e.g., *Nardostachys jatamansi*) and lactic acid bacteria (e.g., *Lactobacillus cinnamon*).

[0098] The environmental parameter stability score is calculated using the following formula:

[0099] ;

[0100] in, Number of key environmental parameters (default value is 3: temperature, pH, ventilation rate); This is the real-time monitoring value of the i-th parameter (e.g., temperature 35℃). The optimal value for the i-th parameter (e.g., the optimal temperature for cinnamon is 36℃). This represents the upper limit of allowable fluctuation for the i-th parameter (e.g., temperature ±2℃, pH ±0.3). The maximum penalty for fluctuation of a single parameter is 20 points, with a total penalty not exceeding 100 points. If a parameter exceeds the safety threshold (e.g., temperature >40℃), it is directly judged as... This triggered an alarm and caused the system to shut down.

[0101] In this embodiment, the scoring range is limited to 0-100 points. If any key indicator exceeds the safety threshold (e.g., temperature > 40℃, pH < 5.0 or > 8.0), the score is directly determined to be 0, triggering an alarm and shutdown; if the content of the effective ingredient is less than 60% of the standard value ( ), The final score shall not exceed 50 points; the microbial morphological integrity rate shall be less than 60% or the proportion of dominant bacteria shall be less than 50%. The final score shall not exceed 70 points.

[0102] This application obtains a fermentation quality score by comprehensively considering the content of effective ingredients, microbial activity, and environmental parameter stability. This score helps to adjust the fermentation process of traditional Chinese medicine in the fermenter and reduce ineffective adjustments.

[0103] In this embodiment, the process optimization suggestions are strictly limited to the optimal fermentation environment range for the medicinal material. For example, during the fermentation of Nardostachys jatamansi, even if the temperature is detected to be slightly low, the adjustment range is recommended not to exceed 28-32℃.

[0104] The aforementioned adjustment of the traditional Chinese medicine fermentation process in the fermenter based on fermentation quality scores and parameter adjustment suggestions includes:

[0105] Based on the fermentation quality score and parameter adjustment suggestions, the hardware modules of the fermentation tank are precisely adjusted. For example, no adjustment is needed when the fermentation quality score is greater than 90, while adjustment is made according to the parameter adjustment suggestions when it is less than 90. Regarding temperature parameters, a jacketed cooling system stabilizes the temperature at 28-32℃ during Nardostachys jatamansi fermentation, while an electric heating rod maintains the temperature at 32-38℃ during cinnamon fermentation. Regarding stirring speed, it is controlled at 150-200 rpm during ginseng fermentation and 250-300 rpm during clove fermentation. Sensors monitor the adjustment effect in real time, and the data is fed back to the model for secondary optimization, forming a closed-loop control system. Through this method, the effective component content of Nardostachys jatamansi increased by 28%, and the effective component content of cinnamon increased by 25%, both significantly higher than the improvement effect of traditional fixed-parameter fermentation.

[0106] The training of the multimodal large model includes the following steps:

[0107] Fermentation data from multiple batches of Chinese medicinal herbs were collected. Each batch of fermentation data included sensor time-series data, microbial image data, process text data, and the final effective component content detection results. In this embodiment, 300 batches each of Nardostachys jatamansi, Kaempferia galanga, Syzygium aromaticum, Ginseng, and Cinnamomum cassia were collected.

[0108] Multiple batches of fermentation data were cleaned to remove abnormal sensor data, blurry microbial images, and invalid text, ultimately retaining 1350 batches of valid data. Among them, abnormal sensor data included data with sudden temperature rises or drops exceeding 5°C, blurry microbial images included data with a clarity of less than 80%, and invalid text included blank process documents.

[0109] Based on the content of effective components in Chinese medicinal materials detected by high performance liquid chromatography (HPLC), a quality score is marked for each batch of data; in this example, an effective component content of ≥90% corresponds to 90-100 points, 80%-90% corresponds to 80-89 points, and so on.

[0110] The fermentation data from multiple batches were divided into a training set, a validation set, and a test set; in this embodiment, the training set consisted of 945 batches, the validation set of 270 batches, and the test set of 135 batches.

[0111] A multimodal large model is trained using training, validation, and test sets. In this embodiment, the training optimizer is AdamW, with an initial learning rate of 1e-4, which decays to 0.8 times the previous rate every 5 epochs. The batch size is 32, and the number of training epochs is 50. Training stops when the validation set loss does not decrease for 5 consecutive epochs. The regularization method is Dropout to prevent overfitting with a probability of 0.2, and L2 regularization is used with a weight decay coefficient of 1e-5.

[0112] In this embodiment, the fermentation quality score output step further includes the following:

[0113] The error correction module fine-tunes the predicted quality score by combining the historical prediction error of the test set, and finally outputs an accurate quality score.

[0114] Optionally, the error correction module can correct the error using the mean or the weighted mean.

[0115] Specifically, the error correction through mean correction is as follows:

[0116] Calculate the average error value of similar batches, and subtract this average error from the current predicted score to offset systematic bias.

[0117] The formula is: Corrected score = Current predicted score - Average of similar batches.

[0118] Error example: The average error of 20 similar batches = (predicted 90 - actual 92) + (predicted 88 - actual 90) + ... + (predicted 93 - actual 94) / 20 = -1.2 points. This indicates that the predictions are generally too low.

[0119] If the current predicted score is 91, the corrected score will be 91 - (-1.2) = 92.2 (close to the actual score of 92 in the document).

[0120] For example, if the predicted quality score of a ginseng fermentation batch is 91 points, the corrected score is 91 - (-1.2) = 92.2 points. In this embodiment, the average error of historical predictions is ≤2 points.

[0121] The weighted mean correction error is determined by assigning higher weights to batches that are more closely related to the features in the current batch among similar batches.

[0122] The formula is: Corrected score = Current predicted score - Σ (Similar batch error × Batch weight).

[0123] In this embodiment, the input data is obtained in the following way:

[0124] (1) Sensor time series data: The data is collected in real time by IoT devices such as temperature sensor, pH sensor, and dissolved oxygen sensor connected through the fermenter sensor interface. The data is transmitted to the data acquisition layer via WiFi 6+LoRaWAN or 5G NR protocol.

[0125] (2) Microbial image data: The optical detection port of the fermenter is equipped with a 2-megapixel CCD camera, which takes a microbial image every 5 minutes. The image resolution is 1920×1080. During the shooting, LED supplementary lighting is used to ensure consistent image brightness. The image data is compressed and then transmitted to the data acquisition layer.

[0126] (3) Process text data: The user enters the data through the system backend, including the name of Chinese medicinal materials, place of origin, initial moisture content, parameters of historical successful fermentation cases, etc. At the same time, the system automatically captures the parameter adjustment time, alarm records and other operation records during the fermentation process to form a complete process text library.

[0127] In summary, the large model in this embodiment has the following beneficial effects:

[0128] (1) Integrate the knowledge graph of Chinese medicine fermentation into the reasoning layer, and supplement the fermentation characteristics rules of different Chinese medicinal materials such as nardostachys chinensis requiring low temperature and cinnamon requiring medium and high temperature, so as to solve the problem of insufficient knowledge of fermentation in the general large model.

[0129] (2) Based on the fermentation data of five kinds of Chinese medicinal materials, the initial weights of each modal feature in the attention mechanism were adjusted to enhance the attention to key fermentation indicators; for example, the weight of microbial image features was increased to 0.4, the weight of sensor data was 0.3, and the weight of text data was 0.3.

[0130] Compared with using only the Qwen model, in the task of predicting the fermentation quality of five kinds of Chinese medicinal materials, the prediction accuracy of the model in this application was 95.2%, while that of the Qwen model was 82.6%, representing an improvement of 12.6 percentage points. Compared with traditional fermentation control methods, the content of effective components in Nardostachys jatamansi fermentation increased by 30%, and the fermentation cycle of Cinnamomum cassia was shortened by 20%; compared with the fermentation control method using the Qwen model, the content of effective components in Nardostachys jatamansi fermentation increased by 12%, and the fermentation cycle of Cinnamomum cassia was shortened by 5%.

[0131] (3) This application identifies the types of Chinese medicinal materials through text encoding, calls the characteristic data of the corresponding Chinese medicinal materials, and assigns higher weights to features related to the sensitive parameters of fermented Chinese medicinal materials according to the attention mechanism, so as to realize the personalized adaptation of the large model to different Chinese medicinal materials, so as to realize the customization of exclusive fermentation parameters for Chinese medicinal materials, and increase the content of effective ingredients by 20%-30%.

[0132] A traditional Chinese medicine fermentation system, comprising:

[0133] A computer device, the computer device including a memory, a processor and a computer program stored in the memory, the processor executing the computer program to implement the steps of the method;

[0134] Fermentation tank;

[0135] The Internet of Things (IoT) sensor is connected to the fermenter and communicates with a computer device to acquire sensor time-series data.

[0136] An optical detection module, which communicates with a computer device, is used to acquire microbial image data;

[0137] The temperature control system, located outside the fermentation tank and connected to a computer device, is used to regulate the fermentation temperature.

[0138] The pH adjustment system is connected to the fermenter and communicates with a computer device to adjust the fermentation pH.

[0139] The stirring system, installed inside the fermentation tank, is connected to a computer device for adjusting the stirring speed;

[0140] The data transmission module is used to transmit data and supports WiFi 6+LoRaWAN / 5G NR protocols.

[0141] In this embodiment, the fermentation tank includes a 50L or 316L stainless steel tank body, which has corrosion resistance and high temperature resistance; its interfaces include: a feed port for adding Chinese medicinal materials and fermentation inoculum; a discharge port for discharging the fermented Chinese medicinal product; a sampling port for manual sampling of fermentation samples; a sensor interface for connecting temperature, pH and other sensors; and an optical detection port for providing a shooting channel for a CCD camera, with a built-in LED supplementary lighting device.

[0142] The IoT sensors include: a temperature sensor with an accuracy of ±0.5℃; a pH sensor with an accuracy of ±0.1pH; and a dissolved oxygen sensor with a measurement range of 0-20mg / L and an accuracy of ±0.1mg / L.

[0143] The optical detection module includes a CCD camera for capturing images of microbial morphology.

[0144] The temperature control system includes: an electric heating rod for heating; and a jacketed cooling device for cooling, together maintaining a temperature accuracy of ±0.5℃.

[0145] The pH adjustment system includes: an online pH electrode for real-time pH detection; and an acid / base addition pump for adding acid / base solutions based on the detection results to maintain pH accuracy of ±0.1.

[0146] The stirring system includes a three-bladed propeller with a stirring speed of 50 rpm to 500 rpm, which can be adjusted as needed.

[0147] In this embodiment, microbial detection is performed using fluorescence detection combined with bright-field imaging; optionally, a Raman spectroscopy detection module can be added to improve the accuracy of microbial species identification. Raman spectroscopy can identify the molecular structure of microorganisms and further distinguish between similar-shaped microorganisms such as yeast and lactic acid bacteria. It is suitable for fermentation scenarios with strict requirements on the types of microorganisms, such as ginseng fermentation where the proportion of yeast needs to be precisely controlled.

[0148] A large-scale fermentation model for traditional Chinese medicine includes:

[0149] The data processing layer includes: a preprocessing module, responsible for data cleaning; a feature extraction module, which extracts time-series, image, and text features; and a data fusion module, which fuses multimodal data.

[0150] The model inference layer includes: a multimodal fermentation large model, supporting Qwen+Vision Transformer / LLaMA 3+Swin Transformer; an inference engine for fast analysis; and an interpretability module for calculating SHAP values ​​and attention maps.

[0151] The application service layer includes: a quality control module to monitor fermentation quality; a process optimization module to generate parameter adjustment suggestions; and a decision support module to provide anomaly handling solutions.

[0152] The layers are connected through data interfaces to achieve unidirectional data flow: data processing layer → model inference layer → application service layer.

[0153] In this embodiment, all data is stored in InfluxDB, supporting process retrospective and optimization.

[0154] A computer program product includes a computer program that, when executed by a processor, implements the steps of the method.

[0155] Example 2

[0156] The difference between this embodiment and Embodiment 1 is that the multimodal large model includes the LLaMA model and the SwingTransformer model;

[0157] The visual encoding is based on the Swing Transformer model; the text encoding is based on the LLaMA model.

[0158] The attention mechanism is a cross-attention mechanism; the feature association weights are fine-grained associations between features of different modalities.

[0159] The tree structure algorithm is the random forest algorithm, and the fermentation domain knowledge rules are the fermentation domain rule base.

[0160] The multimodal large model includes: an encoding layer, a fusion layer, an inference layer, and an output layer; the analysis of real-time fermentation data using the multimodal large model includes the following steps:

[0161] S1: The coding layer performs numerical coding, visual coding, and text coding on the real-time fermentation data to obtain coded feature data; wherein, the sensor time-series data, microbial image data, and process text data are respectively numerically coded, visually coded, and text-coded to obtain standardized time-series feature vectors, image feature matrices, and text semantic vectors.

[0162] S2: The fusion layer calculates the feature association weights of the encoded feature data through an attention mechanism, and outputs a multimodal feature tensor based on the feature association weights;

[0163] S3: The inference layer uses a tree structure algorithm combined with fermentation domain knowledge rules to infer multimodal feature tensors to obtain intermediate inference results; wherein, the intermediate inference results include the current fermentation quality status and parameter optimization direction;

[0164] S4: The output layer transforms intermediate inference results into fermentation quality scores and parameter adjustment suggestions.

[0165] S1 includes the following steps:

[0166] S11: Numerical encoding: Standardize the sensor time series data and output a standardized time series feature vector; in this embodiment, the data is mapped to the [0,1] interval to eliminate the influence of dimensions.

[0167] S12: Visual Encoding: Based on the Swing Transformer model, a window attention mechanism is used to perform hierarchical processing on microbial images. Local microbial features are extracted first, and then global features are fused to output the image feature matrix.

[0168] Local microbial characteristics refer to the size of a single microorganism, while global characteristics refer to the distribution density of microorganisms.

[0169] S13: Text Encoding: Based on the LLaMA 3 model, semantic understanding is performed on the process text data, focusing on extracting information such as the metabolic characteristics of Chinese medicinal materials and fermentation contraindications, and outputting text semantic vectors.

[0170] S2 includes the following steps:

[0171] A cross-attention mechanism is used to calculate fine-grained correlations between different modal features, and multimodal feature tensors are output based on these fine-grained correlations.

[0172] The fine-grained correlation between different modal features specifically refers to the correspondence between a certain temperature range and a specific microbial morphology.

[0173] S3 includes the following steps:

[0174] By combining a rule base in the fermentation field with a random forest algorithm, the multimodal feature tensor is analyzed to infer the current fermentation quality status and parameter optimization direction, and intermediate inference results are output.

[0175] The fermentation rule base includes rules such as "the pH value of ginseng fermentation needs to be maintained at 6.0-6.5".

[0176] S4 includes the following steps:

[0177] Transform the results of the inference layer into intuitive information—fermentation quality scores, process optimization suggestions, and anomaly diagnosis reports.

[0178] During model training, the following parameters were used: Training optimizer: SGD optimizer was used, with an initial learning rate of 2e-4, which decayed to 0.75 times the previous learning rate every 5 epochs; Training batch size: 64; Number of training epochs: 40, and training was stopped when the validation set loss did not decrease for 5 consecutive epochs; Regularization method: L1 regularization was used, with a weight decay coefficient of 5e-6, combined with an early stopping strategy.

[0179] In this embodiment, before outputting the fermentation quality score, the following is also included:

[0180] The text semantic vectors extracted by the LLaMA model are compared with the image feature matrix extracted by the Swing Transformer model to see if they match. If the verification is successful, the final quality score is output to further reduce the error.

[0181] The matching of the text semantic vector with the image feature matrix includes whether the text annotation "Gansong" is consistent with the morphology of Gansong fermentation microorganisms in the image.

[0182] This embodiment has the following beneficial effects:

[0183] (1) Visual encoding optimization: Compared with the traditional VisionTransformer, the window attention mechanism of Swing Transformer reduces the amount of computation by about 30%; at the same time, it improves the accuracy of local feature extraction.

[0184] (2) Text encoding adaptation: In view of the characteristics of LLaMA 3 in Chinese text processing, the word segmentation dictionary can be optimized and special words for Chinese medicinal materials such as "Gansong" and "Shannai" can be added to improve the accuracy of text semantic extraction;

[0185] (3) This embodiment maintains the multimodal fusion logic and inference accuracy unchanged, both >95%; the inference speed is improved by 25%, shortening from 100ms to 75ms; it is suitable for fermentation scenarios with high real-time requirements; the quality scoring error rate is reduced by 1.2 percentage points. Furthermore, the computational cost is reduced by 30%; annual cost savings of RMB 1.45 million are achieved for labor, energy consumption, and waste losses, while production increases by 20%–30%, and product added value increases by 15%–25%.

[0186] Example 3

[0187] The difference between this embodiment and Embodiment 1 or Embodiment 2 is that the model inference layer further includes: an interpretability module for calculating SHAP values ​​and attention maps; and the application service layer further includes: an interpretable interface for clarifying the decision-making basis.

[0188] like Figure 3 As shown, the explanatory interface uses a bar chart to display the influence weights of parameters such as temperature, pH, and ventilation rate; it uses a flowchart to show the decision logic of "quality score 90-100 points → continue current process; 80-89 points → fine-tune ventilation rate; <80 points → stop and check"; it uses a line graph to show the 95% confidence interval of the model prediction results, reflecting the reliability of the prediction; it uses a curve to show the parameter deviation from the warning line, such as triggering a red warning when the temperature exceeds 40℃; and the interface supports mouse hover to view detailed data, helping staff understand the basis of the model's decision-making.

[0189] In summary, the interpretability module and interpretability interface address the problem of lack of basis for quality control decisions, provide interpretable analysis, and clarify the contribution of key characteristics to fermentation quality.

[0190] It is understood that the present invention has been described through some embodiments, and those skilled in the art will recognize that various changes or equivalent substitutions can be made to these features and embodiments without departing from the spirit and scope of the invention. Furthermore, under the teachings of the present invention, these features and embodiments can be modified to adapt to specific situations and materials without departing from the spirit and scope of the invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the protection scope of the present invention.

[0191] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. A method for fermenting traditional Chinese medicine, characterized in that, Includes the following steps: Acquire real-time fermentation data; wherein, the real-time fermentation data includes sensor time-series data, microbial image data, and process text data; By analyzing real-time fermentation data using a multimodal large model, fermentation quality scores and parameter adjustment suggestions are obtained. Based on the fermentation quality score and parameter adjustment suggestions, the fermentation process of traditional Chinese medicine in the fermenter was adjusted.

2. The method for fermenting traditional Chinese medicine according to claim 1, characterized in that, The analysis of real-time fermentation data using a multimodal large model includes the following steps: The real-time fermentation data is numerically encoded, visually encoded, and textually encoded to obtain encoded feature data; wherein, the encoded feature data includes temporal feature vectors, image feature matrices, and textual semantic vectors; The attention mechanism is used to calculate the feature association weights of the encoded feature data, and the multimodal feature tensor is output based on the feature association weights. By combining a tree structure algorithm with knowledge rules in the fermentation field, multimodal feature tensors are inferred to obtain intermediate inference results; wherein, the intermediate inference results include the current fermentation quality status and parameter optimization direction; The intermediate inference results were transformed into fermentation quality scores and parameter adjustment suggestions.

3. The method for fermenting traditional Chinese medicine according to claim 2, characterized in that, The multimodal large model includes the Qwen model and the Vision Transformer model; The visual encoding is based on the Vision Transformer model; the text encoding is based on the Qwen model. The tree structure algorithm is a decision tree algorithm, and the fermentation domain knowledge rules are fermentation domain knowledge graphs.

4. The method for fermenting traditional Chinese medicine according to claim 2, characterized in that, The multimodal large model includes the LLaMA model and the Swing Transformer model; The visual encoding is based on the Swing Transformer model; the text encoding is based on the LLaMA model. The attention mechanism is a cross-attention mechanism; the feature association weights are fine-grained associations between features of different modalities. The tree structure algorithm is the random forest algorithm, and the fermentation domain knowledge rules are the fermentation domain rule base.

5. The traditional Chinese medicine fermentation method according to claim 4, characterized in that, Before outputting the fermentation quality score, the following is also included: Compare whether the text semantic vectors extracted by the LLaMA model match the image feature matrix extracted by the Swing Transformer model.

6. The method for fermenting traditional Chinese medicine according to any one of claims 3-5, characterized in that, The training of the multimodal large model includes the following steps: Multiple batches of fermentation data of Chinese medicinal materials were collected; each batch of fermentation data included sensor time-series data, microbial image data, process text data, and the final detection results of effective ingredient content. Clean up multiple batches of fermentation data; Based on the final results of the effective ingredient content test, a fermentation quality score is marked for each batch of fermentation data; The fermentation data from multiple batches were divided into training set, validation set, and test set; Train a multimodal large model using the training set, validation set, and test set.

7. The method for fermenting traditional Chinese medicine according to claim 6, characterized in that, After obtaining real-time fermentation data, it also includes: Preprocessing is performed on sensor time-series data, microbial image data, and process text data; The preprocessing includes the following steps: Remove outliers from the data; Fill in missing values ​​in the data.

8. A traditional Chinese medicine fermentation system, comprising a computer device, said computer device including a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-7.

9. The traditional Chinese medicine fermentation system according to claim 8, characterized in that, Also includes: Fermentation tank; The Internet of Things (IoT) sensor is connected to the fermenter and communicates with a computer device to acquire sensor time-series data. An optical detection module, which communicates with a computer device, is used to acquire microbial image data; The temperature control system, located outside the fermentation tank and connected to a computer device, is used to regulate the fermentation temperature. The pH adjustment system is connected to the fermenter and communicates with a computer device to adjust the fermentation pH. The stirring system, located inside the fermentation tank, is connected to a computer device to adjust the stirring speed.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-7.