Breaker bearing fault data enhancement method based on VAE-GAN network
By using continuous wavelet transform and Wasserstein distance in VAE-GAN network, combined with the gradient penalty term method, the problems of high computational cost of data augmentation methods and limitations of model hypothesis in the prior art are solved, and the data augmentation effect and virtual data are improved Quality, suitable for the enhancement of circuit breaker bearing fault data, enhances the training data quality of the fault diagnosis model.
Patent Information
- Application Number
- CN202411023197.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-15
AI Technical Summary
In the prior art, the data augmentation method based on VAE-GAN has problems such as high computational cost and complexity, limitations in model assumptions, and inaccurate detection results, and insufficient data augmentation model in capturing deep-level features of data.
Using the circuit breaker bearing failure data enhancement method based on VAE-GAN network, features are extracted through continuous wavelet transformation, and random noise is replaced by hidden variables of the VAE model as the GAN generator input, increasing network depth, and using Wasserstein distance to replace KL divergence. Add gradient penalty items to improve training stability and data enhancement effects.
It improves the data enhancement effect, and the generated virtual data quality is higher, making up for the defects of data imbalance, enhances the training data quality of the fault diagnosis model, and reduces the computing cost and complexity.
Smart Images

Figure CN118964987A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of health management, and in particular can be used for data enhancement of unbalanced data using a variational autoencoder-generative adversarial network (VAE-GAN), and specifically is a method for enhancing circuit breaker bearing fault data based on a VAE-GAN network. Background Art
[0002] Circuit breakers are widely used in many fields but are prone to failure. Bearings, as key components of circuit breaker buffers, can also cause various problems due to various factors. Early methods for diagnosing such faults mostly relied on manual experience, but there were cases of misjudgment and missed judgment. With the emergence of artificial intelligence technology, the extraction and judgment of fault diagnosis features using deep learning is more efficient and accurate.
[0003] At present, it is difficult to obtain a large amount of labeled data in actual industrial sites, and the poor generalization ability limits the development of deep learning-based fault diagnosis technology. Therefore, methods and approaches to assist in improving deep learning capabilities, represented by data enhancement, have received widespread attention in recent years.
[0004] For example: The document with application number "CN202310355427" discloses "A method for fault diagnosis of unbalanced samples of bearings based on multi-scale feature fusion", constructs a VAE-GAN sample generation model to generate pseudo samples of corresponding categories to increase the amount of sample data, and designs a multi-scale feature extraction model. The channel attention mechanism is used to weightedly fuse the features to achieve the identification of bearing fault status. However, the introduction of pseudo samples will lead to imbalance and inconsistency in the distribution of the data set, affecting the generalization ability of the model and the actual application effect. In addition, the multi-scale feature extraction and its subsequent feature fusion process require a lot of computing resources and complex parameter adjustment process, which increases the technical cost and difficulty of implementation and maintenance.
[0005] Another document with the application number "CN202410088255.1" discloses "3D modeling-based target detection data enhancement method and system", which embeds the target-specific perspective view into the selected background image to synthesize the enhanced image, and uses the enhanced image set to train the target detector. If the constructed 3D model is inaccurate, the generated specific perspective view will also have errors, which will affect the quality of the enhanced image and the training effect of the target detector. The whole process involves multiple steps, which requires high computational and time costs and cannot meet the needs of large-scale training.
[0006] The common problems of the above documents are: the computational cost and complexity are high, and the effectiveness and accuracy of the models are highly dependent on their assumptions, data processing methods, and the scale and distribution of training data. The limitations of model assumptions will lead to inaccurate detection results, and data enhancement models are insufficient in capturing deep-level features of the data. Summary of the invention
[0007] The present invention proposes a method for enhancing circuit breaker bearing fault data based on a VAE-GAN network, which overcomes the problems of high computational cost and complexity in the prior art, the limitations of model assumptions leading to inaccurate detection results, and the insufficiency of the data enhancement model in capturing deep-level features of the data.
[0008] To achieve the above object, the technical solution provided by the present invention is as follows:
[0009] A method for enhancing circuit breaker bearing fault data based on a VAE-GAN network comprises the following steps:
[0010] Step 1: Perform feature transformation on fault data;
[0011] Step 2: Add VAE to GAN and build a model: Use the hidden variables output by the variational autoencoder VAE as the input of the GAN model generator and increase the network depth at the same time;
[0012] Step 3: Use Wasserstein distance to replace the KL divergence that measures the distance between real samples and generated samples, constrain the discriminator through gradient penalty, and finally use the model to generate generated samples similar to real data.
[0013] Preferably, in step 1, continuous wavelet transform is performed on the collected circuit breaker bearing fault data to convert the one-dimensional signal into a two-dimensional image;
[0014] For any L 2 For the function f(t) in (R) space, the continuous wavelet transform (CWT) is defined as:
[0015]
[0016] Among them, a is the scale factor, τ is the translation factor, ψ a,τ is the wavelet basis function.
[0017] Preferably, in the above step 2, the objective function of the GAN is as shown in formula (4):
[0018]
[0019] In the formula, E represents the mathematical expectation, D(x) represents the probability of judging the input real sample as true, D(G(z)) represents the probability of judging the input generated sample as true, and P data (x) represents the real data distribution, P(z) represents the data distribution obeyed by random noise, which is generally a Gaussian distribution, indicating the degree of difference between the real sample and the generated sample.
[0020] Preferably, in the above step 2, the VAE uses a neural network to train a simple distribution To approximate p θ (z|x), and the KL divergence is used to measure the closeness between the two, as shown in formula (6):
[0021]
[0022] Substituting formula (5) into formula (6), we can get the following objective function:
[0023]
[0024] remember in is called the variational lower bound, then for p θ The parameter estimation problem of (z|x) is transformed into the lower bound Optimization problem; generally assume It obeys Gaussian distribution, and the latent variable z obeys standard normal distribution, that is, p θ (z|x)~N(0,1); μ and σ 2 Represents the mean and variance, which can be learned through the network;
[0025] In order to optimize the network loss using the gradient descent method, VAE uses a re-parameterization method to transform μ and σ by a Gaussian noise e during sampling. 2 Combined into a hidden variable z, that is, z = μ + e × σ.
[0026] Preferably, in the above step 3, the Wasserstein distance is defined as formula (9):
[0027]
[0028] Where z represents the latent variable of the variational autoencoder, Π(P r ,P g ) represents the real data distribution P r and generate data distribution P g The set of all joint probability distributions of , from which a real sample x and a generated sample G(z) are sampled, and the expectation E of the distance ||xG(z)|| is calculated. (x,G(z))~y[||xG(z)||].
[0029] Compared with the prior art, the present invention has the following beneficial effects:
[0030] 1. The feature transformation of this method adopts continuous wavelet transform. After the circuit breaker bearing fault signal involved in the present invention is transformed by Mexh and Morlet wavelet basis functions, the image highlights are disorderly and irregular, and the features are not obvious. However, after the signal is transformed by the wavelet basis function adopted by the method of the present invention, the image highlights are clearer and more concentrated, and the extracted feature information is more obvious.
[0031] 2. In the model of this method, the hidden variables output by the encoder of the VAE model are used to replace the random noise as the input of the GAN model generator, which avoids the training instability problem caused by random noise and improves the quality of the introduced virtual data;
[0032] 3. The optimization goal of the variational autoencoder VAE is to minimize the KL divergence between the latent variable distribution and the standard normal distribution. However, the KL divergence will become a constant when the distribution of the two samples is very different, resulting in the problem of gradient vanishing during model training. In order to avoid the problem of gradient vanishing caused by the large difference between the generated samples and the real samples, the present invention replaces the KL divergence with the Wasserstein distance and limits the weight range, thereby smoothly reflecting the distance between the two samples, increasing the stability of training and improving the data enhancement effect.
[0033] 4. The discriminator will maximize the loss value during the training process. Although weight clipping can independently limit the value range of each network parameter, the network parameters are always concentrated near the extreme value, and the value range of weight clipping is difficult to determine, which easily leads to the problem of gradient vanishing or gradient explosion. Therefore, the present invention adopts the method of adding a gradient penalty term to force the discriminant network to meet the K-Lipschitz constraint condition, and the effect is better when the gradient value is constrained around 1, that is, K=1.
[0034] 5. The present invention utilizes virtual data generation technology to enhance data, make up for the defect of data imbalance, improve the quality of training data, and provide a data basis for subsequent fault diagnosis models. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Overall flow chart of bearing fault data enhancement method based on VAE-GAN network;
[0036] Figure 2 Time-frequency transformation diagram;
[0037] Figure 3 Rolling element fault signal diagram after three wavelet basis function transformations;
[0038] Figure 4 A structural diagram of the method of the present invention;
[0039] Figure 5 This is a comparison chart between the data generated by the method of the present invention and the real data. DETAILED DESCRIPTION
[0040] The present invention will be described in detail below with reference to the accompanying drawings and embodiments.
[0041] Figure 1 The figure shows the overall flow chart of the present invention. The implementation idea of the present invention is: first, the collected data is subjected to wavelet transform to obtain a time-frequency diagram, then the VAE-GAN encoder and generator (decoder) are trained and the adversary is trained, and finally, the model parameters of the method are saved and samples are generated to achieve the enhancement of unbalanced data.
[0042] The present invention provides a method for enhancing circuit breaker bearing fault data based on a VAE-GAN network, and the specific implementation steps are as follows:
[0043] Step 1: Perform feature transformation on fault data:
[0044] 1.1 Collect circuit breaker bearing fault data:
[0045] The data comes from the public bearing data set of Huazhong University of Science and Technology, including three types of faults caused by the ball, inner ring and outer ring in the bearing. The data are all vibration signals with the horizontal axis as time and the vertical axis as amplitude.
[0046] 1.2 Perform continuous wavelet transform on the collected vibration signal to convert the one-dimensional signal of the circuit breaker bearing fault data into a two-dimensional image.
[0047] Depend on Figure 2 As can be seen, the present invention uses time-frequency transformation technology to transform the circuit breaker bearing fault data from the time domain to the time-frequency domain, that is, converting a one-dimensional signal into a two-dimensional image. Time-frequency transformation can be achieved by a variety of methods, among which wavelet transform is a time-frequency local analysis technology developed from short-time Fourier transform. It can perform multi-scale analysis on the signal through operations such as translation, and is suitable for non-stationary and time-varying signals containing a lot of noise such as circuit breaker bearings.
[0048] For any L 2 For the function f(t) in (R) space, the continuous wavelet transform (CWT) is defined as:
[0049]
[0050] Among them, a is the scale factor, τ is the translation factor, ψ a,τis the wavelet basis function. Performing continuous wavelet transform on a one-dimensional vibration signal is equivalent to projecting the one-dimensional signal onto a two-dimensional plane. Its two-dimensional time-frequency diagram reflects the relationship between the frequency, amplitude and time of the vibration signal. Wavelet transform can ensure time resolution while also taking into account good performance, solving the shortcomings of short-time Fourier transform.
[0051] The appropriate wavelet basis function can show obvious fault characteristics on the two-dimensional time-frequency diagram. As shown in formula (3), the expression of continuous wavelet transform is the convolution of signal and wavelet basis function. The similarity between wavelet basis function and signal is as follows:
[0052]
[0053] Among them, δ represents the similarity coefficient; s i is the area under each peak after taking the absolute value of the wavelet basis function, m i is the maximum value of each peak after the wavelet basis function takes the absolute value; a i is the weighting coefficient of each peak after taking the absolute value of the wavelet basis function, and k is the number of peaks after determining the absolute value of the wavelet basis function.
[0054] It can be analyzed from the formula that if the signal waveform is similar to the wavelet basis function, then after the signal is amplified, other parts of the signal that do not have the shape feature are suppressed. Therefore, in order to extract more effective fault information from the signal, the present invention requires the wavelet basis function waveform to be similar to the signal.
[0055] Depend on Figure 3 As can be seen, three wavelet basis functions are selected for comparative experiments, and the one-dimensional signal of the circuit breaker bearing fault is converted based on the basis functions of Mexh wavelet, Morlet wavelet and ComplexMorlet wavelet, respectively, to obtain the time-frequency diagram of the circuit breaker bearing fault. It can be found from the figure that the image highlights after the signal is converted by Mexh and Morlet wavelet basis functions are disorderly and irregular, and the features are not obvious, but after the signal is converted by ComplexMorlet wavelet basis function, the image highlights are clearer and more concentrated, and the extracted feature information is more obvious than the previous two. By comparison, the wavelet basis function used in the present invention is ComplexMorlet wavelet.
[0056] Step 2: Add VAE to GAN and build the model, which includes the following steps:
[0057] 2.1. Build GAN model:
[0058] GAN can be abstracted as a maximum-minimum problem, and its objective function is shown in formula (4):
[0059]
[0060] In the formula, E represents the mathematical expectation, D(x) represents the probability of judging the input real sample as true, D(G(z)) represents the probability of judging the input generated sample as true, and P data (x) represents the real data distribution, P(z) represents the data distribution obeyed by random noise, which is generally a Gaussian distribution, indicating the degree of difference between the real sample and the generated sample. The goals of the generator G and the discriminator D are opposite, and the training principle is to train the generator and the discriminator separately and alternately.
[0061] 2.2. Add VAE to GAN and build the model:
[0062] Compared with ordinary autoencoders, variational autoencoders (VAE) can learn the approximate probability distribution of implicit variables and generate new data through sampling. If in a continuous or discrete space V, there is a variable that follows an unknown distribution P θ (Y) is a random vector Y. VAE can learn a parameterized model through a series of observable samples. To approach P θ (Y), and then use the model to generate new samples with the same distribution as the real samples. Assuming that the training data set is x and the latent variable is z, the probability distribution of z can be inferred from the Bayesian formula as follows.
[0063]
[0064] Where p(z|x) is the probability distribution of z given x. The distribution of latent variables can be calculated by observing a large number of data samples. However, in practical applications, the real data x is generally a high-dimensional continuous variable, and it is difficult to directly solve the distribution of z using the formula. Therefore, VAE uses a neural network to train a simple distribution To approximate p θ (z|x), and the KL divergence is used to measure the closeness of the two, as shown in formula (6).
[0065]
[0066] Substituting formula (5) into formula (6), we can get the following objective function:
[0067]
[0068] remember in is called the variational lower bound, then for p θ The parameter estimation problem of (z|x) is transformed into the lower bound It is generally assumed that It obeys Gaussian distribution, and the latent variable z obeys standard normal distribution, that is, p θ (z|x)~N(0,1). μ and σ 2 In order to optimize the network loss using the gradient descent method, VAE uses a re-parameterization method to transform μ and σ by a Gaussian noise e during sampling. 2 Combined into a latent variable z, that is, z = μ + e × σ. The network structure of VAE mainly includes the latent variable encoding part and the decoding generation part. The optimization goal of the model is to make the learned latent variable distribution as close to the standard normal distribution as possible, and continuously reduce the reconstruction error between the generated samples and the original real samples until the optimal solution is reached. Its loss function is shown in formula (8). The first term on the right side of the formula represents the KL divergence value between the latent variable distribution and the standard normal distribution, and the second term is the KL divergence between the original data X and the generated data The square error between .
[0069]
[0070] The input of the generator G in GAN is usually random noise, which makes it difficult to train the generator G and the discriminator D, and easily causes the phenomenon of mode collapse. In contrast, VAE, as a latent space generation model with excellent performance, can autonomously learn the latent features of the image and its probability distribution, which is expected to improve the problem of the generator caused by input noise.
[0071] Therefore, if Figure 4 As shown, the present invention uses the hidden variables output by the encoder of the VAE model to replace the random noise as the input of the GAN model generator, and at the same time increases the network depth, thereby effectively improving the data enhancement effect. VAE and GAN share a generator, the input of which is determined by the hidden variables after the real sample is encoded by the variational autoencoder. The variational autoencoder VAE is composed of a fully connected layer, whose task is to reduce the dimension of the high-dimensional features of the real input sample, obtain the mean and variance of the hidden variables, and constrain the distribution of the input noise. The optimization goal of the variational autoencoder VAE is to minimize the KL divergence between the distribution of the hidden variables and the standard normal distribution.
[0072] Step 3: Use Wasserstein distance to replace KL divergence to improve data enhancement effect:
[0073] KL divergence will become a constant when the distribution difference of two samples is large, resulting in the problem of gradient vanishing during model training. To avoid this problem, the method model proposed in the present invention uses Wasserstein distance to measure the similarity between two samples. When the generated samples and the real samples have little overlap at the beginning of training, it can smoothly reflect the distance between the two samples, thereby improving the stability of training.
[0074] The Wasserstein distance is defined as follows:
[0075]
[0076] Where z represents the latent variable of the variational autoencoder, Π(P r ,P g ) represents the real data distribution P r and generate data distribution P g The set of all joint probability distributions of , from which a real sample x and a generated sample G(z) are sampled, and the expectation E of the distance ||xG(z)|| is calculated. (x,G(z))~y [||xG(z)||].
[0077] Different joint distributions γ calculate different expectations. The infimum of these expectations is defined as the Wasserstein distance between the two distributions. Considering that it is almost impossible to traverse all joint distributions to calculate the expected value, equation (9) is converted to:
[0078]
[0079] In the formula, sup{·} represents the supremum of the set, K is a constant, and ||f|| L ≤K means that the function f(·) satisfies the K-Lipschitz continuity condition. In order to make all functions meet this condition, weight clipping is used instead of K-Lipschitz constraint, that is, the range of weights is limited to [-l,l]. When the parameters updated by the network exceed this range, they are limited to -l or l so that the Lipschitz continuity condition is met.
[0080] Use f w Represents a variety of possible functions, that is, it must satisfy ||f w || L ≤K, the solution of equation (10) can be transformed into the solution of equation (11):
[0081]
[0082] Under the condition that the parameter update does not exceed a certain range, the Wasserstein distance between the real data distribution and the generated data distribution can be approximated as formula (12):
[0083]
[0084] Wasserstein distance overcomes the defects of KL divergence, but the parameters of the network are always concentrated near the extreme values, and the value range of weight clipping is difficult to determine, which easily leads to the problem of gradient vanishing or gradient explosion. Therefore, the present invention adopts the strategy of adding gradient penalty terms to force the discriminant network to meet the K-Lipschitz constraint conditions, and the effect is better when the gradient value is constrained around 1, that is, K=1.
[0085] Gradient penalty term L gp Defined as:
[0086]
[0087] In the formula, x r represents a random sample from the linear interpolation of x and G(z), ε represents a random coefficient, It means that the real data and the generated data distribution are evenly distributed along the straight line between the pairs of sampling points.
[0088] The Lipschitz restriction requires the discriminator gradient not to exceed K, and hopes to maximize the score gap between true and false samples. The gradient penalty controls the gradient near K by making the penalty smaller the closer to K and larger the farther from K.
[0089] The comparison between the generated data and the real data using this method model to improve the data enhancement effect is shown in Figure 2. Figure 5 As shown in the figure, the three pictures in the first row are the real data diagrams of 0-ball fault, 1-inner ring fault, and 2-outer ring fault, and the three pictures in the second row are the generated data diagrams of 0-ball fault, 1-inner ring fault, and 2-outer ring fault. It can be seen that the generated data is very similar to the real data, which can make up for the imbalance of circuit breaker bearing fault data, improve the data quality of training, and provide a data basis for subsequent fault diagnosis models.
[0090] In addition, in order to quantitatively reflect and illustrate the effectiveness and superiority of the performance of the model of this method, the FID score is used to quantitatively analyze the data generation results of the model of this method. FID can evaluate the similarity and diversity of two groups of images. It is based on the distribution distance between the generated image and the real image in the feature space, and is used to measure the degree of difference between the generated image and the real image. FID extracts the feature vectors of the real image and the generated image by using the pre-trained Inception neural network, calculates the mean and covariance of the feature vectors of the real image and the generated image, and then calculates the distance between the two feature vector distributions, that is, the distance between the two multivariate Gaussian distributions. The FID calculation formula is as follows:
[0091] FID=||μ r -μ g || 2+Tr(∑r+∑g-2(∑r∑g) 1 / 2 ) (15)
[0092] Among them, μ r is the feature mean of the real image, μ g is the feature mean of the generated image, ∑r is the covariance matrix of the real image, and ∑g is the covariance matrix of the generated image. The lower the FID score, the closer the distribution of the generated image is to the real image, and the better the quality of the generated image.
[0093] Table 1 FID score comparison table
[0094]
[0095] In order to verify the innovation and advantages of the method proposed in this invention, the data generation results of the model of this method are compared with the results of GAN and VAE. Table 1 shows the FID scores of these models. The bold data in the table represent the data with the lowest FID score. The three types of faults, ball fault, inner ring fault, and outer ring fault, correspond to labels 0, 1, and 2, respectively. As can be seen from the table, GAN generates the worst sample diversity, and the FID scores of all categories are the highest, followed by VAE, but the FID score is still large. Among all categories, the FID score of the model of this method is the lowest, which shows that the diversity of the generated samples of the model of this method is the best and contains the richest fault information.
[0096] The above is an explanation of the specific implementation of the present invention, rather than a limitation of the present invention. Those skilled in the relevant technical field can also make various equivalent technical solutions without departing from the scope of the present invention, so all equivalent technical solutions should be included in the protection scope of the present invention.
Claims
1. A method for enhancing circuit breaker bearing fault data based on VAE-GAN network, characterized in that: The following steps are involved: Step 1: Perform feature transformation on fault data; Step 2: Add VAE to GAN and build a model: Use the hidden variables output by the variational autoencoder VAE as the input of the GAN model generator and increase the network depth at the same time; Step 3: Use Wasserstein distance to replace the KL divergence that measures the distance between real samples and generated samples, constrain the discriminator through gradient penalty, and finally use the model to generate generated samples similar to real data.
2. The method for enhancing bearing fault data of a circuit breaker based on a VAE-GAN network according to claim 1 is characterized in that: In the step 1, continuous wavelet transform is performed on the collected circuit breaker bearing fault data to convert the one-dimensional signal into a two-dimensional image; For any L 2 For the function f(t) in (R) space, the continuous wavelet transform (CWT) is defined as: Among them, a is the scale factor, τ is the translation factor, ψ a,τ is the wavelet basis function.
3. The method for enhancing circuit breaker bearing fault data based on VAE-GAN network according to claim 1 or 2, characterized in that: In step 2, the objective function of the GAN is as shown in formula (4): In the formula, E represents the mathematical expectation, D(x) represents the probability of judging the input real sample as true, D(G(z)) represents the probability of judging the input generated sample as true, and P data (x) represents the real data distribution, P(z) represents the data distribution obeyed by random noise, which is generally a Gaussian distribution, indicating the degree of difference between the real sample and the generated sample.
4. The method for enhancing bearing fault data of a circuit breaker based on a VAE-GAN network according to claim 3 is characterized in that: In step 2, the VAE uses a neural network to train a simple distribution To approximate p θ (z|x), and the KL divergence is used to measure the closeness between the two, as shown in formula (6): Substituting formula (5) into formula (6), we can get the following objective function: remember in is called the variational lower bound, then for p θ The parameter estimation problem of (z|x) is transformed into the lower bound Optimization problem; generally assume It obeys Gaussian distribution, and the latent variable z obeys standard normal distribution, that is, p θ (z|x)~N(0,1); μ and σ 2 Represents the mean and variance, which can be learned through the network; In order to use the gradient descent method to optimize the network loss, VAE uses the re-parameter method to transform μ and σ through a Gaussian noise e during the sampling operation. 2 Combined into a hidden variable z, that is, z = μ + e × σ.
5. The method for enhancing bearing fault data of a circuit breaker based on a VAE-GAN network according to claim 4 is characterized in that: In step 3, the Wasserstein distance is defined as follows: Where z represents the latent variable of the variational autoencoder, Π(P r ,P g ) represents the real data distribution P r and generate data distribution P g The set of all joint probability distributions of , from which a real sample x and a generated sample G(z) are sampled, and the expectation E of the distance ||xG(z)|| is calculated. (x,G(z))~y [||xG(z)||].
