A chemical process fault diagnosis method based on semi-supervised consistency coding network
Patent Information
- Application Number
- CN202311422979.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-30
- Publication Date
- 2026-10-27
- Estimated Expiration
- 2043-10-30
AI Technical Summary
[0003]近年来,深度学习在故障诊断领域取得了不错效果,然而传统的监督学习方法需要大量的有标签数据,化工过程数据的故障变化类型可分为阶跃、随机变化、粘滞等,且每一种变化类型根据不同的化工流程又要做具体细分,而实际工业中含有标签的数据较少,因此对数据进行标记是一项非常耗时的工作,这对深度学习在过程故障诊断领域的发展造成了很大的影响
[0088]本发明的有益效果在于:本发明提出一种新型的基于半监督一致性编码网络的化工过程故障诊断方法,利用改进蚁群算法(ant colony optimization)优化的半监督特征选择进行数据降维,提升模型学习效率、提高预测精度、降低计算复杂度,以利用未标记数据进行化工过程故障诊断和定位,并降低故障诊断中模型检测的误报率,提高对故障数据识别的准确率。
Smart Images

Figure CN117421658B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of fault detection technology and relates to a method for diagnosing chemical process faults based on a semi-supervised consensus coding network. Background Technology
[0002] With the rapid development of modern chemical industry, chemical processes are becoming increasingly automated and complex. While large-scale industrial processes bring enormous economic benefits, due to the high coupling and complexity of the systems, even minor disturbances can paralyze the entire system, leading to huge economic losses and even casualties. Therefore, fault detection and diagnosis technologies are essential for all chemical processes, ensuring their reliable and safe operation according to production plans.
[0003] In recent years, deep learning has achieved good results in the field of fault diagnosis. However, traditional supervised learning methods require a large amount of labeled data. Fault variation types in chemical process data can be categorized into step, stochastic, and viscous variations, and each variation type requires further subdivision depending on the specific chemical process. In reality, labeled data is scarce in industrial settings, making data labeling a very time-consuming task. This significantly impacts the development of deep learning in process fault diagnosis. On the other hand, supervised learning focuses on fault classification and lacks interpretability in identifying fault-related variables. This is crucial for operators to pinpoint fault variables and locate fault locations. Supervised deep learning is often used as an uninterpretable model for fault diagnosis and cannot analyze which process variable information supports the fault classification results. In contrast, semi-supervised learning promises to utilize unlabeled data for fault diagnosis and achieve interpretability to locate faults to relevant variables. Furthermore, chemical process data is often high-dimensional, and direct use of such data can easily lead to the curse of dimensionality. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a chemical process fault diagnosis method based on a semi-supervised consensus coding network.
[0005] To achieve the above objectives, the present invention provides the following technical solution:
[0006] A method for fault diagnosis in chemical processes based on semi-supervised consensus coding networks includes the following steps:
[0007] S1: Acquire the operational variables and process variables measured by various sensors during the chemical production process as historical data of the chemical production process;
[0008] S2: Obtain sample data for fault diagnosis in chemical processes, and perform preprocessing operations on the dataset according to its characteristics;
[0009] S3: Construct a CRLE-LSTM classification model and initialize the model parameters;
[0010] S4: Use the training set for semi-supervised training of CRLE-LSTM;
[0011] S5: Using diagnostic accuracy and localization accuracy as model metrics, continuously optimize the training effect to obtain a trained model for online fault diagnosis;
[0012] S6: After processing, the online process data samples are fed into a validated CRLE-LSTM to classify fault types and extract fault-related variables.
[0013] Furthermore, the historical data of the chemical production process described in step S1 includes various process variable sensors and field instruments. The operating variables include total feed rate, valve opening degree, and stirring speed, while the process variables include flow rate, pressure, temperature, and liquid level.
[0014] Furthermore, the preprocessing method described in step S2 includes data cleaning, feature transformation, and feature selection;
[0015] Data cleaning includes modifying and removing data with missing values or formatting errors, deleting invalid data, and verifying the consistency of the data.
[0016] Feature transformation includes data normalization and data augmentation. Normalizing the feature data to the [0,1] interval is achieved using the Min-Max method, with the following formula:
[0017]
[0018] Feature selection involves eliminating features that are irrelevant to the annotation or are redundant, thereby reducing the number of features.
[0019] Furthermore, the feature selection employs a semi-supervised feature selection method based on ant colony optimization algorithm, and introduces a nonlinear curve to update the linear convergence factor q0, specifically expressed as:
[0020]
[0021] q0 increases non-linearly, meaning the rate of increase decreases from fast to slow.
[0022] The feature selection method steps are as follows:
[0023] Step 1: Initialize parameters, including the number of ants N, the number of iterations T, the number of initial features d, and the number of features in the feature subset d′;
[0024] Step 2: Initialize the pheromone τ of each edge based on the mutual information between the labeled data and the class label, calculate the feature redundancy matrix flcos based on all samples, and the correlation vector flcorr between only labeled samples and class labels, and calculate the state value vector V for each feature node.
[0025] Step 2.1: Calculate the feature redundancy matrix flcos based on all samples and the feature correlation vector flcorr calculated using only labeled samples. The first is the redundancy matrix flcos with dimension d×d. The formula for calculating the cosine coefficient of the redundancy between features is as follows:
[0026]
[0027] In the formula, X and Y are two n-dimensional feature vectors, where n is the number of samples; the second metric is a correlation vector flcorr of size d.
[0028]
[0029] In the formula, X and Y are two n-dimensional feature vectors, T is the upper limit of the grid division of X×Y, which increases with the number of instances in the dataset. The higher the mutual information, the more similar the two variables are. MI(X,Y) is the mutual information between features X and Y, and MI(X,Y) is defined as follows:
[0030]
[0031] In the formula, p(x) is the probability function of x, and p(x,y) represents the joint probability of x and y;
[0032] Step 2.2: Initialize the pheromone by calculating the mutual information between features and class labels. The specific expression is as follows:
[0033] τ i =MI(F i ,Y L )
[0034] Local feature V is initialized as a correlation vector between features and class labels based on labeled data:
[0035] V i =flcorr(F i ,Y L )
[0036] Step 3: Place each ant on a random node and generate an ant counter AntT for each feature node, initializing it to 0;
[0037] Step 4: Using the redundancy matrix and correlation vector as activation functions, the ant updates its next state based on the state transition probability, then updates the ant's state again, calculates the probability again, selects the next state, and updates the ant's state once more. This process of updating the ant's position continues until the ant dies. The state transition equation is defined as:
[0038]
[0039] In the formula, N k Let be a set of unvisited features accessible to ant k; β measures the importance of heuristic information, with a value ranging from [0,1]; the reward function is defined as:
[0040]
[0041] In the formula, This represents the relevance of the next feature and its related labels, where l is its related label; It represents the correlation between the current feature and the next feature;
[0042] Step 5: Update the local state vector V using the reward function and increment the ant counter of the corresponding feature node by 1. The state vector V is defined as follows:
[0043] V(S t )=V(S t )+α[r t+1 +γV(S t+1 )-V(S t )]
[0044] In the formula, S t+1 This represents the state vector of the next feature node, where α is the learning rate and γ represents the influence rate of the next node.
[0045] Step 6: Repeat steps 4 and 5 until all ants have completed the search for the best ant.
[0046] Step 7: Update the global state vector and pheromone, defined as follows:
[0047]
[0048]
[0049] In the formula, N is the number of ants, ρ is the pheromone decay factor, d is the number of features, and AntT(i) represents the number of ants that pass through the i-th feature.
[0050] Step 8: Repeat steps 4, 5, 6, and 7 until the iteration limit is reached;
[0051] Step 9: Sort the features in descending order of pheromone content of the feature nodes, and select the top d′ features as the preferred feature subset.
[0052] Furthermore, the CRLE-LSTM classification model combines LAE with LSTM while adhering to the CR method;
[0053] The LAE consists of a noisy encoder, a decoder, and skip connections from encoder to decoder in all layers; the CR consists of a noisy encoder, a noiseless encoder, and an exponential moving average connection between the two encoders; the CRLE-LSTM explicitly calculates variable importance in the reconstruction loss of each layer. Encoded channel data is processed layer-by-layer through encoder training for feature extraction optimization. The LSTM can extract temporal features from the data. The output of the encoder layer is... The output of the decoder layer is Output through encoder layer and decoder layer output The reconstruction error is obtained; the top-level output of the noisy encoder is... The top-level output of the noiseless encoder is y, which is obtained by using y and The consistency error is obtained, and the softmax classification error is obtained by combining the output of labeled data with the data labels. Finally, the three errors are combined for gradient descent training.
[0054] The CRLE-LSTM encoding layer consists of LSTM, BatchNorm, and activation functions. LSTM uses feedback connections to grasp the internal characteristics of chemical process time data. The LSTM module of the encoding layer is calculated as follows:
[0055] h m =LSTM(y m-1 )
[0056] In the formula, y m-1 The input is a sample matrix, and the output is processed by BatchNorm, defined as follows:
[0057]
[0058]
[0059]
[0060] In the formula, L is the number of samples in this batch, m is the current coding layer number, and h BNm The output of the LSTM is processed by BatchNorm, where r and β are scaling and translation variables, which are trainable parameters; random noise is added to the original input to enhance the model's generalization ability.
[0061] hm =h BNm +n m
[0062] The hidden layer output matrix is calculated as follows:
[0063] y m =g(a T h m +b)
[0064] In the formula, a and b are the orthogonalized hidden layer input weights and thresholds, respectively, and satisfy a T a = 1, b T b = 1, g is the activation function, and LeakyReLU activation function is used;
[0065] In the CRLE-LSTM decoding layer, u is first obtained from the input of the upper layer. m To expand the feature dimension size; then, using the f function, based on u m Calculate the summation weights v m and upper-layer information μ m ;v m Use an additional sigmoid function to convert v m Restricted to the range (0,1); all a in function f m All parameters are trainable.
[0066] u m =BatchNorm(LSTM(Z) m+1 ))
[0067] μ m =f(u m (20)
[0068] v m =sigmoid(g(u m ))
[0069] The function f is defined as follows:
[0070] f(x)=a1⊙sigmoid(a2⊙x+a3)+a4⊙x+a5
[0071] v m and 1-v m They are μ m and The weights of the summation, where It is the skip connection information of the coding layer;
[0072] Z m =v m ⊙μ m +(1-v m)h m
[0073] The structure of the noiseless coding channel of CRLE-LSTM is the same as that of the noisy coding channel, and its parameters are determined based on the moving average of the noisy coding channel:
[0074] θ′ t =αθ′ t-1 +(1-α)θ t
[0075] Where, θ t These are the parameters of the noisy coding channel after a certain training iteration, θ′ t-1 These are the parameters of the previous noise-free encoded channel, θ′ t This is the parameter of the current noise-free coded channel, θ′. t-1 With θ t The weighted sum;
[0076] The loss function of the CRLE-LSTM framework is defined as fault classification loss, input reconstruction loss, and consistency regularization loss; the classification error of softmax is expressed as:
[0077]
[0078] In the formula, i * Let y be the output of the average encoder along the time dimension, representing the actual sample class; the reconstruction error is defined as the mean squared error loss, which is defined as:
[0079]
[0080]
[0081] In the formula, C is the total number of layers in the encoder, and N is the total number of layers in the encoder. m Let m be the number of features in the m-th layer. The consistency error is expressed as follows:
[0082]
[0083] In the formula, L is the sample size, and y i and y i These are the outputs of the noiseless encoder and the noisy encoder, respectively; the reconstruction error and consistency error are added as regularization terms to the supervision cost of the semi-supervised fault classification. The loss function of the CRLE-LSTM framework is defined as:
[0084] J = J lable +λJ recon +w u (t)J con
[0085] In the formula, λ and w u(t) is the weighting function that controls the impact of unsupervised loss on the total loss.
[0086] Furthermore, in step S4, the training data is input into the noisy encoder and the noiseless encoder in batches. The classification error is calculated for the labeled data, and the reconstruction error and consistency error are calculated for the unlabeled data. The model is trained by stochastic gradient descent based on the fusion loss function.
[0087] Furthermore, step S6 also includes adding online fault data to the historical database to enrich the dataset.
[0088] The beneficial effects of this invention are as follows: This invention proposes a novel chemical process fault diagnosis method based on a semi-supervised consensus coding network. It utilizes an improved ant colony optimization algorithm to optimize semi-supervised feature selection for data dimensionality reduction, thereby improving model learning efficiency, prediction accuracy, and reducing computational complexity. This allows for the use of unlabeled data for chemical process fault diagnosis and localization, while also reducing the false alarm rate of model detection in fault diagnosis and improving the accuracy of fault data identification.
[0089] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description
[0090] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:
[0091] Figure 1 Here is a diagram of the CRLE-LSTM model framework;
[0092] Figure 2 A comparison chart of the values of the linear convergence factor and the nonlinear factor;
[0093] Figure 3 The flowchart shows the feature selection process based on the improved ant colony optimization algorithm.
[0094] Figure 4 This is a fault diagnosis and location model based on CRLE-LSTM. Detailed Implementation
[0095] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0096] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual images. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.
[0097] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.
[0098] Please see Figures 1-4 This invention addresses the challenges of acquiring labeled data in chemical process fault diagnosis, the heavy reliance of supervised methods on labeled data, and the insufficient interpretability of process variables, which hinders fault localization. It proposes a novel chemical process fault diagnosis method based on a semi-supervised consistent coding network (CRLE-LSTM). This method uses a Long Short-Term Memory (LSTM) network to extract temporal features, employs a trapezoidal autoencoder (LAE) for semi-supervised learning, effectively utilizes unlabeled data, and introduces a consistency regularization (CR) method into the encoder-decoder framework to push the decision boundary into a low-density region, making the distinction between different categories more obvious and significantly improving fault diagnosis accuracy. The method specifically includes the following steps:
[0099] (1) Acquire the operating variables and process variables measured by various sensors in the chemical production process as historical data of the chemical production process, including various process variable sensors and field instruments. The operating variables include total feed rate, valve opening, and stirring speed. The process variables include flow rate, pressure, temperature, and liquid level, etc.
[0100] (2) Sample data for chemical process fault diagnosis were obtained. Preprocessing operations were performed on the dataset based on its characteristics, including data cleaning, feature transformation, and feature selection. Data cleaning and feature transformation significantly improved the completeness, consistency, and standardization of the data, thus enhancing data quality. Since chemical process variables are highly correlated and redundant, and are often high-dimensional, feature selection can remove irrelevant or redundant features, reduce data dimensionality, prevent overfitting, and improve model accuracy. 70% of the preprocessed data was randomly selected as the training set, and the remaining 30% was used as the test set.
[0101] ① Data cleaning includes modifying and removing data with missing values or formatting errors, deleting invalid data, and checking data consistency. Feature transformation includes data normalization and data augmentation. Each traffic feature may have different dimensional relationships. To avoid large differences between features affecting the classification results and to improve the model's convergence speed, the data is normalized to the [0,1] interval using the Min-Max method, with the formula:
[0102]
[0103] ② Feature selection involves removing irrelevant or redundant features, reducing the number of features. This reduces model training time, prevents overfitting, and improves model accuracy. This invention proposes a semi-supervised feature selection method based on ant colony optimization (ACO) algorithm. The ACO algorithm is improved to enhance performance by introducing a nonlinear curve to update the linear convergence factor q0, thereby improving search accuracy and convergence speed, and balancing the search performance of the optimization algorithm. Specifically:
[0104] In the original ACO algorithm, the relationship between the ant's movement control coefficient q and the constant coefficient q0 at the node determines the coordination between global search and local exploitation. q0 is a constant coefficient in the range [0,1], and q is a random number in the range [0,1]. When the coefficient q > q0, the ant will perform a global walk to search for the global optimum, called exploration; when the coefficient q ≤ q0, the ant will only choose the feature with the highest pheromone, called exploitation. Because q is a random number, whether to explore or exploit is mainly determined by q0. The larger q0 is, the faster the algorithm converges, but the easier it is to get trapped in local optima. q0 increases linearly between 0 and 1, while the intelligent search process of the ant colony algorithm can be regarded as a complex nonlinear behavior. Therefore, a nonlinear curve is introduced to update the convergence factor q0, with the specific expression as follows:
[0105]
[0106] Where ω=1, ω is the nonlinear convergence coefficient. As the number of iterations increases, q0 increases nonlinearly, that is, the rate of increase slows down. In the early stage of iteration, the ant colony mainly explores and searches for the optimal solution globally. In the later stage of iteration, the ant colony mainly utilizes the local resources and performs fine-grained searches locally, thus better balancing the global and local search performance of the algorithm.
[0107] ③ The basic steps of feature selection based on the improved ant colony algorithm are as follows:
[0108] Step 1: Initialize parameters, including the number of ants N, the number of iterations T, the number of initial features d, and the number of features in the feature subset d′.
[0109] Step 2: Initialize the pheromone τ of each edge based on the mutual information between the labeled data and the class label, calculate the feature redundancy matrix flcos based on all samples, and the correlation vector flcorr between only labeled samples and class labels, and calculate the state value vector V for each feature node.
[0110] Step 2.1: Calculate the feature redundancy matrix flcos based on all samples and the feature correlation vector flcorr calculated using only labeled samples. The first is the redundancy matrix flcos with dimension d×d. The formula for calculating the cosine coefficient of the redundancy between features is as follows:
[0111]
[0112] In the formula, X and Y are two n-dimensional feature vectors, and n is the number of samples. The second metric is a correlation vector flcorr of size d.
[0113]
[0114] In the formula, X and Y are two n-dimensional feature vectors, T is the upper limit of the grid division of X×Y, which increases with the number of instances in the dataset. The higher the mutual information, the more similar the two variables are. MI(X,Y) is the mutual information between features X and Y, and MI(X,Y) is defined as follows:
[0115]
[0116] In the formula, p(x) is the probability function of x, and p(x,y) represents the joint probability of x and y.
[0117] Step 2.2: Pheromone initialization affects ACO performance. Initializing pheromones with a constant will slow down ACO convergence. Therefore, to accelerate convergence and improve efficiency, pheromones are initialized by calculating the mutual information between features and class labels. The specific expression is as follows:
[0118] τ i =MI(F i ,Y L (6)
[0119] The local feature V is initialized as a correlation vector between the features and class labels based on the labeled data.
[0120] V i =flcorr(F i ,Y L (7)
[0121] Step 3: Place each ant on a random node and generate an ant counter AntT for each feature node, initialized to 0.
[0122] Step 4: Using the redundancy matrix and correlation vector as activation functions, the ant updates its next state based on the state transition probability, then updates the ant's state again, calculates the probability again, selects the next state, and updates the ant's state once more. This process of updating the ant's position continues until the ant dies. The state transition equation is defined as:
[0123]
[0124] In the formula, N k Let be a set of unvisited features accessible to ant k. Let β measure the importance of the heuristic information, with a value ranging from [0,1]. The reward function is defined as:
[0125]
[0126] In the formula, This represents the relevance of the next feature and its related labels, where l is its related label. It represents the correlation between the current feature and the next feature.
[0127] Step 5: Update the local state vector V using the reward function and increment the ant counter of the corresponding feature node by 1. The state vector V is defined as follows:
[0128] V(S t )=V(S t )+α[r t+1 +γV(S t+1 )-V(S t (10)
[0129] In the formula, S t+1 This represents the state vector of the next feature node, α is the learning rate, and γ represents the influence rate of the next node.
[0130] Step 6: Repeat steps 4 and 5 until all ants have completed the search for the best ant.
[0131] Step 7: Update the global state vector and pheromone, defined as follows:
[0132]
[0133]
[0134] In the formula, N is the number of ants, ρ is the pheromone decay factor, d is the number of features, and AntT(i) represents the number of ants that have passed through the i-th feature.
[0135] Step 8: Repeat steps 4, 5, 6, and 7 until the iteration limit is reached.
[0136] Step 9: Sort the features in descending order of pheromone content of the feature nodes, and select the top d′ features as the preferred feature subset.
[0137] (3) This model combines LAE with LSTM and follows the CR method to effectively utilize unlabeled data for fault diagnosis, which greatly improves the fault diagnosis performance. In addition, in CRLE-LSTM, the decoder reconstruction input is defined as a weighted sum of fault-related information from the upper layer and fault-independent information from the coding layer. Therefore, the variables reconstructed mainly using upper layer information can be regarded as fault-related variables because these variables contribute the most to classification and are conducive to locating the fault to the relevant variables.
[0138] A CRLE-LSTM classification model is constructed and its parameters are initialized. The CRLE-LSTM structure consists of three parts: a trapezoidal autoencoder module, a consistency regularization module, and a hybrid loss module. The LAE consists of a noisy encoder, a decoder, and skip connections from encoder to decoder in all layers. The CR consists of a noisy encoder, a noiseless encoder, and an exponential moving average connection between the two encoders. The CRLE-LSTM explicitly calculates variable importance in the reconstruction loss of each layer, which helps to pinpoint faults to specific process variables. Encoded channel data is processed layer-by-layer through encoder training, and feature extraction is performed. The LSTM extracts temporal features from the data. The output of the encoder layer is... The output of the decoder layer is Output through encoder layer and decoder layer output The reconstruction error is obtained. The top-level output of the noisy encoder is... The top-level output of the noiseless encoder is y, which is obtained by using y and The consistency error is obtained, and the softmax classification error is obtained by combining the output of labeled data with the data labels. Finally, the three errors are combined for gradient descent training.
[0139] The CRLE-LSTM encoding layer consists of LSTM, BatchNorm, and activation functions. Chemical process data is a typical time series, and LSTM can capture the internal characteristics of time data through feedback connections. The LSTM module of the encoding layer is calculated as follows:
[0140] h m =LSTM(y m-1 (13)
[0141] In the formula, y m-1 The input is a sample matrix, and the output is processed by BatchNorm, which improves the model's convergence speed and classification performance. It is defined as follows:
[0142]
[0143]
[0144]
[0145] In the formula, L is the number of samples in this batch, m is the current coding layer number, and h BNm The output of the LSTM is processed by BatchNorm, where r and β are scaling and translation variables, which are trainable parameters. Random noise is added to the original input to enhance the model's generalization ability.
[0146] hm =h BNm +n m (17)
[0147] The hidden layer output matrix is calculated as follows:
[0148] y m =g(a T h m +b) (18)
[0149] In the formula, a and b are the orthogonalized hidden layer input weights and thresholds, respectively, and satisfy a T a = 1, b T b = 1, g is the activation function, and the LeakyReLU activation function is used.
[0150] In the CRLE-LSTM decoding layer, u is first obtained from the input of the upper layer. m To expand the feature dimension size. Then, using the f function defined in equation (22), according to u m Calculate the summation weights v m and upper-layer information μ m v m An additional sigmoid function was used, therefore v m It is restricted to the range (0,1). All a in the function f are limited to the range (0,1). m All parameters are trainable.
[0151] u m =BatchNorm(LSTM(Z) m+1 (19)
[0152] μ m =f(u m (20)
[0153] v m =sigmoid(g(u m )) (twenty one)
[0154] The function f is defined as follows:
[0155] f(x)=a1⊙sigmoid(a2⊙x+a3)+a4⊙x+a5 (22)
[0156] v m and 1-v m They are μ m and The weights of the summation, where It is the skip connection information of the coding layer.
[0157] Z m =vm ⊙μ m +(1-v m )⊙h m (twenty three)
[0158] The structure of the noiseless encoding channel of CRLE-LSTM is the same as that of the noisy encoding channel. Its parameters are not obtained by training with backward gradient descent, but are determined by the moving average of the noisy encoding channel:
[0159] θ′ t =αθ′ t-1 +(1-α)θ t (twenty four)
[0160] Where, θ t These are the parameters of the noisy coding channel after a certain training iteration, θ′ t-1 These are the parameters of the previous noise-free encoded channel, θ′ t This is the parameter of the current noise-free coded channel, θ′. t-1 With θ t The weighted sum.
[0161] The loss function of the CRLE-LSTM framework is defined as fault classification loss, input reconstruction loss, and consistency regularization loss. Encoder-decoder networks can extract features useful for classification, contributing to feature interpretability; however, these features lack discriminative power. The CR method, on the other hand, can push samples into low-density separation regions, helping the model to distinguish features. The classification error of softmax can be expressed as:
[0162]
[0163] In the formula, i * Let y represent the actual sample class, and y be the output of the average encoder along the time dimension. The reconstruction error is defined as the mean squared error loss, which is defined as:
[0164]
[0165]
[0166] In the formula, C is the total number of layers in the encoder, and N is the total number of layers in the encoder. m Let be the number of features in the m-th layer. The consistency error is expressed as follows:
[0167]
[0168] In the formula, L is the sample size, and y i and y iThese are the outputs of the noiseless encoder and the noisy encoder, respectively. The reconstruction error and consistency error are added as regularization terms to the supervision cost of the semi-supervised fault classification. The loss function of the CRLE-LSTM framework is defined as:
[0169] J = J lable +λJ recon +w u (t)J con (29)
[0170] In the formula, λ and w u (t) is the weighting function that controls the impact of unsupervised loss on the total loss.
[0171] (4) Use the training set for semi-supervised training of CRLE-LSTM. Input the training data into the noisy encoder and the noisy encoder in batches. Calculate the classification error for labeled data and the reconstruction error and consistency error for unlabeled data. Train the model using stochastic gradient descent based on the fusion loss function.
[0172] (5) Diagnostic accuracy and positioning accuracy are used as model metrics to continuously optimize the training effect and obtain a training model for online fault diagnosis.
[0173] (6) After processing, the online process data samples are fed into a validated CRLE-LSTM to classify fault types and extract fault-related variables. For maintenance purposes, online fault data can be added to a historical database to enrich the dataset.
[0174] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for fault diagnosis in chemical processes based on semi-supervised consensus coding networks, characterized in that: Includes the following steps: S1: Acquire the operational variables and process variables measured by various sensors during the chemical production process as historical data of the chemical production process; S2: Obtain sample data for fault diagnosis in chemical processes, and perform preprocessing operations on the dataset according to its characteristics; S3: Construct a CRLE-LSTM classification model and initialize the model parameters; S4: Use the training set for semi-supervised training of CRLE-LSTM; S5: Using diagnostic accuracy and localization accuracy as model metrics, continuously optimize the training effect to obtain a trained model for online fault diagnosis; S6: After processing, the online process data samples are fed into a validated CRLE-LSTM to classify fault types and extract fault-related variables. The CRLE-LSTM classification model combines LAE with LSTM while adhering to the CR method; The LAE consists of a noisy encoder, a decoder, and skip connections from encoder to decoder in all layers; the CR consists of a noisy encoder, a noiseless encoder, and an exponential moving average connection between the two encoders; the CRLE-LSTM explicitly calculates variable importance in the reconstruction loss of each layer. Encoded channel data is processed layer-by-layer through encoder training for feature extraction optimization. The LSTM can extract temporal features from the data. The output of the encoder layer is... The output of the decoder layer is Output through encoder layer and decoder layer output The reconstruction error is obtained; The top-level output of the noisy encoder is The top-level output of the noiseless encoder is ,pass and The consistency error is obtained, and the softmax classification error is obtained by combining the output of labeled data with the data labels. Finally, the three errors are combined for gradient descent training. The CRLE-LSTM encoding layer consists of LSTM, BatchNorm, and activation functions. LSTM uses feedback connections to grasp the internal characteristics of chemical process time data. The LSTM module of the encoding layer is calculated as follows: In the formula, The input is a sample matrix, and the output is processed by BatchNorm, defined as follows: In the formula, This refers to the number of samples in this batch. The current coding layer number, The output of the LSTM is the result after BatchNorm processing. and The scaling and translation variables are trainable parameters; by adding random noise to the original input, the model's generalization ability is enhanced. The hidden layer output matrix is calculated as follows: In the formula b and b are the orthogonalized hidden layer input weights and thresholds, respectively, and satisfy the following conditions: , , For the activation function, use the LeakyReLU activation function; In the CRLE-LSTM decoding layer, the first step is to obtain the input from the upper layer. To expand the feature dimension size; Then, using f Function, according to Calculate the summation weights and upper-level information ; Use an additional sigmoid function to... Limited to the range (0,1); f All in the function All parameters are trainable. The function f is defined as follows: and They are and The weights of the summation, where It is the skip connection information of the coding layer; The structure of the noiseless coding channel of CRLE-LSTM is the same as that of the noisy coding channel, and its parameters are determined based on the moving average of the noisy coding channel: in, These are the parameters of the noisy coding channel after a certain training iteration. These are the parameters from the previous noise-free coded channel. These are the parameters of the current noise-free coding channel. and The weighted sum; The loss function of the CRLE-LSTM framework is defined as fault classification loss, input reconstruction loss, and consistency regularization loss; the classification error of softmax is expressed as: In the formula, Let y be the output of the average encoder along the time dimension, representing the actual sample class; the reconstruction error is defined as the mean squared error loss, which is defined as: In the formula, C represents the total number of layers in the encoder. Let m be the number of features in the m-th layer. The consistency error is expressed as follows: In the formula, L is the sample size. and These are the outputs of the noiseless encoder and the noisy encoder, respectively; the reconstruction error and consistency error are added as regularization terms to the supervision cost of the semi-supervised fault classification. The loss function of the CRLE-LSTM framework is defined as: In the formula, and It is a weighting function that controls the impact of unsupervised loss on the total loss.
2. The chemical process fault diagnosis method based on a semi-supervised consensus coding network according to claim 1, characterized in that: The historical data of the chemical production process mentioned in step S1 includes various process variable sensors and field instruments. The operating variables include total feed rate, valve opening degree, and stirring speed, while the process variables include flow rate, pressure, temperature, and liquid level.
3. The chemical process fault diagnosis method based on a semi-supervised consensus coding network according to claim 1, characterized in that: The preprocessing methods described in step S2 include data cleaning, feature transformation, and feature selection; Data cleaning includes modifying and removing data with missing values or formatting errors, deleting invalid data, and verifying the consistency of the data. Feature transformation includes data normalization and data augmentation. Normalizing the feature data to the [0,1] interval is achieved using the Min-Max method, with the following formula: Feature selection involves eliminating features that are irrelevant to the annotation or are redundant, thereby reducing the number of features.
4. The chemical process fault diagnosis method based on a semi-supervised consensus coding network according to claim 3, characterized in that: The feature selection employs a semi-supervised feature selection method based on ant colony optimization algorithm, and introduces a nonlinear curve to update the linear convergence factor. The specific expression is: It exhibits a non-linear increasing trend, meaning the rate of increase gradually decreases. The feature selection method steps are as follows: Step 1: Initialize parameters, including the number of ants N, the number of iterations T, the initial feature set size d, and the number of features in the feature subset. ; Step 2: Initialize the pheromone τ of each edge based on the mutual information between the labeled data and the class label, calculate the feature redundancy matrix flcos based on all samples, and the correlation vector flcorr between only labeled samples and class labels, and calculate the state value vector V for each feature node. Step 2.1: Calculate the feature redundancy matrix flcos based on all samples and the feature correlation vector flcorr calculated using only labeled samples. The first is of dimension 1. The formula for calculating the cosine coefficient of redundancy between features is as follows: (The formula is missing from the provided text.) In the formula, X and Y are two n-dimensional feature vectors, where n is the number of samples; the second metric is a correlation vector flcorr of size d. In the formula, X and Y are two n-dimensional feature vectors, and T is... The upper limit of the grid partitioning increases with the number of instances in the dataset; the higher the mutual information, the more similar the two variables are. For the mutual information between features X and Y, The definition is as follows: In the formula, Let x be a probability function. This represents the joint probability of x and y; Step 2.2: Initialize the pheromone by calculating the mutual information between features and class labels. The specific expression is as follows: Local feature V is initialized as a correlation vector between features and class labels based on labeled data: Step 3: Place each ant on a random node and generate an ant counter AntT for each feature node, initializing it to 0; Step 4: Using the redundancy matrix and correlation vector as activation functions, the ant updates its next state based on the state transition probability, then updates the ant's state again, calculates the probability again, selects the next state, and updates the ant's state once more. This process of updating the ant's position continues until the ant dies. The state transition equation is defined as: In the formula, Let k be a set of unvisited features accessible to ant k. The importance of heuristic information is measured, with values ranging from [0,1]; the reward function is defined as: In the formula, This represents the correlation between the next feature and its related labels. Tag it accordingly; It represents the correlation between the current feature and the next feature; Step 5: Update the local state vector V using the reward function, and increment the ant counter of the corresponding feature node by 1. The state vector V is defined as follows: In the formula, This represents the state vector of the next feature node. It's the learning rate. Characterizes the influence rate of the next node; Step 6: Repeat steps 4 and 5 until all ants have completed the search for the best ant. Step 7: Update the global state vector and pheromone, defined as follows: In the formula, N is the number of ants. Here, d is the pheromone decay factor, and d is the number of features. This represents the number of ants that passed through the i-th feature; Step 8: Repeat steps 4, 5, 6, and 7 until the iteration limit is reached; Step 9: Sort the features in descending order of pheromone content, and select the top [features]. These features are selected as the preferred feature subset.
5. The chemical process fault diagnosis method based on a semi-supervised consensus coding network according to claim 1, characterized in that: In step S4, the training data is input into the noisy encoder and the noiseless encoder in batches. The classification error is calculated for the labeled data, and the reconstruction error and consistency error are calculated for the unlabeled data. The model is trained by stochastic gradient descent based on the fusion loss function.
6. The chemical process fault diagnosis method based on a semi-supervised consensus coding network according to claim 1, characterized in that: Step S6 also includes adding online fault data to the historical database to enrich the dataset.