Method and device for realizing penicillin fermentation process variable selection processing based on mutual information and attention mechanism, processor and medium thereof

By applying mutual information and attention mechanisms to select industrial process variables in industrial production, the problems of difficulty in monitoring quality variables and insufficient robustness of soft measurement models in industrial processes are solved. Efficient and accurate variable selection and prediction are achieved, and the cost is reduced. Computational cost and improved model interpretability.

CN118711706APending Publication Date: 2024-09-27EAST CHINA UNIV OF SCI & TECH
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410623006.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-20
Publication Date
2024-09-27

AI Technical Summary

Technical Problem

In industrial production, existing technologies are difficult to effectively monitor and control quality variables, resulting in unstable product quality. In addition, soft measurement models have insufficient robustness and accuracy when facing high-dimensional and complex industrial processes, and have high computational costs.

Method used

Using methods based on mutual information and attention mechanisms, by calculating the mutual information between measurement variables and quality variables, removing irrelevant variables, and establishing a prediction model based on the attention mechanism, setting the number of retained variables, removing redundant variables, and finally Variable contributions were assessed via KernelSHAP's Shapley analysis.

Benefits of technology

It effectively reduces model complexity and data redundancy, improves the prediction accuracy of quality indicators, enhances the interpretability of the model, and provides powerful guidance for the fermentation production process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118711706A
    Figure CN118711706A
Patent Text Reader

Abstract

The invention relates to a method for realizing penicillin fermentation process variable selection processing based on mutual information and an attention mechanism. The method comprises the following steps: acquiring penicillin production data, calculating mutual information MI between a measurement variable and a quality variable, and removing the measurement variable irrelevant to the quality variable; a prediction model based on an attention mechanism is established, the number of reserved variables is set, redundant variables in the variables selected by the MI are removed, and optimized variables are obtained; and defining a linear interpretation model, and evaluating the contribution of the optimal variables based on Shapley analysis of KernelSHAP. The invention also relates to a device for realizing penicillin fermentation process variable selection processing based on the mutual information and the attention mechanism, a processor and a storage medium thereof. According to the penicillin fermentation process variable selection method based on the mutual information and the attention mechanism, quality related variables are optimized through the MI and the attention mechanism, the model complexity and the data redundancy are effectively reduced, and the prediction precision of quality indexes is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of neural network technology, in particular to the field of variable selection, and specifically refers to a method, device, processor and computer-readable storage medium thereof for implementing variable selection processing in a penicillin fermentation process based on mutual information and attention mechanism. Background Art

[0002] In the field of industrial production, the monitoring and control of quality variables plays a vital role in ensuring high-quality production. Timely acquisition of the values ​​of quality variables is essential for timely adjustments in the production process. This is conducive to improving product quality, increasing production efficiency and reducing production costs. However, due to the limitations of current technology and the inherent complexity of industrial processes, it is difficult to directly measure quality variables. Therefore, there is an urgent need for an efficient and accurate method to obtain these variables. In this context, soft sensing has become a viable solution to build predictive models from easily collected process variables and has gained wide acceptance for its cost-effectiveness and efficient estimation of quality variables.

[0003] Soft sensors can be roughly divided into mechanism-based models and data-driven models. With the advancement of technologies such as cloud computing and data storage, as well as the advantage of not requiring mechanism information, data-driven soft sensor models have become a hot topic of research. Machine learning methods such as principal component regression (PCR), partial least squares (PLS) regression, and support vector machine (SVM) are widely used in the field of soft sensors. However, the nonlinearity of industrial systems causes these linear methods to be highly interpretable, but often insufficiently effective in actual industrial processes. To solve nonlinear problems, kernel methods and local weighting have been widely studied and used, but in the face of complex processes, it is difficult for kernel methods to determine kernel functions, and local weighting methods cannot be completely linearized. Artificial neural networks are widely used in soft measurements of quality variables in industrial production processes due to their powerful fitting capabilities.

[0004] However, the high dimensionality and complexity of industrial process data often affect the robustness and accuracy of soft sensor models. To solve this problem, a large number of models for feature representation have been developed. For example, some scholars use variable weighted stacked autoencoders (VW-SAE) to identify irrelevant variables. In addition, a hierarchical optimization algorithm based on MI is used for stacked autoencoders (SAE), using MI as an importance measure, combining random variables to estimate the threshold, and selecting relevant features through systematic hierarchical optimization. However, these methods are all incremental elimination of irrelevant features, which will lead to an increase in computational costs. The use of mutual information and attention mechanisms for variable selection can eliminate feature variables and redundant variables that are not related to quality, effectively reducing computational costs. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the above-mentioned prior art and provide a method, device, processor and computer-readable storage medium thereof for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism, which are simple to operate, low in computational cost and have a wide range of applications.

