Pseudo-tag-based intelligent diagnosis method and system for few-sample mechanical faults, and medium

By adopting a semi-supervised adversarial learning method based on pseudo-labels in intelligent fault diagnosis of gearboxes, the generator generates fake data with pseudo-labels, and combines the discriminator to build a semi-supervised adversarial learning model, solving the problem of difficulty in collecting labeled fault data in the prior art, and achieving efficient fault diagnosis in the case of scarce label samples.

CN120086734APending Publication Date: 2025-06-03SOUTHWEST JIAOTONG UNIV

Patent Information

Application Number
CN202411334744.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-06-03

AI Technical Summary

Technical Problem

Existing gearbox intelligent fault diagnosis technology based on deep learning is difficult to collect labeled fault data, resulting in a degradation in fault diagnosis performance.

Method used

A semi-supervised adversarial learning method based on pseudo-labels is adopted to generate fake data with pseudo-labels through the generator, and a semi-supervised adversarial learning model is built with a discriminator to reduce dependence on real data.

Benefits of technology

In the case of scarce labeled samples, the fault diagnosis performance is significantly improved, the dependence on labeled data is reduced, and the time and cost of manual labeling is saved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120086734A_ABST
    Figure CN120086734A_ABST
Patent Text Reader

Abstract

The invention relates to the field of intelligent diagnosis of mechanical faults, in particular to an intelligent diagnosis method and system for few-sample mechanical faults based on pseudo tags and a medium. The diagnosis method comprises the following steps: S1, data acquisition and division; real data without labels and real data with labels are formed; s2, constructing and training a semi-supervised adversarial learning model; the semi-supervised adversarial learning model comprises a generator and a discriminator; the generator is used for generating false data with a false label from the random noise z and a given false label y; the first output of the discriminator is used for discriminating whether the input sample data is real data or false data; and the second path of output is used for judging the label type of the input sample data. And S3, fault diagnosis testing. According to the method, the semi-supervised adversarial learning model is constructed based on the generator and the discriminator, and the false data with the false label is generated by using the generator to assist training, so that the dependence on real data can be reduced, and the fault diagnosis performance cannot be reduced due to the reduction of the real data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of mechanical intelligent fault diagnosis, and particularly to a few-shot mechanical fault intelligent diagnosis method, system and medium based on pseudo-labels. Background Art

[0002] The gearbox is an important part of the mechanical transmission system, which can transmit power, change the rotational speed and the direction of motion, and is widely used in industrial equipment. Due to the long-term operation of the gearbox under complex and harsh conditions such as high temperature, heavy load and high speed, the gears in the gearbox are prone to fatigue failures, such as cracks, wear, spalling, pitting, etc. If gear faults are not monitored and diagnosed in time during the budding period, it will further exacerbate the damage of the equipment. In the lightest case, it may lead to equipment shutdown and production interruption, and in the worst case, it may lead to casualties and incalculable losses. Therefore, implementing gearbox fault diagnosis is crucial for ensuring the safety and reliability of machine operation.

[0003] Deep learning is a popular artificial intelligence technology, which has been widely used in the field of mechanical fault diagnosis in recent years. Compared with traditional signal processing-based fault diagnosis methods, deep learning is less dependent on expert knowledge and can automatically predict the health status of equipment. For example, Chinese Patent No. CN113505664B discloses a fault diagnosis method for a planetary gearbox of a wind turbine, which includes collecting vibration signals of the planetary gearbox as samples, including labeled source domain samples, unlabeled source domain samples and target domain samples to be diagnosed; performing signal preprocessing to convert each sample into a fast spectral kurtosis image, thereby obtaining a labeled source domain, an unlabeled source domain and a target domain; constructing a deep residual semi-supervised domain generalization network structure, setting hyperparameters required in training, using an adversarial game mechanism based on the Wasserstein generative adversarial network and a semi-supervised learning method based on pseudo-labels to train the deep residual semi-supervised domain generalization network to obtain a final diagnosis model for fault identification.

[0004] Chinese Patent No. CN114021285B discloses a rotating machinery fault diagnosis method based on mutual local adversarial transfer learning, which includes: considering that the label information hidden in the target domain data is not fully utilized, designing a mutual learning network structure to learn reliable pseudo-labels, so that the unlabeled target domain data can be fully utilized, thereby improving the model performance. The robustness of this model is better than that of a single network structure. Considering that ignoring the category information of faults and directly aligning the source domain and target domain data from a global perspective may cause alignment deviation problems, providing multiple local adversarial domain classifiers to replace the global adversarial domain classifier, and each local adversarial domain classifier aligns the source domain and target domain features of each category respectively to obtain better similar features.

[0005] Although prior arts such as CN113505664B and CN114021285B improve the accuracy of diagnostic models through pseudo - labels, they still rely on a large number of real training samples. However, in actual scenarios, collecting a large amount of fault sample data is very challenging, resulting in a decline in fault diagnosis performance. Therefore, it is particularly urgent to develop a few - shot semi - supervised learning intelligent fault diagnosis method. Summary of the Invention

[0006] The object of the present invention is to overcome the problem that it is difficult to collect labeled fault data in the existing gearbox intelligent fault diagnosis technology based on deep learning, resulting in a decline in fault diagnosis performance, and to provide a few - shot mechanical fault intelligent diagnosis method, system and storage medium based on pseudo - labels.

[0007] In the first aspect, the present invention provides a few - shot mechanical fault intelligent diagnosis method based on pseudo - labels, including the following steps:

[0008] S1. Data acquisition and division; forming unlabeled real data and labeled real data;

[0009] S2. Construction and training of a semi - supervised adversarial learning model;

[0010] S3. Using the discriminator in the trained semi - supervised adversarial learning model to conduct fault diagnosis tests.

[0011] Preferably, the semi - supervised adversarial learning model includes a generator and a discriminator; the generator is used to generate fake data with pseudo - labels from random noise z and given pseudo - labels y; the discriminator model is used to receive sample data and conduct discrimination and classification. The sample data is at least one of fake data with pseudo - labels, unlabeled real data, and labeled real data. The discriminator model has two outputs: the first output is to discriminate whether the input sample data is real data or fake data; the second output is to discriminate the label type of the input sample data.

[0012] According to a preferred embodiment, the generator includes: a first input layer, an embedding layer, a deformation layer, and five deconvolution layers. The first input layer is used to input random noise z and given pseudo - labels y. The embedding layer is used to encode the pseudo - labels y, and then fuse the pseudo - labels y with the random noise z. The deformation layer is used to change the dimension of the output data of the embedding layer. The five deconvolution layers are used to perform upsampling with five deconvolution Deconv operations on the output of the deformation layer to generate fake data with pseudo - labels.

[0013] According to a preferred embodiment, the discriminator includes a second input layer, four fully convolutional layers, a global average pooling layer, a flattening layer, a first fully connected layer, and a second fully connected layer. The second input layer is used to input sample data. The four fully convolutional layers are used to perform downsampling with four convolutional operations on the input sample data. The global average pooling layer is used to adaptively perform dimensionality reduction on the input data. The flattening layer is used to change the shape of the tensor without changing its data content. The first fully connected layer is the judgment output, which is used to judge whether the input sample data comes from real data or fake data. The second fully connected layer is the classification output, which is used to determine the fault type of the input sample data. The first fully connected layer and the second fully connected layer are arranged in parallel and are both connected to the output of the flattening layer.

[0014] According to a preferred embodiment, step S2 further includes constructing a supervised contrast loss function for constraining the distribution difference between the generated fake data and the real data. The supervised contrast loss function is:

[0015]

[0016] where i ∈ I ≡ {1, 2, …, N} is the index of the training samples, N is the number of training samples; A(i) ≡ I\{i} represents the set of all samples in the set I except the anchor point i; P{i} ≡ {p ∈ A(i): y p = y i} represents the set of all sample indices that belong to the same category as the anchor point but do not include the anchor point; σ() is the cosine similarity metric function; τ is the temperature coefficient; h i is the feature vector after dimensionality reduction of the input sample by the discriminator, h p represents the feature vector that belongs to the same category as the anchor point i, and h a represents the remaining feature vectors except the anchor point. Among them, the training samples are composed of labeled fake data and labeled real data.

[0017] According to a preferred embodiment, the training in step S2 at least includes training the discriminator:

[0018] Input the random noise z and the pseudo-label y into the generator to obtain labeled fake data;

[0019] Input the labeled fake data and the unlabeled real data into the discriminator, then pass through the first path output, and calculate the first adversarial loss;

[0020] Input the labeled fake data and the labeled real data into the discriminator model, then pass through the second path output, and calculate the auxiliary classification loss of the labeled fake data and the auxiliary classification loss of the labeled real data respectively;

[0021] Based on the first adversarial judgment loss, the auxiliary classification loss of the fake data with labels and the auxiliary classification loss of the real data with labels, the total loss of the discriminator is calculated.

[0022] According to a preferred embodiment, the training in step S2 further includes training the generator:

[0023] The random noise z and the pseudo-label y are input into the generator to obtain the fake data with labels;

[0024] The fake data with labels is input into the discriminator and then output through the first path, and the second adversarial loss is calculated;

[0025] The fake data with labels is input into the discriminator model, and then output through the second path, and the auxiliary classification loss of the fake data with labels is calculated.

[0026] The fake data with labels and the real data with labels are input into the discriminator for feature dimensionality reduction to obtain the reduced features; the supervised contrast loss is calculated according to the reduced features.

[0027] Based on the second adversarial loss, the auxiliary classification loss, and the supervised contrast loss, the total loss of the generator is calculated.

[0028] According to a preferred embodiment, the training in step S2 further includes alternately training the generator and the discriminator until the number of training rounds reaches a preset number of rounds to obtain the optimal discriminator.

[0029] According to a preferred embodiment, step S3 includes: inputting the samples of the test set into the optimal discriminator, and obtaining the prediction result of the fault diagnosis on the second output of the optimal discriminator.

[0030] The present invention also provides a few-shot mechanical fault intelligent diagnosis system based on pseudo-labels, including: an input unit for inputting a sample to be measured; a processing unit for obtaining the prediction result of the sample to be measured according to the few-shot mechanical fault intelligent diagnosis method based on pseudo-labels provided by the present invention; and an output unit for outputting the prediction result.

[0031] The present invention also provides a storage medium, which stores executable instructions, and the executable instructions cause a processor to execute the few-shot mechanical fault intelligent diagnosis method based on pseudo-labels provided by the present invention.

[0032] Compared with the prior art, the beneficial effects of the present invention are:

[0033] The present invention constructs a semi - supervised adversarial learning model based on a generator and a discriminator, and at the same time uses the generator to generate fake data with pseudo - labels to assist in training, so as to reduce the dependence on real data, and the fault diagnosis performance will not be reduced due to the reduction of real data. The present invention is more suitable for fault diagnosis in the case of scarce labeled samples, greatly reducing the dependence on labeled data, alleviating the problem of relying on expert experience for labeling in actual engineering, and saving the time and cost of manual annotation. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic flow chart of the gearbox fault diagnosis method based on pseudo - labels of the present invention;

