Method for predicting solid content in traditional Chinese medicine extraction process based on deep learning

By employing a deep learning-based temporal regression model in the extraction process of traditional Chinese medicine, combined with a gated recurrent unit and a feature attention mechanism, real-time prediction of solid content was achieved. This solves the problems of detection lag and insufficient robustness in existing technologies, and improves the quality monitoring and early warning capabilities.

CN121215091APending Publication Date: 2025-12-26JIANGSU OCEAN UNIV
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202511292719.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-11
Publication Date
2025-12-26

AI Technical Summary

Technical Problem

Existing technologies are insufficient for dynamic prediction of solid content under multivariate operating conditions during the extraction of traditional Chinese medicine, resulting in detection lag and insufficient robustness, and failing to reflect the impact of operating condition disturbances on quality trends in a timely manner.

Method used

A deep learning-based approach is adopted, utilizing a time-series regression model composed of a gated recurrent unit and a feature attention convergence layer. By collecting and aligning multivariate process data from the extraction stage and solid content labeling data obtained from near-infrared spectroscopy, anomaly handling, standardization, and sliding time window sample building are performed. The gated recurrent unit extracts time-dependent features, and the feature attention adaptively weights key process variables on the output side to achieve real-time prediction.

Benefits of technology

It enables forward-looking and real-time prediction of solid content in the extraction process, improves batch-to-batch consistency monitoring and quality risk early warning capabilities, reduces quality risks caused by detection lag, and enhances robustness and generalization ability under complex working conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121215091A_ABST
    Figure CN121215091A_ABST
Patent Text Reader

Abstract

The invention discloses a method for predicting solid content in a traditional Chinese medicine extraction process based on deep learning, which comprises the following steps of: collecting multiple variables such as ethyl acetate temperature, total liquid inlet flow velocity, total liquid inlet flow accumulation, total gate valve opening and the like in an extraction section, and synchronously aligning with the solid content obtained by near infrared spectrum conversion; performing exception handling, standardization and sliding time window sample establishment; constructing a'stacked GRU + feature attention + regression layer 'model, adopting gradient descent end-to-end training, and performing verification selection by using RMSE, R2 and MAPE; and after online, inputting by using a minute-level window to realize online and real-time prediction of the solid content. According to the method, an existing device does not need to be transformed, the prediction precision and robustness under complex working conditions are improved, and support is provided for extraction quality trend interpretation and early warning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of process analysis technology, specifically to a method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning. Background Technology

[0002] As the traditional Chinese medicine industry develops towards continuous, intelligent, and highly consistent processes, quality control in the extraction stage becomes increasingly critical. Solid content (SC), as a core process quality indicator measuring the concentration and fluctuation of active ingredients in the extract, is directly related to subsequent alcohol precipitation, drying, and formulation quality. Traditional methods rely heavily on experimental chemical measurements or single-point online instrument feedback, which suffers from detection lag, insufficient response to complex multivariate conditions, and inability to predict trends in advance. In the production environment, multiple time-series variables such as temperature, flow rate, valve position, and solvent ratio interact, causing SC evolution to exhibit significant nonlinearity and time dependence. Therefore, there is an urgent need for a production process-oriented method that can integrate multivariate time-series data and achieve online prediction of SC to assist in amplifying real-time interpretation and early warning in production, reducing batch-to-batch differences and rework risks.

[0003] In the fields of pharmaceutical process analysis (PAT) and quality control, near-infrared spectroscopy (NIRS) combined with chemometric models such as partial least squares (PLS) has been widely used for rapid quantification of dry, wet, or extract samples, offering advantages such as simple sample pretreatment and fast detection speed. Meanwhile, process instruments such as refractive index, density method, and conductivity method are also used for online estimation of indicators such as "total solids" (SC), replacing or supplementing offline chemical detection. However, these technologies primarily address the issues of "measurement" and "estimation," making it difficult to dynamically predict future SC values ​​based on multivariate process data. Furthermore, traditional statistical regression or time-series networks without attention mechanisms have limited adaptive recognition capabilities for key features under complex operating conditions, are susceptible to noise and operating condition drift, resulting in insufficient generalization performance and field usability. Therefore, for "prediction-only" applications, the industry needs to introduce deep time-series modeling and feature weighting concepts into the online prediction of SC values ​​in traditional Chinese medicine extraction processes.

