Industrial process fault detection method and system based on spatiotemporal feature attention fusion

By adopting the spatiotemporal feature attention fusion model in industrial process fault detection, combining multi-channel convolution and attention mechanism, the problem of insufficient spatiotemporal feature extraction in the existing technology is solved, and the accuracy and reliability of fault detection are improved, so as to achieve Higher fault detection accuracy.

CN118797321BActive Publication Date: 2024-11-22WUHAN TEXTILE UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411288685.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-14
Publication Date
2024-11-22
Estimated Expiration
2044-09-14

AI Technical Summary

Technical Problem

The prior art is difficult to effectively extract spatiotemporal features in industrial process fault detection, especially when processing multi-dimensional time series data, resulting in insufficient accuracy and reliability of fault detection.

Method used

Using a fault detection model based on space-time feature attention fusion, spatial features are extracted through multi-channel one-dimensional convolution, and temporal features are extracted through two-dimensional convolution, and feature fusion is performed using channel-weighted attention and cross-attention mechanisms to ensure that the model can be comprehensive Capture multi-dimensional feature information of the data.

Benefits of technology

It improves the accuracy and reliability of fault detection, can achieve higher fault detection accuracy in diverse scenarios, dynamically select and optimize key features, and enhances the neural network's attention to key information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118797321B_ABST
    Figure CN118797321B_ABST
Patent Text Reader

Abstract

The present invention discloses an industrial process fault detection method and system based on spatiotemporal feature attention fusion, including: performing data standardization processing on the original normal data, and extracting spatial feature information in the variable dimension by using multi-channel one-dimensional convolution. In the time dimension, multi-channel two-dimensional convolution is used to extract the time feature information of the data, thereby solving the problem of extracting the time variable correlation and data time series of multi-dimensional time series data features; then, the extracted multi-channel feature data is subjected to channel attention weighted fusion to better capture the distribution characteristics of the data on different channels, thereby enhancing the useful feature information; next, the spatiotemporal feature fusion is performed by using the cross attention mechanism to enhance the expression ability of the data features; further, the fused features are subjected to model training on the reconstructed data through the fully connected layer to obtain the fault detection model; finally, the online data is input into the fault detection model to obtain the fault detection result of the online data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial process fault detection, and proposes an industrial process fault detection method and system based on spatiotemporal feature attention fusion, which is suitable for early warning and monitoring of industrial processes. Background Art

[0002] In modern industry, Industry 4.0 and related technologies are developing rapidly. Industrial process fault detection is the key to ensure continuous and efficient production. Timely detection and identification of equipment failures or abnormal conditions can avoid production interruptions, reduce maintenance costs, and improve production efficiency and product quality. These technologies not only enhance the stability and reliability of production lines, but also reduce the waste of resources and energy, which is crucial to the economic benefits and environmental impact of enterprises. In this context, process monitoring has become a key technology to maintain the stable operation of industrial processes, which is crucial to safe production and product quality.

[0003] Existing technologies mostly rely on traditional statistical models and machine learning, which have limited effects on complex nonlinear non-Gaussian data processing. In contrast, deep learning has shown great potential by mapping data to latent space to describe process characteristics, which is the key to feature extraction. However, due to the complexity and diversity of industrial data and the performance of different models, deep learning is limited in feature extraction and it is difficult to fully map the features that match the data.

[0004] As typical deep learning models, autoencoders and long short-term memory networks have shown significant performance advantages in unsupervised learning, especially in the field of fault detection. However, there are still challenges in extracting spatiotemporal features of time series data, especially when dealing with multidimensional data. Some researchers have taken advantage of the advantages of convolutional neural networks in image processing and mapped one-dimensional time series to two dimensions through the Gram angle field to perform fault detection. Although this method focuses on temporal characteristics, it usually ignores the importance of spatial features, while other methods focus on spatial characteristics and ignore temporal characteristics. In order to solve the problem of insufficient spatiotemporal feature extraction, an industrial process fault detection method based on spatiotemporal feature attention fusion is proposed. Summary of the invention

[0005] The present invention proposes a fault detection model based on the fusion of spatiotemporal feature attention. In terms of spatial feature extraction, multi-channel one-dimensional convolution is used to process the original data to extract rich spatial features. In terms of temporal feature extraction, the original data is first converted into a Gram matrix, and then the temporal features of the data are extracted using two-dimensional convolution. In order to further fuse and enhance the feature expression, a channel-weighted attention mechanism is used to evaluate the importance of each channel. The temporal features mainly involve the changes in the data over time, while the spatial features focus on the distribution and changes of the data in the spatial dimension. Considering that temporal features and spatial features provide different but complementary information in data representation, cross attention is used for spatiotemporal fusion to ensure that the model can effectively combine spatial features and temporal features, thereby improving the accuracy and reliability of fault detection. The method comprises the following steps:

[0006] S1, offline phase, obtains historical multivariate time series datasets from industrial processes , where m represents the number of samples and n represents the number of variables;

[0007] S2, for the dataset The corresponding data samples of each characteristic variable in the standardization process are obtained. ;

[0008] S3, transforming the data X into a Gram matrix pattern XG;