[0006] In order to achieve the above-mentioned object, the method, device, processor and computer-readable storage medium thereof for implementing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism of the present invention are as follows:

[0007] The method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism is mainly characterized in that the method comprises the following steps:

[0008] (1) Obtain penicillin production data, calculate the mutual information MI between measurement variables and quality variables, and remove measurement variables that are not related to quality variables;

[0009] (2) Establish a prediction model based on the attention mechanism, set the number of retained variables, remove redundant variables from the variables selected by MI, and obtain the preferred variables;

[0010] (3) Define the linear explanatory model and evaluate the contribution of the preferred variables based on Shapley analysis of KernelSHAP.

[0011] Preferably, the step (1) specifically comprises the following steps:

[0012] (1.1) Obtain data from the real penicillin production process through data sources, including offline data and online data;

[0013] (1.2) Calculate the mutual information between the measurement variables and the quality variables, set a threshold, and remove the measurement variables whose mutual information values ​​are less than the threshold.

[0014] Preferably, the mutual information MI between the measurement variable and the quality variable is calculated in step (1), specifically:

[0015] The mutual information MI between the measurement variables and the quality variables is calculated according to the following formula:

[0016]

[0017] Among them, I(X;Y) represents the mutual information value between two variables, P X (x) and P Y (y) represent the marginal probability density of x and y respectively, P (X,Y) (x,y) represents the joint probability density of x and y.

[0018] Preferably, the step (2) specifically comprises the following steps:

[0019] (2.1) Use the variable dataset selected by MI to establish a prediction model based on the attention mechanism and calculate the output of the attention mechanism;

[0020] (2.2) Set the number of variables finally selected and the number of variables to be deleted in each step, and determine the redundant feature variables that need to be deleted.

[0021] Preferably, the step (2.1) of calculating the attention mechanism output specifically includes the following steps:

[0022] (2.1.1) For each input X, map it to three different spaces;

[0023] (2.1.2) Use dot product attention to calculate similarity;

[0024] (2.1.3) Convert similarity into attention weight through softmax function;

[0025] (2.1.4) Apply the converted attention weights to the corresponding V to obtain the attention output.

[0026] Preferably, in the step (2.1.1), for each input X, it is mapped to three different spaces, specifically:

[0027] For each input X, it is mapped into three different spaces according to the following formula:

[0028]

[0029]

[0030]

[0031] The input sequence is D x is the number of features, are the parameter matrices of the linear mapping, Q, K, V are the matrices of the query vector, key vector, and value vector respectively;

[0032] The similarity is calculated in step (2.1.2), specifically:

[0033] The similarity is calculated according to the following formula:

[0034]

[0035] Among them, D k is the dimension of Q and K, where Q and K are the query vector and key vector;

[0036] In the step (2.1.3), the similarity is converted into attention weight through the softmax function, specifically:

[0037] The similarity is converted into attention weight through the softmax function according to the following formula:

[0038] A(Q,K)=softmax(Similarity(Q,K));

[0039] The attention output obtained in the step (2.1.4) is specifically:

[0040] The attention output is obtained according to the following formula:

[0041]

[0042] Where V is the matrix of value vectors, Q and K are query vectors and key vectors, and D k are the dimensions of Q and K.

[0043] Preferably, the redundant feature variables to be deleted in step (2.2) are determined as follows:

[0044] The prediction model output based on the attention mechanism is obtained according to the following formula:

[0045]

[0046] Among them, * represents the convolution operation, H represents the output of the attention mechanism, and W c and b c Represent the weight and bias of the convolutional layer, W l and b l Represent the weights and biases of the linear layer respectively;

[0047] The loss function is obtained according to the following formula:

[0048]

[0049] Among them, θ * represents the parameters in the network that are optimized using stochastic gradient descent, represents the predicted value of the quality variable, and y represents the actual value of the quality variable;

[0050] Determine the redundant feature variables that need to be deleted according to the following formula:

[0051]