[0035] Figure 2 It is a schematic flow chart of data acquisition and division of the present invention;

[0036] Figure 3 It is a schematic architecture diagram of the semi - supervised adversarial learning model of the present invention;

[0037] Figure 4 It is a schematic architecture diagram of the generator model of the present invention;

[0038] Figure 5 It is a schematic architecture diagram of the discriminator model of the present invention;

[0039] Figure 6 It is a schematic diagram of the function of the supervised contrast loss function of the present invention;

[0040] Figure 7 It is a schematic diagram of training the semi - supervised adversarial learning model of the present invention;

[0041] Figure 8 It is a schematic diagram of testing the optimal discriminator using the test data set. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0042] The following further describes the present invention in detail with specific embodiments. However, this should not be construed as limiting the scope of the above - mentioned subject matter of the present invention to the following embodiments. All technologies implemented based on the content of the present invention belong to the scope of the present invention.

[0043] Unless otherwise specified, in the description of the specific embodiments of the present invention, the expression terms indicating the orientation or positional relationship, such as "upper", "lower", "left", "right", "center", "inner", "outer", etc., are all based on the orientation or positional relationship shown in the drawings, or the orientation or positional relationship when the invention product / device / device is commonly used. These terms of orientation or positional relationship are only for the convenience of describing the solution of the present invention or simplifying the description in the specific embodiments, so as to facilitate technicians to quickly understand the solution, rather than indicating or implying that a specific device / component / element must have a specific orientation, or be constructed and operated in a specific positional relationship. Therefore, it should not be construed as a limitation to the present invention.

[0044] In addition, if terms such as "horizontal", "vertical", "hanging", "parallel" appear, it does not mean that the corresponding device / component / element is required to be absolutely horizontal or vertical or hanging or parallel, but can be slightly inclined or have a deviation. For example, "horizontal" only means that its direction is more horizontal relative to "vertical", and does not mean that the structure must be completely horizontal, but can be slightly inclined. Or, it can be simply understood that the corresponding device / component / element is arranged in directions such as "horizontal", "vertical", "hanging", "parallel", etc., and can have an error / deviation of ±10% relative to the corresponding direction setting, more preferably within ±8%, more preferably within ±6%, more preferably within ±5%, 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 solution of the present invention.

[0045] In addition, when expressions such as "first", "second", "third", etc. appear in the terms, they are only used to distinguish the description of the same or similar components, and should not be understood as emphasizing or implying the relative importance of specific components.

[0046] In addition, in the description of the embodiments of the present invention, "several", "multiple", "a number of" represent at least 2. It can be any situation such as 2, 3, 4, 5, 6, 7, 8, 9, etc., or even more than 9.

[0047] In addition, in the description of the technical solution of the present invention, unless otherwise clearly specified / defined / limited, where terms such as "set", "installed", "connected", "connected", "provided with", "laid", "arranged" appear, they should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection. It can be connection means commonly used in the art such as welding, riveting, bolting, threaded connection, etc. This connection can be a mechanical connection, an electrical connection or a communication connection; it can be directly connected, or indirectly connected through an intermediate medium, and can be the communication inside two components.

[0048] Embodiment 1

[0049] This embodiment provides a few-shot mechanical fault intelligent diagnosis method based on pseudo-labels. The method includes the following steps:

[0050] S1. Data collection and division; forming unlabeled real data and labeled real data;

[0051] S2. Construction and training of a semi-supervised adversarial learning model;

[0052] S3. Using the discriminator in the trained semi-supervised adversarial learning model to conduct fault diagnosis tests.

[0053] Preferably, the semi-supervised adversarial learning model includes a generator and a discriminator; the generator is used to generate fake data with pseudo-labels from random noise z and given pseudo-labels y; the discriminator model is used to receive sample data and conduct discrimination and classification. The sample data is at least one of fake data with pseudo-labels, unlabeled real data, and labeled real data. The discriminator model is provided with two-way outputs: the first output is to discriminate whether the input sample data is real data or fake data; the second output is to discriminate the label type of the input sample data.

[0054] In this embodiment, the generator generates fake data with pseudo-labels, and a semi-supervised adversarial learning model is constructed based on the generator and the discriminator. Therefore, when performing training and learning, the dependence on real sample data can be reduced, and the fault diagnosis performance will not be reduced due to the reduction of real sample data.

[0055] The prior art needs to collect a large amount of fault data from the field. However, since mechanical equipment cannot operate with faults for a long time, the available fault data is scarce. If the fault data is scarce, the fault diagnosis model cannot be well trained, resulting in a decline in fault diagnosis performance; moreover, the fault data collected from the field is unlabeled, and generally, it needs to be manually labeled before the labeled data can be used to train the fault diagnosis model; however, manually labeling data is time-consuming and laborious. The method provided in this embodiment only needs to rely on the annotation of a small amount of data, and a large amount of data does not need to be annotated; secondly, the method provided in this embodiment can also generate labeled data to assist model training.

[0056] Embodiment 2

