A method for fault direction and magnitude estimation based on fault data expansion
By generating virtual fault data in the three-water tank system and building a full connection and attention network model, the problem of fault direction and amplitude estimation in the deep learning fault estimation method is solved, and dynamic fault estimation with multiple inputs and multiple outputs is realized, which improves faults Diagnostic accuracy.
Patent Information
- Application Number
- CN202411445123.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-16
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2044-10-16
Smart Images

Figure CN118965244B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of industrial fault diagnosis, and in particular to a method for estimating fault direction and amplitude by fault data expansion. Background Art
[0002] At present, most of the existing research focuses on fault isolation and identification (FII), which divides the system into multiple isolated parts and can determine the nature and level of the fault. The two constitute the basic content of fault-tolerant control or fault correction. Fault identification (FI) can analyze and identify the ongoing faults based on the information obtained from condition monitoring, combined with the working principle, structural characteristics, operating parameters, etc. of the equipment, and provide effective feedback and support for fault location and recovery in the subsequent maintenance process. Some shallow data-driven fault isolation and identification methods, such as principal component analysis, independent component analysis, partial least squares, subspace-assisted methods and their variants.
[0003] However, the above methods do not take into account the identification of fault direction. In order to solve this problem, the idea of fault direction is applied in the model method. Because the model-based identification method expands and estimates the fault as part of the system state parameter, the direction information is included in the state variable, thus having the function of fault location. The main challenges faced by the current deep learning-based fault estimation method include: 1) It is difficult to collect all fault conditions in reality; 2) There is no estimation model for fault direction and amplitude. Summary of the invention
[0004] Based on this, it is necessary to provide a fault direction and amplitude estimation method for fault data expansion, which includes:
[0005] S1: Collect normal data samples of the three-tank system and generate virtual fault data samples based on the normal data samples;
[0006] S2: construct a fault estimation model, and input the virtual fault data sample into the fault estimation model; the fault estimation model includes a fully connected network model and an attention network model; the fully connected network model is used to predict the additive fault amplitude, multiplicative fault amplitude, fault type and fault quantity of the virtual fault data sample; the attention network model is used to predict the additive fault direction and multiplicative fault direction of the virtual fault data sample;
[0007] S3: repeatedly generate virtual fault data samples and input them into the fault estimation model for iterative training;
[0008] S4: Input the fault data to be tested into the trained fault estimation model and output the fault diagnosis result.
[0009] Beneficial effects: This method collects normal data samples of the three-tank system, generates virtual fault data samples based on the normal data samples; builds a fault estimation model; repeatedly generates virtual fault data samples, and inputs them into the fault estimation model for iterative training; inputs the fault data to be tested into the trained fault estimation model, and outputs the fault diagnosis result; this method uses the fault direction and fault amplitude as prediction labels, and obtains a multi-input and multi-output dynamic fault estimation method, which makes up for the defect that it is difficult to collect all fault conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0011] Figure 1 Flow chart of a method for estimating fault direction and amplitude by fault data expansion according to an embodiment of the present application.
[0012] Figure 2a This is a schematic diagram of a linear rising fault in an embodiment of the present application.
[0013] Figure 2b This is a schematic diagram of a linear descent fault in an embodiment of the present application.
[0014] Figure 2c This is a schematic diagram of a peak-type fault according to an embodiment of the present application.
[0015] Figure 2d This is a schematic diagram of an oscillation failure in an embodiment of the present application.
[0016] Figure 3 This is a schematic diagram of the structure of the three-water tank system of an embodiment of the present application.
[0017] Figure 4 Schematic diagram of the loss function during the training process of an embodiment of the present application.
[0018] Figure 5a This is a test result diagram of channel 1 of an embodiment of the present application.
[0019] Figure 5b This is a test result diagram of channel 2 of an embodiment of the present application.
[0020] Figure 5c This is a test result diagram of channel 3 of an embodiment of the present application.
[0021] Figure 5dThis is a test result diagram of channel 4 of an embodiment of the present application.
[0022] Figure 5e This is a test result diagram of channel 5 of an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are described in detail below in conjunction with the accompanying drawings. In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar improvements without violating the connotation of the present application, so the present application is not limited by the specific embodiments disclosed below.
[0024] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0025] like Figure 1 As shown, this embodiment provides a method for estimating fault direction and amplitude by fault data expansion, the method comprising:
[0026] S1: Collect normal data samples of the three-tank system and generate virtual fault data samples based on the normal data samples.
[0027] Furthermore, according to the form in which the fault occurs, the fault types of the virtual fault data samples can be divided into additive faults and multiplicative faults; additive faults mean that a fault signal is directly added to the normal output or state of the system, and this fault signal can be constant or random; multiplicative faults usually involve changes in a certain process or parameter of the system, resulting in changes in the relationship between the output and input of the system, and the fault is mathematically described as a multiplicative fault.
[0028] The additive fault is described as:
[0029] ;
[0030] ;
[0031] in, represents a virtual fault data sample with additive faults, ; The number of features representing normal data samples or virtual fault data samples; x represents a normal data sample; represents an additive fault superimposed on a normal data sample; represents the additive fault direction vector; represents the additive fault magnitude vector;
[0032] The multiplicative fault is described as:
[0033] ;
[0034] ;
[0035] in, represents a virtual fault data sample with multiplicative faults, ; I represents the identity matrix; represents the multiplicative fault source matrix; It indicates that the influence of multiplicative fault source matrix on normal data samples is in the form of additive fault; represents the multiplicative fault direction matrix; represents the multiplicative fault magnitude matrix.
[0036] Since a multiplicative fault with only one position fault is similar to an additive fault of a univariate error, this embodiment only discusses the case where multiplicative faults occur in multiple different directions and additive faults occur in one direction.
[0037] Furthermore, generating a virtual fault data sample based on a normal data sample includes:
[0038] In this embodiment, fault mode generation, from the perspective of fault identification, the lack of complete fault samples may affect the accuracy of identification. If the network is trained only with real fault data, it will only be sensitive to specific fault amplitudes. Therefore, in this embodiment, some virtual fault samples are generated based on real normal data samples to assist the learning of the neural network. It can keenly identify most deviations in system behavior that are beyond the normal range, without being limited to certain existing fault modes. By adding random fault signals to normal data samples, virtual fault data samples are generated; the generation expression of virtual fault data samples is:
[0039] ;
[0040] ;
[0041] ;
[0042] in, represents a virtual fault data sample of length k; Indicates whether to impose additive faults on normal data samples of length k; Indicates whether to impose multiplicative faults on normal data samples of length k; represents an additive fault superimposed on a normal data sample of length k; Represents a normal data sample of length k; represents the multiplicative fault source matrix; I represents the identity matrix; is the first random variable that follows a uniform distribution with a lower limit of 0 and an upper limit of 1; is the first hyperparameter; represents the additive fault direction vector; Represents k rows The additive fault magnitude matrix of the columns.
[0043] S2: Construct a fault estimation model and input the virtual fault data samples into the fault estimation model; the fault estimation model includes a fully connected network model and an attention network model; the fully connected network model is used to predict the additive fault amplitude, multiplicative fault amplitude, fault type and fault quantity of the virtual fault data samples; the attention network model is used to predict the additive fault direction and multiplicative fault direction of the virtual fault data samples.
[0044] The generation methods of additive fault magnitude, multiplicative fault magnitude, additive fault direction, multiplicative fault direction and fault quantity are provided as follows:
[0045] The additive fault direction is generated as follows:
[0046] ;
[0047] in, represents the additive fault direction vector; represents a vector with 1 in the i-th position and 0 in the other positions. ; The number of features representing normal data samples or virtual fault data samples;
[0048] The additive fault amplitude is generated as follows:
[0049] ;
[0050] ;
[0051] in, Represents k rows The additive fault magnitude matrix of the columns; Indicates column-wise averaging; are all column vectors of length k and element value 0, The column where the fault is located is a random integer; represents the fault column vector of length k; is the second hyperparameter; is a second random variable that follows a uniform distribution with a lower limit of 0 and an upper limit of 1.
[0052] Figure 2a , Figure 2b , Figure 2c , Figure 2d The schematic diagrams of four types of additive faults are given respectively. Figure 2a In the case of a fault with a slope of b = 1 / 2, Figure 2b In the case of a fault with a slope of b = -1 / 2, Figure 2c In the case of a sudden change in amplitude, this is also a form of failure. Figure 2d In the example, the trajectory of the fault sample shifts up and down around the signal in the normal state, and the shift exceeds the normal and threshold values.
[0053] The multiplicative fault directions are generated as follows:
[0054] ;
[0055] in, represents the true multiplicative fault direction matrix; represents the direction vector of multiplicative fault; It means creating a diagonal matrix with the multiplicative fault direction vector as the diagonal element (here, the fault vector is generated and then converted into a matrix); ; The number of features representing normal data samples or virtual fault data samples; Indicates randomly selected vector; represents a vector with 1 in the i-th position and 0 in the other positions.
[0056] The multiplicative fault amplitude is generated as follows:
[0057] , ;
[0058] in, represents the true multiplicative fault magnitude matrix; represents the multiplicative fault magnitude vector; Indicates the lower limit of the multiplicative fault amplitude; Indicates the upper limit of the multiplicative fault amplitude; is between closed intervals Random numbers within.
[0059] How the number of failures is generated:
[0060] ;
[0061] in, Indicates the number of faults; ; The number of features representing normal data samples or virtual fault data samples; Indicates the fault type. When it is 0, it indicates that the fault type is additive fault. When it is 1, it indicates that the fault type is multiplicative fault.
[0062] In this embodiment, the fully connected network model includes an input layer, a hidden layer, and an output layer;
[0063] The input layer is used to input the virtual fault data samples;
[0064] The hidden layer works like this:
[0065] ;
[0066] in, Represents the nth output of the hidden layer; The network parameters are The first linear layer of the network; Indicates l The input of a linear layer; q The structure of the fully connected network model composed of a multi-level cascaded sub-network of layers is expressed as: H q : = { H 1, H 2,…, H q}; H q Represents a fully connected network model; H q Indicates q Layer multi-level cascade sub-network;
[0067] The fully connected network model is used to predict the additive fault amplitude / multiplicative fault amplitude, fault type and fault quantity of virtual fault data samples.
[0068] The workflow of the attention network model is as follows:
[0069] The input virtual fault data sample is mapped through a single-layer linear layer to obtain the query and key, and the calculation formula is:
[0070] ;
[0071] in, Indicates a query; Indicates the key; A linear layer representing a single layer; represents a virtual fault data sample of length k;
[0072] In the attention network model, the mean function is used to calculate the average value of the input virtual fault data samples by column to obtain the value, and the calculation formula is:
[0073] ;
[0074] in, To express value; Indicates finding the mean by column;
[0075] The query, the key and the value are passed through a scoring function to obtain a score, and the calculation formula is:
[0076] ;
[0077] in, Indicates the rating; represents the hyperbolic tangent function; T represents the transpose; The number of features representing normal data samples or virtual fault data samples;
[0078] The score is passed through a single hidden layer fully connected neural network to output the prediction result of the attention network model. The calculation formula is:
[0079] ;
[0080] in, Represents the prediction results of the attention network model; represents a fully connected neural network with a single hidden layer, ; Indicates that there is no activation function and the output vector length is Linear layer of
[0081] The prediction result of the attention network model includes predicting the additive fault direction or the multiplicative fault direction of the virtual fault data sample.
[0082] This embodiment also provides a workflow of the fault estimation model, including:
[0083] Step 1: Input the virtual fault data samples into two identical attention network models respectively to obtain additive fault directions and multiplicative fault directions respectively;
[0084] Step 2: Expand the virtual fault data samples by row, and pass the virtual fault data samples expanded by row through two identical fully connected network models to obtain additive fault amplitudes and multiplicative fault amplitudes respectively;
[0085] Step 3: The virtual fault data samples expanded by row are passed through two identical fully connected network models respectively to obtain the fault type and fault quantity.
[0086] S3: Repeatedly generate virtual fault data samples and input them into the fault estimation model for iterative training.
[0087] Specifically, the process of training the fault estimation model includes:
[0088] Adding labels to the virtual fault data samples, the labels including: additive fault direction / multiplicative fault direction, additive fault amplitude / multiplicative fault amplitude, fault type and fault;
[0089] The mean square error loss is calculated based on the label corresponding to the virtual fault data sample and the data output by the fault estimation model. Based on the mean square error loss, the RMSprop optimizer is used to set the hyperparameter batch size B=16 and the training rounds E poch =588, learning rate l r =2 e -4 , perform back propagation, and save the model parameters after training.
[0090] S4: Input the fault data to be tested into the trained fault estimation model and output the fault diagnosis result.
[0091] The fault direction and amplitude estimation method for fault data expansion provided in the present embodiment collects normal data samples of the three-water tank system, generates virtual fault data samples based on the normal data samples; constructs a fault estimation model; repeatedly generates virtual fault data samples, and inputs them into the fault estimation model for iterative training; inputs the fault data to be tested into the trained fault estimation model, and outputs the fault diagnosis result; thus, the fault direction and fault amplitude are used as prediction labels, thereby obtaining a multi-input and multi-output dynamic fault estimation method, which makes up for the defect that it is difficult to collect all fault conditions.
[0092] The three tanks system (TTS) is a typical nonlinear process, which consists of three tanks connected in series, such as Figure 3 shown.
[0093] TTS has two control variables, which are the flow rates (Q1 and Q2) of the inlet regulating valves of slot 1 and slot 2. The flow rates from slot 1 to slot 3 and from slot 2 to slot 3 are Q 13 and Q 32 , which are connected and transported through pipelines. The water levels of tanks 1 to 3 are measured by sensors and recorded as h 1.h 2. h 3.
[0094] Therefore, the process variable of TTS is the input data (normal data sample) x k It can be expressed as:
[0095] ;
[0096] In the normal state, TTS was run 10 times to collect a total of 16,008 normal data samples for generating virtual fault data samples. In addition, each fault type was run once, and a total of 201×12 normal data samples and 1800×8 fault data points were collected (the fault was introduced at the 200th point, and time 0 was the initial state), which were used as a test set to detect the performance of the model. The description of the fault types in the TTS simulation is shown in Table 1;
[0097] Table 1 is a description table of fault types simulated by TTS;
[0098] ;
[0099] The batch size is B=16 and the time window is , each sliding window step length is , the normal data sample x k Convert to 4D data , where the value of N is calculated as follows:
[0100] ;
[0101] in, Indicates rounding down, discarding data that is less than one batch. Take each batch of data and use the S1 method to randomly generate virtual fault data samples, which are used as fault data sets to train the fault estimation model. Load the fault estimation model parameters after training, use the test set for testing, divide the fault data in the test set into batches and shuffle them, and randomly extract some data for testing. The loss function in the model training process is as follows: Figure 4 The test results are shown in Table 2 and Figure 5a , Figure 5b , Figure 5c , Figure 5d , Figure 5e As shown. Figure 5a , Figure 5b , Figure 5c , Figure 5d , Figure 5e In the figure, the solid lines are the estimated fault amplitudes, and the dashed lines are the real fault amplitudes. There are 5 features.
[0102] Table 2 shows the test accuracy of the fault direction, fault number and fault type of the fault estimation model;
[0103] ;
[0104] It can be seen from Table 2 that the fault estimation model constructed in this embodiment has a high estimation accuracy.
[0105] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0106] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the patent application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent application shall be subject to the attached claims.
Claims
1. A fault direction and amplitude estimation method for fault data expansion, characterized in that: include: S1: Collect normal data samples of the three-tank system and generate virtual fault data samples based on the normal data samples; S2: construct a fault estimation model, and input the virtual fault data sample into the fault estimation model; the fault estimation model includes a fully connected network model and an attention network model; The fully connected network model includes multiple linear layers; A single linear layer works like this: ; in, Indicates n The output of each linear layer is also the input of the next layer; Indicates n A linear layer network; Indicates l The input of a linear layer; q The structure of the fully connected network model composed of a multi-level cascaded sub-network of layers is expressed as: H q : = { H 1, H 2,…, H q }; H q Represents a fully connected network model; H q Indicates q Layer multi-level cascade sub-network; The fully connected network model is used to predict the additive fault amplitude / multiplicative fault amplitude, fault type and fault quantity of virtual fault data samples; The workflow of the attention network model is as follows: The input virtual fault data sample is mapped through a single-layer linear layer to obtain the query and key, and the calculation formula is: ; in, Indicates a query; Indicates the key; represents a linear layer of a single layer; represents a virtual fault data sample of length k; In the attention network model, the mean function is used to calculate the average value of the input virtual fault data samples by column to obtain the value, and the calculation formula is: ; in, To express value; Indicates finding the mean by column; The query, the key and the value are passed through a scoring function to obtain a score, and the calculation formula is: ; in, Indicates the rating; represents the hyperbolic tangent function; T represents the transpose; The number of features representing normal data samples or virtual fault data samples; The score is passed through a fully connected neural network with two linear layers, and the prediction result of the attention network model is output. The calculation formula is: ; in, Represents the prediction results of the attention network model; represents a fully connected neural network with a single hidden layer, ; Indicates that there is no activation function and the output vector length is Linear layer of The prediction result of the attention network model includes predicting the additive fault direction or the multiplicative fault direction of the virtual fault data sample; S3: repeatedly generating virtual fault data samples, and inputting them into the fault estimation model for iterative training; S4: Input the fault data to be tested into the trained fault estimation model and output the fault diagnosis result.
2. The fault direction and amplitude estimation method of fault data expansion according to claim 1, characterized in that: The fault types of the virtual fault data samples are divided into additive faults and multiplicative faults; the additive fault is described as: ; ; in, represents a virtual fault data sample with additive faults, ; The number of features representing normal data samples or virtual fault data samples; x represents a normal data sample; represents an additive fault superimposed on a normal data sample; represents the additive fault direction vector; represents the additive fault magnitude vector; The multiplicative fault is described as: ; ; in, represents a virtual fault data sample with multiplicative faults, ; I represents the identity matrix; represents the multiplicative fault source matrix; It indicates that the influence of multiplicative fault source matrix on normal data samples is in the form of additive fault; represents the multiplicative fault direction matrix; represents the multiplicative fault magnitude matrix.
3. The fault direction and amplitude estimation method of fault data expansion according to claim 2, characterized in that: Generating a virtual fault data sample based on a normal data sample comprises: A virtual fault data sample is generated by randomly adding a fault signal to the normal data sample; the generation expression of the virtual fault data sample is: ; ; ; in, represents a virtual fault data sample of length k; Indicates whether to impose additive faults on normal data samples of length k; Indicates whether to impose multiplicative faults on normal data samples of length k; represents an additive fault superimposed on a normal data sample of length k; Represents a normal data sample of length k; represents the multiplicative fault source matrix; I represents the identity matrix; is the first random variable that follows a uniform distribution with a lower limit of 0 and an upper limit of 1; is the first hyperparameter; represents the additive fault direction vector; Represents k rows The additive fault magnitude matrix of the columns.
4. The fault direction and amplitude estimation method of fault data expansion according to claim 2, characterized in that: The additive fault direction is generated as follows: ; in, represents the additive fault direction vector; represents a vector with 1 in the i-th position and 0 in the other positions. ; The number of features representing normal data samples or virtual fault data samples; The additive fault amplitude is generated as follows: ; ; in, Represents k rows The additive fault magnitude matrix of the columns; Indicates finding the mean by column; are all column vectors of length k and element value 0, The column where the fault is located is a random integer; represents the fault column vector of length k; is the second hyperparameter; is a second random variable that follows a uniform distribution with a lower limit of 0 and an upper limit of 1.
5. The fault direction and amplitude estimation method of fault data expansion according to claim 2, characterized in that: The multiplicative fault directions are generated as follows: ; in, represents the true multiplicative fault direction matrix; represents the direction vector of multiplicative fault; means creating a diagonal matrix with the multiplicative fault direction vector as the diagonal element; ; The number of features representing normal data samples or virtual fault data samples; Indicates randomly selected vector; represents a vector with 1 in the i-th position and 0 in the other positions. ; The multiplicative fault amplitude is generated as follows: , ; in, represents the true multiplicative fault magnitude matrix; represents the multiplicative fault magnitude vector; Indicates the lower limit of the multiplicative fault amplitude; Indicates the upper limit of the multiplicative fault amplitude; is between closed intervals Random numbers within.
6. The fault direction and amplitude estimation method of fault data expansion according to claim 2, characterized in that: It also includes how the number of failures is generated: ; in, Indicates the number of faults; ; The number of features representing normal data samples or virtual fault data samples; Indicates the fault type. When it is 0, it indicates that the fault type is additive fault. When it is 1, it indicates that the fault type is multiplicative fault.
7. The fault direction and amplitude estimation method of fault data expansion according to claim 1, characterized in that: The workflow of the fault estimation model is: Step 1: Input the virtual fault data samples into two attention network models with the same structure respectively, and obtain additive fault directions and multiplicative fault directions respectively; Step 2: Expand the virtual fault data samples by row, and pass the virtual fault data samples expanded by row through two fully connected network models with the same structure to obtain additive fault amplitudes and multiplicative fault amplitudes respectively; Step 3: The virtual fault data samples expanded by row are passed through two fully connected network models with the same structure respectively to obtain the fault type and fault quantity.
8. The fault direction and amplitude estimation method of fault data expansion according to claim 1, characterized in that: The process of training the fault estimation model includes: Adding labels to the virtual fault data samples, the labels including: additive fault direction / multiplicative fault direction, additive fault amplitude / multiplicative fault amplitude, fault type and fault quantity; The mean square error loss is calculated based on the label corresponding to the virtual fault data sample and the data output by the fault estimation model. Based on the mean square error loss, the RMSprop optimizer is used to set the hyperparameter batch size B=16 and the training rounds E poch =588, learning rate l r =2 e -4 , perform back propagation, and save the model parameters after training.