[0009] S4, perform multi-channel one-dimensional convolution feature extraction on data X to extract rich spatial feature information and obtain feature data X1; perform multi-channel two-dimensional convolution feature extraction on data XG to extract rich temporal feature information and obtain feature data XG2;

[0010] S5, use channel weighted attention to process features X1 and XG2 to obtain weighted feature maps W_X1 and W_XG2;

[0011] S6, use the cross attention mechanism to perform spatiotemporal fusion on the weighted feature map to obtain the fused feature map X_f;

[0012] S7, X_f passes through the fully connected layer to obtain the reconstructed features consistent with the original data X dimension, calculate the reconstruction error, and use it as the loss function of the model constructed in steps S4-S6 for back propagation, update the parameters of the model, and obtain a new set of parameters. After multiple iterations, a trained fault detection model is finally obtained;

[0013] S8, taking data X as input, using the trained fault detection model to calculate the reconstructed data X_R, and calculating the sample residual value , and then calculate the control limits of the normal data set through kernel density estimation;

[0014] S9, in the online stage, the real-time collected data X_n is used, standardized and input into the trained fault detection model to calculate the residual value corresponding to the test data , compare it with the control limit, and finally determine whether a fault occurs based on the comparison result value.

[0015] Furthermore, the specific formula for the standardization process in step S2 is as follows:

[0016] ;

[0017] in, is the original value of the data sample corresponding to the jth feature variable in the data set S, represents the mean value corresponding to the jth variable, It is expressed as the variance corresponding to the j-th variable.

[0018] Furthermore, the specific implementation of step S3 is as follows:

[0019] 31) Normalize the time series data Encoded as the angle cosine, , 1 , and encode the timestamp as the radius to represent the rescaled time series in polar coordinates as follows:

[0020] ;

[0021] in represents the value of the jth variable of the ith sample, Indicates that The angle after the arc cosine function transformation;

[0022] 32) Using the cosine of the angle sum at each time point to characterize the temporal correlation within different time intervals, the Gram sum angle field GASF is defined as follows:

[0023] ;

[0024] in The angle corresponding to the (i+1)th sample of the jth variable is represented by adding the i-th sample angle and the (i+1)-th sample angle and calculating the corresponding value using the cosine function;

[0025] 33) For a single variable , time series data with batch length L, where Representative The two-dimensional data set XG formed by sampling points is:

[0026] .

[0027] Furthermore, in step S4, convolutional feature extraction is performed on the data sets X and XG. The specific formula is as follows:

[0028] ;

[0029] ;

[0030] in and They are respectively the first The convolution kernel and bias term connected between the i-th input feature map and the j-th feature map of the layer, Indicates -The i-th input feature map of layer 1, is the ReLU activation function, It is the feature map obtained after a convolution operation, indicating the The j-th feature map of the layer; and They are respectively the first The convolution kernel and bias term connected between the i-th input feature map and the j-th feature map of the layer, Indicates -The i-th input feature map of layer 1, It is the feature map obtained after a two-dimensional convolution operation, indicating the The j-th feature map of the layer.

[0031] Furthermore, in step S5, X1 is converted into W_X1 through the weighted attention module W-SENet, and the process is as follows:

[0032] 51) Obtain the feature X1 after multi-channel one-dimensional convolution feature extraction and perform the following calculation:

[0033] ;

[0034] Among them, the characteristics The superscript c represents the number of feature channels, w represents the width of the feature, and h represents the height of the feature. represents the compression operation, which is to compress the feature size of c,w,h to the size of c,1,1, that is, to compress w and h into 1 dimension. This process is completed by global average pooling;

[0035] 52) Use the compressed feature vector , perform full connection layer calculation to obtain attention weight ,Will With features Perform point multiplication calculation and then add them in the channel dimension to obtain the feature map after weighted fusion of features , the specific formula is as follows:

[0036] ;

[0037] ;

[0038] in is the Relu function, W1 and W2 are the weights of the two fully connected layers, is the softmax function, which ensures that the weight of each channel adds up to 1. is the attention weight, using The function performs weighted processing on each channel, and finally multiplies the original feature map to obtain the channel-weighted feature map. The whole process is learned in the channel dimension to obtain the importance of each channel, and finally added together in the channel dimension to obtain the channel-weighted fusion feature map. ;

[0039] W-SENet transforms the feature map X1 of size c,w,h into the feature map W_X1 of size 1,w,h, and processes XG2 in the same way to obtain W_XG2.

[0040] Furthermore, the processing process of the cross-attention mechanism in step S6 is as follows;

[0041] ;

[0042] ;

[0043] in Represents the channel-weighted temporal feature map, which is used to calculate the key (K) and value (V). is the dimension of the key, and for The spatial feature map representing the channel weighting is used to calculate its query matrix Q. Finally, the attention score is calculated. The softmax function is used to generate the attention weight, and the use of softmax ensures that the attention weight of each key adds up to 1. Finally, the feature X_f after the fusion of spatiotemporal features is obtained through this attention score calculation process.

[0044] Furthermore, the calculation formula of the loss function in step S7 is as follows:

