Optimization method of multi-target additive detection conditions in complex matrix
By using reinforcement learning and multi-objective optimization algorithms, the detection conditions of gas chromatography or gas chromatography-mass spectrometry are adjusted in real time, which solves the problems of low separation efficiency and decreased sensitivity in the detection of multi-objective additives in complex matrices. It realizes dynamic optimization and adaptive control of detection conditions, thereby improving detection efficiency and accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GUANGZHOU GRG METROLOGY & TEST CO LTD
- Filing Date
- 2025-12-25
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies suffer from low separation efficiency and decreased detection sensitivity when detecting multi-target additives in complex matrices. Furthermore, they lack real-time dynamic optimization capabilities, leading to repeated manual adjustments of detection conditions that are time-consuming, labor-intensive, and have poor reproducibility.
By employing reinforcement learning, active learning, and multi-objective optimization algorithms, and training with a deep Q-network, the detection conditions of gas chromatography or gas chromatography-mass spectrometry are adjusted in real time to optimize key modeling parameters, thereby achieving real-time collaborative optimization and adaptive optimization of multiple detection conditions.
It improves the efficiency, accuracy, and robustness of multi-target additive detection in complex matrices, realizes dynamic closed-loop control of detection conditions, avoids the limitations of single-target optimization, and provides a more efficient and accurate detection solution.
Smart Images

