Two-stage failure sample enhancement method and device, electronic equipment and storage medium
By generating fault samples with general and random attributes through a two-stage fault sample augmentation method, the problems of unbalanced data distribution and sample scarcity are solved, thereby improving the accuracy and robustness of the fault diagnosis model.
Patent Information
- Application Number
- CN202310432654.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-21
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-04-21
AI Technical Summary
Existing fault diagnosis methods suffer from low accuracy in real-world engineering environments due to uneven data distribution and scarce samples, making it difficult to cover all possible fault scenarios.
A two-stage fault sample augmentation method is adopted. The first stage generates fault baseline samples with general attributes, and the second stage generates fault samples with random attributes. These samples are then combined with real samples for augmentation.
It enables the diversified generation of fault diagnosis samples, improves the accuracy and robustness of fault diagnosis models, and solves the problem of the difficulty in building and training generative models.
Smart Images

Figure CN116662797B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, and in particular to a two-stage fault sample enhancement method and device, electronic equipment and storage medium. BACKGROUND
[0002] Fault diagnosis is one of the most important tasks in the modern industrial field, which can help to find equipment faults in time and perform maintenance, and ensure the normal operation of production efficiency and equipment. Most of the existing fault diagnosis methods are based on existing data for learning, and perform fault diagnosis through the trained model. However, in the real engineering environment, due to the influence of running environment, manufacturing process, etc., the frequency of different fault categories under different working conditions will be significantly different. In addition, due to the reasons such as lack of ready-made equipment for collecting fault data, insufficient accumulation of historical data, etc., some fault class samples are rare, and the distribution between normal samples or other fault class samples is uneven. Due to the limitation and difficulty of obtaining such fault sample data, the existing data is often difficult to cover all possible fault conditions, so that the precision of the fault diagnosis model based on data driving is not high, and the fault diagnosis result is not accurate enough. SUMMARY
[0003] In view of the above problems existing in the related art, the embodiments of the present application provide a two-stage fault sample enhancement method and device, electronic equipment and storage medium.
[0004] The first invention provides a two-stage fault sample enhancement method, comprising:
[0005] In the first stage, the first noise vector is expanded based on the annotation information, and the expanded first noise vector and the real fault reference sample are input into the first conditional generative adversarial network model to generate a fault reference sample containing general attributes;
[0006] In the second stage, the fault reference sample containing general attributes is added with a second noise vector and an annotation information encoding vector, and a real fault sample is combined as an input of the second conditional generative adversarial network model to generate a fault sample containing random attributes;
[0007] The fault sample containing random attributes and the corresponding annotation information are added to the historical fault sample to obtain an enhanced fault sample;
[0008] The first noise vector and the second noise vector are both obtained by random noise sampling, the labeling information includes a working condition and a fault mode, the first conditional generative adversarial network model is obtained by training based on historical fault samples and predetermined general attribute labels, and the second conditional generative adversarial network model is obtained by training based on fault benchmark samples output by the first conditional generative adversarial network model and random attribute labels.
[0009] In some embodiments, the first conditional generative adversarial network model is trained based on the following steps:
[0010] The first conditional generative adversarial network model is constructed, and the first conditional generative adversarial network model includes a first generator, a first discriminator and a first classifier.
[0011] General attributes of the preprocessed historical fault samples are extracted by time series decomposition as fault benchmark sample labels in the first stage;
[0012] The first noise vector is expanded based on the labeling information, and the expanded first noise vector is input into the first generator to obtain simulated fault benchmark samples;
[0013] The real fault benchmark samples and the simulated fault benchmark samples are input into the first discriminator to obtain first true-false discrimination results;
[0014] The real fault benchmark samples and the simulated fault benchmark samples are input into the first classifier to obtain first classification results containing the labeling information;
[0015] A first loss of the first conditional generative adversarial network model is determined, model training is completed based on back propagation of the first loss, and parameters of the first generative adversarial network model are updated.
[0016] In some embodiments, the second conditional generative adversarial network model is trained based on the following steps:
[0017] The second conditional generative adversarial network model is constructed, and the second conditional generative adversarial network model includes a second generator, a second discriminator and a second classifier.
[0018] The second noise vector is expanded based on the labeling information, and the expanded second noise vector and the fault benchmark samples generated in the first stage are input into the second generator to obtain simulated fault samples;
[0019] The real fault samples and the simulated fault samples are input into the second discriminator to obtain second true-false discrimination results;
[0020] inputting the real fault samples and the simulated fault samples into the second classifier to obtain a second classification result containing the labeling information;
[0021] determining a second loss of the second conditional generative adversarial network model, completing model training based on back propagation of the second loss, and updating parameters of the second conditional generative adversarial network model.
[0022] In some embodiments, the general attributes include trends and cycles.
[0023] In a second aspect, the present application further provides a two-stage fault sample enhancement device, comprising:
[0024] a first generation module configured to, in a first stage, expand a first noise vector based on labeling information, input the expanded first noise vector and real fault benchmark samples into a first conditional generative adversarial network model, and generate fault benchmark samples containing general attributes;
[0025] a second generation module configured to, in a second stage, add a second noise vector and a labeling information encoding vector to the fault benchmark samples containing general attributes, combine real fault samples as inputs of a second conditional generative adversarial network model, and generate fault samples containing random attributes;
[0026] an acquisition module configured to add the fault samples containing random attributes and corresponding labeling information to historical fault samples, and acquire enhanced fault samples;
[0027] wherein the first noise vector and the second noise vector are both obtained by random noise sampling, the labeling information includes working conditions and fault modes, the first conditional generative adversarial network model is obtained after being trained based on historical fault samples and pre-determined general attribute labels, and the second conditional generative adversarial network model is obtained after being trained based on fault benchmark samples output by the first conditional generative adversarial network model and random attribute labels.
[0028] In some embodiments, the first conditional generative adversarial network model is trained based on the following steps:
[0029] The first conditional generative adversarial network model comprises a first generator, a first discriminator and a first classifier.
[0030] The general attributes of the preprocessed historical fault samples are extracted by time series decomposition as fault benchmark sample labels in the first stage.
[0031] The first noise vector is expanded based on the labeling information, and the expanded first noise vector is input into the first generator to obtain simulated fault benchmark samples.
[0032] inputting the real fault benchmark sample and the simulated fault benchmark sample into the first discriminator to obtain a first true-false discrimination result;
[0033] inputting the real fault benchmark sample and the simulated fault benchmark sample into the first classifier to obtain a first classification result containing the labeled information;
[0034] determining a first loss of the first conditional generative adversarial network model, completing model training based on back propagation of the first loss, and updating parameters of the first conditional generative adversarial network model.
[0035] In some embodiments, the second conditional generative adversarial network model is trained based on the following steps:
[0036] constructing the second conditional generative adversarial network model, the second conditional generative adversarial network model comprising a second generator, a second discriminator and a second classifier;
[0037] extending the second noise vector based on labeled information, inputting the extended second noise vector and the fault benchmark sample generated in the first stage into the second generator to obtain a simulated fault sample;
[0038] inputting the real fault sample and the simulated fault sample into the second discriminator to obtain a second true-false discrimination result;
[0039] inputting the real fault sample and the simulated fault sample into the second classifier to obtain a second classification result containing the labeled information;
[0040] determining a second loss of the second conditional generative adversarial network model, completing model training based on back propagation of the second loss, and updating parameters of the second conditional generative adversarial network model.
[0041] In some embodiments, the general attributes include trends and cycles.
[0042] In a third aspect, the present application further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the two-stage fault sample enhancement method according to any one of the above aspects when executing the program.
[0043] In a fourth aspect, the present application further provides a non-transitory computer readable storage medium having a computer program stored thereon, wherein the computer program is executable on a processor to implement the two-stage fault sample enhancement method according to any one of the above aspects.
[0044] In a fifth aspect, the present application further provides a computer program product comprising a computer program which, when executed by a processor, implements the two-stage fault sample enhancement method according to any one of the above.
[0045] The two-stage fault sample enhancement method, device, electronic equipment and storage medium provided by the embodiments of the present application are designed and implemented to generate the sample contents in the first stage and the second stage in the two-stage generation process, implement the guidance for the overall fault diagnosis sample generation, meet the fault diagnosis learning requirements based on data driving, gradually implement the enhancement of the complex fault diagnosis sample through the two-stage manner, and thus solve the problems that the generative model is difficult to construct and difficult to train in the fault sample generation process. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0047] Figure 1 Fig. 1 is one of the flow diagrams of the two-stage fault sample enhancement method provided by the embodiments of the present application;
[0048] Figure 2 Fig. 2 is another of the flow diagrams of the two-stage fault sample enhancement method provided by the embodiments of the present application;
[0049] Figure 3 Fig. 3 is a third of the flow diagrams of the two-stage fault sample enhancement method provided by the embodiments of the present application;
[0050] Figure 4 Fig. 4 is a structural diagram of the two-stage fault sample enhancement device provided by the embodiments of the present application;
[0051] Figure 5 Fig. 5 is a physical structure diagram of the electronic equipment provided by the embodiments of the present application. DETAILED DESCRIPTION
[0052] The traditional data imbalance problem is usually alleviated by oversampling, downsampling or integrated learning. These methods are linear, new data is generated from the original data, and deep data information cannot be fully mined, so the distribution of unbalanced data cannot be well mapped.
[0053] A series of generative models based on deep learning technology such as generative adversarial networks and autoencoders are gradually applied to the field of fault diagnosis to learn the deep nonlinear information of fault data and generate more diversified fault diagnosis data to achieve sample enhancement and improve the accuracy of fault diagnosis models.
[0054] Compared with traditional sample enhancement methods, the method can learn more complex and diversified data distribution in a nonlinear mapping manner, achieve data enhancement of a small number of fault samples, and effectively improve the fault diagnosis problem under a small sample.
[0055] However, due to the complex training process steps of various deep learning-based generative models, involving numerous hyperparameters, the training process of the model is difficult to control and the training effect is difficult to guarantee. For example: the generative adversarial network model needs to achieve Nash equilibrium through the mutual game of the generative model and the discriminative model to complete the information learning process of the model. In this process, the training of the generative model and the discriminative model needs to be cross-performed, and the stability of the model training is easily affected by the learning rate and other hyperparameters, resulting in mode collapse and other situations in the training, which seriously affects the sample enhancement effect.
[0056] To solve the above problems in the related art, the embodiment of the present application provides a two-stage fault sample enhancement method, device, electronic equipment and storage medium, which specifically designs and realizes the sample generation content of the first stage and the second stage in the two-stage generation process, realizes the guidance for the generation of the overall fault diagnosis sample, meets the learning needs of data-driven fault diagnosis, and gradually realizes the enhancement of complex fault diagnosis samples through the two-stage method, thereby solving the problems of difficult construction and difficult training of the generative model in the fault sample generation process. The method is suitable for fault sample enhancement in the field of aviation.
[0057] To make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the present application will be described clearly and completely below in combination with the drawings in the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor belong to the scope of protection of the present application.
[0058] Figure 1 is one of the flowcharts of the two-stage fault sample enhancement method provided by the embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0059] Step 101, in the first stage, the first noise vector is expanded based on the annotation information, the expanded first noise vector and the real fault benchmark sample are input into the first conditional generative adversarial network model, and the fault benchmark sample containing general attributes is generated.
[0060] Step 102, in the second stage, the second noise vector and the annotation information encoding vector are added to the fault benchmark sample containing general attributes, and the real fault sample is combined as the input of the second conditional generative adversarial network model, and the fault sample containing random attributes is generated.
[0061] Step 103, the fault sample containing random attributes and the corresponding annotation information are added to the historical fault sample, and the enhanced fault sample is obtained.
[0062] The first conditional generative adversarial network model is obtained by training based on the historical fault sample and the pre-determined general attribute label, the second conditional generative adversarial network model is obtained by training based on the fault benchmark sample output by the first conditional generative adversarial network model and the random attribute label, the first noise vector and the second noise vector are obtained by random noise sampling, and the annotation information includes working conditions and fault modes.
[0063] Specifically, the annotation information includes working conditions and fault modes. Taking signal sampling data as an example, first, the first noise vector is obtained by random noise sampling, and then is spliced with the working condition and fault mode encoding vector to serve as the input of the first conditional generative adversarial network (CGAN) model to generate the fault benchmark sample containing general attributes. The first conditional generative adversarial network model is obtained by training based on the historical fault sample and the pre-determined general attribute label. The first stage generates the fault benchmark sample containing general attributes, realizes the learning of the general attributes under the specific fault mode in the fault diagnosis sample library, and further realizes the generation of the fault benchmark sample containing general attributes.
[0064] Then, the second noise vector and the corresponding annotation information encoding vector are added to the fault benchmark sample generated in the first stage, and the real fault sample is combined as the input of the second conditional generative adversarial network model to generate the complete fault sample containing random attributes. The second conditional generative adversarial network model is obtained by training based on the fault benchmark sample output by the first generative adversarial network model and the random attribute label. The second stage generates the fault sample containing random attributes, realizes the learning of the random attributes of the noise. The second stage combines the fault benchmark sample generated in the first stage, and further realizes the generation of the complete new fault sample with random attributes.
[0065] Finally, the generated fault samples and the corresponding labeling information are labeled, and the real fault samples collected historically are obtained to obtain the enhanced fault samples. Then, fault diagnosis modeling is realized according to the enhanced fault samples, and the results are evaluated.
[0066] The two-stage fault sample enhancement method provided by the embodiment of the application specifically designs and realizes the sample generation content of the first stage and the second stage in the two-stage generation process, realizes the guidance for the generation of the overall fault diagnosis sample, meets the fault diagnosis learning demand based on data driving, and gradually realizes the enhancement of the complex fault diagnosis sample in a two-stage manner, so that the problems that the generative model is difficult to construct and difficult to train in the fault sample generation process are solved.
[0067] In some embodiments, the general attributes include trends and cycles.
[0068] Specifically, taking signal sampling data as an example, trends and cycles are taken as general attributes to construct fault benchmark samples. The general attributes can be adjusted according to actual needs, and are not limited to trends and cycles.
[0069] In some embodiments, the first conditional generative adversarial network model is trained based on the following steps:
[0070] The first conditional generative adversarial network model is constructed, and the first conditional generative adversarial network model includes a first generator, a first discriminator and a first classifier;
[0071] The general attributes of the preprocessed historical fault samples are extracted through time series decomposition as the fault benchmark sample labels of the first stage;
[0072] The first noise vector is expanded based on the labeling information, the expanded first noise vector is input into the first generator, and the simulated fault benchmark sample is obtained;
[0073] The real fault benchmark sample and the simulated fault benchmark sample are input into the first discriminator to obtain the first true-false discrimination result;
[0074] The real fault benchmark sample and the simulated fault benchmark sample are input into the first classifier to obtain the first classification result containing the labeling information;
[0075] The first loss of the first conditional generative adversarial network model is determined, the model training is completed based on the back propagation of the first loss, and the parameters of the first generative adversarial network model are updated.
[0076] Specifically, the first conditional generative adversarial network model includes the first generator, the first discriminator and the first classifier, and is trained based on at least the following steps:
[0077] First, collect historical fault samples that need to be enhanced, containing labeled information, as training data; preprocess the training data, including but not limited to: outlier removal, normalization, etc., and then build a training dataset by windowing.
[0078] Then, extract the general attributes of the training data through time series decomposition (Seasonal-Trend decomposition procedure based on Loess, STL) as the first-stage fault benchmark sample label.
[0079] Then, random noise sampling obtains a first noise vector, adds a labeled information encoding vector to obtain an expanded first noise vector. The expanded first noise vector is input into the first-stage partial model. The noise sampling can come from Gaussian noise, which is selected according to actual needs. For example, the noise vector is (B, N), B represents the batch size, and N represents the noise representation dimension. After adding the labeled information encoding vector, it is expanded to (B, N+2), and the result is sent to the first discriminator and the first classifier to obtain the loss, and then the first generator is updated.
[0080] The first generator takes the expanded first noise vector as input and outputs simulated fault benchmark samples. The first discriminator takes the real fault benchmark samples and the simulated fault benchmark samples as input and outputs the true or false discrimination of the input, i.e., the first true or false discrimination result. The first classifier also takes the real fault benchmark samples and the simulated fault benchmark samples as input and outputs the multi-label result of the labeled information in the input information, i.e., the first classification result. Determine the first loss of the first conditional generative adversarial network model, which includes the first generator loss, the first discriminator loss and the first classifier loss. Then, through multiple iterations of the dataset and according to the backpropagation of the first loss, the model is trained, and the parameters of the first generative adversarial network model are updated, including the first generator parameters, the first discriminator parameters and the first classifier parameters.
[0081] Among them, according to the backpropagation of the first loss to realize the model training, after obtaining the first discriminator loss and the first classifier loss, the first generator is updated. The output result of the first generator will be input into the first discriminator and the first classifier together with the real fault benchmark sample for training, realizing the update of the first discriminator and the first classifier.
[0082] In the fault sample enhancement process, the simulated fault benchmark sample output by the first generator, i.e., the fault benchmark sample generated in the first stage, carries the fault benchmark sample label, i.e., the general attribute. The first generator can include a deep learning-based generator such as a generative adversarial network, a variational autoencoder, etc. The first discriminator and the first classifier can be a fully connected visual network, a long short-term memory network, etc.
[0083] In some embodiments, the second conditional generative adversarial network model is trained based on the following steps:
[0084] A second conditional generative adversarial network model is constructed, which includes a second generator, a second discriminator, and a second classifier.
[0085] Based on the labeled information, the second noise vector is expanded, and the expanded second noise vector and the fault benchmark sample generated in the first stage are input into the second generator to obtain a simulated fault sample.
[0086] The real fault sample and the simulated fault sample are input into the second discriminator to obtain a second true-false discrimination result.
[0087] The real fault sample and the simulated fault sample are input into the second classifier to obtain a second classification result containing labeled information.
[0088] A second loss of the second conditional generative adversarial network model is determined, and the model training is completed based on the back propagation of the second loss, and the parameters of the second generative adversarial network model are updated.
[0089] Specifically, the second conditional generative adversarial network model includes a second generator, a second discriminator, and a second classifier, and is trained based on at least the following steps:
[0090] First, a second noise vector is sampled from random noise, and an encoding vector of labeled information is added to obtain an expanded second noise vector. The expanded second noise vector, the fault benchmark sample generated in the first stage, and the real fault sample are input into the second stage as model inputs. The noise sampling can be from Gaussian noise, which is selected according to actual requirements.
[0091] The second generator outputs a simulated fault sample as an output by taking the extended second noise vector and the fault benchmark sample generated in the first stage as inputs.
[0092] The second generator is updated according to the back propagation of the second loss, and the output of the second generator is input into the second discriminator and the second classifier together with the real fault sample to update the second discriminator and the second classifier.
[0093] The second generator can include a generative adversarial network, a variational autoencoder and other deep learning-based generators.
[0094] Compared with the related art, the two-stage fault sample enhancement method provided by the embodiments of the present application has at least the following technical effects:
[0095] (1) Compared with the sample sampling paradigm in the traditional data enhancement method, new fault diagnosis data can be generated, the generated samples have randomness, and the generated data is more diversified.
[0096] (2) The first stage can realize general attribute learning of the fault sample, such as trend, period, etc., but is not limited thereto, and can be customized by designing the input label to realize other attribute learning. For example, wavelet transform and Fourier transform are performed on the original data as the generator label, and the corresponding fault benchmark result can be generated in the first stage. Therefore, it has high optimization capability.
[0097] (3) Compared with the fault sample enhancement method in the related art, the generation in different stages can be guided through two stages. Therefore, it has better generation effect.
[0098] (4) Compared with other deep learning generation methods, the training process gradually realizes the generation of complex fault samples through the staged manner, the whole process is easier to train, and can effectively alleviate the problem of mode collapse.
[0099] (5) To some extent, the modeling problem under small sample in fault diagnosis is solved, the problem of limited fault data and difficulty in obtaining is improved, and the robustness and accuracy of the fault diagnosis model can be improved due to the generation and injection of random noise in the second stage.
[0100] (6) If the generator and the discriminator use deep neural networks, although it is a two-stage sample enhancement method, end-to-end generation can be realized after the model is trained, and the application efficiency is high.
[0101] The technical solutions provided by the present application will be further described below with specific embodiments.
[0102] Figure 2 is a flowchart of the two-stage fault sample enhancement method provided by the embodiment of the present application, as shown in Figure 2 , the method comprises at least the following steps:
[0103] Step 1: Collect the fault sample data set that needs to be enhanced, containing working condition, fault mode and other label information, as training data.
[0104] Step 2: Preprocess the training data, such as removing outliers, normalizing, etc., and then construct the training data set by windowing method.
[0105] Step 3: Extract the trend component and periodic component in the data by time series decomposition as the fault benchmark sample label of the first stage.
[0106] Step 4: Randomly sample noise vectors from Gaussian noise, then add working condition and fault mode coding vectors, and the whole is used as the training vector input of the first stage model. Construct CGAN, including generator, discriminator and classifier three parts. Among them, the generator takes the training vector as input, and outputs the simulated fault benchmark sample; the discriminator takes the real fault benchmark sample and the simulated fault benchmark sample as input, and outputs the true or false discrimination of the input; the classifier takes the real fault benchmark sample and the simulated fault benchmark sample as input, and outputs the multi-label result of the working condition and fault mode in the input information. Calculate the loss of the generator, the loss of the discriminator and the loss of the classifier. Then, through multiple iterations of the data set, and according to the back propagation of the loss, the model is trained, and the generator parameters, discriminator parameters and classifier parameters are updated respectively.
[0107] Step 5: Add noise to the generated sample in the first stage. The noise is randomly sampled from Gaussian noise, and then the working condition and fault mode encoding vector are added, which is the input of the second stage model as a whole. A CGAN is constructed, including a generator, a discriminator and a classifier. The generator accepts the training vector as input and outputs the simulated fault sample; the discriminator accepts the real fault sample and the simulated fault sample as input and outputs the true or false discrimination of the input; the classifier accepts the real fault sample and the simulated fault sample as input and outputs the multi-label result of the working condition and fault mode in the input information. The loss of the generator, the loss of the discriminator and the loss of the classifier are calculated respectively. Then, through multiple iterations of the data set, the model training is realized according to the back propagation of the loss, and the generator parameters, the discriminator parameters and the classifier parameters are updated respectively.
[0108] Step 6, respectively through the trained first stage generation model and the second stage generation model to generate fault benchmark sample and fault sample in turn. The fault sample and its working condition and fault mode label are added to the historical fault data to realize fault sample enhancement. Then, according to the enhanced fault sample, fault diagnosis modeling is realized, and the result is evaluated.
[0109] Figure 3 is a flowchart of the two-stage fault sample enhancement method provided by the embodiment of the application, as shown in Figure 3 The method comprises the following steps:
[0110] Step 1: Random noise sampling obtains a noise vector, which is then expanded in the original vector dimension and added with working condition and fault mode encoding information. For example, the noise vector is (B, N), B represents batch size, and N represents noise representation dimension. After adding the encoding information, it is expanded to (B, N+2).
[0111] Step 2: input the result of step 1 into the generator of the first stage to obtain the fault benchmark sample, and then send it to the discriminator and the classifier of the first stage together with the real fault benchmark sample for training, so as to update the discriminator and the classifier of the first stage.
[0112] Step 3: randomly sample a noise vector, then expand it in the original vector dimension and add working condition and fault mode encoding information. For example, the noise vector is (B, N), B represents batch size, and N represents noise representation dimension. After adding the encoding information, it is expanded to (B, N+2), which is sent to the discriminator and the classifier of the first stage to obtain the loss and update the first stage generator.
[0113] Step 4: Randomly sample noise, add working condition and fault mode encoding information, input the trained first-stage generator to complete the generation of fault benchmark samples. Then randomly sample noise again and add it to the corresponding elements of the fault benchmark samples. For example, the noise vector is (B, N), the fault benchmark sample vector is (B, N), and the result after addition is (B, N). Then add the working condition and fault mode encoding information, which is the same as the first stage.
[0114] Step 5: Input the result of step 4 into the second-stage generator to obtain fault samples, and then send them to the second-stage discriminator and classifier together with the real fault samples for training, to update the second-stage discriminator and classifier.
[0115] Step 6, randomly obtain the second-stage input, i.e. noise, working condition, fault mode encoding information, and fault benchmark samples generated by the first stage. Send the result to the second-stage discriminator and classifier to obtain the loss and update the second-stage generator.
[0116] Figure 4 is a structural schematic diagram of a two-stage fault sample enhancement device provided by an embodiment of the present application, as Figure 4 indicated, the device at least includes:
[0117] A first generation module 401 is configured to, in the first stage, expand a first noise vector based on annotation information, input the expanded first noise vector and real fault benchmark samples to a first conditional generative adversarial network model, and generate fault benchmark samples containing general attributes.
[0118] A second generation module 402 is configured to, in the second stage, add a second noise vector and an annotation information encoding vector to the fault benchmark samples containing general attributes, combine real fault samples as inputs of a second conditional generative adversarial network model, and generate fault samples containing random attributes.
[0119] An acquisition module 403 is configured to add the fault samples containing random attributes and corresponding annotation information to historical fault samples, and acquire enhanced fault samples.
[0120] The first noise vector and the second noise vector are both obtained by random noise sampling, the annotation information includes working conditions and fault modes, the first conditional generative adversarial network model is obtained by training based on historical fault samples and pre-determined general attribute labels, and the second conditional generative adversarial network model is obtained by training based on fault benchmark samples output by the first conditional generative adversarial network model and random attribute labels.
[0121] In some embodiments, the first conditional generative adversarial network model is trained based on the following steps:
[0122] constructing the first conditional generative adversarial network model, the first conditional generative adversarial network model comprising a first generator, a first discriminator and a first classifier;
[0123] extracting general attributes of the preprocessed historical fault samples through time series decomposition as fault benchmark sample labels of the first stage;
[0124] extending the first noise vector based on the annotation information, inputting the extended first noise vector into the first generator, and obtaining simulated fault benchmark samples;
[0125] inputting the real fault benchmark samples and the simulated fault benchmark samples into the first discriminator to obtain first true-false discrimination results;
[0126] inputting the real fault benchmark samples and the simulated fault benchmark samples into the first classifier to obtain first classification results containing the annotation information;
[0127] determining a first loss of the first conditional generative adversarial network model, completing model training based on back propagation of the first loss, and updating parameters of the first generative adversarial network model.
[0128] In some embodiments, the second conditional generative adversarial network model is trained based on the following steps:
[0129] constructing the second conditional generative adversarial network model, the second conditional generative adversarial network model comprising a second generator, a second discriminator and a second classifier;
[0130] extending a second noise vector based on the annotation information, inputting the extended second noise vector and the fault benchmark samples generated in the first stage into the second generator, and obtaining simulated fault samples;
[0131] inputting the real fault samples and the simulated fault samples into the second discriminator to obtain second true-false discrimination results;
[0132] inputting the real fault samples and the simulated fault samples into the second classifier to obtain second classification results containing the annotation information;
[0133] determining a second loss of the second conditional generative adversarial network model, completing model training based on back propagation of the second loss, and updating parameters of the second generative adversarial network model.
[0134] In some embodiments, the general attributes include trends and cycles.
[0135] Figure 5This is a schematic diagram of the physical structure of the electronic device provided in the embodiments of the present invention, such as... Figure 5 As shown, the electronic device may include: a processor 510, a communications interface 520, a memory 530, and a communication bus 540, wherein the processor 510, the communications interface 520, and the memory 530 communicate with each other via the communication bus 540. The processor 510 can call logical instructions in the memory 530 to execute a two-stage fault sample enhancement method, which includes:
[0136] In the first stage, the first noise vector is expanded based on the annotation information. The expanded first noise vector and the real fault benchmark sample are input into the first conditional generative adversarial network model to generate fault benchmark samples with general attributes.
[0137] In the second stage, a second noise vector and a labeled information encoding vector are added to the fault benchmark sample containing general attributes. Combined with real fault samples as input to the second conditional generative adversarial network model, fault samples containing random attributes are generated.
[0138] The fault samples containing random attributes and their corresponding annotation information are added to the historical fault samples to obtain enhanced fault samples.
[0139] The first noise vector and the second noise vector are both obtained through random noise sampling. The annotation information includes operating conditions and fault modes. The first conditional generative adversarial network model is obtained after training based on historical fault samples and pre-determined general attribute labels. The second conditional generative adversarial network model is obtained after training based on fault benchmark samples output by the first conditional generative adversarial network model and random attribute labels.
[0140] In some embodiments, the first conditional generative adversarial network model is trained based on the following steps:
[0141] Construct the first conditional generative adversarial network model, which includes a first generator, a first discriminator, and a first classifier;
[0142] The common attributes of preprocessed historical fault samples are extracted by time-series decomposition and used as the fault baseline sample labels for the first stage.
[0143] The first noise vector is expanded based on the annotation information, and the expanded first noise vector is input into the first generator to obtain a simulated fault benchmark sample.
[0144] inputting the real fault benchmark sample and the simulated fault benchmark sample into the first discriminator to obtain a first true-false discrimination result;
[0145] inputting the real fault benchmark sample and the simulated fault benchmark sample into the first classifier to obtain a first classification result containing the labeled information;
[0146] determining a first loss of the first conditional generative adversarial network model, completing model training based on back propagation of the first loss, and updating parameters of the first generative adversarial network model.
[0147] In some embodiments, the second conditional generative adversarial network model is trained based on the following steps:
[0148] constructing the second conditional generative adversarial network model, the second conditional generative adversarial network model comprising a second generator, a second discriminator and a second classifier;
[0149] extending the second noise vector based on the labeled information, inputting the extended second noise vector and the fault benchmark sample generated in the first stage into the second generator to obtain a simulated fault sample;
[0150] inputting the real fault sample and the simulated fault sample into the second discriminator to obtain a second true-false discrimination result;
[0151] inputting the real fault sample and the simulated fault sample into the second classifier to obtain a second classification result containing the labeled information;
[0152] determining a second loss of the second conditional generative adversarial network model, completing model training based on back propagation of the second loss, and updating parameters of the second generative adversarial network model.
[0153] In some embodiments, the general attributes include trends and cycles.
[0154] Further, the logic instructions in the memory 530 described above can be implemented in the form of software functional units and sold or used as independent products, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the parts that make contributions to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, etc.
[0155] In another aspect, the present application also provides a computer program product, which comprises a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program can be executed by a processor to enable a computer to execute the two-stage fault sample enhancement method provided by the above-mentioned methods, which comprises:
[0156] In the first stage, the first noise vector is expanded based on the annotation information, and the expanded first noise vector and the real fault benchmark sample are input into a first conditional generative adversarial network model to generate a fault benchmark sample containing general attributes;
[0157] In the second stage, the fault benchmark sample containing general attributes is added with a second noise vector and an annotation information encoding vector, and combined with a real fault sample as an input of a second conditional generative adversarial network model to generate a fault sample containing random attributes;
[0158] The fault sample containing random attributes and the corresponding annotation information are added to the historical fault sample to obtain an enhanced fault sample;
[0159] Wherein, the first noise vector and the second noise vector are both obtained by random noise sampling, the annotation information includes working conditions and fault modes, the first conditional generative adversarial network model is obtained after being trained based on historical fault samples and predetermined general attribute labels, and the second conditional generative adversarial network model is obtained after being trained based on the fault benchmark sample output by the first conditional generative adversarial network model and random attribute labels.
[0160] In yet another aspect, the present application also provides a non-transitory computer-readable storage medium having stored thereon a computer program, which, when executed by a processor, implements a two-stage failure sample enhancement method provided by each of the above methods, the method comprising:
[0161] In the first stage, the first noise vector is expanded based on the annotation information, and the expanded first noise vector and the real failure benchmark sample are input into a first conditional generative adversarial network model to generate a failure benchmark sample containing general attributes;
[0162] In the second stage, the failure benchmark sample containing general attributes is added with a second noise vector and an annotation information encoding vector, and combined with a real failure sample as input of a second conditional generative adversarial network model to generate a failure sample containing random attributes;
[0163] The failure sample containing random attributes and the corresponding annotation information are added to historical failure samples to obtain an enhanced failure sample;
[0164] The first noise vector and the second noise vector are both obtained by random noise sampling, the annotation information includes working conditions and failure modes, the first conditional generative adversarial network model is obtained after being trained based on historical failure samples and predetermined general attribute labels, and the second conditional generative adversarial network model is obtained after being trained based on the failure benchmark sample output by the first conditional generative adversarial network model and random attribute labels.
[0165] The device embodiments described above are only schematic, wherein the units shown as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment. Those skilled in the art can understand and implement without creative labor.
[0166] From the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software plus a necessary general hardware platform, and of course can also be realized by hardware. Based on such understanding, the above technical solutions can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as a ROM / RAM, a magnetic disk, an optical disk, etc., and includes a plurality of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.
[0167] It should be pointed out finally that the above embodiments are only used to illustrate the technical solutions of the present application, but not to limit the same; and although the present application has been described in detail with reference to the foregoing embodiments, it should be appreciated by those skilled in the art that the technical solutions recorded in the foregoing embodiments can be modified, or some technical features thereof can be replaced equivalently; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A two-stage failure sample augmentation method, characterized in that, The method comprises the following steps: In the first stage, the first noise vector is expanded based on the annotation information, the expanded first noise vector and the real fault benchmark sample are input into a first conditional generative adversarial network model, and a fault benchmark sample containing general attributes is generated; In the second stage, the fault benchmark sample containing general attributes is added with a second noise vector and an annotation information encoding vector, and a real fault sample is combined as input of a second conditional generative adversarial network model, and a fault sample containing random attributes is generated; The fault sample containing random attributes and the corresponding annotation information are added to historical fault samples, and an enhanced fault sample is obtained; The first noise vector and the second noise vector are both obtained by random noise sampling, the annotation information includes working conditions and fault modes of industrial equipment, the general attributes include trends and cycles of industrial equipment, the first conditional generative adversarial network model is obtained after training based on historical fault samples and predetermined general attribute labels, and the second conditional generative adversarial network model is obtained after training based on fault benchmark samples output by the first conditional generative adversarial network model and random attribute labels; The first conditional generative adversarial network model is trained based on the following steps: The first conditional generative adversarial network model is constructed, and the first conditional generative adversarial network model comprises a first generator, a first discriminator and a first classifier; General attributes of the preprocessed historical fault sample are extracted by time series decomposition as fault benchmark sample labels in the first stage; The first noise vector is expanded based on the annotation information, and the expanded first noise vector is input into the first generator to obtain a simulated fault benchmark sample; The real fault benchmark sample and the simulated fault benchmark sample are input into the first discriminator to obtain a first true-false discrimination result; The real fault benchmark sample and the simulated fault benchmark sample are input into the first classifier to obtain a first classification result containing the annotation information; A first loss of the first conditional generative adversarial network model is determined, model training is completed based on back propagation of the first loss, and parameters of the first generative adversarial network model are updated.
2. The two-stage failure sample enhancement method of claim 1, wherein, The second conditional generative adversarial network model is trained based on the following steps: The second conditional generative adversarial network model is constructed, and the second conditional generative adversarial network model comprises a second generator, a second discriminator and a second classifier; The second noise vector is expanded based on the annotation information, and the expanded second noise vector and the fault benchmark sample generated in the first stage are input into the second generator to obtain a simulated fault sample; The real fault sample and the simulated fault sample are input into the second discriminator to obtain a second true-false discrimination result; The real fault sample and the simulated fault sample are input into the second classifier to obtain a second classification result containing the annotation information; A second loss of the second conditional generative adversarial network model is determined, model training is completed based on back propagation of the second loss, and parameters of the second generative adversarial network model are updated.
3. The two-stage adversarial sample augmentation method of any one of claims 1-2, wherein, The general attributes include trends and cycles.
4. A two-stage failure sample augmentation device, characterized by, Comprise: The first generation module is used for expanding the first noise vector based on the annotation information in the first stage, inputting the expanded first noise vector and the real fault benchmark sample into the first conditional generative adversarial network model, and generating a fault benchmark sample containing general attributes; The second generation module is used for adding a second noise vector and an annotation information encoding vector to the fault benchmark sample containing general attributes in the second stage, combining a real fault sample as input of a second conditional generative adversarial network model, and generating a fault sample containing random attributes; The acquisition module is used for adding the fault sample containing random attributes and corresponding annotation information to historical fault samples, and acquiring an enhanced fault sample; Wherein, the first noise vector and the second noise vector are obtained by random noise sampling, the annotation information includes working conditions and fault modes of industrial equipment, the general attributes include trends and cycles of industrial equipment, the first conditional generative adversarial network model is obtained after training based on historical fault samples and predetermined general attribute labels, and the second conditional generative adversarial network model is obtained after training based on fault benchmark samples output by the first conditional generative adversarial network model and random attribute labels; Wherein, the first conditional generative adversarial network model is trained based on the following steps: The first conditional generative adversarial network model is constructed, and the first conditional generative adversarial network model includes a first generator, a first discriminator and a first classifier; The general attributes of the preprocessed historical fault samples are extracted through time series decomposition as fault benchmark sample labels in the first stage; The first noise vector is expanded based on the annotation information, and the expanded first noise vector is input into the first generator to obtain a simulated fault benchmark sample; The real fault benchmark sample and the simulated fault benchmark sample are input into the first discriminator to obtain a first true-false discrimination result; The real fault benchmark sample and the simulated fault benchmark sample are input into the first classifier to obtain a first classification result containing the annotation information; The first loss of the first conditional generative adversarial network model is determined, the model training is completed based on the back propagation of the first loss, and the parameters of the first generative adversarial network model are updated.
5. The two-stage failure sample enhancement device of claim 4, wherein, The second conditional generative adversarial network model is trained based on the following steps: The second conditional generative adversarial network model is constructed, and the second conditional generative adversarial network model includes a second generator, a second discriminator and a second classifier; The second noise vector is expanded based on the annotation information, and the expanded second noise vector and the fault benchmark sample generated in the first stage are input into the second generator to obtain a simulated fault sample; The real fault sample and the simulated fault sample are input into the second discriminator to obtain a second true-false discrimination result; The real fault sample and the simulated fault sample are input into the second classifier to obtain a second classification result containing the annotation information; The second conditional generative adversarial network model is trained based on the following steps: Determine a second loss of the second generative adversarial network model, complete model training based on back propagation of the second loss, and update parameters of the second generative adversarial network model.
6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the two-stage failure sample enhancement method of any one of claims 1-3 when executing the program.
7. A non-transitory computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the two-stage failure sample enhancement method of any one of claims 1-3.
8. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the two-stage failure sample enhancement method of any one of claims 1-3. The computer program, when executed by the processor, implements the two-stage failure sample enhancement method of any one of claims 1-3.
Citation Information
Patent Citations
Photovoltaic module fault diagnosis method, system and device based on deep convolutional adversarial network
CN110414601A
Small sample rolling bearing fault diagnosis method based on convolutional transformer generative adversarial network
CN115859142A