[0057] This embodiment is a further improvement on Embodiment 1. Preferably, the generator includes: a first input layer, an embedding layer, a deformation layer, and five transposed convolutional layers. The first input layer is used to input random noise z and a given pseudo-label y. The embedding layer is used to encode the pseudo-label y and then fuse the pseudo-label y with the random noise z. The deformation layer is used to change the dimension of the output data of the embedding layer. The five transposed convolutional layers are used to upsample the output of the deformation layer through five transposed convolution Deconv operations to generate fake data with pseudo-labels.

[0058] Preferably, the discriminator includes a second input layer, four fully convolutional layers, a global average pooling layer, a flattening layer, a first fully connected layer, and a second fully connected layer. The second input layer is used to input sample data. The four fully convolutional layers are used to downsample the input sample data through four convolution operations. The global average pooling layer is used to adaptively reduce the dimension of the input data. The flattening layer is used to change the shape of the tensor without changing its data content. The first fully connected layer is the judgment output, which is used to judge whether the input sample data comes from real data or fake data. The second fully connected layer is the classification output, which is used to determine the fault type of the input sample data. The first fully connected layer and the second fully connected layer are arranged in parallel and are both connected to the output of the flattening layer.

[0059] Preferably, step S2 further includes constructing a supervised contrast loss function, which is used to constrain the distribution difference between the generated fake data and the real data. The supervised contrast loss function is:

[0060]

[0061] where i ∈ I ≡ {1, 2, …, N} is the index of the training samples, N is the number of training samples; A(i) ≡ I\{i} represents the set of all samples in set I except the anchor point i; P{i} ≡ {p ∈ A(i): y p = y i} represents the set of all sample indices that belong to the same category as the anchor point but do not include the anchor point; σ() is the cosine similarity metric function; τ is the temperature coefficient; h i is the feature vector after the discriminator reduces the dimension of the input sample, h p represents the feature vector that belongs to the same category as the anchor point i, h a represents the remaining feature vectors except the anchor point. Among them, the training samples are composed of fake data with labels and real data with labels.

[0062] Preferably, the training in step S2 at least includes training the discriminator:

[0063] Input the random noise z and the pseudo-label y into the generator to obtain fake data with labels;

[0064] Input the labeled fake data and the unlabeled real data into the discriminator, then output through the first path, and calculate the first adversarial loss;

[0065] Input the labeled fake data and the labeled real data into the discriminator model, then output through the second path, and calculate the auxiliary classification loss of the labeled fake data and the auxiliary classification loss of the labeled real data respectively;

[0066] Calculate the total loss of the discriminator based on the first adversarial judgment loss, the auxiliary classification loss of the labeled fake data, and the auxiliary classification loss of the labeled real data.

[0067] Preferably, the training in step S2 further includes training the generator:

[0068] Input the random noise z and the pseudo-label y into the generator to obtain the labeled fake data;

[0069] Input the labeled fake data into the discriminator, then output through the first path, and calculate the second adversarial loss;

[0070] Input the labeled fake data into the discriminator model, then output through the second path, and calculate the auxiliary classification loss of the labeled fake data,

[0071] Input the labeled fake data and the labeled real data into the discriminator for feature dimensionality reduction to obtain the reduced features; calculate the supervised contrast loss based on the reduced features;

[0072] Calculate the total loss of the generator based on the second adversarial loss, the auxiliary classification loss, and the supervised contrast loss.

[0073] Preferably, the training in step S2 further includes alternately training the generator and the discriminator until the number of training rounds reaches the preset number of rounds to obtain the optimal discriminator.

[0074] Preferably, step S3 includes: inputting the samples of the test set into the optimal discriminator, and obtaining the prediction result of the fault diagnosis on the second output of the optimal discriminator.

[0075] Embodiment 3

[0076] This embodiment is a further improvement of Embodiment 1 and Embodiment 2. This embodiment provides a few-shot mechanical fault intelligent diagnosis method based on pseudo-labels.

[0077] Preferably, referring to Figure 1 , this embodiment may include the following steps:

[0078] S1: Data acquisition and division.

[0079] S2: Construction and training of the semi-supervised adversarial learning model.

[0080] S3: Fault diagnosis test.

[0081] Preferably, step S1 may be: collecting the fault signals of the gearbox, and then processing the fault signals and dividing the data set. Preferably, the division of the data set is: dividing the processed fault signals into a training set, a validation set, and a test set. Among them, the training set is used to train the semi-supervised adversarial learning model; the validation set is used to verify the performance of the semi-supervised adversarial learning model; the test set is used to test the fault diagnosis effect of the semi-supervised adversarial learning model after the training of the semi-supervised adversarial learning model is completed.

[0082] See Figure 2 , specifically, step S1 may include:

[0083] Collecting a number of fault vibration signals from the gearbox; then using continuous wavelet transform to process the fault vibration signals and transforming the one-dimensional vibration signals into two-dimensional time-frequency diagrams; finally dividing a number of time-frequency diagram samples into a training set, a validation set, and a test set. Preferably, the division of a number of time-frequency diagram samples may be 40% for the training set, 30% for the validation set, and 30% for the test set. Preferably, after transforming the vibration signals into time-frequency diagrams, only the time-frequency diagram model is used for training.

[0084] Preferably, step S2 may include:

[0085] Step S2.1, constructing a semi-supervised adversarial learning model assisted by pseudo-labels. See Figure 3 , the semi-supervised adversarial learning model includes a generator G and a discriminator D. The generator G receives a random noise z and a given pseudo-label y, and generates labeled fake data according to the received random noise z and the given pseudo-label y The label refers to the fault type. Preferably. The fault types may include broken teeth, pitting corrosion of tooth surface, tooth surface wear, and missing teeth, and the corresponding labels are 1, 2, 3, 4 in sequence, and the label of a healthy gear is 0.