[0045] ;

[0046] in represents the weight of the fully connected layer, Represents the i-th sampling data.

[0047] Furthermore, the specific implementation of step S8 is as follows:

[0048] 81) Take X as input and input it into the trained fault detection model to calculate the reconstruction error X_R.

[0049] =Model( );

[0050] in, represents the normalized input data, , 1 , Model represents the trained fault detection model, Represents input data Reconstructed data after Model;

[0051] 82) Use the reconstructed data to calculate the residual value of the sample, specifically:

[0052] ;

[0053] in It is expressed as the residual value of the i-th sample. After the above formula, the residual value of each sample is obtained;

[0054] 83) The sample residual value is calculated using kernel density estimation to obtain the control limit of normal data. Specifically: Assume is the statistic of the control limit to be sought, that is for , the actual density probability density function is written as , the estimated probability density function is :

[0055] ;

[0056] in, ,..., express m samples of ; is the kernel function, is bandwidth;

[0057] Then set the confidence level , It can be calculated from the following cumulative probability formula, where Threshold represents the control limit:

[0058] ;

[0059] Finally, the above steps are used to calculate The control limit Threshold.

[0060] Furthermore, the specific implementation of step S9 is as follows:

[0061] Use the online data X_n, standardize it, and then input it into the trained model to calculate the residual value, and compare it with the control limit Threshold, specifically:

[0062] ;

[0063] =Model( );

[0064] ;

[0065] in, and They are respectively represented as the mean and variance corresponding to the j-th variable of the data set S, It represents the data of the jth variable of the i-th sample after standardization. Represents the reconstructed data, Represents the residual value corresponding to the i-th sample;

[0066] .

[0067] The present invention also provides an industrial process fault detection system based on spatiotemporal feature attention fusion, including a processor and a memory, the memory being used to store program instructions, and the processor being used to call the stored instructions in the memory to execute an industrial process fault detection method based on spatiotemporal feature attention fusion as described in the above technical solution.

[0068] Compared with the prior art, the above technical solution conceived by the present invention can achieve the following beneficial effects:

[0069] (1) This paper proposes a fault detection method based on the fusion of spatiotemporal feature attention. The cross-attention mechanism is used to fuse temporal features and spatial features, comprehensively capture the multi-dimensional feature information of the original data, and achieve higher fault detection accuracy under diverse scenario requirements.

[0070] (2) In the variable dimension, multi-channel one-dimensional convolution is used for feature extraction to obtain rich spatial feature information. In the time dimension, the time series data is converted into a two-dimensional image represented by the Gram angular field, and a multi-channel two-dimensional convolutional neural network is used to achieve efficient extraction of temporal features.

[0071] (3) The present invention constructs a channel-weighted attention mechanism that can evaluate the importance of features extracted from different channels and assign higher weights to more important channels, thereby achieving weighted fusion of features and making the neural network pay more attention to key information, thereby achieving dynamic feature selection and optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0072] Figure 1 It is a flow chart of an industrial process fault detection method based on spatiotemporal feature attention fusion provided by an embodiment of the present invention.

[0073] Figure 2 Schematic diagram of the detection results of various methods and the experimental method for industrial process fault detection using fault 10 in the TEP data set, where (a) is a schematic diagram of the detection results of the PCA method, (b) is a schematic diagram of the detection results of the KPCA method, (c) is a schematic diagram of the detection results of the AE_LSTM method, and (d) is a schematic diagram of the detection results of the method of the present invention.

[0074] Figure 3 It is a schematic diagram of the detection results of various methods for industrial process fault detection using fault 19 in the TEP data set and the experimental method, wherein (a) is a schematic diagram of the detection results of the PCA method, (b) is a schematic diagram of the detection results of the KPCA method, (c) is a schematic diagram of the detection results of the AE_LSTM method, and (d) is a schematic diagram of the detection results of the method of the present invention. DETAILED DESCRIPTION

[0075] In order to more clearly illustrate the purpose, technical solutions and advantages of the present invention, the present invention is described in detail below in conjunction with the accompanying drawings and Examples. It should be pointed out that the specific embodiments described herein are only used to explain the present invention and do not limit the scope of the present invention. In addition, the technical features in each embodiment of the present invention described below can be combined with each other as long as they do not conflict.

[0076] Figure 1 A flowchart showing an embodiment of the present invention, a method for industrial process fault detection based on spatiotemporal feature attention fusion, comprising the following steps:

[0077] (1) Dataset collection and preprocessing

[0078] (1.1) Obtaining data sets from industrial processes , specifically:

[0079] Obtain industrial process data to form the original data set, where m represents the number of samples and n represents the number of sensors, that is, the number of variable features;

[0080] (1.2) Standardize the corresponding data samples of each feature variable in the data set S to obtain the standardized data set X . Specifically:

[0081] (1.2.1) The data standardization calculation method is:

[0082] The standardization process includes performing mean-variance standardization on each data in the data set. This standardization method is to scale the characteristic values ​​of the data set in a way that the mean is 0 and the standard deviation is 1. The specific formula is as follows:

[0083] ;