Figure CN122017059A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of analytical chemistry, specifically to an optimization method for the detection conditions of multi-target additives in complex matrices. Background Technology
[0002] In analytical chemistry, the detection of multi-target additives in complex matrices is crucial. Complex matrices include environmental samples, biological fluids, and industrial materials. Multi-target additives, such as plasticizers, antioxidants, and residual solvents, are widely used in food safety, environmental monitoring, and product quality control. Gas chromatography (GC) and gas chromatography-mass spectrometry (GC-MS) are the mainstream detection methods. However, complex matrices contain numerous interfering components (such as proteins, lipids, inorganic salts, and polymers), leading to low separation efficiency and decreased detection sensitivity of target additives. Traditional detection methods rely on empirical parameter settings, which are difficult to adapt to the dynamic changes of different sample matrices. Repeated manual trial and error optimization is necessary, which is time-consuming, labor-intensive, and has poor reproducibility.
[0003] Existing technical document CN119827682A discloses a method for detecting folate metabolites in erythrocytes using tandem liquid chromatography-mass spectrometry (LC-MS / MS), which dynamically adjusts gradient parameters by real-time monitoring of the liquid chromatogram and utilizing a deep learning algorithm. However, this method is only applicable to specific biological samples (folate metabolites) and does not address the detection of multi-target adjuvants in complex matrices. Its optimization is based on image analysis, lacking systematic collaborative optimization of multiple detection conditions, and it does not incorporate reinforcement learning or active learning mechanisms, nor does it achieve adaptive learning based on real-time feedback, nor does it address dynamic optimization of detection conditions. With the development of artificial intelligence technology, machine learning has been applied to chromatographic data analysis, but existing methods mostly focus on offline modeling or single parameter adjustment, lacking real-time collaborative optimization of multiple detection conditions such as injection port temperature, heating program, ion source temperature, and scanning range, and thus failing to achieve dynamic closed-loop control of the detection process. Summary of the Invention
[0004] To address the technical problems existing in the prior art, this invention proposes an optimization method for multi-target additive detection conditions in complex matrices. By integrating reinforcement learning, active learning, and multi-target optimization algorithms, real-time collaborative optimization and adaptive optimization of multiple detection conditions are achieved, thereby improving the detection efficiency, accuracy, and robustness of multi-target additive detection in complex matrices.
[0005] The purpose of this invention is to provide an optimized method for detecting multi-target additives in complex matrices.
[0006] An optimization method for multi-target adjuvant detection conditions in complex matrices includes the following steps:
[0007] S1. Initialize the detection conditions for multi-target adjuvant detection in complex matrices, analyze complex matrix samples and collect chromatographic / mass spectrometry data, extract characteristic parameters from the chromatographic / mass spectrometry data, and construct a characteristic parameter dataset based on the extracted characteristic parameters;
[0008] S2. Define key modeling parameters and optimization objectives, construct a quantitative relationship model between key modeling parameters and various performance indicators Y, and train a deep Q-network using an active learning algorithm based on the feature parameter dataset based on the quantitative relationship model and multi-objective reward function. The optimized key modeling parameters are obtained through the trained deep Q-network.
[0009] S3. Feed back the optimized key modeling parameters to the detection system and adjust the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry system in real time.
[0010] Specifically, step S1 includes:
[0011] S11. Before analyzing complex matrix samples, initialize the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry instrument based on the historical database of multi-target adjuvant detection in complex matrices.
[0012] S12. Use a gas chromatograph or gas chromatography-mass spectrometry to analyze complex matrix samples and acquire chromatographic or mass spectrometric data in real time. Extract the following characteristic parameters: retention time, peak area, peak height, signal-to-noise ratio, resolution, tailing factor, and scan range. Construct a characteristic parameter dataset based on the extracted characteristic parameters.
[0013] Specifically, step S2 includes:
[0014] S21. Define the state space and action space of the deep Q-network. The state space includes the combination of key modeling parameters, and the action space is defined as the adjustment operation of the detection conditions.
[0015] S22. Set optimization goals, including higher resolution (Rs), shorter analysis time, and lower limit of detection (LOD).
[0016] S23. Based on the optimization objective, construct a response surface model for each performance index, train each response surface model to obtain a trained response surface model, and use the trained response surface model to output the corresponding performance index value according to the input key modeling parameters.
[0017] S24. Based on the optimization objective, a multi-objective reward function of a deep Q-network is set, and an improved non-dominated sorting genetic algorithm is used to solve it, generating a Pareto optimal solution set.
[0018] S25. Using the trained response surface model as a virtual environment for reinforcement learning, the deep Q-network is trained using an active learning algorithm based on the feature parameter dataset and multi-objective reward function.
[0019] S26. Define the design space threshold, set the threshold for model fit and each performance index, and calculate the probability that the key modeling parameters of each solution meet all the thresholds based on the generated Pareto optimal solution set. Prioritize the retention of high-probability solutions to obtain the optimized key modeling parameters.
[0020] Specifically, the key modeling parameters include heating rate, injection port temperature, carrier gas flow rate, column oven initial temperature, and ion source temperature; the action space is defined as the adjustment operation of the detection conditions, including the following discrete actions: adjusting the heating rate, adjusting the injection port temperature, and adjusting the carrier gas flow rate.
[0021] Specifically, the deep Q-network structure includes an input layer, a hidden layer, and an output layer. The input layer is used to receive the output feature parameter vector, and the dimension is set according to the number of features. The hidden layer includes three fully connected layers: the first hidden layer has 128 nodes, the second hidden layer has 64 nodes, and the third hidden layer has 32 nodes, all of which use the ReLU activation function. The output layer is the action value function Q(s,a), and the output dimension is equal to the size of the action space.
[0022] Specifically, step S23 includes:
[0023] A deterministic screening design method is used to generate an experimental matrix, which covers all key modeling parameters in the parameter space with the fewest number of experiments. The key modeling parameters and response values of each experiment are recorded to generate a training sample set.
[0024] Based on the training sample set, a response surface model is constructed for each performance index to describe the quantitative relationship between key modeling parameters and each performance index Y.
[0025] Specifically, the multi-objective reward function for the steps is expressed as follows:
[0026] R=ω1* R _ R S +ω2* R_T+ω3* R_LOD;
[0027] Where R represents the total reward value, R_R S R_T represents the separation bonus, R_LOD represents the analysis time bonus, * represents the detection limit bonus, * represents multiplication, and ω1, ω2, and ω3 are weighting coefficients.
[0028] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0029] This invention proposes an optimization method for multi-target adjuvant detection conditions in complex matrices. By defining key modeling parameters and optimization objectives, a quantitative relationship model is constructed between these parameters and various performance indicators (Y). Based on this model and the multi-target reward function, a deep Q-network is trained using an active learning algorithm on a feature parameter dataset. The trained deep Q-network yields optimized key modeling parameters. This method combines reinforcement learning with multi-target optimization to achieve dynamic closed-loop optimization of detection conditions. An active learning strategy is introduced to efficiently explore the parameter space, establishing a systematic optimization framework for multi-target adjuvant detection in complex matrices. Multi-target collaborative optimization simultaneously optimizes separation, sensitivity, and analysis time, avoiding the limitations of single-target optimization. The optimized key modeling parameters are fed back to the detection system, adjusting the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry (GC-MS) system in real time. Continuous learning capability updates the model based on new data, improving long-term system performance. This achieves real-time collaborative and adaptive optimization of multiple detection conditions, enhancing the detection efficiency, accuracy, and robustness of multi-target adjuvant detection in complex matrices. This method solves the problems of static, single-target, and manual optimization in existing technologies, providing a more efficient and accurate optimization scheme for detection conditions. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the structures shown in these drawings without creative effort.
[0031] Figure 1 This is a flowchart of an optimization method for multi-target additive detection conditions in a complex matrix, as described in an embodiment of the present invention. Detailed Implementation
[0032] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments, and the implementation of the present invention is not limited thereto. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0033] Example 1:
[0034] like Figure 1 The diagram shows a flowchart of a method for optimizing the detection conditions of multi-target additives in a complex matrix. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to the present invention includes the following steps:
[0035] S1. Initialize the detection conditions for multi-target adjuvant detection in complex matrices, analyze complex matrix samples and collect chromatographic / mass spectrometry data, extract characteristic parameters from the chromatographic / mass spectrometry data, and construct a characteristic parameter dataset based on the extracted characteristic parameters.
[0036] S11. Before analyzing complex matrix samples, initialize the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry instrument based on the historical database of multi-target adjuvant detection in complex matrices.
[0037] Based on a historical database of detection of multi-target adjuvants in complex matrices, this database contains a large number of detection parameters and performance data for complex matrix samples. The detection conditions for multi-target adjuvant detection in complex matrices are specific settings during method operation, including adjustable instrument parameters such as heating rate (TR), injection port temperature (T_inj), column oven initial temperature (T_init), carrier gas flow rate (F_c), ion source temperature, interface temperature, and mass scan range. These parameters directly control the instrument's operating status. An initial detection parameter combination is set, such as a programmed temperature ramp: initial temperature 70℃ held for 1 min, ramped at 15℃ / min to 280℃ and held for 5 min; injection port temperature: 250℃; detector temperature: 280℃; carrier gas flow rate: 1.0 mL / min.
[0038] S12. Use a gas chromatograph (GC) or gas chromatograph-mass spectrometer (GC-MS) to analyze complex matrix samples and acquire chromatographic or mass spectrometric data in real time. Extract the following feature parameters: retention time, peak area, peak height, signal-to-noise ratio (S / N), resolution (Rs), tailing factor, and scan range. Construct a feature parameter dataset based on the extracted feature parameters. The feature parameter dataset provides input for model training.
[0039] In this embodiment, the extraction of characteristic parameters is completed by the chromatographic data system (CDS) software supporting gas chromatography (GC) or gas chromatography-mass spectrometry (GC-MS). The instrument separates and detects complex matrix samples under method control, and chromatograms or mass spectra are drawn in real time. Characteristic parameters such as retention time, peak area, peak height, signal-to-noise ratio (S / N), resolution (Rs), tailing factor, and scanning range are extracted based on the chromatograms or mass spectra. Among them, the retention time is the time required for the analyte to reach the detector at the column outlet after injection. Under the same chromatographic conditions, the retention time of a compound is basically fixed. Preliminary qualitative analysis is usually carried out by comparing the retention time with that of the standard. The peak area is the area enclosed by the chromatographic peak curve and the baseline, and the peak height is the vertical distance from the peak apex of the chromatogram to the baseline. Within a certain concentration range, the peak area or peak height is proportional to the concentration of the component. The peak area is usually more stable and less affected by minor fluctuations in flow rate. The signal-to-noise ratio is the ratio of the signal intensity to the noise intensity, and S / N = peak height / noise level, which is used to evaluate the detection sensitivity and data reliability. Usually, when S / N ≥ 3, the target is considered to be detected (limit of detection, LOD), and when S / N ≥ 10, the quantitative result is considered reliable (limit of quantitation, LOQ). The resolution Rs is an index used to measure the separation degree of two adjacent chromatographic peaks, and Rs = 2 × (tR2 - tR1) / (W1 + W2); where tR2 and tR1 are the retention times of the two peaks respectively, and W1 and W2 are the baseline widths of the two peaks, which is the distance between the intersection points of the tangents drawn through the inflection points on both sides of the peak and the baseline. When Rs > 1.5, the two peaks are considered to be baseline separated. Resolution is a key index for evaluating the quality of chromatographic methods. Poor resolution will seriously affect the accuracy of quantification. The tailing factor is a parameter for measuring the symmetry of the chromatographic peak. The ideal symmetric peak has a tailing factor of 1.0. An excessive tailing factor (>1.2) indicates that there may be active sites (such as injection port or column contamination, stationary phase mismatch), which will affect the reproducibility of the peak area and resolution. The scanning range is a parameter unique to the mass spectrometer detector, which refers to the mass range covered by the mass spectrometer during data acquisition and can be set in the instrument method. Setting it too wide may reduce the scanning speed or sensitivity; setting it too narrow may result in the loss of the target or other useful information.
[0040] S2. Define the key modeling parameters and optimization objectives, construct a quantitative relationship model between the key modeling parameters and each performance index Y, and based on the quantitative relationship model and the multi-objective reward function, train the deep Q-network through an active learning algorithm based on the characteristic parameter dataset, and obtain the optimized key modeling parameters through the trained deep Q-network.
[0041] S21. Define the state space and action space of the deep Q-network. The state space includes the key modeling parameters, and the action space is defined as the adjustment operations of the detection conditions.
[0042] Deep Q-Network (DQN), as a classic deep RL algorithm, enables agents (optimization models) to learn optimal decision strategies directly from complex raw data. The state space is the window through which the agent perceives the environment. It describes the critical operating state of the chromatography system at any given time and is defined as a set of key modeling parameters (CMPs) that have a decisive impact on the chromatographic separation effect. The key modeling parameters are the few parameters that have the greatest impact on the method performance selected from the detection conditions and are the core variables that need to be optimized.
[0043] Specifically, key modeling parameters (CMPs) include heating rate (TR), injection port temperature (T_inj), carrier gas flow rate (F_c), column oven initial temperature (T_init), and ion source temperature (T_source). Among these, heating rate (TR) controls the rate at which the column temperature increases, directly affecting the separation efficiency and analysis time. Injection port temperature (T_inj) ensures complete sample vaporization, avoiding injection discrimination or thermal decomposition. Carrier gas flow rate (F_c) affects the retention time of components and the separation efficiency of the column. Column oven initial temperature (T_init) determines the separation effect of early eluting components. Ion source temperature (T_source) (if used with GC-MS) affects the ionization efficiency of the analyte. The state space can also include performance indicators extracted from the previous chromatographic run: higher resolution (Rs), shorter analysis time, lower limit of detection (LOD), etc. By incorporating historical performance into the state space, the agent can learn the consequences of past operations, thereby learning the relationship between parameter adjustments and performance effects.
[0044] In this embodiment, the action space is defined as the adjustment operations of the detection conditions, specifically including the following discrete actions: adjusting the heating rate, adjusting the injection port temperature, and adjusting the carrier gas flow rate. For example: heating rate change ±3℃ / min, injection port temperature adjustment ±5℃, carrier gas flow rate change ±0.1 mL / min. In each decision step, the agent selects one of these three actions to execute. For example, in a certain state, the agent might choose to "increase the carrier gas flow rate by 0.1 mL / min". After executing the action, the system enters a new state and obtains a corresponding reward value based on the chromatographic response (such as the degree of improvement in resolution and peak symmetry). The agent's ultimate goal is to learn a strategy that maximizes the long-term cumulative reward through a series of action selections, i.e., finding the optimal detection conditions.
[0045] Specifically, the deep Q-network structure includes an input layer, hidden layers, and an output layer. The input layer receives a feature parameter vector, with its dimension determined by the number of features. The input data is standardized to ensure all features are of the same magnitude, which is beneficial for network training convergence. The hidden layers consist of three fully connected layers that perform complex nonlinear feature transformations. The first hidden layer has 128 nodes and uses the ReLU (Rectified Linear Unit) activation function. This layer is responsible for extracting high-level features from the original state parameters. The ReLU function effectively alleviates the vanishing gradient problem, is computationally efficient, and helps accelerate training. The second hidden layer has 64 nodes and uses the ReLU activation function. This layer further learns and combines features, learning the complex mapping relationship between state features and action values. The third hidden layer has 32 nodes and uses the ReLU activation function, serving as the final feature extraction layer, preparing for the output action value. The output layer is the action value function Q(s,a), representing the expected cumulative reward for taking action a in state s. The output dimension is equal to the size of the action space. In this example, the action space contains 3 actions, therefore the output layer has 3 nodes. Each node outputs a Q-value, representing the expected value of performing the corresponding action (adjusting TR, T_inj, or F_c) under the current input state s. The agent selects the action with the highest expected value with a high probability. The output dimension is equal to the action space size; for example, three Q-values correspond to the expected benefits of the three adjustment actions. Specifically, a vector is output, such as [Q(s, a1), Q(s, a2), Q(s, a3)], where Q(s, a1) represents the long-term value of performing the action "heating rate +3°C / min" under the current chromatographic conditions; Q(s, a2) represents the long-term value of performing "injection temperature +5°C"; and Q(s, a3) represents the long-term value of performing "carrier gas flow rate +0.1 mL / min". The agent examines all output Q-values and then selects the action with the highest Q-value to execute.
[0046] S22. Set optimization goals, including higher resolution (Rs), shorter analysis time, and lower limit of detection (LOD).
[0047] S23. Based on the optimization objective, construct a response surface model for each performance index, train each response surface model to obtain a trained response surface model, and use the trained response surface model to output the corresponding performance index value according to the input key modeling parameters.
[0048] S231. A deterministic screening design (DSD) method is used to generate an experimental matrix, covering all key modeling parameters in the parameter space with the fewest possible experiments. The key modeling parameters and response values (performance metrics) of each experiment are recorded to generate a training sample set. The training sample set contains N samples, each including a vector of key modeling parameters and a vector of performance metrics.
[0049] A deterministic screening design (DSD) method is used to generate an experimental matrix that covers the parameter space with the minimum number of experiments. For example, for three key modeling parameters (CMPs), DSD generates seven sets of experimental detection conditions, with each set measuring performance indicators (resolution, analysis time, and limit of detection) to ensure uniform distribution of experimental points and reduce the number of experiments. Specifically, the key modeling parameters (CMPs) and their experimental ranges are determined. Taking gas chromatography (GC) as an example, the feasible ranges of key modeling parameters (CMPs) such as temperature programmed rate (TR), injection port temperature (T_inj), column oven initial temperature (T_init), and carrier gas flow rate (F_c) are determined, for example, TR: 5~20℃ / min, T_inj: 200-300℃, T_init: 40-100℃, F_c: 0.5~2.0 mL / min. Experimental plans are generated based on the DSD algorithm. Chromatographic experiments are conducted according to the plans, and the response values (performance metrics) of each experiment are recorded: higher resolution (Rs), shorter analysis time, and lower limit of detection (LOD). The output is a dataset D containing N samples, where each sample is a (key modeling parameter vector and performance metric vector). Uncertainty sampling is used to select the sample with the most information to train the detection condition optimization model. The detection conditions are adjusted based on the actions output by the deep Q-network. New experiments are executed, data is collected, and the state and reward are updated, forming a closed-loop control.
[0050] S232. Based on the training sample set, construct a response surface model for each performance index to describe the quantitative relationship between key modeling parameters and each performance index Y. The response surface model can effectively simulate the complex relationship between input parameters and output response, and can be expressed as:
[0051] Y = β0 + ΣβᵢXᵢ + ΣβᵢᵢXᵢ² + ΣβᵢⱼXᵢXⱼ + ε;
[0052] Where: Y represents the performance index, which can be resolution, sensitivity, analysis time, detection limit, etc.; β0 represents the model constant term; Xi represents the i-th key method parameter; βi represents the linear coefficient of the i-th key method parameter; βii represents the quadratic coefficient of the i-th key method parameter; βij represents the interaction coefficient between the i-th and j-th key method parameters; and ε represents the error term. In this embodiment, the training sample set is used to train each response surface model, resulting in four trained response surface models. Given any set of CMPs, the corresponding performance index values can be obtained.
[0053] S24. Based on the optimization objective, set the multi-objective reward function of the deep Q network, and use the improved non-dominated sorting genetic algorithm (NSGA-II) to solve it, generating the Pareto optimal solution set.
[0054] The multi-objective reward function is a weighted composite reward function that integrates multiple optimization objectives into a single reward value. The multi-objective reward function is expressed as follows:
[0055] R=ω1* R _ R S +ω2* R_T+ω3* R_LOD;
[0056] Where R represents the total reward value, R_R S For the separation bonus, R_T represents the analysis time bonus, R_LOD represents the detection limit bonus, * indicates multiplication, and ω1, ω2, and ω3 are weighting coefficients. The weighting coefficients ω1, ω2, and ω3 are adjusted according to actual needs to balance the various objectives. For example, setting a target separation R_T... S = 1.5, when the minimum resolution (Rs_min) is below this value, a large negative reward (penalty) is given; when it is reached or exceeded, a positive reward is given, but the reward growth is slowed to avoid over-optimization. w1=0.5, w2=0.3, w3=0.2, indicating that resolution is considered the most important objective, followed by analysis time and detection limit. After defining the multi-objective reward function, the action value function Q(s, a) now represents the expected weighted comprehensive reward that can be obtained by taking action a in state s and following the optimal strategy. Through the multi-objective weighted comprehensive reward function, deep Q-networks can effectively solve the complex trade-offs in gas chromatography method optimization. Through a data-driven approach, it autonomously explores a huge parameter space to find Pareto optimal solutions that meet specific requirements (defined by the weights of the reward function).
[0057] Specifically, for multi-objective reward functions, an improved non-dominated sorting genetic algorithm (NSGA-II) is used to solve the problem, generating a Pareto optimal solution set and achieving a trade-off between objectives. The improved non-dominated sorting genetic algorithm effectively handles multi-objective optimization problems and obtains a Pareto optimal solution set through non-dominated sorting and crowding calculation. The specific steps include: initializing the population by randomly generating an initial population P0, with the population size set according to the problem size, typically 100. Non-dominated sorting involves dividing the population into different non-dominated layers. The first layer represents the Pareto optimal solution set, the second layer represents solutions dominated by the first layer, and so on. Crowding calculation measures the density of solutions in the objective space. Higher crowding indicates sparser solutions and better diversity. Selection, crossover, and mutation are performed using tournament selection, simulated binary crossover, and polynomial mutation operations to generate the offspring population Q. t Merging and selection will merge the parent population P. t and offspring population Q t Merge into R t , for R t Perform non-dominated ranking and crowding calculation, and select the top N individuals as the next generation population P. t ₊1. Termination condition: The algorithm terminates when the maximum number of iterations (usually 200) is reached, outputting the Pareto optimal solution set. NSGA-II exhibits good convergence; the Pareto front stabilizes after 100 iterations. The crowding distance index shows a uniform solution distribution with no clustering.
[0058] S25. Using the trained response surface model as a virtual environment for reinforcement learning, the deep Q-network is trained using an active learning algorithm based on the feature parameter dataset and multi-objective reward function to obtain the trained deep Q-network.
[0059] An active learning loop is introduced. After the deep Q-network finds promising points in the virtual environment, it checks the uncertainty of the response surface model at these points, selects points with high uncertainty for real experiments, updates the response surface model, and then retrains the deep Q-network based on the feature parameter dataset and the multi-objective reward function until convergence. The feature parameter dataset established in step S1 is the core data source for training the deep Q-network. This database stores various chromatographic / mass spectrometric feature parameters extracted from experimental samples, such as retention time, peak area, and signal-to-noise ratio.
[0060] In this embodiment, a state space is defined, comprising key modeling parameters (CMPs) including heating rate (TR), inlet temperature (T_inj), column oven initial temperature (T_init), carrier gas flow rate (F_c), and ion source temperature (T_source). In the virtual environment, performance metrics are predicted by the response surface model; therefore, using the key modeling parameters as states, they can be represented as follows:
[0061] s = [TR, T_inj, T_init, F_c, T_source, ...];
[0062] In a reinforcement learning environment, the state should be a complete description of the current system. In detection condition optimization, the current system state is determined by the current critical modeling parameters (CMPs), and the performance metric is a result of these parameters. If only the parameters are changed, the performance metric is deterministic and can be determined by the response surface model of the performance metric. Therefore, if the critical modeling parameters are known, all the information is known. In a virtual environment, the parameters change at every step, and the performance metric is obtained on the fly through the response surface model.
[0063] In this embodiment, an action space is defined as follows: discrete actions: heating rate change ±3°C / min, injection port temperature adjustment ±5°C, carrier gas flow rate change ±0.1 mL / min. Each action has two directions (increase and decrease), so there are actually 6 discrete actions in the action space: Action 0: TR +3°C / min, Action 1: TR -3°C / min, Action 2: T_inj +5°C, Action 3: T_inj -5°C, Action 4: F_c +0.1 mL / min, Action 5: F_c -0.1 mL / min. The deep Q-network structure includes: Input layer: the number of nodes equals the dimension of the state space (i.e., the number of CMPs, e.g., 5). Hidden layers: 3 layers, with 128, 64, and 32 nodes respectively, using the ReLU activation function. Output layer: 6 nodes, corresponding to the Q values of the 6 actions.
[0064] A deep Q-network is trained based on a multi-objective reward function. During training, the agent explores and learns in a virtual environment constructed using a response surface model. Each episode starts from a random initial state in the parameter space and executes a series of actions until the maximum number of steps or performance requirements are met. An active learning loop is introduced, incorporating an active learning mechanism. During training, states considered optimal by the agent (i.e., those with the highest Q-values) are recorded. The response surface model is then used to predict the uncertainty (variance) of these states. States with high predicted rewards and high uncertainty are selected for real-world experiments. The real experimental data is added to the training set, the response surface model is retrained, and the deep Q-network is retrained using the updated response surface model. This process is repeated until convergence, resulting in a well-trained deep Q-network.
[0065] S26. Define the design space threshold, set the threshold for model fit and each performance index, and calculate the probability that the key modeling parameters of each solution meet all the thresholds based on the generated Pareto optimal solution set. Prioritize the retention of high-probability solutions to obtain the optimized key modeling parameters.
[0066] Specifically, a Bayesian probability design space or a confidence interval design space can be introduced to calculate the probability that each parameter combination satisfies all thresholds, prioritizing the retention of parameter combinations with high probabilities. This includes:
[0067] Define design space thresholds to set thresholds for model fit and each performance metric, constructing a reliable operating space. For example: goodness of fit R² > 0.9, separation Rs ≥ 1.5, and signal-to-noise ratio S / N ≥ 10. Evaluate the model's prediction accuracy using k-fold cross-validation (k=5), requiring R² > 0.9 to ensure good generalization ability. The dataset can be randomly divided into 5 parts, using 4 parts to train the model and 1 part for validation. Calculate the R² between predicted and actual values in the 5 validation iterations, setting validation criteria: R² > 0.9 to ensure the model does not overfit and its prediction ability is reliable; separation Rs ≥ 1.5 to ensure effective component separation; and signal-to-noise ratio S / N ≥ 10 to ensure detection sensitivity and reliability.
[0068] Extensive sampling is performed across the entire range of key modeling parameters. For each sampled point, a Bayesian model is used to calculate the posterior prediction distribution of each key modeling parameter value. Based on the posterior prediction distribution, the probability that the point meets each compliance threshold is calculated. The compliance probability is calculated, and for each solution (i.e., a set of model parameters) found by the optimization algorithm, the joint probability that the solution meets all compliance thresholds is evaluated. For a candidate solution x, its compliance probability Psuccess(x) can be expressed as:
[0069] Psuccess(x) = P (Separation degree(x) ≥ 1.5 ∩ Signal-to-noise ratio(x) ≥ 10 ∩ R) 2 (x) > 0.9.
[0070] Instead of being guided by a single metric value (such as the highest prediction separation), this approach prioritizes retaining and exploring solutions with the highest probability of achieving the target. This ensures that the ultimately selected operating point can consistently produce satisfactory results even under normal fluctuations. By combining the optimization objective of the probability-of-achievement method with the uncertainty quantification capability of the Bayesian probabilistic design space, and supplementing it with model robustness assessment using k-fold cross-validation, a fundamental shift can be achieved from pursuing the "optimal point" to identifying the "reliable region." The defined design space can better guide practice, ensuring that process and product quality remain consistent and controllable within the expected operating range, significantly improving the efficiency and reliability of R&D and production activities.
[0071] S3, Dynamic Closed-Loop Optimization and Real-Time Application, feeds back the optimized key modeling parameters to the detection system, and adjusts the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry system in real time.
[0072] The optimized parameter combinations are fed back to the detection system to adjust the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry system in real time. Based on the optimization results, key parameters such as column temperature, carrier gas flow rate, and injection volume are dynamically adjusted.
[0073] This invention forms a closed loop of "acquisition → optimization → adjustment → verification" through real-time data acquisition and model updates. Data acquisition: Real-time acquisition of detection data, including chromatograms and mass spectra. Model optimization: Updating the multi-objective optimization model based on newly acquired data. Parameter adjustment: Adjusting detection conditions according to the optimization results. Verification and evaluation: Verifying the adjusted detection effect and evaluating whether it meets quality requirements. Through real-time data acquisition and model updates, the system continuously learns new sample characteristics and adapts to matrix changes. When encountering a new sample matrix, the system can automatically adjust detection conditions, improving long-term stability.
[0074] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A method for optimizing the detection conditions of multi-target adjuvants in complex matrices, characterized in that, Includes the following steps: S1. Initialize the detection conditions for multi-target adjuvant detection in complex matrices, analyze complex matrix samples and collect chromatographic and / or mass spectrometry data, extract feature parameters from chromatographic and / or mass spectrometry data, and construct a feature parameter dataset based on the extracted feature parameters; S2. Define key modeling parameters and optimization objectives, construct a quantitative relationship model between key modeling parameters and various performance indicators Y, and train a deep Q network using an active learning algorithm based on the feature parameter dataset based on the quantitative relationship model and multi-objective reward function. The trained deep Q network outputs optimized key modeling parameters. S3. Feed back the optimized key modeling parameters to the detection system and adjust the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry system in real time.
2. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 1, characterized in that, Step S1 includes: S11. Before analyzing complex matrix samples, initialize the detection conditions of the gas chromatograph or gas chromatography-mass spectrometry instrument based on the historical database of multi-target adjuvant detection in complex matrices. S12. Use a gas chromatograph or gas chromatography-mass spectrometry to analyze complex matrix samples and acquire chromatographic or mass spectrometric data in real time. Extract the following characteristic parameters: retention time, peak area, peak height, signal-to-noise ratio, resolution, tailing factor, and scan range. Construct a characteristic parameter dataset based on the extracted characteristic parameters.
3. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 1, characterized in that, Step S2 includes: S21. Define the state space and action space of the deep Q-network. The state space includes the combination of key modeling parameters, and the action space is defined as the adjustment operation of the detection conditions. S22. Set optimization goals, including higher separation, shorter analysis time, and lower detection limit; S23. Based on the optimization objective, construct a response surface model for each performance index, train each response surface model to obtain a trained response surface model, and use the trained response surface model to output the corresponding performance index value according to the input key modeling parameters. S24. Based on the optimization objective, a multi-objective reward function of a deep Q-network is set, and an improved non-dominated sorting genetic algorithm is used to solve it, generating a Pareto optimal solution set. S25. Using the trained response surface model as a virtual environment for reinforcement learning, the deep Q-network is trained using an active learning algorithm based on the feature parameter dataset and multi-objective reward function. S26. Define the design space threshold, set the threshold for model fit and each performance index, and calculate the probability that the key modeling parameters of each solution meet all the thresholds based on the generated Pareto optimal solution set. Prioritize the retention of high-probability solutions to obtain the optimized key modeling parameters.
4. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 3, characterized in that, The key modeling parameters include heating rate, injection port temperature, carrier gas flow rate, column oven initial temperature, and ion source temperature. The action space is defined as the adjustment operations of the detection conditions, including the following discrete actions: adjusting the heating rate, adjusting the injection port temperature, and adjusting the carrier gas flow rate.
5. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 3, characterized in that, The deep Q-network structure includes an input layer, hidden layers, and an output layer. The input layer receives the output feature parameter vector, and its dimension is set according to the number of features. The hidden layer includes three fully connected layers: the first hidden layer has 128 nodes, the second hidden layer has 64 nodes, and the third hidden layer has 32 nodes, all of which use the ReLU activation function. The output layer is the action value function Q(s,a), and its output dimension is equal to the size of the action space.
6. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 3, characterized in that, Step S23 includes: A deterministic screening design method is used to generate an experimental matrix, which covers all key modeling parameters in the parameter space with the fewest number of experiments. The key modeling parameters and response values of each experiment are recorded to generate a training sample set. Based on the training sample set, a response surface model is constructed for each performance index to describe the quantitative relationship between key modeling parameters and each performance index Y.
7. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 3, characterized in that, The multi-objective reward function for the aforementioned step is expressed as follows: R=ω1* R _ R S +ω2* R_T+ω3* R_LOD; Where R represents the total reward value, R_R S R_T represents the separation bonus, R_LOD represents the detection limit bonus, * represents multiplication, and ω1, ω2, and ω3 are all weighting coefficients.
8. The method for optimizing the detection conditions of multi-target additives in a complex matrix according to claim 6, characterized in that, The training sample set contains N samples, each of which includes a vector of key modeling parameters and a vector of performance metrics.