[0086] The discriminator D receives the training samples as input data. The training samples may be labeled fake data unlabeled real data labeled real data or several of them. Preferably, the unlabeled real data and the labeled real data may be collected from the gearbox fault test bench.

[0087] The discriminator D is provided with two outputs, one output is the discriminant output, and the other output is the auxiliary classifier.

[0088] The discriminant output is used to judge the probability that the sample input to the discriminator D is true or false.

[0089] An auxiliary classifier for discriminating the sample type of labeled samples.

[0090] Step S2.1.1, establish a generator G and a discriminator D.

[0091] The generator G is used to generate fake data that is similar to but not exactly the same as the real data. See Figure 4 , the generator may include a first input layer, an embedding layer, a reshape layer, and five deconvolution layers.

[0092] The first input layer is used to input random noise z and a given pseudo-label y.

[0093] The embedding layer is used to process the pseudo-label y. The embedding layer encodes the pseudo-label y to ensure that the length of each fault type label in pseudo y is consistent with the length of the random noise z. The encoding here is to randomly generate a vector of length 100.

[0094] The reshape layer is used to fuse the random noise z and the output data of the embedding layer into data of size 100×1×1.

[0095] After five deconvolution (Deconv1, Deconv2, Deconv3, Deconv4, Deconv5) upsampling operations on the output of the reshape layer, fake data with pseudo-labels is obtained.

[0096] Deconv1 performs deconvolution on the output data of the reshape layer to convert the data size to 512×4×4;

[0097] Deconv2 performs deconvolution on the output data of Deconv1 to convert the data size to 256×8×8;

[0098] Deconv3 performs deconvolution on the output data of Deconv2 to convert the data size to 128×16×16;

[0099] Deconv4 performs deconvolution on the output data of Deconv3 to convert the data size to 64×32×32;

[0100] Deconv5 performs deconvolution on the output data of Deconv4 to convert the data size to 1×64×64.

[0101] The input of the discriminator D is a sample, and the output of the discriminator D is set with two paths. One path of the output of the discriminator D is to discriminate whether the input sample is real data or fake data; the other path of the output is to determine the label type of the input labeled sample.

[0102] See Figure 5 , the discriminator D may include a second input layer, four fully convolutional layers, a global average pooling layer, a flattening layer, a first fully connected layer, and a second fully connected layer.

[0103] The second input layer is used to input samples.

[0104] The four fully convolutional layers (Conv1, Conv2, Conv3, Conv4) perform downsampling of the sample data through four convolutional operations.

[0105] The global average pooling layer is used to adaptively perform dimensionality reduction on the input feature map, and then convert the feature map into an output with a fixed size. In this article, the size of the input feature map is changed from 512x4x4 to 512x1x1.

[0106] The flattening layer is used to change the shape of the tensor without changing its data content. In this embodiment, the flattening layer rearranges the input feature map tensor to adapt to the input requirements of Fc1 and Fc2. Specifically, the dimension of the input tensor is changed from 512x1x1 to 512.

[0107] The first fully connected layer (Fc1) and the second fully connected layer (Fc2) are arranged in parallel.

[0108] The first fully connected layer (Fc1) is the discriminant output, which discriminates whether the input sample comes from real data or fake data.

[0109] The second fully connected layer (Fc2) is an auxiliary classifier, which is used to determine the fault type of the sample. The auxiliary classifier is used to perform fault prediction on the input labeled data, that is, to judge the fault type of the input labeled data.

[0110] The second fully connected layer (Fc2) is an auxiliary classifier, and the number of its neurons is equal to the number of fault types. The number of sample categories.

[0111] The detailed structural design parameters of the generator G and the discriminator D are shown in Table 1.

[0112] Table 1 Structural parameters of the generator G and the discriminator D

[0113]

[0114]

[0115] Among them, z_dim is the vector length of the random noise z, and n_class is the number of label types, that is, the number of fault types.

[0116] The generator G uses the batch normalization function (BN) to constrain the gradient of the transposed convolution. The output of the generator G is activated by the Tanh function, which limits the output range to the interval [-1, 1]. The rectified linear unit (ReLU) and the leaky rectified linear unit (LeakyReLU) are used for the generator model and the discriminator model respectively.

[0117] The role of the generator is to generate labeled samples. For example, b random noise vectors z of length 100 (z_dim = 100) are input, and the pseudo-label y is specified. That is, the size of the random noise z is b×100, and the size of the pseudo-label y is b. After passing through the embedding layer, the output size of the model is 100. For example, y = [2, 0, 3], that is, 2, 0, and 3 are represented by random vectors of length 100 respectively. Then the size of y after encoding becomes 3×100.

[0118] After passing through the deformation layer, the output size is 100×1×1. Then, after five transposed convolution layers (Deconv), the model size is b×1×64×64, that is, b labeled samples are generated, and the size of each sample is 1×64×64.

[0119] For the discriminator, it contains two parallel output branches. One is used to discriminate whether the input sample is a real sample or a fake sample, and the other branch is used to classify the labeled samples. When the input is an unlabeled sample, it passes through the convolutional layers Conv1, Conv2, Conv3, Conv4, Conv5, global average pooling, and flattening in sequence, and finally outputs through the fully connected layer (Fc1). When the input is a labeled sample, it passes through the convolutional layers Conv1, Conv2, Conv3, Conv4, Conv5, global average pooling, and flattening in sequence, and finally outputs through the fully connected layer (Fc2).