[0084] in, is the original value of the data sample corresponding to the jth feature variable in the data set S, represents the mean value corresponding to the jth variable, which is calculated by adding all sample values ​​of the feature and then dividing by the number of samples. It is expressed as the variance corresponding to the jth variable. The standard deviation is an indicator that measures the degree of data dispersion. It is calculated by summing the squares of the difference between each sample value and the mean of the feature, dividing it by the number of samples, and finally taking the square root.

[0085] (2) The two-dimensional coding of time series data adopts the GASF coding of time series. The specific coding process is as follows:

[0086] (2.1) Industrial process data set Time series data obtained after standardization Encoded as the cosine of the angle and the timestamp as the radius to represent the rescaled time series in polar coordinates. The formula is as follows:

[0087] ;

[0088] in represents the value of the jth variable of the ith sample, Indicates that the inverse cosine function is performed on it The transformed angle, where the arccosine is defined as an angle, is the inverse function of the arccosine.

[0089] (2.2) After the rescaled time series is converted to the polar coordinate system, the cosine value of the angle sum at each time point is used to reflect the time correlation in different time intervals. The definition of GASF (Gramian Angular Summation Field) is as follows:

[0090] ;

[0091] in It represents the angle corresponding to the (i+1)th sample of the jth variable. The i-th sample angle and the (i+1)-th sample angle are added together and then the corresponding value is calculated using the cosine function.

[0092] (2.3) For the high-dimensional time series data of the present invention, there are multiple variables. For a single variable j, the sampling length is the time series data of the batch size L, where i represents the i-th sampling point, and the second data set XG formed is:

[0093] .

[0094] (3) Model establishment and updating

[0095] The spatiotemporal feature attention fusion model used in this embodiment includes the following parts: a convolutional neural network to extract temporal and spatial features, a channel weighted attention module to perform feature enhancement, and cross-attention fusion of spatiotemporal features.

[0096] (3.1) Convolutional neural network extracts temporal and spatial features: This part mainly includes the convolution feature extraction of one-dimensional data to extract rich spatial feature information. At the same time, convolution feature extraction is performed on the two-dimensional image after GASF encoding to extract rich temporal feature information.

[0097] (3.1.1) The one-dimensional convolutional neural network extracts spatial feature information from the standardized time series X to obtain feature data X1. In view of the temporal correlation of the time series data, the data XG obtained by GASF transformation is used, and the temporal features are extracted using a two-dimensional convolutional neural network to obtain feature data XG2. At the same time, in order to further improve the feature expression ability of convolution, the present invention uses more network channels to construct a deep CNN to extract rich feature information. Each convolution layer is composed of multiple learnable convolution kernels, and each convolution kernel has a trainable weight and bias. The convolution layer uses the convolution kernel to perform a convolution operation on a local area of ​​the input data, and generates an output feature map through an activation function. The convolution operation process is as follows:

[0098] ;

[0099] ;

[0100] in They are respectively the first The convolution kernel and bias term connected between the i-th input feature map and the j-th feature map of the layer, Indicates -The i-th input feature map of layer 1, is the ReLU activation function, It is the feature map obtained after a convolution operation, indicating the The j-th feature map of the layer. They are respectively the first The convolution kernel and bias term connected between the i-th input feature map and the j-th feature map of the layer, Indicates -The i-th input feature map of layer 1, It is the feature map obtained after a two-dimensional convolution operation, indicating the The j-th feature map of the layer.

[0101] (3.2) Channel weighted attention module (Weighted Squeeze-and-Excitation Network, W-SENet): The main function of this model is to perform feature enhancement. When multi-channel convolution is used for feature extraction, this method can effectively enrich the number of features, but it also leads to the extraction of some useless feature information, such as noise distribution, which interferes with the learning process of CNN and cannot effectively improve the learning efficiency. On this basis, the present invention proposes a channel weighted attention fusion mechanism, which can automatically learn important feature information and assign it a certain weight. In the fusion stage, a more representative feature map is obtained by multiplying the assigned weight matrix with the original input. The mechanism mainly includes four parts: compression, excitation, product, and fusion. Obtain the feature X1 after multi-channel one-dimensional convolution feature extraction, and perform the following operations:

[0102] (3.2.1) Compression operation,For the multi-channel feature maps X1 and XG, the c,w,h-dimensional feature maps are compressed into a C,1,1 vector along the direction of the feature channel through a global average pooling operation, as follows:

[0103] ;

[0104] (3.2.2) Excitation operation, using two fully connected layers and a softmax function to participate in the gating mechanism. The fully connected layer is used to better integrate all input feature information, and the softmax activation function is used to map each element in the input vector to a value between 0 and 1, and ensure that the sum of all elements is 1. The formula is as follows:

[0105] ;

[0106] in is the Relu function, W1 and W2 are the weights of the two fully connected layers, O is the softmax function, is the attention weight.

[0107] (3.2.3) Product operation: The attention weight obtained through the above operation is weighted to the original features using the broadcast mechanism of multiplication, thereby realizing the redistribution of the original features in the dimension of the channel. The formula is as follows:

[0108] ;