[0052] Among them, r h is the index of the variable with the highest mutual information value.

[0053] Preferably, the step (3) of evaluating the contribution of the preferred variable is as follows:

[0054] The linear model is obtained according to the following formula:

[0055]

[0056] Among them, X be is the preferred variable, g(·) is the linear model, φ0 is a constant, φ j is the Shapley value of the j-th variable;

[0057] The optimization target is obtained according to the following formula:

[0058] L(f,g,π)=∑ z∈Z [f(h(Z))-g(Z)] 2 π(Z);

[0059] Among them, h(Z) represents the transformation of features, [] represents the R predicted by the linear regression model 2 R predicted by MAVS model 2 The difference between the two, f() represents the trained MAVS prediction model, π(Z) represents the weight of the data, Z is a random variable composed of 0 or 1, and the dimension is equal to the number of preferred variables;

[0060] in,

[0061]

[0062] M represents the number of data in the data set used, and |Z| represents the number of 1s in Z.

[0063] The device for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism is characterized in that the device comprises:

[0064] a processor configured to execute computer executable instructions;

[0065] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism are implemented.

[0066] The processor for implementing penicillin fermentation process variable selection processing based on mutual information and attention mechanism is characterized in that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for implementing penicillin fermentation process variable selection processing based on mutual information and attention mechanism are implemented.

[0067] The computer-readable storage medium is characterized in that a computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism.

[0068] The penicillin fermentation process variable selection method based on mutual information and attention mechanism of the present invention is adopted to obtain the preferred variable set of penicillin fermentation process, better predict the penicillin yield, and provide strong guidance for the fermentation process. By optimizing quality-related variables through MI and attention mechanism, the model complexity and data redundancy are effectively reduced, and the prediction accuracy of quality indicators is improved. Shapley analysis of the preferred variables can effectively evaluate the contribution of the variables, further improve the interpretability of the model, and provide strong guidance for the fermentation production process. BRIEF DESCRIPTION OF THE DRAWINGS

[0069] Figure 1 This is a schematic diagram of the variable contribution analysis principle of the method for implementing variable selection processing in the penicillin fermentation process based on mutual information and attention mechanism of the present invention.

[0070] Figure 2 A quality-related feature variable selection diagram based on mutual information for the method of the present invention for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism.

[0071] Figure 3 The present invention is a flowchart of redundant variable deletion based on the attention mechanism for the method of realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism.

[0072] Figure 4 This is a comparison chart of the prediction effects of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism of the present invention and other methods.

[0073] Figure 5 The present invention is a flow chart of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism. DETAILED DESCRIPTION

[0074] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.

[0075] The method for implementing penicillin fermentation process variable selection processing based on mutual information and attention mechanism of the present invention comprises the following steps:

[0076] (1) Obtain penicillin production data, calculate the mutual information MI between measurement variables and quality variables, and remove measurement variables that are not related to quality variables;

[0077] (2) Establish a prediction model based on the attention mechanism, set the number of retained variables, remove redundant variables from the variables selected by MI, and obtain the preferred variables;

[0078] (3) Define the linear explanatory model and evaluate the contribution of the preferred variables based on Shapley analysis of KernelSHAP.

[0079] As a preferred embodiment of the present invention, the step (1) specifically comprises the following steps:

[0080] (1.1) Obtain data from the real penicillin production process through data sources, including offline data and online data;

[0081] (1.2) Calculate the mutual information between the measurement variables and the quality variables, set a threshold, and remove the measurement variables whose mutual information values ​​are less than the threshold.

[0082] As a preferred embodiment of the present invention, the mutual information MI between the measurement variable and the quality variable is calculated in step (1), specifically:

[0083] The mutual information MI between the measurement variables and the quality variables is calculated according to the following formula:

[0084]

[0085] Among them, I(X;Y) represents the mutual information value between two variables, P X (x) and P Y (y) represent the marginal probability density of x and y respectively, P (X,Y) (x,y) represents the joint probability density of x and y.

[0086] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:

[0087] (2.1) Use the variable dataset selected by MI to establish a prediction model based on the attention mechanism and calculate the output of the attention mechanism;

[0088] (2.2) Set the number of variables finally selected and the number of variables to be deleted in each step, and determine the redundant feature variables that need to be deleted.

[0089] As a preferred embodiment of the present invention, the step (2.1) of calculating the attention mechanism output specifically includes the following steps:

[0090] (2.1.1) For each input X, map it to three different spaces;

[0091] (2.1.2) Use dot product attention to calculate similarity;

[0092] (2.1.3) Convert similarity into attention weight through softmax function;

[0093] (2.1.4) Apply the converted attention weights to the corresponding V to obtain the attention output.

[0094] As a preferred embodiment of the present invention, in the step (2.1.1), for each input X, it is mapped to three different spaces, specifically:

[0095] For each input X, it is mapped into three different spaces according to the following formula:

[0096]

[0097]

[0098]

[0099] The input sequence is D x is the number of features, are the parameter matrices of the linear mapping, Q, K, V are the matrices of the query vector, key vector, and value vector respectively;

[0100] The similarity is calculated in step (2.1.2), specifically:

[0101] The similarity is calculated according to the following formula:

[0102]

[0103] Among them, D k are the dimensions of Q and X, Q and K are the query vector and key vector;

[0104] In the step (2.1.3), the similarity is converted into attention weight through the softmax function, specifically:

[0105] The similarity is converted into attention weight through the softmax function according to the following formula:

[0106] A(Q,K)=softmax(Similarity(Q,K));

[0107] The attention output obtained in the step (2.1.4) is specifically:

[0108] The attention output is obtained according to the following formula:

[0109]

[0110] Where V is the matrix of value vectors, Q and K are query vectors and key vectors, and D k are the dimensions of Q and K.

[0111] As a preferred embodiment of the present invention, the redundant feature variables to be deleted in step (2.2) are determined as follows:

[0112] The prediction model output based on the attention mechanism is obtained according to the following formula:

[0113]

[0114] Among them, * represents the convolution operation, H represents the output of the attention mechanism, and W c and b c Represent the weight and bias of the convolutional layer, W l and b l Represent the weights and biases of the linear layer respectively;

[0115] The loss function is obtained according to the following formula:

[0116]

[0117] Among them, θ * represents the parameters in the network that are optimized using stochastic gradient descent, represents the predicted value of the quality variable, and y represents the actual value of the quality variable;

[0118] Determine the redundant feature variables that need to be deleted according to the following formula:

[0119]

[0120] Among them, r h is the index of the variable with the highest mutual information value.

[0121] As a preferred embodiment of the present invention, the contribution of the preferred variable is evaluated in step (3), specifically:

[0122] The linear model is obtained according to the following formula:

[0123]

[0124] Among them, X be is the preferred variable, g(·) is the linear model, φ0 is a constant, φ j is the Shapley value of the j-th variable;

[0125] The optimization target is obtained according to the following formula:

[0126] L(f,g,π)=∑ z∈Z [f(h(Z))-g(Z)]2 π(Z);

[0127] Among them, h(Z) represents the transformation of features, [] represents the R predicted by the linear regression model 2 R predicted by MAVS model 2 The difference between the two, f() represents the trained MAVS prediction model, π(Z) represents the weight of the data, Z is a random variable composed of 0 or 1, and the dimension is equal to the number of preferred variables;

[0128] in,

[0129]

[0130] M represents the number of data in the data set used, and |Z| represents the number of 1s in Z.

[0131] The device for implementing penicillin fermentation process variable selection processing based on mutual information and attention mechanism of the present invention, wherein the device comprises:

[0132] a processor configured to execute computer executable instructions;

[0133] A memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism are implemented.

[0134] The processor of the present invention is used to implement penicillin fermentation process variable selection processing based on mutual information and attention mechanism, wherein the processor is configured to execute computer executable instructions, and when the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for implementing penicillin fermentation process variable selection processing based on mutual information and attention mechanism are implemented.

[0135] The computer-readable storage medium of the present invention stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the above-mentioned method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism.

[0136] In a specific embodiment of the present invention, a penicillin fermentation process variable selection method (MAVS) based on mutual information and attention mechanism is involved, wherein the method comprises the following steps: obtaining penicillin fermentation process data, calculating the mutual information MI between feature variables and quality variables, setting a threshold, and selecting feature variables related to quality; establishing a prediction model based on the attention mechanism, introducing attention weights, and measuring the correlation between variables, thereby eliminating redundant variables in the variables selected by mutual information, thereby obtaining a preferred variable set for the penicillin fermentation process for predicting penicillin production; finally, defining a linear explanatory model, and using the Shapley value based on KernelSHAP to perform interpretable contribution analysis on the preferred variables.

