Fault sample generation and diagnosis method, system, equipment and program product
By introducing the UNet architecture and CBN encoding of category labels into the generator model, the generator model effectively alleviates the network forgetting problem, generates high-fidelity fault samples, solves the data scarcity problem, and improves the accuracy of fault diagnosis and the generalization ability of the model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SOUTHWEST JIAOTONG UNIV
- Filing Date
- 2025-12-31
- Publication Date
- 2026-05-08
AI Technical Summary
Existing technologies suffer from network forgetting issues when generating fault samples, making it difficult for synthesized samples to retain key discriminative features of specific fault categories. This limits the reliable deployment and application of intelligent diagnostic systems in small-sample industrial scenarios.
A convolutional neural network (UNet architecture) with an encoder-decoder structure is used in conjunction with conditional batch normalization (CBN) to encode category labels. Fault samples are generated through a conditional generative adversarial network model, ensuring that conditional information is effectively propagated in each layer, mitigating information loss and improving the fidelity of generated samples.
Under limited data conditions, high-fidelity conditional fault samples across fault categories are generated, alleviating the problem of data scarcity and improving the availability of training samples and the accuracy of diagnostic models.
Smart Images

Figure CN121997200A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mechanical fault diagnosis, and in particular to a fault sample generation and diagnosis method, system, equipment and program product. Background Technology
[0002] In industrial rotating machinery systems, bearings, as critical support components, play a vital role in supporting shafts and reducing friction, often referred to as the "joints of industry." However, statistics show that compared to other rotating components, bearings have a higher failure rate and more frequent failure phenomena. Therefore, implementing efficient and accurate intelligent fault diagnosis is crucial for ensuring the safe and stable operation of industrial equipment. In recent years, with the rapid development of artificial intelligence technology, deep learning methods—including representative architectures such as convolutional neural networks, recurrent neural networks, autoencoders, Transformers, and generative adversarial networks—have been widely applied in the field of industrial fault diagnosis, significantly promoting the evolution of equipment maintenance models from traditional preventive maintenance to data-driven predictive maintenance, effectively improving the accuracy and efficiency of fault identification.
[0003] However, in real-world industrial scenarios, due to stringent requirements for data privacy and operational security, real-world fault data is often difficult to obtain and extremely limited in quantity. On the one hand, once an anomaly is detected, immediate shutdown and maintenance are usually necessary to prevent the accident from escalating; on the other hand, equipment operates stably for extended periods under normal conditions, resulting in a natural scarcity of fault samples. This data scarcity severely restricts the training effectiveness of data-driven intelligent diagnostic models, limiting their diagnostic accuracy and generalization capabilities. To alleviate this problem, researchers have begun exploring data-generation-based technical approaches, expanding the training set by synthesizing high-quality, high-fidelity fault samples, thereby enhancing the model's learning ability.
[0004] While generative adversarial networks (GANs) and other generator models have shown potential in fault diagnosis tasks with limited data, existing technologies still have significant shortcomings. In particular, existing models generally suffer from severe network forgetting during the synthesis process: when training deep generative structures, the initial input category information (such as fault type labels) gradually decays or is even lost as the network depth increases. This results in generated samples that, while approximating real data in overall distribution, struggle to accurately retain key discriminative features for specific fault categories. This problem limits the effectiveness of synthesized data in downstream diagnostic tasks, making it difficult to truly improve the model's ability to identify rare fault types, and thus hindering the reliable deployment and application of intelligent diagnostic systems in small-sample industrial scenarios. Summary of the Invention
[0005] To address the problem of network forgetting in fault samples generated by existing technologies, this invention provides a fault sample generation and diagnosis method, system, device, and program product.
[0006] In a first aspect, the present invention provides a method for generating fault samples, comprising the following steps: S1. Sample data acquisition and processing: Collect vibration signals of different bearing fault types, convert the vibration signals of each fault type into time-frequency diagrams, and form a dataset for training. S2. Construction and training of the conditional generative adversarial network model; wherein the conditional generative adversarial network model includes a generator model and a discriminator model; the generator model is used to generate fault samples with pseudo-labels based on real fault samples; the discriminator model is used to receive samples and perform discrimination and classification; the conditional generative adversarial network model is trained using the dataset; the generator model adopts a convolutional neural network with an encoder-decoder structure and combines conditional batch normalization to encode category labels; S3. Fault Sample Generation: Generate fault samples with pseudo-labels using the generator model in the trained network model.
[0007] According to a preferred embodiment, the generator model includes an encoder and a decoder. The encoder has a first layer of a double convolutional conditional normalization module (DoubleConvCBN), a second layer of a first downsampling conditional normalization module (Down1_CBN), and a third layer of a second downsampling conditional normalization module (Down2_CBN). The decoder has a first layer of a first upsampling conditional normalization module (Up1_CBN), a second layer of a second upsampling conditional normalization module (Up2_CBN), and a third layer of a convolutional output module (Conv). The second downsampling conditional normalization module (Down2_CBN) of the encoder and the first upsampling conditional normalization module (Up1_CBN) of the decoder are connected by jumpers. The first downsampling conditional normalization module (Down1_CBN) of the encoder and the second upsampling conditional normalization module (Up2_CBN) of the decoder are also connected by jumpers.
[0008] According to a preferred embodiment, the network structure of the discriminator model includes, in sequence: a discriminative input layer, four fully convolutional layers, a flattening layer, and a first fully connected layer and a second fully connected layer, both connected to the output of the flattening layer. The discriminative input layer is used to input sample data. The four fully convolutional layers are used to perform four convolutional downsampling operations on the sample data. The flattening layer is used to change the shape of the tensor. The first fully connected layer is the discriminative output, used to determine whether the input sample is true or false. The second fully connected layer is an auxiliary discriminant classifier, used to determine whether the input sample is true or false and to classify the input sample.
[0009] According to a preferred embodiment, in S2, Hinge loss is used to calculate the adversarial loss of the generator model and the discriminator model; the total loss of the generator model and the discriminator model is constructed by combining the adversarial loss and the auxiliary discriminator classification loss of the auxiliary discriminator classifier.
[0010] According to a preferred embodiment, in S2, the generator model is trained using the Class Conditional Feature Moment Matching Loss Function (CFMM); the Class Conditional Feature Moment Matching Loss Function can simultaneously align the first and second moments of the generated feature distribution with the true feature distribution within each category.
[0011] This invention also provides a fault sample generation system, comprising: an input unit, a processing unit, and an output unit. The input unit is used to input random noise and a given category label. The processing unit obtains synthesized fault samples according to the fault sample generation method provided by this invention. The output unit is used to output the synthesized fault samples.
[0012] The present invention also provides an electronic device. The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the fault sample generation method provided by the present invention.
[0013] The present invention also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the fault sample generation method provided by the present invention.
[0014] The present invention also provides a fault diagnosis method, comprising: generating fault samples using the fault sample generation method provided by the present invention; training a fault diagnosis model constructed based on a deep learning algorithm using the fault samples; and performing fault diagnosis using the trained fault diagnosis model constructed based on the deep learning algorithm.
[0015] This invention also provides a fault diagnosis system, comprising: a sample input unit, a fault diagnosis unit, and a result output unit. The sample input unit is used to input samples to be diagnosed. The fault diagnosis unit performs fault diagnosis using a fault diagnosis model constructed based on a deep learning algorithm; the fault diagnosis model constructed based on the deep learning algorithm is trained using fault samples generated by the fault sample generation method provided by this invention. The result output unit is used to output the fault diagnosis results.
[0016] Compared with the prior art, the beneficial effects of the present invention are as follows: The fault sample generation method provided by this invention differs from existing conditional embedding strategies and data-driven generation methods. This embodiment introduces a convolutional neural network (UNet architecture) with an encoder-decoder structure into the generator model, and combines it with Conditional Batch Normalization (CBN) to encode category labels, effectively embedding conditional information into each layer of the proposed UNet-based generator model. By combining the skip connections of UNet with the adaptive conditional learning capability of CBN, dual information enhancement is achieved. This not only alleviates information loss during forward propagation but also ensures the synthesis of high-fidelity conditional data. Therefore, high-fidelity conditional fault samples can be synthesized across different fault categories with limited data availability, thereby alleviating the data scarcity problem and ensuring the availability of a large number of training samples. Attached Figure Description
[0017] Figure 1 This is a schematic diagram of a fault sample generation method according to a preferred embodiment of the present invention; Figure 2 This is a schematic diagram of the composition architecture of a generator model according to a preferred embodiment of the present invention; Figure 3 This is a schematic diagram of the composition architecture of a discriminator model according to a preferred embodiment of the present invention; Figure 4 Schematic diagram of fault samples generated by various methods; Figure 5 MMD scores for fault samples generated by various methods; Figure 6 This is a schematic diagram of the t-SNE visualization analysis results of the present invention; Figure 7 This is a schematic flowchart of a preferred embodiment of the fault diagnosis method of the present invention; Figure 8 This is a schematic diagram illustrating the diagnostic accuracy of a preferred embodiment of the present invention; Figure 9 This is a schematic diagram showing the feature visualization results of a comparison of tag embedding methods in a preferred embodiment of the present invention. Figure 10 This is a schematic diagram showing the diagnostic accuracy results of a comparison of tag embedding methods according to a preferred embodiment of the present invention. Detailed Implementation
[0018] The present invention will now be described in further detail with reference to specific embodiments. However, this should not be construed as limiting the scope of the present invention to the following embodiments; all technologies implemented based on the content of the present invention fall within the scope of the present invention.
[0019] Unless otherwise specified, the use of terms such as "upper," "lower," "left," "right," "center," "inner," and "outer" to indicate orientation or positional relationships in the description of specific embodiments of the present invention is based on the orientation or positional relationships shown in the accompanying drawings, or the orientation or positional relationship in which the product / equipment / device is typically placed during use. These terms are merely for the purpose of facilitating the description of the present invention or simplifying the description in specific embodiments, enabling those skilled in the art to quickly understand the solution, and do not indicate or imply that a particular device / component / element must have a specific orientation, or be constructed and operated in a specific positional relationship. Therefore, they should not be construed as limitations on the present invention.
[0020] Furthermore, the use of terms such as "horizontal," "vertical," "suspended," and "parallel" does not imply that the corresponding device / component / element must be absolutely horizontal, vertical, suspended, or parallel, but rather that it can be slightly tilted or have a deviation. For example, "horizontal" merely means that its direction is more horizontal relative to "vertical," not that the structure must be completely horizontal, but that it can be slightly tilted. Alternatively, it can be simplified to mean that the corresponding device / component / element, when set in a "horizontal," "vertical," "suspended," or "parallel" direction, can have an error / deviation of ±10% relative to the corresponding direction, more preferably within ±8%, more preferably within ±6%, more preferably within ±5%, and more preferably within ±4%. As long as the corresponding device / component / element is within the error / deviation range, it can still achieve its function in the present invention.
[0021] Furthermore, the use of terms such as "first," "second," and "third" in terminology is merely for distinguishing descriptions of identical or similar components and should not be interpreted as emphasizing or implying the relative importance of a particular component.
[0022] Furthermore, in the description of the embodiments of the present invention, "several", "more than", and "a number of" represent at least two. The number can be any number, such as 2, 3, 4, 5, 6, 7, 8, or 9, and can even exceed nine.
[0023] Furthermore, in the description of the technical solution of this invention, unless otherwise explicitly specified / limited / restricted, the terms "set up," "install," "connect," "link," "provided with," "laid out," and "arranged" should be interpreted broadly. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to common connection methods in the art, such as welding, riveting, bolting, and threaded connections. Such connections can be mechanical, electrical, or communication connections; they can be direct connections or indirect connections through an intermediate medium; and they can refer to the internal communication between two components.
[0024] Example 1 This embodiment provides a method for generating fault samples. See also: Figure 1 Preferably, the fault sample generation method provided in this embodiment includes the following steps: S1. Sample data collection and processing.
[0025] Preferably, S1 includes: collecting vibration signals of different fault types of bearings, converting the vibration signals of each fault type into time-frequency diagrams, and forming a dataset for training.
[0026] S2. Construction and training of conditional generative adversarial network models.
[0027] Preferably, the conditional generative adversarial network model includes a generator model and a discriminator model. The generator model is used to generate fault samples with pseudo-labels based on real fault samples. The discriminator model is used to receive samples and perform discrimination and classification. In S2, the conditional generative adversarial network model is trained using the dataset. The generator model employs a convolutional neural network with an encoder-decoder structure, combined with conditional batch normalization to encode class labels.
[0028] S3. Fault Sample Generation. Preferably, S3 includes: generating fault samples with pseudo-labels using the generator model in the trained network model.
[0029] This embodiment differs from existing conditional embedding strategies and data-driven generation methods. It introduces an encoder-decoder convolutional neural network (UNet architecture) into the generator model and combines it with Conditional Batch Normalization (CBN) to encode class labels, effectively embedding conditional information into each layer of the proposed UNet-based generator model. By combining the skip connections of UNet with the adaptive conditional learning capabilities of CBN, dual information enhancement is achieved. This not only mitigates information loss during forward propagation but also ensures the synthesis of high-fidelity conditional data. This allows for the synthesis of high-fidelity fault samples across different fault categories with limited data availability, thus alleviating the data scarcity problem and ensuring the availability of a large number of training samples.
[0030] Example 2 This embodiment is a further improvement on embodiment 1, and the repeated content will not be described again.
[0031] Preferably, during execution S1, a bearing fault signal test bench is constructed in this embodiment to collect bearing fault data. This test bench includes two support bearings, one test bearing, a drive motor, a hydraulic loading system, and auxiliary components, supporting a radial load range of 0–20 tons and a motor speed range of 0–6000 rpm. Preferably, the test bearing is an SKF NU 312 ECM cylindrical roller bearing with an outer diameter of 130 mm, a pitch circle diameter of 96 mm, an inner diameter of 60 mm, and a roller diameter of 19 mm. Two accelerometers are diagonally mounted above the test bearing, acquiring vibration signals at a sampling frequency of 12800 Hz, with each test condition lasting approximately 3 minutes.
[0032] The test bench collects vibration signals from the test bearings in five states: normal state, inner ring pitting failure, outer ring crack failure, roller spalling failure, and cage breakage failure.
[0033] Vibration signals collected for each fault state were segmented into training, validation, and test sets using a standard non-overlapping sampling strategy. Each segment contained 2048 sampling points, and the vibration signals were converted into time-frequency images using continuous wavelet transform to generate source domain samples of size 3×64×64 for model training.
[0034] Following the transfer learning paradigm, a large number of source domain samples are available, which are used as input to the generator model to produce sufficient synthetic data.
[0035] The target domain samples contain only 20 real fault samples for each class. These real fault samples and the synthesized fault samples are used together to train the conditional generative adversarial network model proposed in S2.
[0036] Both the target domain samples and the source domain samples are real fault samples, differing only in their operating conditions. For example, the source domain samples are motor acceleration signals collected at 1500 rpm, while the target domain samples are motor acceleration signals collected at 3000 rpm.
[0037] The general architecture of a Generative Adversarial Network (GAN) consists of two components: a generator model and a discriminator model. The generator model aims to produce realistic synthetic data (often called "fake data") that resembles but is not identical to real data, while the discriminator model is trained to distinguish whether a given sample comes from the real data distribution or the synthetic distribution of the generator model. Through an adversarial training process between the two models, the generator model's ability to produce realistic data gradually improves until the discriminator model can no longer reliably distinguish between real and generated samples. At this point, the training process is considered to have reached Nash equilibrium, meaning that the synthetic samples produced by the generator model are indistinguishable from real samples by the discriminator model. Following this general paradigm, the conditional generative adversarial network model proposed in S2 of this embodiment also adopts a generator-discriminator model architecture to construct its model structure.
[0038] See Figure 2 Preferably, the generator model in this embodiment is built on the UNet architecture. Specifically, the proposed generator model consists of an encoder and a decoder interconnected by skip connections. Instead of using random noise as input, the encoder acquires actual data samples and then performs two downsampling operations. Subsequently, the decoder performs upsampling to reconstruct the data, ultimately producing synthetic samples. To effectively incorporate class label information and mitigate the label forgetting problem throughout the generation process, this embodiment integrates conditional batch normalization (CBN) after each convolutional layer. Given an input feature map x and a one-hot encoded label y, the CBN operation can be formally defined as follows: (1) Among them, category-related gains and category-related bias Obtained through a learnable affine transformation. and It is a trainable weight matrix. This mechanism allows the label y to dynamically modulate the feature map, thereby ensuring the effective propagation of conditional information throughout the UNet generator model. As a result, intermediate features become explicitly conditional on the class label, which alleviates the label forgetting problem and enhances class-specific consistency in generated samples. Therefore, this embodiment uses the sequence "Conv(x)→CBN(x,y)→ReLU(x)" to construct each module of the UNet generator model.
[0039] The generator model includes an encoder and a decoder; The encoder has a first layer of DoubleConvCBN (double convolutional conditional normalization module), a second layer of Down1_CBN (first downsampling conditional normalization module), and a third layer of Down2_CBN (second downsampling conditional normalization module). The DoubleConvCBN, a conditional normalization module, consists of two identical convolutional modules. Each convolutional module comprises a convolutional operation layer (Conv), followed by a conditional normalization layer (CBN) and an activation layer (ReLU). The first downsampling conditional normalization module Down1_CBN has a first layer of max pooling and a second layer of double convolution conditional normalization module DoubleConvCBN. The second downsampling conditional normalization module Down2_CBN has a first layer of max pooling and a second layer of double convolution conditional normalization module DoubleConvCBN. The decoder has a first layer consisting of a first upsampling conditional normalization module Up1_CBN, a second layer consisting of a second upsampling conditional normalization module Up2_CBN, and a third layer consisting of a convolutional output module Conv. The first upsampling conditional normalization module Up1_CBN has an upsampling layer in the first layer, a splicing layer in the second layer, and a double convolutional conditional normalization module DoubleConvCBN in the third layer. The second upsampling conditional normalization module Up2_CBN has an upsampling layer as the first layer, a splicing layer as the second layer, and a double convolutional conditional normalization module DoubleConvCBN as the third layer. The convolution output module Conv has a first layer that is a convolution operation layer and a second layer that is an activation layer Tanh. The encoder's second downsampling condition normalization module Down2_CBN and the decoder's first upsampling condition normalization module Up1_CBN are connected by a jumper. The encoder's first downsampling conditional normalization module Down1_CBN and the decoder's second upsampling conditional normalization module Up2_CBN are connected by a jumper.
[0040] First, the source domain sample x and the corresponding label y are fed into the DoubleConvCBN module through the generation input layer to obtain the output feature x1. The output feature x1 and the source domain label y are input into the first downsampling conditional normalization module Down1_CBN for feature downsampling processing, and then the feature x2 is output. The output feature x2 and the source domain label y are input into the second downsampling conditional normalization module Down2_CBN for feature downsampling processing, and then the feature x3 is output. The output features x3, x2 and the source domain label y are input into the first upsampling conditional normalization module Up1_CBN for feature upsampling processing to obtain the output feature x4; The output features x4, x1 and the source domain label y are input into the second upsampling conditional normalization module Up2_CBN for feature upsampling processing to obtain the output feature x5; The output feature x5 is input into the convolutional output module Conv to obtain fault samples with pseudo-labels.
[0041] See Figure 3 This embodiment constructs the discriminator model according to the common downsampling structure, namely the "Conv(x)→LeakyReLU(x)" pattern. Specifically, the first four layers act as downsampling blocks, gradually reducing the input image resolution from 64×64 to 4×4. Then, a flattening operation is applied to generate a 2048-dimensional feature vector, which is then input into two fully connected layers. The discriminator model employs two parallel output branches, i.e., two fully connected layers are set up to connect the outputs of the flattening layers in parallel. The first fully connected layer performs binary discrimination, outputting 1 for real samples and 0 for generated samples. The second fully connected layer acts as an auxiliary discriminator classifier, which not only distinguishes between real and fake samples but also predicts their specific categories. Following common practice, this embodiment also applies spectral normalization (SN) to all layers of the discriminator model to improve gradient stability and alleviate the problems of gradient vanishing or exploding. For each layer in the discriminator model, the weight matrix W is normalized by its spectral norm: (2) in SN It is the normalized weight matrix such that its spectral norm satisfies σ( SN ( W ))=1. This normalization ensures that the Lipschitz constant of the discriminator model satisfies || D || Lip ≤1, thereby promoting more stable gradient behavior during training. Preferably, in this embodiment, the SN is embedded in the convolutional layer and the fully connected layer.
[0042] Preferably, the network structure of the discriminator model includes, in sequence: a discriminator input layer, four fully convolutional layers, a flattening layer, and a first fully connected layer and a second fully connected layer, which are set in parallel and are all connected to the output of the flattening layer.
[0043] The sample can be a real sample or a sample generated by the generator model G.
[0044] Four fully convolutional layers (Conv1_SN, Conv2_SN, Conv3_SN, Conv4_SN) perform four convolutional downsampling operations on the sample data: The input data size of Conv1_SN is 3×64×64, and the output data size after downsampling is 16×32×32. The input data size of Conv2_SN is 16×64×64, and the output data size after downsampling is 32×16×16. The input Conv3_SN data size is 32×16×16, and the output downsampled data size is 64×8×8. The input data size of Conv4_SN is 64×8×8, and the output data size after downsampling is 128×4×4.
[0045] A flattening layer is used to change the shape of a tensor without altering its data content. In this embodiment, the flattening layer rearranges the input feature map tensor to fit the input requirements of Fc1 and Fc2; specifically, it flattens the dimensions of the input tensor from 128×4×4 to 2048.
[0046] The first fully connected layer (Fc1) and the second fully connected layer (Fc2) are set in parallel.
[0047] The first fully connected layer (Fc1) is the discriminant output, which determines whether the input sample comes from real data or fake data. It has 1 neuron.
[0048] The second fully connected layer (Fc2) is an auxiliary discriminant classifier. This auxiliary discriminant classifier can not only distinguish whether the input sample is real or fake, but also classify the input sample. Moreover, the auxiliary discriminant classifier performs the discrimination and classification of the input sample simultaneously.
[0049] The second fully connected layer (Fc2) is an auxiliary discriminant classifier with twice the number of fault categories (2×Class).
[0050] The detailed structural design parameters of the generator model and the discriminator model are shown in Table 1.
[0051] Table 1. Structural parameters and related data sizes of the generator and discriminator models.
[0052] After constructing the generator and discriminator models, a conditional generative adversarial network (GAN) model is obtained, which then needs to be trained. The GAN model provided in this embodiment employs a two-player adversarial training strategy, simultaneously training with source domain samples and a limited number of target domain samples. Preferably, after constructing the GAN model, the generator and discriminator models are trained alternately using source domain samples and a limited number of target domain samples.
[0053] The optimization objective function of the existing conditional generative adversarial network model ACGAN is as follows: (3) (4) in D , C ,and G These represent the discriminator model, the auxiliary classifier, and the generator model, respectively. P X,Y (or Q X,Y ) represents the joint distribution of real (or generated) samples and their labels. z Indicates from Gaussian distribution P Z A noise vector randomly sampled from the middle. It is a weighting coefficient used to balance the contributions of adversarial loss and auxiliary classification loss.
[0054] In ACGAN, its objective function includes two types of losses: adversarial loss and auxiliary classification loss. (a) and (c) correspond to the adversarial losses of the generator model and the discriminator model, respectively, while (b) and (d) correspond to their auxiliary classification losses. To enhance training stability and improve the diversity of generated samples, this embodiment introduces several widely adopted strategies into the ACGAN framework, replacing its original adversarial loss and auxiliary classification loss functions.
[0055] First, regarding the adversarial loss term, this embodiment uses Hinge loss instead of the original binary cross-entropy loss in (a) and (c) to stabilize adversarial training. The corresponding objective function is restated as follows: (5) (6) in and These represent the adversarial losses after the updates to D and G, respectively.
[0056] Furthermore, based on Figure 2The improved generator model structure shown in this embodiment samples (x, y) from the source domain samples and labels, and then inputs them into the generator model G. This modification uses structured data (x, y) as input instead of directly inputting noise signals into the generator, thereby further enhancing the stability and fidelity of the generated samples.
[0057] Second, regarding the auxiliary classification loss term, this embodiment replaces the traditional auxiliary classifier in (b) and (d) with an auxiliary discriminant classifier. The objective function of the auxiliary discriminant classifier is defined as follows: (7) (8) in, This represents the probability that input x is classified as y and is the true value. This represents the probability that x is classified as y and is a forgery.
[0058] Finally, by combining adversarial loss and auxiliary discriminant classification loss, the total losses of the generator model and the discriminator model are rewritten as follows: (9) (10) Here, α is a weighting coefficient used to balance the contributions of adversarial loss (9) and auxiliary classification loss (10). In conditional generative adversarial networks, adversarial loss typically plays a dominant role, driving the generator model to gradually align the distribution of synthetic samples with the distribution of real data. In contrast, auxiliary classification loss plays a complementary role by encouraging the generator model to produce samples with correct class label information and enhanced diversity. Preferably, in this embodiment, based on experience, [the following can be used]. Set it to 0.5.
[0059] To improve the quality of generated samples, this embodiment proposes a Class Conditional Feature Moment Matching (CFMM) loss function for training the generator model. This function simultaneously aligns the first and second moments of the generated feature distribution with the true feature distribution within each class. Unlike traditional adversarial objectives that primarily consider global alignment, this design encourages the generator model to capture the global statistics and internal structure of class-specific features, thereby achieving more realistic and diverse conditional generation.
[0060] make The feature representation of the real sample, The feature representation of the generated sample, d This is the feature dimension, which is 2048 in this embodiment. For each category... In this embodiment, the corresponding feature set is defined as follows: , , where y rand y g These are the category labels for real samples and generated samples, respectively. In this embodiment, C=4, and the fault label (pseudo-label) categories include: Category 0, Category 1, Category 2, Category 3, and Category 4; corresponding to: normal state, inner ring pitting fault, outer ring crack fault, roller spalling fault, and cage fracture fault, respectively. To align the global position of the feature distribution, this embodiment calculates the average feature vector of category c: (11) Then, the first-order feature matching loss is defined as the L1 norm between the means: (12) Besides mean alignment, capturing the correlation between feature dimensions is also crucial. Therefore, this embodiment calculates the covariance matrix of the true features and generated features within category c: (13) Enforcing alignment of second-order statistics by using the Frobenius norm of the square matrix between covariance matrices: (14) Finally, the CFMM loss is averaged over all valid classes (i.e., classes where both real and generated samples exist): (15) Therefore, by integrating the proposed CFMM loss into the generator model optimization, the final objective function for training the generator model is rewritten as follows: (16) in It is a weighting system used to adaptively adjust the strength of this term. and These are the maximum and minimum values, respectively; t and T are the current iteration number and the total number of iterations, respectively; and k is the slope parameter controlling the rate of change, defined as follows: (17) Based on formulas (9) and (16), the final optimization function of the proposed conditional generative adversarial network model is given as follows: (18) Then, during adversarial training, the parameter updates for the generator model and the discriminator model are represented as follows: (19) in , These are the model parameters for the discriminator model and the generator model. and These are their corresponding learning rates.
[0061] A conditional generative adversarial network (GAN) model is trained; a generator model is extracted from the trained discriminant conditions of the GAN model to generate fault samples. Preferably, after the model training is completed, the optimal generator model is extracted, and the source domain sample x and the corresponding label y are input into the generator model to generate labeled synthetic samples.
[0062] To comprehensively evaluate the fault sample generation method proposed in this invention, several representative and well-known conditional generator models are introduced as comparative baselines to assess the quality of the generated samples and their effectiveness in data augmentation for downstream fault diagnosis tasks: 1) ACGAN: A baseline conditional generator model that embeds an auxiliary classifier into the output branch of a discriminator model to improve the quality and diversity of generated samples.
[0063] 2) MACGAN: An improved ACGAN framework with independent generator, discriminator and classifier modules to improve training stability, and uses Wasserstein distance to mitigate mode collapse.
[0064] 3) TransCWGAN: A Transformer-based conditional generator model that integrates Transformer layers into the generator model, combining conditional GAN and Wasserstein distance with gradient penalty to generate labeled fault data.
[0065] 4) SSAEL: An improved semi-supervised adversarial reinforcement learning method based on ACGAN, which integrates supervised contrastive learning and gradient normalization to improve training stability and the fidelity of generated samples.
[0066] 5) ADCGAN: This conditional model embeds an auxiliary discriminant classifier module into ACGAN to model the joint distribution of data and labels, thereby improving training stability and alleviating the problem of low intra-class diversity.
[0067] 6) TRA-ACGAN: This improved method incorporates the Vision Transformer block into the generator and discriminator models of ACGAN, replacing the traditional convolutional structure, and is trained using Wasserstein distance loss enhanced by a gradient penalty term.
[0068] 7) ReACGAN: By integrating the data-to-data cross-entropy loss function into the improved ACGAN, a novel ReACGAN model is proposed to make full use of class label information, replacing the traditional softmax cross-entropy.
[0069] 8) TACGAN: A variant of ACGAN that includes two auxiliary classifiers, introducing additional classifiers to enhance intra-class diversity and improve sample quality.
[0070] All conditional generator models generate 500 synthetic samples in a single run, 100 samples per class. For visual inspection, two samples are randomly selected from each class generated by each conditional generator model.
[0071] See Figure 4 These synthetic images demonstrate that the proposed method consistently generates realistic synthetic samples across all categories while maintaining diversity, rather than simply replicating real data. While some conditional generator models produce relatively high-quality samples in specific categories, they often suffer from pattern collapse or aliasing issues in other categories.
[0072] To quantitatively evaluate the generated fault samples, this embodiment employs two widely used metrics: FID and MMD. More specifically, 20 samples are randomly selected from each category of the generated data, for a total of 100 synthetic samples used for evaluation. Similarly, 100 real samples are drawn from the validation set as references. Furthermore, the generation experiment is repeated five times to ensure the robustness of the evaluation and the reliability of the scores; the minimum, maximum, and average values of these trials are summarized in Table 1.
[0073] Table 2: Sample quality assessment based on FID and MMD
[0074] As shown in Table 2, the present invention achieved the lowest scores on both metrics, indicating that the fault samples generated by the present invention are closer to the distribution of real data compared with other condition generator models.
[0075] To provide a more granular assessment, the quality of each category was evaluated using the MMD metric. For example... Figure 5 As shown, this embodiment (Ours) consistently produces minimal distributional variation across all categories, with its MMD score significantly lower than the comparison method. Furthermore, the MMD values obtained in this embodiment remain very stable, showing only minor variations across categories. This consistency highlights the robustness of this embodiment and its ability to maintain inter-class diversity while ensuring close alignment with the real-world data distribution.
[0076] Finally, t-SNE visualization technology is used to analyze the alignment between features of real and generated samples. First, a ResNet model is trained as a feature extractor on a large set of real samples. Then, this trained model is used to extract features from unseen synthetic samples, which are then projected into a two-dimensional space using t-SNE. The results are shown below. Figure 6As shown, solid markers represent real verification samples, and hollow markers represent generated samples. Compared with other methods, the features of the samples generated in this embodiment are more closely aligned with the features of the real samples within each category, exhibiting better clustering results and demonstrating higher distribution similarity.
[0077] Example 3 This embodiment provides a fault sample generation system, including: an input unit, a processing unit, and an output unit. The input unit is used to input random noise and a given category label. The processing unit obtains synthesized fault samples according to the fault sample generation method described in Embodiment 1 or Embodiment 2. The output unit is used to output the synthesized fault samples.
[0078] Example 4 This embodiment provides an electronic device. The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the fault sample generation method involved in Embodiment 1 or Embodiment 2.
[0079] Example 5 This embodiment provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the fault sample generation method involved in Embodiment 1 or Embodiment 2.
[0080] Example 6 This embodiment provides a fault diagnosis method. The fault diagnosis method includes: generating fault samples using the fault sample generation method described in Embodiment 1 or Embodiment 2; training a fault diagnosis model constructed based on a deep learning algorithm using the fault samples; and performing fault diagnosis using the trained fault diagnosis model constructed based on the deep learning algorithm.
[0081] In practical applications, condition monitoring data for high-end mechanical equipment is often scarce, which limits the effectiveness of data-driven fault diagnosis methods. To address this bottleneck, the generator model proposed in the fault sample generation method described in Example 1 or Example 2 is used to expand the training dataset, thereby improving the performance of deep learning-based diagnostic models.
[0082] See Figure 7 First, a large number of synthetic samples are generated using the generator model proposed in the fault sample generation method of Example 1 or Example 2. A training dataset is then constructed using the synthetic samples and real samples. Preferably, the training dataset contains a larger proportion of synthetic samples.
[0083] Secondly, the CNN-based fault diagnosis model is trained using the training dataset; and the trained fault diagnosis model is then used for fault diagnosis.
[0084] Finally, the diagnostic results were analyzed.
[0085] Preferably, this embodiment evaluates the quality of synthetic samples generated by the generator model through a downstream classification task. Specifically, a CNN-based fault diagnosis model is constructed. To simulate real-world data scarcity, the fault diagnosis model can be trained on only a sufficient number of generated samples, or on a mixed dataset containing a large number of synthetic samples and a limited number of real samples. The performance of the trained fault diagnosis model is then evaluated on a fully realistic test set collected from actual mechanical equipment, thereby assessing its diagnostic accuracy and generalization ability under real-world constraints.
[0086] This embodiment effectively addresses the common challenge of data scarcity in industrial applications. It is worth emphasizing that the training set design reflects real-world conditions: real samples are extremely scarce, while synthetic samples are plentiful. To rigorously evaluate the model's generalization performance, the validation and test sets consist entirely of real-world collected data, with 50 samples per fault category. This configuration ensures that the evaluation reflects the model's performance under actual operating conditions.
[0087] To quantitatively evaluate the effectiveness of generated samples in fault diagnosis, this embodiment investigates model performance under different training data volumes. This method allows for direct comparison between models trained on real samples and models trained on synthetic samples. Specifically, if a model trained on generated samples achieves a diagnostic accuracy comparable to a model trained on real samples, it provides empirical evidence that the generated data is both realistic and high-fidelity. Therefore, this embodiment varies the number of training samples for each category from 10 to 100 and evaluates the corresponding diagnostic accuracy. The results are as follows: Figure 8 As shown. In Figure 8 In the diagram, the blue dashed line corresponds to a model trained solely on real samples and evaluated on a real test set, while the red solid line represents a model trained solely on generated samples and evaluated under the same testing protocol. Notably, the two curves almost overlap, indicating that the diagnostic accuracy of the generated samples is very close to that of the real data. These results demonstrate that, in data-scarce scenarios, the generated samples in this embodiment can effectively replace real data for training fault diagnosis models.
[0088] Comparative experiments were conducted to demonstrate that the proposed method outperforms state-of-the-art generator models in fault diagnosis data augmentation. In these experiments, the training dataset consisted entirely of samples generated by each corresponding generator model, while evaluation was performed on the real test dataset. Similarly, the training samples were entirely generated by the corresponding models, and the test results on the real dataset were reported in 10 independent trials, as shown in Table 3.
[0089] Table 3: Fault diagnosis accuracy under different training samples
[0090] As shown in Table 3, compared with the other eight baseline generator models, the proposed method consistently achieves higher diagnostic accuracy under different training sample sizes. Furthermore, when the number of training samples for each category exceeds 50, the performance of the fault diagnosis method proposed in this embodiment approaches that of fault diagnosis models trained on real samples, highlighting its strong competitiveness and effectiveness in practical fault diagnosis tasks.
[0091] To compare the effectiveness of the layer-by-layer label embedding method described in this invention, a comparative experiment was set up in this embodiment, that is, only the first layer of the generator was embedded as a comparison. The effectiveness of the proposed layer-by-layer label embedding method was verified by two experimental systems: linear probe classification experiment and t-SNE intermediate feature visualization. Specifically, features of the first five layers of the pre-trained generator were extracted sequentially to evaluate the feature separability of each layer and to explore how class label information guides the formation of intermediate representations. Figure 9 The visualization results of intermediate features of the method described in this invention and t-SNE with label embedding only in the first layer are presented. Experimental results show that with label embedding only in the first layer, deep feature clusters gradually overlap, indicating weak class discrimination ability. In contrast, the layer-by-layer label embedding method maintains a compact and well-defined feature cluster distribution at all layers. Figure 10 The classification accuracy of each feature layer was compared, and this metric reflects the degree of class distinction of the feature encoding. Experimental results show that the layer-by-layer label embedding method not only significantly outperforms the comparison method in all layers, but also maintains a non-decreasing trend with increasing network depth. In contrast, the accuracy of label embedding only in the first layer drops sharply in deep networks, indicating that the influence of the initial class signal gradually weakens.
[0092] Example 7 This embodiment provides a fault diagnosis system, including: a sample input unit, a fault diagnosis unit, and a result output unit. The sample input unit is used to input samples to be diagnosed. The fault diagnosis unit performs fault diagnosis using a fault diagnosis model built based on a deep learning algorithm; the fault diagnosis model built based on the deep learning algorithm is trained using fault samples generated by the fault sample generation method involved in Embodiment 1 or Embodiment 2. The result output unit is used to output the fault diagnosis results.
[0093] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for generating fault samples, characterized in that, Includes the following steps: S1. Sample data acquisition and processing: Collect vibration signals of different bearing fault types, convert the vibration signals of each fault type into time-frequency diagrams, and form a dataset for training. S2. Construction and training of the conditional generative adversarial network model; wherein the conditional generative adversarial network model includes a generator model and a discriminator model; the generator model is used to generate fault samples with pseudo-labels based on real fault samples; the discriminator model is used to receive samples and perform discrimination and classification; the conditional generative adversarial network model is trained using the dataset; the generator model adopts a convolutional neural network with an encoder-decoder structure and combines conditional batch normalization to encode category labels; S3. Fault Sample Generation: Using the generator model in the trained generative adversarial network model to generate fault samples with pseudo-labels.
2. The method for generating fault samples according to claim 1, characterized in that, The generator model includes an encoder and a decoder; The encoder has a first layer of DoubleConvCBN (double convolutional conditional normalization module), a second layer of Down1_CBN (first downsampling conditional normalization module), and a third layer of Down2_CBN (second downsampling conditional normalization module). The decoder has a first layer consisting of a first upsampling conditional normalization module Up1_CBN, a second layer consisting of a second upsampling conditional normalization module Up2_CBN, and a third layer consisting of a convolutional output module Conv. The second downsampling conditional normalization module Down2_CBN of the encoder and the first upsampling conditional normalization module Up1_CBN of the decoder are connected by a jumper. The encoder's first downsampling conditional normalization module Down1_CBN and the decoder's second upsampling conditional normalization module Up2_CBN are connected by a jumper.
3. The method for generating fault samples according to claim 2, characterized in that, The network structure of the discriminator model includes, in sequence: a discriminator input layer, four fully convolutional layers, a flattening layer, and a first fully connected layer and a second fully connected layer, which are set in parallel and are connected to the output of the flattening layer. The discrimination input layer is used to input sample data; The four fully convolutional layers are used to perform four convolutional downsampling operations on the sample data; The flattening layer is used to change the shape of the tensor; The first fully connected layer is the discriminant output, used to determine whether the input sample is real or fake; The second fully connected layer is an auxiliary discriminant classifier used to determine whether the input sample is real or fake and to classify the input sample.
4. The method for generating fault samples according to claim 3, characterized in that, In S2, Hinge loss is used to calculate the adversarial loss of the generator model and the discriminator model; the total loss of the generator model and the discriminator model is constructed by combining the adversarial loss and the auxiliary discriminator classification loss of the auxiliary discriminator classifier.
5. The method for generating fault samples according to claim 4, characterized in that, In S2, the generator model is trained using the class-conditional feature moment matching loss function; The class-conditional feature moment matching loss function can simultaneously align the first and second moments of the generated feature distribution with the true feature distribution within each class.
6. A fault sample generation system, characterized in that, include: The input unit is used to input random noise and a given class label; The processing unit obtains a synthesized fault sample according to the fault sample generation method as described in any one of claims 1 to 5; The output unit is used to output the synthesized fault sample.
7. An electronic device, characterized in that, The electronic device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the fault sample generation method according to any one of claims 1 to 5.
8. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the fault sample generation method according to any one of claims 1 to 5.
9. A fault diagnosis method, characterized in that, include: A fault sample is generated using the fault sample generation method according to any one of claims 1 to 5; The fault samples are used to train a fault diagnosis model built based on a deep learning algorithm; Fault diagnosis is performed using the fault diagnosis model built based on the deep learning algorithm that has been trained.
10. A fault diagnosis system, characterized in that, include The sample input unit is used to input the sample to be diagnosed. The fault diagnosis unit performs fault diagnosis using a fault diagnosis model constructed based on a deep learning algorithm; the fault diagnosis model constructed based on the deep learning algorithm is trained using fault samples generated by the fault sample generation method according to any one of claims 1 to 5. The result output unit is used to output the fault diagnosis results.