[0109] in It is the weighted feature of X1.

[0110] (3.2.4) Fusion operation, in the dimension of the channel, adds and sums the elements of the corresponding position of each tensor to obtain the fused feature tensor graph. The formula is as follows:

[0111] .

[0112] Through this fusion method, the weights assigned to each channel can be multiplied and added to obtain the feature map after channel weighted fusion. , W-SENet converts the original feature map X1 of size c,w,h into a feature map of size 1,w,h This means that the importance of feature extraction for each channel is automatically learned. Following similar steps, W_XG2 is obtained.

[0113] (3.3) The cross-attention mechanism of spatiotemporal fusion crosses the spatial feature W_X1 and the temporal feature W_XG2. The cross-attention mechanism process is as follows:

[0114] ;

[0115] ;

[0116] in represents the time feature map after channel weighting, which is used to calculate the key (K) and value (V) in the present invention, and for Represents the spatial feature map after channel weighting. The present invention is used to calculate its query matrix Q. Finally, the attention score is calculated. The softmax function is used to generate the attention weight, and the use of softmax ensures that the attention weight of each key adds up to 1. is the dimension of the key, and the purpose of scaling is to prevent the value from being too large. Finally, through this attention score calculation process, the feature X_f after the fusion of spatiotemporal features is obtained.

[0117] (3.4) Perform full connection mapping on the fused feature X_f to obtain the reconstructed feature, calculate the loss error, use the calculated loss error to perform back propagation, and update the model parameters. Specifically:

[0118] ;

[0119] in is the weight matrix of the fully connected layer, Loss is the loss function of the model, and the loss function is back-propagated to update the parameters of the model to obtain a new set of parameters. After multiple iterations, a trained fault detection model is finally obtained.

[0120] (4) Calculation of control limits

[0121] (4.1) Take X as input and input it into the trained model to calculate the reconstruction error X_R. The relevant formula is as follows:

[0122] =Model( );

[0123] in Represents the standardized input data, Model represents the trained model, Represents input data Reconstructed data after Model.

[0124] (4.2) Use the reconstructed data to calculate the residual value of the sample, specifically:

[0125] ;

[0126] in , which is expressed as the residual value of the i-th sample. Through the above formula, the residual value of each sample can be obtained.

[0127] (4.3) The sample residual value is used to calculate the control limit of normal data. Specifically: Assume is the statistic of the control limit to be sought, that is for , the actual density probability density function is written as , the estimated probability density function is :

[0128] ;

[0129] in, ,..., express m samples of ; is the kernel function, is bandwidth;

[0130] Then set the confidence level , It can be calculated from the following cumulative probability formula, where Threshold represents the control limit:

[0131] ;

[0132] Finally, from the above steps, we can calculate The control limit Threshold.

[0133] (5) Determination of online data in the online phase

[0134] Use the data X_n collected in real time during the online phase, standardize it, and then input it into the trained model to calculate the residual value and compare it with the Threshold. Specifically:

[0135] ;

[0136] =Model( );

[0137] ;

[0138] in, and They are respectively represented as the mean and variance corresponding to the j-th variable of the data set S. It represents the data after standardization of the jth variable of the i-th sample. Represents the reconstructed data, Represents the residual value corresponding to the i-th sample;

[0139] .

[0140] The present invention proposes a fault detection method of spatiotemporal feature attention fusion. A cross-attention mechanism is used to fuse temporal features and spatial features, comprehensively capture the multi-dimensional feature information of the original data, and achieve higher fault detection accuracy under diverse scenario requirements. In the variable dimension, multi-channel one-dimensional convolution is used for feature extraction to obtain rich spatial feature information. In the time dimension, the time series data is converted into a two-dimensional image represented by the Gram angular field, and a multi-channel two-dimensional convolutional neural network is used to achieve efficient extraction of temporal features. In addition, the present invention constructs a channel weighted attention mechanism, which can evaluate the importance of features extracted from different channels, and assign higher weights to more important channels, thereby achieving weighted fusion of features, making the neural network pay more attention to key information, thereby achieving dynamic feature selection and optimization.

[0141] On the other hand, an embodiment of the present invention also provides an industrial process fault detection system based on spatiotemporal feature attention fusion, including a processor and a memory, the memory being used to store program instructions, and the processor being used to call the stored instructions in the memory to execute an industrial process fault detection method based on spatiotemporal feature attention fusion as described in the above technical solution.

[0142] The beneficial effects that can be achieved by the present invention are further explained below in conjunction with specific scenarios.

[0143] In industrial production, a data set developed by a certain chemical company to simulate actual chemical processes is used, namely the Tennessee Eastman Process (TEP) data set. This data set is widely used in the field of process monitoring because of its highly nonlinear and coupled characteristics. The TEP process consists of five units, including a reactor, a condenser, a circulating compressor, a separator, and a product stripper. A total of 52 variables are covered, including 11 manipulated variables, 19 component variables, and 22 measured variables. Among them, component variables and measured variables are collectively referred to as process variables. By controlling the input of variables such as feed, 21 fault types can be simulated, and the fault types are shown in Table 1. The sampling time for normal data and abnormal (fault) data is 3 minutes. The entire TE data set consists of a training set and a test set. The TE set data consists of 22 different simulation run data, and each sample has 52 observed variables. The normal operation samples include 500 training samples and 960 test samples. The training and test samples of the fault type also include 960 samples each, and the data of each fault type introduces a fault at the 161st sampling point. These data are of great significance for process monitoring in research and practice.