[0137] The penicillin fermentation process variable selection method based on mutual information and attention mechanism, wherein the method comprises the following steps:

[0138] (1) Obtain penicillin production data, calculate the mutual information MI between measurement variables and quality variables, set thresholds, and remove measurement variables that are not related to quality variables;

[0139] (2) Establish a new variable data set based on the results of MI selection, perform data normalization, establish a prediction model based on the attention mechanism, set the number of retained variables and the number of variables to be deleted each time, remove redundant variables from the variables selected by MI, and obtain the preferred variables;

[0140] (3) Based on the established quality variable prediction model and linear regression model, Shapley analysis was used to evaluate the contribution of the preferred variables.

[0141] As a preferred embodiment of the present invention, the step (1) specifically comprises the following steps:

[0142] (1.1) Obtain data from the real penicillin production process through data sources, including offline data and online data;

[0143] (1.2) Calculate the mutual information between the measurement variables and the quality variables, set a threshold, and remove the measurement variables whose mutual information value is less than the threshold;

[0144] As a preferred embodiment of the present invention, the mutual information MI between the measured variable x and the quality variable y is calculated in the following manner:

[0145]

[0146] The above formula defines the calculation method of the mutual information value of discrete variables, where I(X; Y) represents the mutual information value between two variables, and P X (x) and P Y (y) represent the marginal probability density of x and y respectively, P (X,Y)(x,y) represents the joint probability density of x and y.

[0147] The mutual information value is non-negative, I(X; Y) ≥ 0. When X and Y are independent, I(X; Y) = 0. When X and Y are highly correlated, the MI value will be higher.

[0148] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:

[0149] (2.1) Use the variable dataset selected by MI to establish a prediction model based on the attention mechanism;

[0150] (2.2) Set the number of variables to be finally selected and the number of variables to be deleted in each step to remove redundant feature variables;

[0151] As a preferred embodiment of the present invention, the attention mechanism output is calculated as follows:

[0152] The input sequence is N and D x Represents the number of samples and features. For each input X, it is first mapped to three different spaces

[0153]

[0154]

[0155]

[0156] and are the parameter matrices of the linear mapping, Q, K, and V are the matrices of the query vector, key vector, and value vector. The similarity is calculated using dot product attention:

[0157]

[0158] D k is the dimension of Q and K, and the similarity is converted into attention weight through the softmax function:

[0159] A(Q,K)=softmax(Similarity(Q,K)).

[0160] The softmax function converts each similarity value into a non-negative vector that sums to 1. These attention weights are then applied to the corresponding V to obtain the attention output:

[0161]

[0162] As a preferred embodiment of the present invention, the redundant variables to be deleted based on the attention mechanism are determined in the following manner:

[0163] After MI feature selection Tagged with The prediction model output based on the attention mechanism is

[0164]

[0165] * denotes the convolution operation, H denotes the output of the attention mechanism, and W c and b c Represent the weight and bias of the convolutional layer, W l and b l Represent the weight and bias of the linear layer respectively. The loss function is:

[0166]

[0167] θ * represents the parameters in the network that are optimized using stochastic gradient descent, represents the predicted value of the quality variable, and y represents the actual value of the quality variable. Assume that the index of the variable with the highest mutual information value is r h , then the eliminated variable index is:

[0168]

[0169] As a preferred embodiment of the present invention, refer to Figure 1 , the step (3) calculates the variable contribution in the following manner:

[0170] Define an interpretable linear model as:

[0171]

[0172] g(·) represents the linear model, φ0 represents a constant, φ j Represents the Shapley value of the jth variable. Z is used as a simplified feature variable. Z is a random variable consisting of 0 or 1, and its dimension is equal to the number of preferred variables. In Z, 1 indicates that the original preferred variable is used, and 0 indicates that the value of the variable is 0. If all values ​​in Z are 1, the above formula is written as:

[0173]

[0174] Where X be Indicates the preferred variable, then g(X be ) is regarded as the contribution of each variable from φ0 prediction to the result, and the optimization goal is:

[0175]

[0176] h(Z) represents the transformation of features, [] represents the R predicted by the linear regression model 2 The R predicted by the prediction model used in the present invention 2 The difference between the two, f() represents the trained prediction model, π(Z) represents the weight of the data, and the expression is as follows:

[0177]