[0120] Step S2.1.2, construct the supervised contrast loss function.

[0121] Since there is a certain gap between the generated samples (labeled fake data) and the real labeled samples, in this embodiment, the supervised contrast loss function is introduced into the constructed pseudo-label assisted semi-supervised adversarial learning model to constrain the distribution difference between the generated samples and the real samples, thereby improving the performance of fault diagnosis. The supervised contrast loss function is shown in formula (1).

[0122]

[0123] where \(i\in I\equiv\{1,2,\ldots,N\}\) is the index of the training samples (true labeled samples + generated labeled samples), i.e., the anchor points, and \(N\) is the number of training samples. \(A(i)\equiv I\setminus\{i\}\) represents the set of all samples in set \(I\) except the anchor point \(i\). \(P\{i\}\equiv\{p\in A(i):y p =y i \}\) represents the set of indices of all samples that belong to the same category as the anchor point but do not include the anchor point. \(\sigma(a,b)=\frac{ab}{\|a\|\|b\|}\) is the cosine similarity metric function. The larger the \(\sigma\) value, the closer the distance between vectors \(a\) and \(b\). \(\tau\) is the temperature coefficient with a value of \(0.3\). is the feature after the discriminator reduces the dimension of the input sample, and \(D F (\cdot)\) outputs a feature dimension \(N_d\) of 512. \(h i , \(h p , \(h a are all the features after the discriminator's flattening layer reduces the dimension, and their dimensions are all 512. \(h i represents the feature vector of the anchor point \(i\), \(h p represents the feature vector that belongs to the same category as the anchor point \(i\), and \(h a represents the remaining feature vectors except the anchor point. The training samples involved in the supervised contrast loss function consist of labeled fake data and labeled real data.

[0124] See Figure 6 , the role of the supervised contrast loss function as shown in formula (1) is:

[0125] Suppose there are three types of fault data, namely category 0, category 1, and category 2, and each category contains real data and fake data. First, select an anchor sample from the three categories. The samples that belong to the same category as the anchor point are regarded as positive classes, and the remaining categories belong to negative classes. Then, use the cosine similarity to calculate the distance between the features of each category. After the model is optimized, the features within the same category are pulled closer, while the features of different categories are separated, thus generating more discriminative features.

[0126] S2.2: Model training.

[0127] S2.2.1: Train the discriminator \(D\). Input the random noise \(z\) and the pseudo-label \(y\) into the generator \(G\) to obtain the labeled fake data Input the labeled fake data and the unlabeled real data into the discriminator \(D\), and then pass through the first path output \(F C _1\) adversarial discriminant output, and calculate the first adversarial loss. The first adversarial loss is as follows:

[0128]

[0129] In the formula, can be regarded as a special case of, where GN(·) is the gradient constraint function, as follows,

[0130]

[0131] Since the samples generated by the generator carry labels, but the labels are not considered when calculating the adversarial loss. Therefore, when calculating the adversarial loss, it is default that the labeled fake data is an unlabeled fake sample, which can be represented by to represent.

[0132] Preferably, the first adversarial loss includes two parts: 1. The adversarial loss of the discriminator for real samples. 2. The adversarial loss of the discriminator for fake samples.

[0133] The purpose of optimizing and training the discriminator is to make the discriminator classify real samples as real as much as possible (hoping that the output probability is as close to 1 as possible); and classify the input fake samples as fake as much as possible (hoping that the output probability is as close to 0 as possible).

[0134] Input the labeled fake data and the labeled real data into the discriminator model D, then pass through the second path output Fc2 auxiliary classifier output, and calculate respectively, the auxiliary classification loss of the labeled real data the auxiliary classification loss of the labeled fake data where is the cross entropy. Combining formula (2), formula (3) and the auxiliary classification loss, the total loss of the discriminator D is

[0135]

[0136] In the formula, β is a weight coefficient with a value of 0.5.

[0137] S2.2.2: Train the generator G. Input the noise and pseudo labels into the generator G to obtain the labeled fake data Input the labeled fake data into the discriminator model D, then pass through the first path output FC1 adversarial discriminant output, and calculate the second adversarial loss (the adversarial loss of the generator):

[0138]

[0139] Because it is training the generator G, and the first path output is the discriminant output, so the second adversarial loss of the generator is calculated. And since the label information is not required when calculating the adversarial loss, it is default that the generated labeled fake data is an unlabeled fake sample, represented by representation. Specifically, the second adversarial loss is the adversarial loss for the discriminator to distinguish the fake samples generated by the generator.

[0140] Input the fake data with labels into the discriminator model D, then output through the second output Fc2 auxiliary classifier, and calculate the auxiliary classification loss of the fake data with labels. Input the fake data with labels and the real data with labels into the discriminator D for feature dimensionality reduction. After dimensionality reduction, output through the middle layer DF(·) of the discriminator to obtain the dimensionality-reduced features. The middle layer DF(·) corresponds to the output of the Flatten layer in the discriminator, that is, the output dimension of DF(·) is 512. Input the dimensionality-reduced features into the formula (1) described above to calculate the supervised contrast loss. The total loss of the generator is

[0141]

[0142] In the formula, γ is the weight coefficient, and its value is 0.5.

[0143] S2.2.3: Refer to Figure 7 , alternately train the generator G and the discriminator D until the training stops to obtain the optimal discriminator D. Preferably, set the number of training rounds to 10,000 times. When the number of training rounds of the model reaches 10,000 times, the training stops.

[0144] Refer to Figure 8 , step S3 is to use the discriminator in the trained semi-supervised adversarial learning model for fault diagnosis testing. Specifically, it can include: input the samples of the test set into the trained discriminator (the optimal discriminator obtained in step S2), and obtain the prediction result of fault diagnosis on the second output Fc2 (auxiliary classifier) of the optimal discriminator, that is, predict what type of fault the input test set sample belongs to.

[0145] Preferably, in this embodiment, only the gearbox dataset is used for experimental illustration. In actual applications, the above method can be applied to the working scenarios of different mechanical equipment for experimental analysis according to needs.

[0146] Collect the vibration signals of the gearbox. Use the pinion on the input shaft of the gearbox as the test gear, and test the gear vibration signals in 5 states including healthy gear, broken tooth, pitting corrosion, tooth surface wear, and missing tooth on this test bench. During the experiment, the rotational speed of the driving motor is set to 1600 rpm, the load torque is 20 N·m, and the sampling frequency of the data acquisition system is set to 12800 Hz. Then, use the vibration acceleration sensor to collect the vibration signals in the vertical direction of the pinion, and the sampling time for each signal is 3 minutes.

[0147] Data division. After obtaining the vibration signals, divide each signal into a training set, a validation set, and a test set, as shown in Table 1. Among them, the non-overlapping sampling method is adopted in the sample segmentation process, and each sample contains 1024 data points. Finally, convert these samples into time-frequency spectra through continuous wavelet transform and use them as the input of the model in this embodiment.

[0148] Table 2 Data division of the gearbox dataset

[0149]

[0150] Set comparison methods. To verify the effectiveness and superiority of the few-shot mechanical fault intelligent diagnosis method based on pseudo-labels provided in this embodiment, compare this embodiment with the following 7 existing intelligent fault diagnosis methods, where CNN, ResNet18, and DisC are methods based on supervised learning, and SSL-DCGAN, HCAE, MSC-GAN, and SSHA-GAN are methods based on semi-supervised learning.

[0151] 1) CNN: The convolutional neural network (CNN) is specifically designed for time-frequency image classification and is considered a classic fault diagnosis model.

[0152] 2) ResNet18: Compared with the traditional convolutional structure, the model combined with residual connections has higher performance. Therefore, the "ResNet18" model with 18 ResNet modules is also used as a supervised learning method for comparison.

[0153] 3) DisC: Directly use the discriminator in the generative adversarial network model designed in the present invention as the classifier for supervised learning tasks.