[0144] Table 1: TEP dataset fault types

[0145]

[0146] In terms of result evaluation, the fault detection rate (FDR) and the fault false alarm rate (FAR) are used to evaluate the performance of the method proposed in the present invention, wherein the FDR and FAR formulas are as follows:

[0147] ;

[0148] ;

[0149] TP indicates that the actual data is faulty and the test result is also the number of faulty data; FN indicates that the actual data is faulty and the test result is the number of normal data; FP indicates that the actual data is normal and the test result is the number of faulty data; TN indicates that the actual data is normal and the test result is the number of normal data.

[0150] Experimental environment The Pytorch framework is used in the entire model, and the server used to run the model has 1 Intel(R) Xeon(R) Silver 4210R CPU @ 2.40GHz and 125GB RAM and 2 NVIDIA GeForce RTX 3090GPUs.

[0151] Offline stage: A normal data set with 500 samples is used to train the model. The present invention sets batch_size to 20, which means that 20 samples will be used in each iteration. Each time a batch_size of data is sent to the model for training, an error value is calculated, and the error value is back-propagated using the Adam optimizer to optimize the relevant parameters of the model. The learning rate of the optimizer is set to 0.01, and the model parameters are updated once. Perform multiple iterations to obtain the optimized model parameters. The model training is now complete.

[0152] After the model is trained, the normalized data is input into the trained model, and the reconstructed data is obtained through forward propagation. The sample residual value is calculated using the reconstructed data. The confidence level is set to 0.95, and then KDE is used to calculate the residual value to obtain the control limit of the normal data.

[0153] Online stage: Use the standardized online data set to input into the trained model, calculate the residual value of the sample, and then compare it with the control limit. When it is less than the control limit, it is judged as normal, and when it is greater than the control line, it is judged as a fault (abnormal).

[0154] In order to highlight the advantages of the present method, three comparative methods were used for comparison. These methods include the PCA method based on the linear correlation between variables and the KPCA method for the nonlinear relationship between variables. KPCA uses a kernel function to map the original variables to a specific kernel space, assuming that the variables are linearly correlated in the space. Its core idea is to reveal the complex structure in the data through nonlinear mapping and better capture the nonlinear relationship between variables. In order to highlight the advantages of the method of the present invention in time feature extraction, AE_lstm was selected as a comparative method. AE_LSTM is specially designed for time series data, and multiple gating mechanisms are integrated internally, which can effectively capture the time correlation in time series data. Therefore, AE_LSTM is selected to verify the effectiveness of the method of the present invention. The confidence of all methods is set to 0.95. The detection rate and false alarm rate results of the present method and the three comparative methods are summarized in Table 2, and the results of the method proposed in the present invention significantly outperforming other methods in detection performance are marked in bold in the table.

[0155] Table 2: False alarm rate / detection rate results on TEP dataset

[0156]

[0157] From the data in the table, it can be seen that the method of the present invention is significantly better than other methods in terms of fault detection rate. For a more specific analysis, the performance of each method is evaluated based on the two indicators of detection rate and false alarm rate. Among the 21 fault types, the method of the present invention achieved the highest detection rate in 12 cases, which shows its advantage in detection rate. The other methods performed better in the following cases: PCA achieved the highest detection rate in 5 cases. KPCA achieved the highest detection rate in 7 cases.

[0158] AE_LSTM achieved the highest detection rate in 6 cases. For example, for fault 16, KPCA had the highest detection rate of 75%, while the detection rate of the method proposed in the present invention was 59%, which was 16% lower than that of KPCA. However, in terms of false alarm rate, the method of the present invention was 10% lower than that of KPCA. Although the detection rate of the method of the present invention is slightly lower than that of KPCA, it has an advantage in reducing the false alarm rate.

[0159] In terms of false alarm rate, the method of the present invention has the lowest false alarm rate in 7 of the 21 fault types: PCA achieved the lowest false alarm rate in 8 cases. KPCA achieved the lowest false alarm rate in 3 cases. AE_LSTM achieved the lowest false alarm rate in 3 cases. Overall, the method of the present invention maintains a low false alarm rate in most cases while maintaining a high detection rate. Even in some cases where the false alarm rate is slightly higher, the difference is not large. For example, for fault 19, although the false alarm rate of the present invention is 8%, which is higher than 0% of PCA and KPCA, this false alarm rate is still within an acceptable range under the premise of a high detection rate. Considering that the confidence level is set to 0.95 and a 5% deviation is allowed, the actual false alarm rate is only 3%.

[0160] In summary, through detailed global and local analysis, the method of the present invention significantly exceeds other methods in detection rate, and also performs well in false alarm rate. Although the false alarm rate is slightly higher in a few cases, these differences can be ignored considering its high detection rate. Other fault types that are not marked with emphasis have similar performance in detection rate and false alarm rate as the three comparison methods, which further verifies the reliability and superiority of the method of the present invention.