[0178] M represents the number of data in the data set used, and |Z| represents the number of 1s in Z.

[0179] In a specific embodiment of the present invention, in the process of predicting the quality variables of the penicillin fermentation process, the absence of quality-related variables and the existence of redundant variables will reduce the model prediction performance. This technical solution proposes a method for selecting variables in the penicillin fermentation process based on mutual information and attention mechanism. First, by calculating the mutual information between the feature variables and the quality variables, the quality-related variables are selected. On this basis, a prediction model based on the attention mechanism is established, the attention weight is introduced, the correlation between the variables is measured, the redundant variables in the quality-related variables are removed, and the preferred variable set of penicillin fermentation is obtained and the contribution of each variable is evaluated by Shapley analysis.

[0180] The variable selection method for penicillin fermentation process based on mutual information and attention mechanism mainly includes the following three main stages:

[0181] 1. Data collection and selection of quality-related variables based on mutual information

[0182] 2. Redundant variable removal based on attention mechanism

[0183] 3. Contribution analysis of Shapley-based optimal variables

[0184] 1. Data collection and selection of quality-related variables based on mutual information

[0185] The present invention uses data from a real penicillin production process provided by a biotechnology engineering research center. Fed batch penicillin fermentation was carried out in a 50L bioreactor using a proprietary process control strategy and a Penicillium chrysogenum strain. There are two types of data, namely offline data and online data. Offline data has poor accuracy, large measurement time intervals, and a small sample size, but contains quality indicators, namely penicillin titer. Online data contains a large number of variables and has a high sampling frequency and high accuracy. As shown in Table 1, the data set contains 25 feature variables and a quality variable penicillin titer.

[0186] Table 1 Variable description

[0187]

[0188]

[0189] The input data is {X,Y}, where the feature variable is X and the quality variable is Y. The mutual information MI of X and Y is calculated. The result is as follows Figure 2 As shown, the MI value of the 19th variable is the highest. Set the threshold MI * The eigenvalues ​​with MI less than 0.5 are deleted, and finally 9 eigenvalues ​​are obtained.

[0190] 2. Redundant variable removal based on attention mechanism

[0191] There is redundancy between some variables selected by MI, which will affect the prediction effect when establishing a soft measurement model. Therefore, this paper uses the attention mechanism to eliminate redundant variables, reduce the number of input variables for subsequent modeling, and reduce the complexity of the model. The steps for removing redundant variables are as follows:

[0192] In the first step, a new data set is established based on the results of MI selection, and the new data set is divided into training set, validation set and test set in a ratio of 5:1:1, and the data set is normalized.

[0193] In the second step, the prediction model was built. The key model parameters included the input dimension set to 9, one dimension was reduced after each variable selection step, the batch size was 16, the learning rate was 0.1, and the ReLU activation function was applied. The convolution layer was configured with a kernel size equal to the variable dimension, and other parameters were kept at the default settings.

[0194] The third step is to input data and train the model. The redundant variables that need to be deleted are determined by the following formula. Assume that the index of the variable with the highest mutual information value is r h , then the eliminated variable index is:

[0195]

[0196] In the fourth step, set the number of retained variables to 6. The model deletes one variable each time. If the number of remaining variables is less than or equal to 6, output the preferred variable index; otherwise, repeat the third step.

[0197] After implementing attention-based variable selection, the results are as follows Figure 3 As shown in the figure, in the first step, x5 and x19 have the highest attention scores, indicating that there is significant data redundancy between the two, so the fifth feature variable needs to be deleted. The variables and attention scores selected in the second step are shown in the figure, and the 17th variable is deleted. In the third step, the 20th variable is deleted, and the number of retained variables is 6, and the screening is ended. It should be noted that in the process of summing the attention score matrix of each sample, the attention score may exceed 1 due to the cumulative effect. To avoid this, column standardization is performed on the results.

[0198] Visualize the screening process Figure 4 (a) It can be seen that eliminating redundant data in three training cycles (600 batches in each cycle) can continuously reduce the loss value at convergence and improve the fitting performance of the neural network. Figure 4 (b) Comparison between the predicted value and the true value of the selected variable shows that the prediction effect is good.