[0154] 4) SSL-DCGAN: A deep convolutional generative adversarial network with semi-supervised learning. In this method, the discriminator can not only distinguish real or fake samples but also classify real samples.

[0155] 5) HCAE: Adopt the hybrid classification autoencoder method for semi-supervised fault diagnosis, which includes an unsupervised learning stage and a supervised learning stage.

[0156] 6) MSC-GAN: Introduce the multi-scale convolution module into the generative adversarial network and train it with both labeled and unlabeled samples.

[0157] 7) SSHA-GAN: A semi-supervised and high-precision adversarial learning framework that combines the generative adversarial network. Convert the vibration signal into a time-frequency image through continuous wavelet transform, and then input the labeled and unlabeled samples into the discriminator to achieve fault diagnosis.

[0158] Analysis of experimental results. Use the test data set to test the model trained in this embodiment and the models of 7 intelligent fault diagnosis methods. To reduce the influence of random errors, each method independently repeats the experiment 5 times. The average classification accuracy and standard deviation are calculated, and the test results are shown in Table 3. It can be found from the fault diagnosis accuracy in Table 3 that an intelligent gearbox fault diagnosis method based on pseudo-label assisted semi-supervised adversarial learning provided in this embodiment has obvious advantages in terms of diagnosis accuracy and stability, and the fault diagnosis effect is better.

[0159] Table 3 Comparison of fault diagnosis accuracies of different methods

[0160]

[0161] Furthermore, this embodiment studies the influence of the number of labeled samples on the fault diagnosis results. Consider five cases where the number of labeled training samples is 3, 6, 15, 20, and 30 respectively. Each case repeats the experiment 5 times, and the average fault diagnosis accuracy and standard deviation are calculated. The results are shown in Table 4. The purpose of this experiment is to further explore the influence of different numbers of labeled training samples on the fault diagnosis accuracy. Generally speaking, the more training samples, the higher the accuracy. According to the results shown in Table 4, an intelligent gearbox fault diagnosis method based on pseudo-label assisted semi-supervised adversarial learning provided in this embodiment is superior to the other 7 methods. Especially when the number of labeled training samples is less, the advantages of this embodiment are more obvious.

[0162] Table 4 Fault diagnosis accuracies of different numbers of labeled training samples

[0163]

[0164] According to the results of the comparative experiment, the method of this embodiment is more suitable for fault diagnosis in the case of scarce labeled samples, greatly reducing the dependence on labeled data, alleviating the problem of relying on expert experience for labeling in actual engineering, and saving the time and cost of manual labeling.

[0165] Embodiment 4

[0166] This embodiment provides a few-shot mechanical fault intelligent diagnosis system based on pseudo-labels. The mechanical fault intelligent diagnosis system includes: an input unit, a processing unit, and an output unit. The input unit is used to input a sample to be measured. The processing unit obtains the prediction result of the sample to be measured according to the few-shot mechanical fault intelligent diagnosis method based on pseudo-labels involved in any one of Embodiment 1, Embodiment 2, and Embodiment 3. The output unit is used to output the prediction result.