[0161] In order to more intuitively demonstrate the superiority of the method of the present invention, the detection results of several fault types with obvious advantages are visualized. Figure 2-Figure 3As shown, the line graph represents the residual value obtained after the data is calculated by the model. The present invention collects 960 samples in total, so the line graph is the result of drawing 960 residual value line graphs. The dotted line represents the threshold value calculated using normal data. When the two are compared together, it can be seen that when the residual value is greater than the threshold value (that is, the value in the line graph is above the dotted line), it means that the data exceeds the threshold value, indicating that the corresponding data is fault data; when the residual value is less than the threshold value (that is, the value in the line graph is below the dotted line), it means that the corresponding data is normal sample data.

[0162] like Figure 2 , first of all, taking fault 10 as an example, in its visualization diagram, the horizontal axis represents 960 sampling points of online data, and each point corresponds to a sampling moment. The vertical axis shows the residual value obtained after calculation of each sampling point. In the figure, the dotted line represents the control line calculated by normal data. In order to enhance the distinguishability of the results, the present invention takes the logarithm of the residual value and the control line and displays them. The residual value of each sampling point is presented in the form of a scatter plot. By observing the image, it can be found that the KPCA method shows a higher detection rate, followed by PCA, and AE_LSTM has the lowest performance, but all methods are inferior to the method of this paper. In the figure, the three comparison methods failed to distinguish the residual values ​​generated by the first 160 normal sample points and the last 800 fault sample points. In contrast, the residual values ​​of the method in this paper are more concentrated in the first 160 normal sample points and are generally lower than the residual values ​​of the last 800 fault sample points. Most of the residual values ​​of normal data are below the control line, while most of the residual values ​​of fault data are above the control line. This shows that the present method can effectively distinguish the normal and abnormal data of fault 10.

[0163] Take fault 19 as an example, as a random fault caused by unknown reasons, such as Figure 3 As shown in the figure, compared with other comparison methods, the performance of this method on fault 19 is particularly outstanding. Specifically, it can be clearly observed in the figure that most of the normal data are below the control line, while the fault data are mainly concentrated above the control line, which reflects the significant advantage of this method in distinguishing fault data from normal data. Further analysis shows that the effect of this method on fault data detection is particularly significant. For example, when using the PCA method for comparison, it was found that nearly 50% of the fault data were below the control line, and the fault sample points could not be effectively identified. In the AE_LSTM method, most of the fault data were also below the control line, indicating that this method failed to detect most of the fault points. In contrast, the method in this paper can effectively distinguish between fault samples and control lines, and the vast majority of the fault data are above the control line, showing extremely high detection accuracy.

[0164] In this patent document, the embodiments and detailed descriptions provided are intended to illustrate the concepts, principles and applications of the present invention, rather than to limit the scope of protection of the present invention. The scope of protection of the present invention shall be determined according to the claims, and it should be understood that any technical improvement, substitution or change that conforms to the innovative spirit and essence of the present invention, as long as it does not exceed the scope of protection defined by the claims, shall be deemed to be within the scope of protection of the present invention. Under the enlightenment of the present invention, technicians in this field can make various forms of replacement or adjustment to adapt to different application scenarios and needs without departing from the core idea and scope of protection of the present invention.

Claims

1. An industrial process fault detection method based on spatiotemporal feature attention fusion, characterized in that: The steps include: S1, offline phase, obtains historical multivariate time series datasets from industrial processes , where m represents the number of samples and n represents the number of variables; S2, for the dataset The corresponding data samples of each characteristic variable in the standardization process are obtained. ; S3, transforming the data X into a Gram matrix pattern XG; S4, perform multi-channel one-dimensional convolution feature extraction on data X to extract rich spatial feature information and obtain feature data X1; perform multi-channel two-dimensional convolution feature extraction on data XG to extract rich temporal feature information and obtain feature data XG2; S5, use channel weighted attention to process features X1 and XG2 to obtain weighted feature maps W_X1 and W_XG2; S6, use the cross attention mechanism to perform spatiotemporal fusion on the weighted feature map to obtain the fused feature map X_f; S7, X_f passes through the fully connected layer to obtain the reconstructed features consistent with the original data X dimension, calculate the reconstruction error, and use it as the loss function of the model constructed in steps S4-S6 for back propagation, update the parameters of the model, and obtain a new set of parameters. After multiple iterations, a trained fault detection model is finally obtained; S8, taking data X as input, using the trained fault detection model to calculate the reconstructed data X_R, and calculating the sample residual value , and then calculate the control limits of the normal data set through kernel density estimation; S9, in the online stage, the real-time collected data X_n is used, standardized and input into the trained fault detection model to calculate the residual value corresponding to the test data , compare it with the control limit, and finally determine whether a fault occurs based on the comparison result value.

2. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: The specific formula for the normalization process in step S2 is as follows: ; in, is the original value of the data sample corresponding to the jth feature variable in the data set S, represents the mean value corresponding to the jth variable, It is expressed as the variance corresponding to the j-th variable.

3. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: The specific implementation of step S3 is as follows: 31) Normalize the time series data Encoded as the angle cosine, , 1 , and encode the timestamp as the radius to represent the rescaled time series in polar coordinates as follows: ; in represents the value of the jth variable of the ith sample, Indicates that The angle after the arc cosine function transformation; 32) Using the cosine of the angle sum at each time point to characterize the temporal correlation within different time intervals, the Gram sum angle field GASF is defined as follows: ; in The angle corresponding to the (i+1)th sample of the jth variable is represented by adding the i-th sample angle and the (i+1)-th sample angle and calculating the corresponding value using the cosine function; 33) For a single variable , time series data with batch length L, where Representative The two-dimensional data set XG formed by sampling points is: 。 4. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: In step S4, convolutional feature extraction is performed on the data sets X and XG. The specific formula is as follows: ; ; in and They are respectively the first The convolution kernel and bias term connected between the i-th input feature map and the j-th feature map of the layer, Indicates -The i-th input feature map of layer 1, is the ReLU activation function, It is the feature map obtained after a convolution operation, indicating the The j-th feature map of the layer; and They are respectively the first The convolution kernel and bias term connected between the i-th input feature map and the j-th feature map of the layer, Indicates -The i-th input feature map of layer 1, It is the feature map obtained after a two-dimensional convolution operation, indicating the The j-th feature map of the layer.

5. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: In step S5, X1 is converted into W_X1 through the weighted attention module W-SENet. The process is as follows: 51) Obtain the feature X1 after multi-channel one-dimensional convolution feature extraction and perform the following calculation: ; Among them, the characteristics The superscript c represents the number of feature channels, w represents the width of the feature, and h represents the height of the feature. represents the compression operation, which is to compress the feature size of c,w,h to the size of c,1,1, that is, to compress w and h into 1 dimension. This process is completed by global average pooling; 52) Use the compressed feature vector , perform full connection layer calculation to obtain attention weight ,Will With features Perform point multiplication calculation and then add them in the channel dimension to obtain the feature map after weighted fusion of features , the specific formula is as follows: ; ; in is the Relu function, W1 and W2 are the weights of the two fully connected layers, is the softmax function, which ensures that the weight of each channel adds up to 1. is the attention weight, using The function performs weighted processing on each channel, and finally multiplies the original feature map to obtain the channel-weighted feature map. The whole process is learned in the channel dimension to obtain the importance of each channel, and finally added together in the channel dimension to obtain the channel-weighted fusion feature map. ; W-SENet transforms the feature map X1 of size c,w,h into a feature map W_X1 of size 1,w,h, and processes XG2 in the same way to obtain W_XG2.

6. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: The processing process of the cross-attention mechanism in step S6 is as follows; ; ; in Represents the channel-weighted temporal feature map, which is used to calculate the key (K) and value (V). is the dimension of the key, and for The spatial feature map representing the channel weighting is used to calculate its query matrix Q. Finally, the attention score is calculated. The softmax function is used to generate the attention weight, and the use of softmax ensures that the attention weight of each key adds up to 1. Finally, the feature X_f after the fusion of spatiotemporal features is obtained through this attention score calculation process.

7. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: The calculation formula of the loss function in step S7 is as follows: ; in represents the weight of the fully connected layer, Represents the i-th sampling data.

8. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: The specific implementation of step S8 is as follows: 81) Take X as input and input it into the trained fault detection model to calculate the reconstruction error X_R. =Model( ); in, represents the normalized input data, , 1 , Model represents the trained fault detection model, Represents input data Reconstructed data after Model; 82) Use the reconstructed data to calculate the residual value of the sample, specifically: ; in It is expressed as the residual value of the i-th sample. After the above formula, the residual value of each sample is obtained; 83) The sample residual value is calculated using kernel density estimation to obtain the control limit of normal data. Specifically: Assume is the statistic of the control limit to be determined, that is for , the actual density probability density function is written as , the estimated probability density function is : ; in, ,..., express m samples of ; is the kernel function, is bandwidth; Then set the confidence level , It can be calculated from the following cumulative probability formula, where Threshold represents the control limit: ; Finally, the above steps are used to calculate The control limit Threshold.

9. The industrial process fault detection method based on spatiotemporal feature attention fusion as claimed in claim 1, characterized in that: The specific implementation of step S9 is as follows: Use the online data X_n, standardize it, and then input it into the trained model to calculate the residual value, and compare it with the control limit Threshold, specifically: ; =Model( ); ; in, and They are respectively represented as the mean and variance corresponding to the j-th variable of the data set S, It represents the data after standardization of the jth variable of the i-th sample. Represents the reconstructed data, represents the residual value corresponding to the i-th sample, and Model represents the trained fault detection model; 。 10. An industrial process fault detection system based on spatiotemporal feature attention fusion, characterized by: It includes a processor and a memory, the memory is used to store program instructions, and the processor is used to call the stored instructions in the memory to execute an industrial process fault detection method based on spatiotemporal feature attention fusion as described in any one of claims 1-9.