Intelligent factory equipment fault diagnosis method based on TimeGAN model
By generating and filtering fault samples using the TimeGAN model and training with a CNN network, the problem of imbalanced fault data in smart factories is solved, improving the accuracy and precision of fault diagnosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-24
- Publication Date
- 2026-03-20
AI Technical Summary
In smart factories, due to the imbalance of fault data, existing technologies struggle to effectively generate high-quality fault samples, leading to a decrease in the accuracy of fault identification and failing to meet the needs of intelligent fault diagnosis.
The TimeGAN model is used to generate samples. Combined with an auxiliary fault classifier and correlation calculation, fault samples with high accuracy and diversity are generated. The samples are trained through a CNN network to achieve dataset balance and improve fault diagnosis accuracy.
By generating and filtering fault samples with original temporal characteristics, the imbalance in data distribution is reduced, the accuracy and precision of fault diagnosis are improved, and efficient fault diagnosis is achieved.
Smart Images

Figure CN116304809B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of fault diagnosis, and particularly relates to an intelligent factory equipment fault diagnosis method based on a TimeGAN model. BACKGROUND
[0002] Abnormal monitoring of key components of intelligent factory equipment is of great significance for safe and economic operation. Timely and accurate fault diagnosis is an effective means to avoid huge economic losses and unnecessary casualties. Since no accurate physical model and rich prior knowledge are required, data-driven fault diagnosis methods have been widely used in abnormal monitoring of intelligent factories. For the operation of industrial systems, a fault diagnosis model can be established through data feature extraction technology. Deep learning is an effective data feature extraction method, which overcomes the problem that shallow learning cannot well extract features in non-linear big data.
[0003] Most data-driven diagnosis methods are based on the assumption of large-scale and balanced training, however, this assumption is usually unrealistic in engineering. In industry, training samples under different health states are usually imbalanced. For example, rotating machinery systems, considering cost and safety, they mostly work in a healthy state, and the running time of the mechanical system in a fault state is very short. The results show that the samples collected to represent the normal state are sufficient, but the corresponding fault data are much less than the healthy samples. At this time, there is imbalance between normal signals and abnormal signals, and due to the lack of fault samples, the accuracy of fault recognition is reduced. The current technology for solving imbalanced data sets is mainly oversampling technology for minority samples and undersampling technology for majority samples, which cannot thoroughly excavate deep features and has insufficient signal generation capability, and cannot meet the huge demand of intelligent fault diagnosis for training data. SUMMARY
[0004] The purpose of the application is to provide an intelligent factory equipment fault diagnosis method based on a TimeGAN model, which generates fault categories with less sample quantity, fully considers the accuracy, diversity and help to fault classification of generated samples, thereby improving the precision of fault diagnosis and realizing intelligent operation and maintenance of intelligent factories.
[0005] The technical solution for achieving the purpose of the application is: an intelligent factory equipment fault diagnosis method based on a TimeGAN model, comprising the following steps:
[0006] Step 1, collect an imbalanced time series fault data set of intelligent factory equipment, and pre-process it as original data, and divide fault categories with large sample quantity and fault categories with small sample quantity according to the original data;
[0007] Step 2, pre-train an auxiliary generated fault classifier with all original data;
[0008] Step 3, process the data corresponding to the fault category with small sample size to obtain a sample set, divide the sample set into a training set and a test set, and input the training set into the TimeGAN model for training to generate sample data sufficient to balance the original data;
[0009] Step 4, mix the generated sample data with the original data to obtain a balanced fault data set;
[0010] Step 5, input the balanced fault data set into the CNN network for training;
[0011] Step 6, use the trained CNN network to perform fault diagnosis on the test set.
[0012] Further, the intelligent factory equipment includes a controller, an industrial robot, a servo motor, a sensor, a frequency converter, a solenoid valve, an industrial camera, and a control cabinet.
[0013] Further, in step 1, the unbalanced time series fault data set is preprocessed including normalization.
[0014] Further, in step 2, the CNN network is trained with all original data as a fault classifier, and the CNN network is composed of an input layer, a first convolutional layer 3*3*32, a first pooling layer 2*2, a second convolutional layer 3*3*64, a second pooling layer 2*2, a third convolutional layer 3*3*128, a third pooling layer 2*2, a full connection layer 2048*1024, and an output layer, wherein the activation function of the output layer is sigmoid.
[0015] Further, in step 3, for the fault category with small sample size, a sliding window is taken, and after setting the step, the time axis is sampled along the time axis to obtain time slice data, and the test set used for fault diagnosis is divided in advance before the TimeGAN model is generated, and the rest is the training set.
[0016] Further, in step 3, the data corresponding to the fault category with small sample size is classified and input into the TimeGAN model for training.
[0017] Further, in step 3, the TimeGAN model includes an embedding network, a recovery network, a generator, and a discriminator, wherein:
[0018] The embedding network is used to learn the latent features of the sample;
[0019] The recovery network is used to restore the latent features to the original sample;
[0020] The generator is used to generate latent features with a distribution close to the original sample, and to restore the generated sample with a distribution close to the original sample into the discriminator and the fault classifier;
[0021] The discriminator is used to determine whether the sample is an original sample or a generated sample;
[0022] The embedding network, the restoration network, the generator and the discriminator are all implemented based on an LSTM network.
[0023] Further, the generated sample with the discrimination probability is sent to the fault classifier trained in step 2, and the classification probability of the generated sample is output. If the probability belonging to the corresponding original fault category is greater than the median of all probabilities, it is considered that the sample has passed the judgment of the fault classifier, and the generated sample belongs to its original fault category and is added to the sample pool.
[0024] Further, in step 3, the generated sample in the TimeGAN model needs to pass the screening of the discriminator, the fault classifier and the correlation calculation, including the discrimination probability P(X i = Real), the fault classification probability P(X i = C), the correlation calculation max∑corr(X i ,X j ), wherein X i is the generated sample in each round, C is the true category of the sample currently trained in the network, X j is the generated sample added to the sample pool under the condition, Real refers to the category of the sample determined to be true, p1 and p2 are set probability values, corr(X i ,X j ) is the correlation coefficient of X i and X j , max∑corr(X i ,X j ) is the maximum correlation coefficient of X i and X j , and ω is the set maximum correlation coefficient threshold.
[0025] The generated sample needs to meet the following conditions:
[0026]
[0027] The condition for the generated sample to pass the fault classifier is set to be that the probability of the classifier determining that the generated sample belongs to the corresponding original fault category is greater than the median of all probabilities, and the correlation is calculated using the Pearson coefficient and the maximum mean deviation MMD.
[0028] Further, in step 3, if the generated sample does not pass the screening, it is retrained, wherein the loss function of the generator of the TimeGAN module includes three parts:
[0029] The generation loss L g , the classification loss L fault-error , the correlation loss L c , and the loss function is constructed as follows:
[0030]
[0031] Wherein, K is the number of generated samples in each round, d fake is the correct discrimination probability of the discriminator in each round, is the probability of the classifier discriminating the category of the generated sample, mean is the average operation, k G , k0 are the number of generated samples in each round and the number of generated samples in the sample pool respectively, corr(X i ,X j ) is the correlation coefficient of X i and X j .
[0032] Compared with the prior art, the present application has the following advantages: (1) a fault classifier is pre-trained with all samples to assist the generation of the TimeGAN model, which can effectively prevent pattern collapse and screen out samples helpful for fault diagnosis; (2) a sample pool is set up, and the correlation of the generated samples is calculated, which can effectively improve the diversity of the generated samples and thus improve the fault diagnosis accuracy of the balanced data set; (3) by generating and screening fault samples with original time sequence characteristics, the imbalance of the original data distribution is reduced, and the accuracy, diversity and improvement of the fault classification accuracy of the generated samples are fully considered, so that efficient and accurate fault diagnosis results are obtained. BRIEF DESCRIPTION OF DRAWINGS
[0033] Figure 1 is a flowchart of the intelligent factory equipment fault diagnosis method based on the TimeGAN model of the present application.
[0034] Figure 2 is a confusion matrix diagram of the direct fault diagnosis result of the unbalanced data.
[0035] Figure 3 is a confusion matrix diagram of the fault diagnosis result of the unbalanced data using the method of the present application. DETAILED DESCRIPTION
[0036] For the problem of insufficient fault data and class imbalance in intelligent factory fault diagnosis, the present application proposes an intelligent factory equipment fault diagnosis method based on the TimeGAN model, which adds an auxiliary generated fault classifier and correlation calculation, fully considers the accuracy, diversity and help to fault classification of the generated samples, and thus improves the accuracy of fault diagnosis and maintains the safety of the intelligent factory.
[0037] As shown in Figure 1 A smart factory equipment fault diagnosis method based on a TimeGAN model, comprising:
[0038] Step 1: Preprocess the unbalanced time series fault dataset, and divide it into a fault category with a large sample size and a fault category with a small sample size.
[0039] Step 2: Pre-train a fault classifier with auxiliary generation using all data.
[0040] Step 3: Send the fault category with a small sample size into the TimeGAN model for training, and generate enough samples to balance the original data.
[0041] Step 4: Mix the generated samples with the original samples to obtain a balanced fault dataset.
[0042] Step 5: Send the balanced dataset into a CNN network for training.
[0043] Step 6: Use the trained CNN network to perform fault diagnosis on the test set.
[0044] As a specific example, in step 1, the unbalanced time series fault dataset is preprocessed, including normalization.
[0045] As a specific example, in step 2, the CNN network is trained using all original data as a fault classifier, and the structure of the CNN network is: input layer, first convolutional layer 3*3*32, first pooling layer 2*2, second convolutional layer 3*3*64, second pooling layer 2*2, third convolutional layer 3*3*128, third pooling layer 2*2, fully connected layer 2048*1024, and output layer, wherein the activation function of the output layer is sigmoid.
[0046] As a specific example, in step 3, for the fault category with a small sample size, a sliding window is taken, a step size is set, and the time axis is sampled along the time axis to obtain time slice data, and the test set used for fault diagnosis is divided in advance before the TimeGAN model is generated, and the rest is the training set.
[0047] As a specific example, in step 3, the data corresponding to the fault category with a small sample size is classified and sent into the TimeGAN model for training.
[0048] As a specific example, in step 3, the TimeGAN model includes an embedding network, a recovery network, a generator, and a discriminator, wherein:
[0049] The embedding network is used to learn the latent features of the samples;
[0050] The restoration network is used to restore the latent feature into the original sample;
[0051] The generator is used to generate the latent feature with a distribution close to the original sample, and restore it into a generated sample with a distribution close to the original sample by the restoration network, and send it into the discriminator and the fault classifier;
[0052] The discriminator is used to determine whether the sample is an original sample or a generated sample;
[0053] The embedding network, the restoration network, the generator, and the discriminator are all implemented based on the LSTM network.
[0054] As a specific example, the generated sample with the discrimination probability is sent into the fault classifier trained in step 2, and the classification probability of the generated sample is output, if the probability belonging to the corresponding original fault category is greater than the median of all probabilities, it is considered that the sample passes the determination of the fault classifier, the generated sample belongs to its original fault category and is added to the sample pool.
[0055] As a specific example, in step 3, the generated sample in the TimeGAN model needs to pass the screening of the discriminator, the fault classifier, and the correlation calculation, including the discrimination probability P(X i = Real), the fault classification probability P(X i = C), and the correlation calculation maxΣcorr(X i ,X j ), wherein X i is the sample generated in each round, C is the true category of the sample currently trained in the network, X j is the generated sample added to the sample pool under the condition, Real refers to the category of the sample determined to be true, p1 and p2 are set probability values, corr(X i ,X j ) is the correlation coefficient of X i and X j , max∑corr(X i ,X j ) is the maximum correlation coefficient of X i and X j , and ω is the set maximum correlation coefficient threshold.
[0056] The generated sample needs to meet the following conditions:
[0057]
[0058] The condition for the generated sample to pass the fault classifier is set to be that the probability of the classifier determining that the generated sample belongs to the corresponding original fault category is greater than the median of all probabilities, and the correlation calculation uses the Pearson coefficient and the maximum mean deviation MMD.
[0059] As a specific example, in step 3, if the generated sample does not pass the screening, retraining is performed, wherein the loss function of the TimeGAN module generator includes three parts:
[0060] The generation loss L g , the classification loss L fault-error , and the correlation loss L c , and the loss function is constructed as follows:
[0061]
[0062] Wherein, K is the number of generated samples in each round, d fake is the correct probability of the discriminator in each round, is the probability of the classifier to distinguish the category of the generated sample, mean is the average operation, k G , k0 are the number of generated samples in each round and the number of generated samples in the sample pool, respectively, corr(X i ,X j ) is the correlation coefficient of X i and X j .
[0063] The application will be further described in detail below in combination with specific embodiments.
[0064] Embodiment
[0065] The embodiment is a smart factory equipment fault diagnosis method based on a TimeGAN model. The method is to expand the unbalanced fault data set by an improved TimeGAN model, fully consider the accuracy, diversity of the generated sample and the help to the fault classification performance, so as to improve the precision of fault diagnosis and maintain the safety of the smart factory.
[0066] The unbalanced fault data set used in the embodiment is a motor bearing fault data set with a sampling frequency of 12K, including normal state, outer ring fault, inner ring fault and ball fault. The number of samples of one type of fault is significantly less than that of other types. The unbalanced data is used for fault diagnosis, and the specific process is as follows:
[0067] (1) Normalize the unbalanced bearing fault data set, and divide it into fault categories with large sample size (normal, inner ring fault, ball fault) and fault categories with small sample size (outer ring fault).
[0068] (2) Train the fault classifier with all data (normal state, outer ring fault, inner ring fault and ball fault), and the structure of the CNN network is as follows: input layer, convolution layer 3*3*32, pooling layer 2*2, convolution layer 3*3*64, pooling layer 2*2, convolution layer 3*3*128, pooling layer 2*2, full connection layer 2048*1024, and output layer, wherein the activation function of the output layer is sigmoid, which is used for assisting TimeGAN generation, and the class probability of the generated sample is output.
[0069] (3) The outer ring fault data is sent to the TimeGAN model for training to generate samples sufficient to balance the original data. The specific steps of model training are as follows:
[0070] (3.1) The outer ring fault data is subjected to sliding window enhancement processing, the window length is 400, and the step length is 20, to obtain time sequence slice data of (200, 400, 1), wherein 200 is the sample quantity.
[0071] (3.2) The outer ring fault data is subjected to embedding network, recovery network, generator and discriminator in TimeGAN, wherein:
[0072] The embedding network is used to learn the latent features of the sample, the recovery network is used to restore the latent features to the original sample, the generator is used to generate latent features with a distribution close to the original sample, and the recovery network is used to restore the generated sample with a distribution close to the original sample to the discriminator and the fault classifier; the discriminator is used to judge whether the sample is an original sample or a generated sample, and the embedding network, the recovery network, the generator and the discriminator are all based on the lstm network.
[0073] (3.3) The generated sample with the discrimination probability is sent to the fault classifier trained in (2) to output the classification probability of the generated sample, and if the probability of the outer ring fault is greater than the median of all probabilities, it is considered that the sample passes the judgment of the fault classifier.
[0074] (3.4) The correlation of the samples that pass the discriminator and the fault classifier and the samples that have passed and have been added to the sample pool is calculated, and the Pearson coefficient and the maximum mean deviation MMD are used. The judgment conditions in (3.3) and (3.4) are as follows:
[0075]
[0076] In this example, p1=0.8, p2 is the median of the classification probability of the fault classifier each time, and ω=0.8
[0077] (3.5) If the generated sample cannot pass the above conditions, it is retrained, wherein the loss function of the generator is as follows:
[0078]
[0079] (3.6) When the number of samples in the sample pool reaches the requirement of the balanced data set, end the training.
[0080] (4) Mix the generated samples with the original samples to obtain a balanced fault data set.
[0081] (5) The balanced data set is sent to the CNN network for training, and the structure of the CNN network is: input layer, convolution layer 3*3*32, pooling layer 2*2, convolution layer 3*3*64, pooling layer 2*2, convolution layer 3*3*128, pooling layer 2*2, full connection layer 2048*1024, output layer, wherein the activation function of the output layer is softmax.
[0082] (6) Use the trained CNN network to perform fault diagnosis on the test set.
[0083] Figure 2 The confusion matrix diagram for directly performing fault diagnosis on the unbalanced data set in the present example, Figure 3 The confusion matrix diagram for using the method to perform fault diagnosis, and the classifier model used for fault detection is the parameter in (5), and it can be seen that the fault detection accuracy of the unbalanced data set is greatly improved.
[0084] The intelligent factory equipment fault diagnosis method based on the TimeGAN model pre-trains a fault classifier to assist the generator to generate samples, and uses correlation calculation to ensure the accuracy, diversity and help to fault classification performance of the generated samples, improves the loss function of the generator, generates samples meeting the requirements of fault diagnosis, reduces the imbalance of the original data distribution, solves the problem of insufficient samples, finally extracts signal space features combined with the powerful spatial feature extraction capability of the CNN convolutional neural network, establishes a fault diagnosis model, realizes efficient and accurate fault diagnosis, and realizes safe maintenance of intelligent equipment.
Claims
1. A method for fault diagnosis of intelligent factory equipment based on the TimeGAN model, characterized in that, Includes the following steps: Step 1: Collect the unbalanced time-series fault dataset of smart factory equipment and preprocess it as raw data. Based on the raw data, divide the fault categories with large sample size into fault categories with small sample size. Step 2: Pre-train an auxiliary fault classifier using all the original data; Step 3: Process the data corresponding to the fault categories with small sample sizes to obtain a sample set. Divide the sample set into a training set and a test set. Feed the training set into the TimeGAN model for training to generate sample data that balances the original data. In the TimeGAN model, generated samples undergo a selection process involving a discriminator, a fault classifier, and relevance calculations, including discrimination probability. Fault classification probability Correlation calculation ,in For each round of generated samples, The true class of the samples currently trained in the network. To meet the conditions for adding generated samples to the sample pool, This refers to the category that the sample judges as true. , It is a set probability value. for and The correlation coefficient, for and The maximum correlation coefficient, It is the set maximum correlation coefficient threshold; The generated samples must meet the following conditions: ; The generated samples are conditionally set by the fault classifier to determine that the probability of the generated sample belonging to the corresponding original fault category is greater than the median of all probabilities. The correlation is calculated using the Pearson coefficient and the maximum mean deviation (MMD). Step 4: Mix the generated sample data with the original data to obtain the balanced fault dataset; Step 5: Feed the balanced fault dataset into the CNN network for training; Step 6: Use the trained CNN network to diagnose faults on the test set.
2. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 1, characterized in that, Smart factory equipment includes controllers, industrial robots, servo motors, sensors, frequency converters, solenoid valves, industrial cameras, and control cabinets.
3. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 1, characterized in that, In step 1, the unbalanced time-series fault dataset undergoes preprocessing including normalization.
4. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 1, characterized in that, In step 2, a CNN network is trained using all the original data as a fault classifier. The CNN network consists of: an input layer, a first convolutional layer of 3*3*32, a first pooling layer of 2*2, a second convolutional layer of 3*3*64, a second pooling layer of 2*2, a third convolutional layer of 3*3*128, a third pooling layer of 2*2, a fully connected layer of 2048*1024, and an output layer, where the activation function of the output layer is sigmoid.
5. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 1, characterized in that, In step 3, for fault categories with small sample sizes, a sliding window is taken, and after setting the step size, samples are overlapped along the time axis to obtain time slice data. Before generating the TimeGAN model, the test set for fault diagnosis is divided in advance, and the rest are used as the training set.
6. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 1, characterized in that, In step 3, the data corresponding to the fault categories with small sample sizes are categorized and fed into the TimeGAN model for training.
7. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 1, characterized in that, In step 3, the TimeGAN model includes an embedding network, a recovery network, a generator, and a discriminator, where: The embedded network is used to learn the latent features of the samples; The recovery network is used to restore latent features to the original sample; The generator is used to generate latent features whose distribution is close to that of the original samples, and the recovery network is used to restore them to generated samples whose distribution is close to that of the original samples, which are then fed into the discriminator and the fault classifier. The discriminator is used to determine whether a sample is an original sample or a generated sample; The embedded network, recovery network, generator, and discriminator are all implemented based on LSTM networks.
8. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 7, characterized in that, The generated samples, whose probabilities are determined by the discriminator, are fed into the fault classifier trained in step 2. The classifier outputs the classification probability of the generated samples. If the probability of belonging to the corresponding original fault category is greater than the median of all probabilities, the sample is considered to have passed the judgment of the fault classifier, and the generated sample belongs to its original fault category and is added to the sample pool.
9. The intelligent factory equipment fault diagnosis method based on the TimeGAN model according to claim 8, characterized in that, In step 3, if the generated samples fail the screening, retraining is performed. The loss function of the TimeGAN module generator consists of three parts: Generation loss Classification loss correlation loss And construct the following loss function: ; in, The number of samples generated in each round, For each round of the discriminator, the probability of making a correct judgment is given. To determine the probability of generating a sample category for the classifier. To perform the averaging operation, , These represent the number of samples generated in each round and the number of samples generated in the sample pool, respectively. for and The correlation coefficient.
Citation Information
Patent Citations
Small sample fault diagnosis method based on improved TimeGAN model
CN114692506A