[0004] Chinese invention patent CN103884676B proposes a quantitative model using partial least squares regression to establish the relationship between near-infrared spectra and multiple index components (including moisture, soluble solids, etc.) of leeches and earthworms, enabling rapid determination of key quality control indicators. It emphasizes the use of the NIRS+PLS chemometric pathway for rapid measurement. Chinese utility model patent CN219915375U proposes an online detection system for total solids in traditional Chinese medicine extracts connected to an extract circulation pipeline. This system uses a detection probe and a digital refractometer to achieve real-time detection of total solids, solving the problems of time-consuming, inefficient, and inaccurate traditional offline detection methods. Chinese invention patent CN101793656B proposes a method for testing the decoction rate of traditional Chinese medicine decoctions. Through comprehensive testing of factors such as water volume, heat, temperature, and time, it calculates the extract content and evaluates the impact of the decoction process on quality, focusing on process evaluation and quality characterization. Chinese invention patent CN103505906B discloses a method for reducing the arsenic load in aqueous extracts of traditional Chinese medicine, employing a strongly alkaline anion exchange resin for arsenic removal, focusing on impurity removal and safety control. Chinese invention patent CN108295032A discloses a method for preparing traditional Chinese medicine formulation granules using resistant dextrin, expanding towards formulation processes and applicable populations, but does not involve process prediction for the extraction process (SC). Chinese invention patent CN119605939A discloses a traditional Chinese medicine compound extract plant beverage and its preparation method, describing the formula, solid content range, and preparation process, belonging to the food / beverage field. Chinese invention patent CN104435732A relates to sea cucumber soft capsules for promoting wound healing and their preparation method, focusing on the preparation and proportioning of enzymatic hydrolysate and traditional Chinese medicine composition.

[0005] As mentioned above, existing technologies either rely on chemometric models such as NIRS+PLS for rapid quantification or achieve online "readings" through single sensing methods such as refraction. Their common characteristic is a bias towards measurement and estimation rather than time-series prediction, making it difficult to accurately predict future SC values ​​using multivariate process data such as temperature, flow rate, valve position, and cumulative flow. Furthermore, they struggle to reflect the impact of operational disturbances on quality trends in a timely manner. Moreover, publicly available information lacks a technical solution that combines time-series deep networks such as GRU with feature attention mechanisms to adaptively highlight key process features and output SC prediction results under complex operating conditions. Based on this, this invention proposes a prediction-only technical approach for the traditional Chinese medicine extraction scenario: using a time series composed of multiple production variables as input, a GRU time-series network with feature attention outputs real-time predicted values ​​of SC. This allows for forward-looking interpretation of quality indicators and data-driven process visualization without altering existing online detection and process equipment, providing immediate evidence for on-site quality decisions. Summary of the Invention

[0006] To address the problems of traditional methods relying on single-point detection, difficulty in integrating multivariate operating conditions leading to inability to dynamically predict, response lag, and insufficient robustness, this invention proposes a deep learning-based method for predicting the solid content in the extraction process of traditional Chinese medicine. It employs a time-series regression model composed of gated recurrent units and a feature attention mechanism. By collecting and aligning multivariate process data from the extraction stage with solid content annotation data obtained from near-infrared spectroscopy, anomaly handling, standardization, and sliding time window sampling are completed. Time-dependent features are extracted using gated recurrent units, and key process variables are adaptively weighted on the output side by feature attention, outputting real-time predicted values ​​of solid content via a fully connected layer. During the training phase, gradient descent is used for end-to-end learning with the goal of minimizing loss, and RMSE and R-squared values ​​are used as the benchmarks. 2 Model selection and early termination are performed using MAPE; online inference is achieved during the deployment phase using the latest time window data. Through this technical approach, a forward-looking, real-time prediction of solids content in the extraction process is realized, improving the ability to monitor batch-to-batch consistency and provide early warning of quality risks. This invention discloses a deep learning-based method for predicting solids content in the extraction process of traditional Chinese medicine, comprising the following steps:

[0007] S1: Data acquisition and time alignment: Collect multivariate process data of the extraction section to form a multivariate process data time series X(t). The multivariate process data includes at least ethyl acetate temperature, total influent flow rate, cumulative total influent flow rate, and total valve opening. Obtain a solid content labeling sequence S(t) with the same time stamp as X(t) through near-infrared spectroscopy and an existing spectral-solid content mapping model. Then, align X(t) and S(t) in time to obtain paired datasets.

[0008] S2: Preprocessing and sample building: Perform outlier handling, missing value handling, denoising and numerical standardization operations on X(t) and S(t) in sequence; construct samples from X(t) with a sliding time window of fixed length L, and use S(t) at the same time as supervision label to generate training, validation and test samples respectively.

[0009] S3: Construction of the SC prediction sub-model: A temporal regression network is established with a gated recurrent unit (GRU) as the encoder and a feature attention convergence layer (FA). First, samples within the time window are input to the GRU to obtain the hidden state sequence. Then, the FA layer weights and converges the hidden state according to feature correlation to obtain the representation h*. Finally, a fully connected regression layer outputs the predicted value. The key update relationship of the GRU satisfies the following formula:

[0010] z t =σ(W z ·[h t-1 ,x t ]+b z (1)

[0011] r t =σ(W r ·[h t-1 ,x t ]+b r (2)

[0012]

[0013] Where σ represents the Sigmoid function, W z h represents the weight matrix of the updated gate. t-1 This indicates that b includes the hidden state from the previous moment. z h represents the bias vector of the update gate. t Indicates the current hidden state, W r It is the weight matrix of the reset gate, b r It is the bias vector for resetting the gate, and * indicates element-wise multiplication. Let W represent the candidate hidden state, W represent the weight matrix, b represent the bias vector, tanh represent the activation function, and z represent the weight vector. t Indicates an update to the door. Indicates the candidate hidden state;

[0014] S4: Model training and selection, minimizing the number of training samples. The difference between S(t) and the target function is used. A gradient descent-based parameter update strategy is adopted to train the time series regression network, and the hyperparameters and early stopping conditions are determined based on the performance of the validation set.

[0015] S5: Online Inference and Output: During production operation, the time-series regression network, trained with the most recent time window X(t) as input, outputs the predicted solids content value at the corresponding time. It enables online, real-time prediction of the solids content during the extraction process.

[0016] As a preferred embodiment of the present invention, step S1, data acquisition and time alignment, specifically includes:

[0017] S1-1: Establish an online data acquisition channel in the extraction section to acquire equally spaced sampling data that form a multivariate process data time series X(t). The sampling period is 1 minute, and the multivariate process data includes at least: ethyl acetate temperature, total influent flow rate, total influent flow accumulation, and total valve opening.

[0018] S1-2: Configure the near-infrared spectroscopy online monitoring unit and call the pre-established spectrum. The solid content mapping model converts the spectrum at each sampling time to obtain the solid content labeling sequence S(t) that is synchronized with X(t) and equally spaced; where S(t) is a discrete time series.

[0019] S1-3: Based on the sampling timestamps, X(t) and S(t) are registered and aligned one by one, and mismatched or missing time points are removed to form pairs of X(t) and S(t) as datasets for training, validation and testing.

[0020] As a preferred embodiment of the present invention, the feature attention convergence layer in step S3 specifically includes the following steps:

[0021] S3-1: Obtain the set of representations expanded along the feature dimension from the GRU output;

[0022] S3-2: During the training phase, the most recent model output is calculated with the target value of the solid content labeling sequence S(t) to obtain the correlation score between each feature and the target.

[0023] S3-3: Perform softmax normalization on the correlation scores to obtain the attention weights corresponding to each feature;

[0024] S3-4: The attention output is obtained by weighted summation of the representation set according to the attention weights, and the attention output is input into the regression layer to output the predicted value of solid content at the current time.

[0025] S3-5: In end-to-end training, the attention weight parameters and GRU parameters are jointly updated so that the attention weights adaptively highlight the feature representations that are more relevant to S(t).

[0026] The weighted convergence of the feature attention mechanism satisfies the following relationship:

[0027] α=σ(W f ·[h,y]) (5)

[0028]

[0029] Among them, h * The final result obtained from the calculation; α is the weight value calculated by the attention mechanism; h is the existing data; σ is the softmax function; W f Here, y is the weight matrix of the attention mechanism; y is the target value. When there are k attention mechanisms calculating weight values ​​α and k existing data points h, the corresponding i-th α and h are multiplied by a matrix, and the k results are added together to obtain the final output h. * .

[0030] As a preferred embodiment of the present invention, in step S3, the temporal regression network is composed of an input layer, stacked gated recurrent unit layers, a feature attention convergence layer and a fully connected regression layer in sequence. The number of layers m of the gated recurrent unit layers is a positive integer not less than 2, and the hidden state sequence of the nth layer is used as the input of the (n+1)th layer. The hidden state sequence of the last layer is provided to the feature attention convergence layer.

[0031] As a preferred embodiment of the present invention, in step S4, the parameter update strategy based on gradient descent is used to perform end-to-end optimization of the prediction model parameter vector θ, and the specific calculation formula is as follows:

[0032]

[0033] In the formula, x is the variable to be optimized. Let η be the loss function and η be the learning rate. Let f(x) be the gradient of the loss function with respect to the input parameters. t ) represents the current output value, y target The objective function is denoted as .

[0034] As a preferred embodiment of the present invention, in step S4, the model training and selection uses three indicators: root mean square error, coefficient of determination, and mean absolute percentage error, to construct a comprehensive evaluation system.

[0035] The calculation of the comprehensive evaluation system specifically includes the following formulas:

[0036]

[0037] Among them, y i For the i-th actual value, For the i-th predicted value, is the mean of the actual values, and n is the sample size.

[0038] Compared with the relevant prior art, the beneficial effects of the present invention are:

[0039] Oriented towards prediction rather than just measurement: Based on existing "readout-type" solutions such as near-infrared / refractive index, this method integrates multivariate process data time series X(t) from the production site to establish an online dynamic prediction capability for solid content S(t), significantly reducing the quality risks caused by detection lag.

[0040] Enhanced time-series modeling capabilities: The use of gated recurrent units (GRUs) to extract nonlinear and time-dependent features allows for better adaptation to multi-source disturbances and operating condition changes during the extraction process compared to traditional statistical regression and non-gated networks.

[0041] Feature Adaptation and Enhanced Noise Robustness: Feature Attention (FA) is introduced to adaptively weight key process variables, suppressing interference from irrelevant or weakly correlated features, thereby improving robustness and generalization ability under complex operating conditions and noise levels, resulting in lower RMSE and higher R-value. 2 And lower MAPE.

[0042] Real-time performance and low computing cost: Inference is based on a sliding time window, resulting in a short end-to-end computing link; GRU is relatively lightweight and suitable for deployment on edge or production line servers, and can be integrated with PAT and DCS / MES without modifying existing equipment.

[0043] Interpretability and maintainability: FA weights provide clues about the importance of features, making it easier for process engineers to understand the basis of model decisions, supporting model inspection, variable screening and subsequent data governance, and reducing maintenance costs. Attached Figure Description

[0044] Figure 1 A flowchart of a deep learning-based method for predicting the solid content in the extraction process of traditional Chinese medicine, provided by this invention;

[0045] Figure 2 A GRU structure diagram is provided for an embodiment of the present invention;

[0046] Figure 3 The SC prediction model structure provided for embodiments of the present invention;

[0047] Figure 4 A comparison chart of predicted and actual values ​​is provided for embodiments of the present invention. Detailed Implementation

[0048] The present invention will be further described below with reference to the accompanying drawings. However, the present invention can be implemented in many different ways and should not be construed as limited to the embodiments shown; rather, these embodiments provide those skilled in the art with implementation methods that meet applicable legal requirements.

[0049] Example 1: As Figure 1 As shown, this embodiment provides a deep learning-based method for predicting the solid content in the extraction process of traditional Chinese medicine. This method, without altering existing processes or online detection devices, achieves online, forward-looking prediction of the solid content (S(t)) during the extraction process by fusing multivariate process data from the production site with solid content calculated from near-infrared spectroscopy. The overall process is as follows: Figure 1 As shown, the process includes, in sequence, data acquisition and time alignment, preprocessing and sample building, SC prediction sub-model construction, model training and selection, and online inference and output.

[0050] S1: Data Acquisition and Time Alignment. An online data acquisition channel is established in the extraction section to acquire field data to form a multivariate process data time series X(t) using an equal-interval sampling method (preferably with a cycle of 1 minute). At least the following variables closely related to the extraction process should be collected: ethyl acetate temperature, total feed flow rate, cumulative total feed flow, and total valve opening. If necessary, other process quantities related to extraction efficiency or mass transfer (e.g., tower pressure difference, solvent reflux ratio) can be added, but this will not affect the implementation of this embodiment. A near-infrared spectroscopy (NIRS) online monitoring unit is configured synchronously, and the existing spectral-SC mapping model is called to convert the spectrum at each sampling time to obtain a solid content labeling sequence S(t) synchronized with X(t). X(t) and S(t) are registered one-to-one based on the timestamp, and mismatched and missing times are eliminated to form a paired dataset {(X(t),S(t))} that can be directly used for modeling.

[0051] S2: Preprocessing and sample building involves engineered cleaning of paired datasets: anomaly handling and missing data imputation are performed for obvious out-of-bounds values ​​and instantaneous sensor jitter; numerical standardization (e.g., z-score) is performed according to the uniformity of physical dimensions of variables and modeling needs, and gentle smoothing can be applied to high-frequency noise to avoid weakening dynamic information. In the time domain, a fixed-length window L (e.g., 30-120 sampling points, set according to the dynamic response on site) and step size s are used to construct learning samples, i.e., [X(t-L+1),…,X(t)][X(t-L+1) as input segments, paired with the supervision label S(t) at the same time; then the training set, validation set and test set are divided according to production batch or time period to ensure that the segmentation does not leak (e.g., batch hold-out method).

[0052] S3: Construction of the SC prediction sub-model, such as Figure 2 As shown, this embodiment employs a temporal coding structure centered on a gated recurrent unit (GRU); the gating relationships between the update gate, reset gate, and candidate hidden states are implemented using standard GRU units. To enhance the model's adaptive recognition capability for key process features, a feature attention (FA) convergence layer is set after the GRU. This layer performs weight calculations and weighted summations on the representation sets expanded along the feature dimensions to obtain the attention output representation h*. Finally, a fully connected regression layer outputs the predicted solids content value for the current time step. like Figure 3 As shown, the network structure from input to output is: input layer → stacked GRU layer (the number of layers m is a positive integer not less than 2) → FA layer → fully connected regression layer. The stacked GRU uses a layer-by-layer propagation method, with the hidden state sequence of the nth layer serving as the input of the (n+1)th layer, and the hidden state sequence of the last layer being provided to the FA layer for aggregation.

[0053] S4: Model training and selection employs an end-to-end supervised learning paradigm to minimize predicted values. The difference from the labeled value S(t) is used as the training objective, and parameters are updated based on gradient descent. Common engineering strategies are introduced during training to improve stability and generalization ability, such as mini-batch stochastic gradients, learning rate warm-up and piecewise decay (or cosine annealing), gradient clipping, weight decay, and Dropout. The RMSE and R² values ​​on the validation set are used as the training parameters. 2 MAPE serves as a comprehensive performance indicator and a basis for early termination: when the indicator shows no significant improvement for several consecutive rounds within a preset tolerance range, training is terminated and the best-performing weights are retained. Hyperparameters (time window L, GRU hidden state dimension, number of stacking layers, batch size, and learning rate, etc.) are determined through a validation set grid or Bayesian search; simultaneously, data standardization parameters and feature lists are versioned to ensure the reproducibility and traceability of the deployment process.

[0054] The S5 online inference and output mechanism deploys trained and validated models in a containerized or service-oriented manner on production line edge servers or data platforms. The system reads the latest multivariate data from the fieldbus / DCS at 1-minute intervals, fills in the most recent time window X[t-L+1:t], and calls the model to output the predicted solids content for the current moment. The difference between the predicted results and the most recent measured S(t) is used for process monitoring and dashboard presentation (not involving direct control of process parameters). For ease of operation and maintenance, the system provides heartbeat and drift monitoring. When the missing rate of key variables exceeds a threshold or the model health is abnormal, an alarm is triggered and a rollback strategy is executed (e.g., activating the previous stable version or temporarily disabling prediction). During the online operation period, the system can be periodically retrained to absorb new operating data, maintaining long-term model stability.

[0055] Through the above-described embodiments, the present invention can achieve online, real-time, and forward-looking prediction of the solid content in the extraction process of traditional Chinese medicine with low engineering modification costs, meet the needs of industrial sites for quality trend interpretation and anomaly early warning, and has good industrialization and promotion application value.

[0056] Example 2: This example uses real data from a company's production line to verify the effectiveness and engineering applicability of the deep learning-based method for predicting solid content in the extraction process of traditional Chinese medicine. Data was collected from March 1st to March 7th, 2024, in a traditional Chinese medicine injection extraction section, totaling 10 batches; the sampling period was 1 minute, with approximately 700-800 records per batch. The multivariate process data time series X(t) includes at least: ethyl acetate temperature, total influent flow rate, cumulative total influent flow, and total valve opening; the solid content labeling sequence S(t) was obtained by near-infrared spectroscopy (NIRS) combined with an existing spectral-SC mapping model. To rigorously evaluate cross-batch generalization performance, the training set used 8 batches of data (a total of 5433 samples), while the "validation set" and "test set" were both derived from complete and unseen batches of data (837 and 764 samples respectively), avoiding sample leakage from the source. The statistics (mean / extreme values) of the main variables are shown in Table 1.

[0057] Table 1: Sample Set Partitioning and Descriptive Statistics

[0058] Sample set variable unit Mean Max Min Sample size Ethyl acetate temperature ℃ 13.6 17.5 8.9 Total weight after distribution kg 668.7 716.5 620.9 training set Total inlet flow rate L / h 703.9 853.2 4.601 5433 Total influent flow rate L 4560.9 9643.9 0.343 Inlet main valve opening none 494.3 581.9 0 Ethyl acetate temperature ℃ 16.7 19.4 12.2 Total weight after distribution kg 742.9 742.9 742.9 Validation set Total inlet flow rate L / h 711.0 743.8 61.31 837 Total influent flow rate L 4997.4 9917.7 1.700 Inlet main valve opening none 456.1 480.8 42.72 Ethyl acetate temperature ℃ 15.2 18.0 12.6 Total weight after distribution kg 651.6 651.6 651.6 test set Total inlet flow rate L / h 704.6 799.7 60.99 764 Total influent flow rate L 4559.8 8977.6 5.012 Inlet main valve opening none 457.2 485.1 35.53

[0059] The tested model is a temporal network consisting of stacked GRU, feature attention (FA), and fully connected regression (network structure is the same as in Example 1). Figure 3 To demonstrate the advantages of the method, three control groups were set up: logistic regression (linear baseline); LSTM (classic gated temporal network); and GRU (gated network without attention). All models were trained under the same data splitting and preprocessing procedures. Validation / testing metrics included RMSE and R-squared. 2 A unified evaluation system for MAPE; using early stopping on the validation set and grid / incremental search to determine hyperparameters to ensure fair comparison.

[0060] As shown in Table 2, GRU+FA (GRU attention) achieved the best results in all three metrics: RMSE = 0.0283, R 2 =0.9959, MAPE = 2.63%; compared with GRU without attention, RMSE decreased by 0.0011 (≈3.74%), and MAPE decreased by 0.10 percentage points (≈3.66%), indicating that feature attention can adaptively highlight process features more relevant to SC under complex conditions and suppress irrelevant noise; compared with logistic regression, MAPE decreased by 0.90 percentage points (≈25.50%), and RMSE decreased by 0.0022 (≈7.21%), indicating that a single linear relationship is difficult to cover the nonlinear and time-dependent characteristics of the extraction process; compared with LSTM, the GRU series is more cost-effective and stable in this task, verifying the rationality of choosing GRU as the time encoder. From Figure 4As can be seen, the predicted point cloud is closely distributed around 45°, with no systematic bias, showing good linear consistency and residual convergence characteristics.

[0061] Table 2: Model Performance Comparison

[0062] RMSE <![CDATA[R 2 ]]> MAPE Logistic Regression 0.0305 0.9951 3.53% LSTM 0.0357 0.9936 3.47% GRU 0.0294 0.9957 2.73% GRU attention 0.0283 0.9959 2.63%

[0063] Based on the validation and testing results from the entire batch, it can be seen that the model still maintains low RMSE, low MAPE, and high R-value on the complete batches that were not used in training. 2 This demonstrates its excellent cross-batch generalization ability to handle raw material differences and minor operational drift. Specifically, the GRU is responsible for characterizing the nonlinear time dependence of X(t), while the Feature Attention (FA) adaptively highlights process quantities with higher correlation to S(t) and suppresses noise and weakly correlated variables during training, thus exhibiting a more stable residual distribution and smaller extreme errors under complex operating conditions. In terms of engineering deployment, the model inference time is significantly less than the 1-minute sampling period, making it suitable for online operation as a containerized service on edge industrial control computers or production line data platforms. It requires no modification to existing PAT and DCS / MES systems, only requiring access to real-time window data X[t-L+1:t] via a standardized interface to output predicted values. Meanwhile, both the training and deployment phases implement versioning and traceability management of data and models (including feature lists, standardized parameters and weight verification), and configure early stop, health inspection and drift monitoring. When the missing rate of key variables or health indicators exceed the threshold, alarms and rollback strategies are triggered, thereby improving the stability and maintainability of long-term operation while ensuring real-time performance.

[0064] Comparative experiments based on real production data show that the SC prediction model using GRU + feature attention significantly outperforms common methods such as logistic regression, LSTM, and pure GRU in terms of comprehensive indicators. It can provide online and forward-looking solid content prediction capabilities for the extraction process without changing the on-site equipment, supporting quality trend interpretation and early warning of anomalies, fully demonstrating the effectiveness and engineering applicability of the method of this invention.

[0065] The above embodiments merely illustrate implementation methods of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention.

Claims

1. A method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning, characterized in that: Includes the following steps: S1: Data acquisition and time alignment: Collect multivariate process data of the extraction section to form a multivariate process data time series X(t). The multivariate process data includes at least ethyl acetate temperature, total influent flow rate, cumulative total influent flow rate, and total valve opening. Obtain a solid content labeling sequence S(t) with the same time stamp as X(t) through near-infrared spectroscopy and an existing spectral-solid content mapping model. Then, align X(t) and S(t) in time to obtain paired datasets. S2: Preprocessing and sample building, performing outlier handling, missing value handling, denoising and numerical standardization operations on X(t) and S(t) in sequence; Samples are constructed from X(t) using a sliding time window of fixed length L, and training, validation and test samples are generated using S(t) at the same time as supervision annotations. S3: Construction of the SC prediction sub-model: A temporal regression network is established with a gated recurrent unit (GRU) as the encoder and a feature attention convergence layer (FA). First, samples within the time window are input to the GRU to obtain the hidden state sequence. Then, the FA layer weights and converges the hidden state according to feature correlation to obtain the representation h*. Finally, a fully connected regression layer outputs the predicted value. The key update relationship of the GRU satisfies the following formula: z t =σ(W z ·[h t-1 ,x t ]+b z ) (1) r t =σ(W r ·[h t-1 ,x t ]+b r ) (2) Where σ represents the Sigmoid function, W z h represents the weight matrix of the updated gate. t-1 This indicates that b includes the hidden state from the previous moment. z h represents the bias vector of the update gate. t Indicates the current hidden state, W r It is the weight matrix of the reset gate, b r It is the bias vector for resetting the gate, and * indicates element-wise multiplication. Let W represent the candidate hidden state, W represent the weight matrix, b represent the bias vector, tanh represent the activation function, and z represent the weight vector. t Indicates an update to the door. Indicates the candidate hidden state; S4: Model training and selection, minimizing the number of training samples. The difference between S(t) and the target function is used. A gradient descent-based parameter update strategy is adopted to train the time series regression network, and the hyperparameters and early stopping conditions are determined based on the performance of the validation set. S5: Online Inference and Output: During production operation, the time-series regression network, trained with the most recent time window X(t) as input, outputs the predicted solids content value at the corresponding time. It enables online, real-time prediction of the solids content during the extraction process.

2. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: Step S1, data acquisition and time alignment, specifically includes: S1-1: Establish an online data acquisition channel in the extraction section to acquire equally spaced sampling data that form a multivariate process data time series X(t). The sampling period is 1 minute, and the multivariate process data includes at least: ethyl acetate temperature, total influent flow rate, total influent flow accumulation, and total valve opening. S1-2: Configure the near-infrared spectroscopy online monitoring unit and call the pre-established spectrum. The solid content mapping model converts the spectrum at each sampling time to obtain the solid content labeling sequence S(t) that is synchronized with X(t) and equally spaced, where S(t) is a discrete time series. S1-3: Based on the sampling timestamps, X(t) and S(t) are registered and aligned one by one, and mismatched or missing time points are removed to form pairs of X(t) and S(t) as datasets for training, validation and testing.

3. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: The feature attention convergence layer in step S3 specifically includes the following steps: S3-1: Obtain the set of representations expanded along the feature dimension from the GRU output; S3-2: During the training phase, the most recent model output is calculated with the target value of the solid content labeling sequence S(t) to obtain the correlation score between each feature and the target. S3-3: Perform softmax normalization on the correlation scores to obtain the attention weights corresponding to each feature; S3-4: The attention output is obtained by weighted summation of the representation set according to the attention weights, and the attention output is input into the regression layer to output the predicted value of solid content at the current time. S3-5: In end-to-end training, the attention weight parameters and GRU parameters are jointly updated so that the attention weights adaptively highlight the feature representations that are more relevant to S(t).

4. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: The weighted convergence of the feature attention mechanism satisfies the following relationship: α=σ(W f ·[h,y]) (5) Among them, h * The final result obtained from the calculation; α is the weight value calculated by the attention mechanism; h is the existing data; σ is the softmax function; W f Here, y is the weight matrix of the attention mechanism; y is the target value. When there are k attention mechanisms calculating weight values ​​α and k existing data points h, the corresponding i-th α and h are multiplied by a matrix, and the k results are added together to obtain the final output h. * .

5. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: In step S3, the temporal regression network consists of an input layer, stacked gated recurrent unit layers, a feature attention convergence layer, and a fully connected regression layer in sequence. The number of layers m of the gated recurrent unit layers is a positive integer not less than 2. The hidden state sequence of the nth layer is used as the input of the (n+1)th layer, and the hidden state sequence of the last layer is provided to the feature attention convergence layer.

6. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: In step S4, the parameter update strategy based on gradient descent performs end-to-end optimization of the prediction model parameter vector θ. The specific calculation formula is as follows: In the formula, x is the variable to be optimized. Let η be the loss function and η be the learning rate. Let f(x) be the gradient of the loss function with respect to the input parameters. t ) represents the current output value, y target The objective function is denoted as .

7. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 1, characterized in that: In step S4, the model training and selection process uses three indicators: root mean square error, coefficient of determination, and mean absolute percentage error, to construct a comprehensive evaluation system.

8. The method for predicting the solid content in the extraction process of traditional Chinese medicine based on deep learning according to claim 7, characterized in that: The calculation of a comprehensive evaluation system specifically includes the following formulas: Among them, y i For the i-th actual value, For the i-th predicted value, is the mean of the actual values, and n is the sample size.

Citation Information

Patent Citations

  • Method for testing decocting rate of traditional Chinese medicine decoction

    CN101793656B

  • Method for reducing arsenic salt load in water extract of traditional Chinese medicine

    CN103505906B

  • A rapid determination method for the content of multi-index components in Chinese herbal medicines

    CN103884676B

  • Stichopus japonicus traditional Chinese medicine soft capsules capable of promoting wound healing and preparation method thereof

    CN104435732A

  • Method for preparing traditional Chinese medicine formula granules by using resistant dextrin

    CN108295032A