[0167] Embodiment 5

[0168] This embodiment provides a storage medium. The storage medium stores executable instructions that cause a processor to execute the few-shot mechanical fault intelligent diagnosis method based on pseudo-labels provided by any one of Embodiment 1, Embodiment 2, and Embodiment 3.

[0169] The foregoing are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A few-sample intelligent mechanical fault diagnosis method based on pseudo labels, characterized in that: The following steps are involved: S1. Data collection and division; forming unlabeled real data and labeled real data; S2, construction and training of semi-supervised adversarial learning model; S3, using the discriminator in the trained semi-supervised adversarial learning model to perform fault diagnosis testing; The semi-supervised adversarial learning model includes a generator and a discriminator; the generator is used to generate fake data with pseudo labels from random noise z and given pseudo labels y; the discriminator model is used to receive sample data and perform discrimination and classification; The sample data is at least one of false data with pseudo labels, real data without labels, and real data with labels; The discriminator model is set with two outputs: The first output is: determining whether the input sample data is real data or false data; The second output is: determining the label type of the input sample data.

2. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 1 is characterized in that: The generator includes: a first input layer, an embedding layer, a deformation layer, and five deconvolution layers; The first input layer is used to input random noise z and a given pseudo label y; The embedding layer is used to encode the pseudo label y and then fuse the pseudo label y with the random noise z; The deformation layer is used to change the dimension of the output data of the embedding layer; The five deconvolution layers are used to upsample the output of the deformation layer by five deconvolution operations to generate false data with pseudo labels.

3. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 2 is characterized in that: The discriminator includes a second input layer, four fully convolutional layers, a global average pooling layer, a flattening layer, a first fully connected layer, and a second fully connected layer; The second input layer is used to input sample data; The four full convolutional layers are used to downsample the input sample data by performing four convolution operations; The global average pooling layer is used to adaptively perform dimensionality reduction operations on input data; The flattening layer is used to change the shape of a tensor without changing its data content; The first fully connected layer is a judgment output, which is used to judge whether the input sample data comes from real data or fake data; The second fully connected layer is a classification output, which is used to determine the fault type of the input sample data; The first fully connected layer and the second fully connected layer are arranged in parallel, and both are connected to the output of the flattened layer.

4. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 1 is characterized in that: Step S2 also includes constructing a supervised contrast loss function to constrain the distribution difference between the generated fake data and the real data; The supervised contrast loss function is: Where i∈I≡{1,2,…,N} is the index of the training sample, and N is the number of training samples; A(i)≡I\{i} represents the set of all samples in set I except anchor point i; P{i}≡{p∈A(i):y p =y i } represents the set of all sample indexes that belong to the same category as the anchor point, but does not include the anchor point; σ() is the cosine similarity metric function; τ is the temperature coefficient; h i is the feature vector after the discriminator reduces the dimension of the input sample, h p Indicates that the feature vector belongs to the same category as the anchor point i, h a represents the remaining feature vectors except the anchor point; The training samples are composed of labeled false data and labeled real data.

5. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 4 is characterized in that: The training in step S2 includes at least training the discriminator: Input random noise z and pseudo label y into the generator to obtain fake data with labels; The labeled fake data and the unlabeled real data are input into the discriminator, then output through the first path, and the first adversarial loss is calculated; The labeled fake data and the labeled real data are input into the discriminator model, and then output through the second path, and the auxiliary classification loss of the labeled fake data and the auxiliary classification loss of the labeled real data are calculated respectively; The total loss of the discriminator is calculated based on the first adversarial judgment loss, the auxiliary classification loss of the labeled fake data, and the auxiliary classification loss of the labeled real data.

6. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 5 is characterized in that: The training in step S2 also includes training the generator: Random noise z and pseudo label y are input into the generator to obtain fake data with labels; The labeled fake data is input into the discriminator and then output through the first path, and the second adversarial loss is calculated; The labeled fake data is input into the discriminator model, then output through the second path, and the auxiliary classification loss of the labeled fake data is calculated. Inputting the labeled false data and the labeled true data into the discriminator to perform feature dimensionality reduction to obtain features after dimensionality reduction; and calculating the supervised contrast loss based on the features after dimensionality reduction; The total loss of the generator is calculated based on the second adversarial loss, auxiliary classification loss, and supervised contrast loss.

7. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 6 is characterized in that: The training in step S2 also includes alternately training the generator and the discriminator until the number of training rounds reaches a preset number of rounds to obtain an optimal discriminator.

8. The method for intelligent diagnosis of mechanical faults with a small number of samples based on pseudo labels according to claim 6 is characterized in that: Step S3 includes: inputting the samples of the test set into the optimal discriminator, and obtaining the prediction result of the fault diagnosis on the second output of the optimal discriminator.

9. A pseudo-label-based few-sample mechanical fault intelligent diagnosis system, characterized in that: include: An input unit, used for inputting samples to be tested; A processing unit, which obtains the prediction result of the sample to be tested according to the few-sample mechanical fault intelligent diagnosis method based on pseudo labels according to any one of claims 1 to 8; An output unit is used to output the prediction result.

10. A storage medium, characterized in that: The storage medium stores executable instructions, and the executable instructions enable a processor to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • A method for fault diagnosis of planetary gearbox in wind turbine units

    CN113505664B

  • Rotating machinery fault diagnosis method based on mutual local adversarial transfer learning

    CN114021285B

Cited By

  • Fault sample generation method, system and device, medium and program product

    CN121071576A