[0199] SVR, PLS, MLP, SurvNet, VW-SAE and this method are used to establish a prediction model. The fitting effect on the test set is as follows: Figure 4 (c) and are summarized in Table 2. It can be seen that the R 2 The highest and the lowest RMSE are better than other methods. Due to the nonlinearity of industrial processes, nonlinear neural network modeling is more effective than linear techniques such as PCR and PLS. Figure 4 (d) The box plot and violin plot show the error distribution of different methods. It can be seen that although SVR and PLS show relatively small IQR, they both produce more outliers. The MLP and SurvNet models produce fewer outliers, but the IQR is much larger than that of other models. The comparison between VWSAE and MAVS shows that MAVS has fewer outliers and a smaller IQR than VW-SAE. This shows the superior ability of this method in eliminating irrelevant variables and redundant information, and can effectively retain the key features that have a significant impact on the modeling effect, thereby improving the convergence accuracy and prediction performance of the model.

[0200] Table 2 Method comparison

[0201] SVR PLS MLP SurvNet VW-SAE MAVS <![CDATA[R 2 ]]> 0.8033 0.8125 0.8384 0.8585 0.8645 0.8749 <![CDATA[RMSE(10 4 )]]> 1.4341 1.4004 1.3000 1.2166 1.1903 1.1140

[0202] 3. Contribution analysis of Shapley-based optimal variables

[0203] The Shapley analysis was performed on the six selected variables according to the prediction model, and the results are shown in Table 3. It can be seen that the variable importance ranking based on the Shapley value is consistent with the MI ranking, and the 19th characteristic variable is the most important, emphasizing the methodological consensus on its relative importance. In addition, all Shapley values ​​are positive, indicating that the variables retained after screening contribute positively to the model.

[0204] Table 3 Contribution analysis of selected variables

[0205] <![CDATA[x2]]> <![CDATA[x4]]> <![CDATA[x 14 ]]> <![CDATA[x 15 ]]> <![CDATA[x 19 ]]> <![CDATA[x 22 <!-- 11 -->]]> Shapley 0.1621 0.1437 0.0294 0.1643 0.4515 0.0290

[0206] Compared with other methods, this method constructs a variable selection and soft measurement framework based on penicillin fermentation process data. By calculating the mutual information between the measured variables and the quality variables, the characteristic variables that are not related to the quality are eliminated. A prediction model based on the attention mechanism is established, and the variable with the highest attention score between the variable with the largest MI value is deleted to remove redundant variables and reduce the data dimension. Compared with other methods, the proposed method improves the prediction effect of the model. The contribution of the selected variables is analyzed by Shapley, which further enhances the interpretability of the model. In summary, the variable selection method based on mutual information and attention mechanism is effective and practical.

[0207] The specific implementation scheme of this embodiment can refer to the relevant description in the above embodiment, which will not be repeated here.

[0208] It can be understood that the same or similar parts of the above embodiments can be referenced to each other, and the contents not described in detail in some embodiments can refer to the same or similar contents in other embodiments.

[0209] It should be noted that, in the description of the present invention, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present invention, unless otherwise specified, the meaning of "plurality" refers to at least two.

[0210] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0211] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0212] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the corresponding program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.

[0213] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0214] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0215] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0216] The penicillin fermentation process variable selection method based on mutual information and attention mechanism of the present invention is adopted to obtain the preferred variable set of penicillin fermentation process, better predict the penicillin yield, and provide strong guidance for the fermentation process. By optimizing quality-related variables through MI and attention mechanism, the model complexity and data redundancy are effectively reduced, and the prediction accuracy of quality indicators is improved. Shapley analysis of the preferred variables can effectively evaluate the contribution of the variables, further improve the interpretability of the model, and provide strong guidance for the fermentation production process.

[0217] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.

Claims

1. A method for variable selection processing in penicillin fermentation process based on mutual information and attention mechanism, characterized in that: The method comprises the following steps: (1) Obtain penicillin production data, calculate the mutual information MI between measurement variables and quality variables, and remove measurement variables that are not related to quality variables; (2) Establish a prediction model based on the attention mechanism, set the number of retained variables, remove redundant variables from the variables selected by MI, and obtain the preferred variables; (3) Define the linear explanatory model and evaluate the contribution of the preferred variables based on Shapley analysis of KernelSHAP.

2. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 1, characterized in that: The step (1) specifically comprises the following steps: (1.1) Obtain data from the real penicillin production process through data sources, including offline data and online data; (1.2) Calculate the mutual information between the measurement variables and the quality variables, set a threshold, and remove the measurement variables whose mutual information values ​​are less than the threshold.

3. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 1, characterized in that: The mutual information MI between the measurement variable and the quality variable is calculated in step (1), specifically: The mutual information MI between the measurement variables and the quality variables is calculated according to the following formula: Among them, I(X;Y) represents the mutual information value between two variables, P X (x) and P Y (y) represent the marginal probability density of x and y respectively, P (X,Y) (x,y) represents the joint probability density of x and y.

4. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 1, characterized in that: The step (2) specifically comprises the following steps: (2.1) Use the variable dataset selected by MI to establish a prediction model based on the attention mechanism and calculate the output of the attention mechanism; (2.2) Set the number of variables finally selected and the number of variables to be deleted in each step, and determine the redundant feature variables that need to be deleted.

5. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 4, characterized in that: The step (2.1) of calculating the attention mechanism output specifically includes the following steps: (2.1.1) For each input X, map it to three different spaces; (2.1.2) Use dot product attention to calculate similarity; (2.1.3) Convert similarity into attention weight through softmax function; (2.1.4) Apply the converted attention weights to the corresponding V to obtain the attention output.

6. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 5, characterized in that: In the step (2.1.1), for each input X, it is mapped to three different spaces, specifically: For each input X, it is mapped into three different spaces according to the following formula: The input sequence is D x is the number of features, are the parameter matrices of the linear mapping, Q, K, V are the matrices of the query vector, key vector, and value vector; The similarity is calculated in step (2.1.2), specifically: The similarity is calculated according to the following formula: Among them, D k are the dimensions of Q and X, Q and K are the query vector and key vector; In the step (2.1.3), the similarity is converted into attention weight through the softmax function, specifically: The similarity is converted into attention weight through the softmax function according to the following formula: A(Q,K)=sofmtax(Similarity(Q,K)); The attention output obtained in the step (2.1.4) is specifically: The attention output is obtained according to the following formula: Where V is the matrix of value vectors, Q and K are query vectors and key vectors, and D k are the dimensions of Q and K.

7. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 4, characterized in that: The redundant feature variables to be deleted in step (2.2) are determined as follows: The prediction model output based on the attention mechanism is obtained according to the following formula: Among them, * represents the convolution operation, H represents the output of the attention mechanism, and W c and b c Represent the weight and bias of the convolutional layer, W l and b l Represent the weights and biases of the linear layer respectively; The loss function is obtained according to the following formula: Among them, θ * represents the parameters in the network that are optimized using stochastic gradient descent, represents the predicted value of the quality variable, and y represents the actual value of the quality variable; Determine the redundant feature variables that need to be deleted according to the following formula: Among them, r h is the index of the variable with the highest mutual information value.

8. The method for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism according to claim 1, characterized in that: The contribution of the preferred variables in step (3) is evaluated as follows: The linear model is obtained according to the following formula: Among them, X be is the preferred variable, g(·) is the linear model, φ0 is a constant, φ j is the Shapley value of the j-th variable; The optimization target is obtained according to the following formula: L(f,g,π)=∑ z∈Z [f(h(Z))-g(Z)] 2 π(Z); Among them, h(Z) represents the transformation of features, [] represents the R predicted by the linear regression model 2 R predicted by MAVS model 2 The difference between them, f() represents the trained MAVS prediction model, π(Z) represents the weight of the data, Z is a random variable consisting of 0 or 1, and the dimension is equal to the number of preferred variables; in, M represents the number of data in the data set used, and |Z| represents the number of 1s in Z.

9. A device for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism, characterized in that: The device comprises: a processor configured to execute computer-executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism as described in any one of claims 1 to 8 are implemented.

10. A processor for implementing variable selection processing in penicillin fermentation process based on mutual information and attention mechanism, characterized in that: The processor is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the various steps of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism described in any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for realizing variable selection processing of penicillin fermentation process based on mutual information and attention mechanism as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Feature interpretation method and device for deep learning calculation result, equipment and medium

    CN112784986A

  • Method and device for realizing penicillin fermentation process knowledge graph construction based on neural network, processor and computer storage medium thereof

    CN116523040A

  • Air quality data standardization method and device, computer equipment and medium

    CN116776095A

  • Coke component quality prediction method and device, equipment and storage medium

    CN117236782A

  • Method for identifying named entities by fusing local context information and utilizing label semantics

    CN117852540A