Training method of generative adversarial network, vibration signal generation method and equipment
The high-quality time domain signal samples are generated by the training method of generating adversarial networks, which solves the problems of small data volume and poor quality in vibration signal expansion, and improves the prediction accuracy of the fault diagnosis model.
Patent Information
- Application Number
- CN202411490845.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-10-24
AI Technical Summary
The prior art has problems of small data quantity and poor quality in the expansion of vibration signals, resulting in low prediction accuracy of the fault diagnosis model.
Using the training method of generating adversarial networks, time domain signal samples are generated through two parallel deconvolution networks, and feature extraction and prediction are performed through discriminators, and the model parameters of the generated adversarial network are optimized to generate diverse and high-quality time Domain signal sample.
It quickly generates diverse time-domain signal samples with high data quality, and improves the prediction accuracy of the fault diagnosis model.
Smart Images

Figure CN119416833A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a training method for generating an adversarial network, a method for generating a vibration signal, and a device. Background Art
[0002] Deep learning has achieved certain beneficial effects in the fields of computer vision, natural language processing, and fault diagnosis, but model training still relies on a large amount of sample data. Fault diagnosis technology is usually used in key equipment, such as engines and generators, to ensure the stable operation of the equipment and avoid major economic losses caused by equipment damage. The training of fault diagnosis models usually uses a large amount of sample data to improve the accuracy of model prediction, but in actual use, the fault data is relatively small. In order to obtain more sample data, the existing technology uses data enhancement methods to enhance the quality or expand the quantity of the data set according to the distribution characteristics of the existing fault data. Among them, the fault data is generally the vibration signal of the equipment.
[0003] However, the vibration signal of the equipment is a kind of time series data, which has time dependence. The existing technology uses a difference-based data generation method to expand the vibration signal, but this method is limited by the number of original samples, and the generated new data tends to spread noise, has no learning ability, and does not essentially enrich the diversity of data samples, resulting in low accuracy of the final model for fault diagnosis prediction. Summary of the invention
[0004] In response to the above-mentioned problems and technical needs, the applicant has proposed a training method for a generative adversarial network, a method and device for generating vibration signals, so as to solve the problems of small amount of expanded data and poor quality of expanded data when expanding vibration signals in the prior art, and to achieve rapid generation of diversified time domain signal samples with high data quality, thereby improving the preset accuracy of the fault diagnosis model.
[0005] The embodiment of the present application provides a training method for a generative adversarial network for generating a vibration signal, the method comprising:
[0006] Acquire a vibration signal sample, wherein the vibration signal sample includes: a vibration signal data segment, and a category label sample corresponding to the vibration signal data segment, and the vibration signal sample is obtained based on fault data when a device fails;
[0007] Generate a time domain signal sample by two parallel deconvolution networks in a generator of a generative adversarial network, wherein the time domain signal sample includes: a time domain signal data segment having a data length consistent with the vibration signal data segment, and a generated category label corresponding to the time domain signal data segment;
[0008] Input the vibration signal sample and the time domain signal sample into the discriminator of the generative adversarial network, obtain signal sample features through two parallel feature extraction networks in the discriminator, and output the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features, wherein the predicted truth of the signal sample is used to indicate whether the signal sample is generated by the generator;
[0009] Based on the first consistency between the predicted truth and the actual truth corresponding to the signal sample, the first size relationship between the first consistency and a first preset value, the second consistency between the predicted category and the category label sample or the generated category label, and the second size relationship between the second consistency and a second preset value, the model parameters of the generative adversarial network are optimized, and the step of generating time domain signal samples through the generator of the generative adversarial network is performed until the first consistency is less than the first preset value and the second consistency is greater than the second preset value, wherein the first preset value is less than the second preset value.
[0010] According to a training method for generating a generative adversarial network for generating vibration signals in one embodiment of the present application, signal sample features are obtained by two parallel feature extraction networks in the discriminator, and the predicted truth of each signal sample and the predicted category of each signal sample are output based on the signal sample features, including:
[0011] The discriminator performs the following prediction process on each signal sample:
[0012] Performing Fourier transform processing on the signal samples to obtain real and imaginary components of the signal samples in the frequency domain;
[0013] Inputting the real component into a first feature extraction network to obtain a real component feature output by the first feature extraction network; and inputting the imaginary component into a second feature extraction network to obtain an imaginary component feature output by the second feature extraction network, wherein the first feature extraction network and the second feature extraction network are two parallel feature extraction networks;
[0014] The real component feature and the imaginary component feature are fused to obtain a fused feature, and the predicted truth and the predicted category are output based on the fused feature.
[0015] According to a training method for a generative adversarial network for generating a vibration signal according to an embodiment of the present application, the discriminator includes: a true-false discriminator and a category classifier;
[0016] The discriminator outputs the predicted truth of each signal sample and the predicted category of each signal sample, including:
[0017] The fused features are input into the authenticity discriminator to obtain the predicted authenticity output by the authenticity discriminator; and the fused features are input into the category classifier to obtain the predicted classification output by the category classifier.
[0018] According to a training method for a generative adversarial network for generating vibration signals according to an embodiment of the present application, a time domain signal sample is generated by two parallel deconvolution networks in a generator of the generative adversarial network, including:
[0019] Inputting a random signal sample into the generator, and dimensionally integrating the random signal sample and the sample label of the random signal sample through the fully connected layer of the generator to obtain a target vector;
[0020] Inputting the target vector into the first deconvolution network and the second deconvolution network respectively, to obtain a real feature vector output by the first deconvolution network and an imaginary feature vector output by the second deconvolution network, wherein the first deconvolution network and the second deconvolution network are two parallel deconvolution networks;
[0021] The real eigenvector and the imaginary eigenvector are combined into a complex domain spectrum, and Fourier transform processing is performed to obtain the time domain signal sample.
[0022] According to a training method for a generative adversarial network for generating a vibration signal according to an embodiment of the present application, in the process of training the generative adversarial network, a preset loss function is used to perform model training;
[0023] The preset loss function includes: a first loss function corresponding to the generator and a second loss function corresponding to the discriminator;
[0024] Wherein, the first loss function includes:
[0025]
[0026] Among them, L G represents the loss value obtained based on the first loss function, X real represents the vibration signal sample, X fake represents the time domain signal sample, C represents the classification, c represents the classification result, P(C=c|X real ) represents the probability of correct classification of vibration signal samples, P(C=c|X fake ) represents the probability of correct classification of time domain signal samples, D(x) represents the discriminator, where x represents the current training input data, P g Represents the data distribution of time domain signal samples;
[0027] Wherein, the second loss function includes:
[0028]
[0029] Among them, L D represents the loss value obtained based on the second loss function, λ represents the regularization term coefficient, represents the difference sample between the vibration signal sample and the artificial data interpolation, ε represents the coefficient, || || p represents the p-norm, represents the gradient operator, P data represents the data distribution of vibration signal samples, Represents the data distribution of the difference samples.
[0030] According to a training method for a generative adversarial network for generating a vibration signal according to an embodiment of the present application, optimizing a model parameter of the generative adversarial network until the first consistency is less than a first preset value includes:
[0031] Training the generative adversarial network based on a preset learning rate variation formula to optimize the model parameters;
[0032] Wherein, the learning rate change formula includes:
[0033] lr=lr0 / (1+exp(-k*((e max -e+1) / W-x0)));
[0034] Among them, lr represents the learning rate, e represents the number of iterations in the model training process, and e max represents the maximum number of iterations, e∈(1,e max ), W=(e max -1) / C i represents the rate of change of the model function of the generated adversarial network; C i Indicates the number of propagations required for the learning rate to reach the flat stage; x0 = L*(e max +1)(e max -1) / 2, lr0 represents the initial learning rate, k is the coefficient, which is a constant.
[0035] The embodiment of the present application also provides a method for generating a vibration signal based on any one of the above-mentioned generative adversarial networks, the method comprising:
[0036] generating a control instruction for instructing the generative adversarial network to generate a vibration signal;
[0037] Based on the control instruction, vibration information is generated by a generator of the generative adversarial network, so that the vibration signal is used as a training sample of a fault recognition model to train the fault recognition model.
[0038] The embodiment of the present application also provides a training device for a generative adversarial network for generating a vibration signal, comprising:
[0039] An acquisition module, used to acquire a vibration signal sample, wherein the vibration signal sample includes: a vibration signal data segment, and a category label sample corresponding to the vibration signal data segment, and the vibration signal sample is obtained based on fault data when a device fails;
[0040] A first generating module, configured to generate a time domain signal sample by two parallel deconvolution networks in a generator of a generative adversarial network, wherein the time domain signal sample comprises: a time domain signal data segment having a data length consistent with that of the vibration signal data segment, and a generated category label corresponding to the time domain signal data segment;
[0041] A prediction module, used for inputting the vibration signal sample and the time domain signal sample into the discriminator of the generative adversarial network, obtaining signal sample features through two parallel feature extraction networks in the discriminator, and outputting the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features, wherein the predicted truth of the signal sample is used to indicate whether the signal sample is generated by the generator;
[0042] A training module is used to optimize the model parameters of the generative adversarial network based on a first consistency between the predicted authenticity and the actual authenticity corresponding to the signal sample, a first size relationship between the first consistency and a first preset value, a second consistency between the predicted category and the category label sample or the generated category label, and a second size relationship between the second consistency and a second preset value, and execute the step of generating a time domain signal sample through the generator of the generative adversarial network until the first consistency is less than the first preset value and the second consistency is greater than the second preset value, wherein the first preset value is less than the second preset value.
[0043] The embodiment of the present application also provides a device for generating a vibration signal based on a generative adversarial network, including:
[0044] A second generating module is used to generate a control instruction for instructing the generative adversarial network to generate a vibration signal;
[0045] The third generating module is used to generate vibration information based on the control instruction through the generator of the generative adversarial network, so as to use the vibration signal as a training sample of the fault recognition model to train the fault recognition model.
[0046] An embodiment of the present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the training method of a generative adversarial network for generating a vibration signal as described in any one of the above items are implemented, or the steps of a method for generating a vibration signal based on a generative adversarial network are implemented.
[0047] The training method of a generative adversarial network, the method and device for generating a vibration signal provided in the embodiments of the present application obtain vibration signal samples; generate time domain signal samples through two parallel deconvolution networks in the generator of the generative adversarial network; input the vibration signal samples and the time domain signal samples into the discriminator of the generative adversarial network, obtain the signal sample features through two parallel feature extraction networks in the discriminator, and output the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features; optimize the model parameters of the generative adversarial network based on the first consistency between the predicted truth and the actual truth corresponding to the signal sample, and the second consistency between the predicted category and the category label sample or the generated category label, and execute the pass The step of generating time domain signal samples through the generator of the generative adversarial network, until the first consistency is less than the first preset value, and the second consistency is greater than the second preset value. It can be seen that the present application determines that the generative adversarial network training is completed when it is determined that the discriminator cannot effectively distinguish whether the signal sample is the original sample or the sample generated by the generator, and the discriminator can effectively predict the category of the signal sample. The generator of the trained generative adversarial network can be used to generate a vibration signal that meets the timing requirements. The present application can generate a large number of time domain signal samples based on a small number of original samples, thereby realizing the diversity of time domain signal samples and providing an effective data basis for the training of the fault diagnosis model, thereby improving the accuracy of the fault diagnosis model prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 It is one of the flow charts of the training method of the generative adversarial network for generating vibration signals provided in the embodiment of the present application;
[0050] Figure 2 It is a schematic diagram of the structure of the generator provided in the embodiment of the present application;
[0051] Figure 3 is a schematic diagram of the structure of the discriminator provided in an embodiment of the present application;
[0052] Figure 4 This is a second flow chart of a method for generating a vibration signal based on a generative adversarial network provided in an embodiment of the present application;
[0053] Figure 5 It is a structural schematic diagram of a training device for a generative adversarial network for generating vibration signals provided in an embodiment of the present application;
[0054] Figure 6 is a structural schematic diagram of a device for generating a vibration signal based on a generative adversarial network provided in an embodiment of the present application;
[0055] Figure 7 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] In order to clearly explain the present application, the sample generation of the prior art is further explained:
[0058] Since vibration signals have time series characteristics, the existing technology uses time series data enhancement methods to expand data. The time series data enhancement methods include two types. The first type is to directly perform basic enhancement operations on time domain and frequency domain data, including overlapping sampling, cropping, flipping, slicing, and noise injection. The second type is to use machine learning or deep learning methods to learn the distribution characteristics of the original samples and generate new virtual signals based on the distribution characteristics. In the second method, it specifically includes an interpolation-based generation method, which expands the sample set by interpolating between a certain sample point and its neighboring sample points to obtain a new sample. However, the interpolation method is limited by the number of original samples, and the generated new data tends to spread noise, does not have learning ability, and does not essentially enrich the diversity of data samples.
[0059] In order to solve the above problems, the embodiment of the present application provides a training method for a generative adversarial network for generating vibration signals, so that the generative adversarial network obtained through training can quickly and accurately generate a large number of time domain signal samples. This method can be applied to smart terminals and can also be applied to servers. Some other descriptions in the embodiments of the present application are for illustrative purposes and are not used to limit the scope of protection of the present application, and will not be described one by one later. The specific implementation of this method is as follows Figure 1 As shown:
[0060] Step 101, obtaining a vibration signal sample.
[0061] The vibration signal sample includes: a vibration signal data segment, and a category label sample corresponding to the vibration signal data segment, and the vibration signal sample is obtained based on fault data when a device fails.
[0062] The equipment is, for example, an engine, a generator, etc., and the fault data is a vibration signal on the surface of the equipment when the equipment fails.
[0063] Step 102, generating time domain signal samples by two parallel deconvolution networks in the generator of the generative adversarial network.
[0064] The time domain signal sample includes: a time domain signal data segment having the same data length as the vibration signal data segment, and a generated category label corresponding to the time domain signal data segment.
[0065] Among them, the length of the production category label is consistent with the length of the category label sample.
[0066] Step 103, input the vibration signal samples and the time domain signal samples into the discriminator of the generative adversarial network, obtain the signal sample features through the two parallel feature extraction networks in the discriminator, and output the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features.
[0067] The predicted truth of the signal sample is used to indicate whether the signal sample is generated by the generator.
[0068] Step 104, based on the first consistency between the predicted authenticity and the actual authenticity corresponding to the signal sample, the first size relationship between the first consistency and the first preset value, the second consistency between the predicted category and the category label sample or the generated category label, and the second size relationship between the second consistency and the second preset value, optimize the model parameters of the generative adversarial network, and execute the step of generating time domain signal samples through the generator of the generative adversarial network until the first consistency is less than the first preset value, and the second consistency is greater than the second preset value.
[0069] The first preset value is smaller than the second preset value.
[0070] The training method of the generative adversarial network provided in the embodiment of the present application obtains vibration signal samples; generates time domain signal samples through two parallel deconvolution networks in the generator of the generative adversarial network; inputs the vibration signal samples and the time domain signal samples into the discriminator of the generative adversarial network, obtains the signal sample features through two parallel feature extraction networks in the discriminator, and outputs the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features; optimizes the model parameters of the generative adversarial network based on the first consistency between the predicted truth and the actual truth corresponding to the signal sample, and the second consistency between the predicted category and the category label sample or the generated category label, and executes the training through the generative adversarial network. The generator of the network generates a time domain signal sample until the first consistency is less than the first preset value, and the second consistency is greater than the second preset value. It can be seen that when it is determined that the discriminator cannot effectively distinguish whether the signal sample is the original sample or the sample generated by the generator, and the discriminator can effectively predict the category of the signal sample, the application determines that the training of the generative adversarial network is completed, and the generator of the trained generative adversarial network can be used to generate a vibration signal that meets the timing requirements. The application can generate a large number of time domain signal samples based on a small number of original samples, realizes the diversity of time domain signal samples, and provides an effective data basis for the training of the fault diagnosis model, thereby improving the accuracy of the fault diagnosis model prediction.
[0071] In a specific embodiment, the specific implementation of generating a time domain signal sample by a generator of a generative adversarial network includes:
[0072] A random signal sample is input into the generator, and the random signal sample and the sample label of the random signal sample are dimensionally integrated through the fully connected layer of the generator to obtain a target vector; the target vector is input into the first deconvolution network and the second deconvolution network respectively to obtain the real characteristic vector output by the first deconvolution network and the imaginary characteristic vector output by the second deconvolution network; the real characteristic vector and the imaginary characteristic vector are combined into a complex domain spectrum, and Fourier transform processing is performed to obtain a time domain signal sample.
[0073] The first feature extraction network and the second feature extraction network are two parallel feature extraction networks.
[0074] Specifically, a set of Gaussian random signals is pre-generated as random signal samples, the length of the signal data segment in the random signal sample is consistent with the data length of the vibration signal data segment, and the length of the sample label is consistent with the length of the production category label. For example, it is assumed that the length of each signal sample is L, and each signal sample includes label information for supervised learning of the neural network.
[0075] Specifically, the generator includes: a fully connected layer (FC), an activation function (swish function) corresponding to the fully connected layer, a first deconvolution network, and a second deconvolution network. The first deconvolution network and the second deconvolution network have the same structure and are designed in parallel. The first deconvolution network includes: multiple deconvolution layers (ConvT), an activation function (swish function) corresponding to the deconvolution layer, a batch normalization layer (BN), a convolution layer (Conv), and an activation function (Tanh function) corresponding to the convolution layer. For details, please refer to Figure 2 .
[0076] Specifically, random signal samples are input into the generator and transmitted to the fully connected layer and swish function to convert the data dimension to the input size suitable for the deconvolution layer. Next, the data will be transmitted to two parallel deconvolution networks for upsampling. After layers of upsampling, the data will be converted to the required output length M (M is the smallest integer power of 2 greater than L) by a convolution layer and the Tanh function. After obtaining the real and imaginary feature vectors, the real and imaginary feature vectors are combined and converted into the generated time domain signal (length L) using the inverse Fourier transform.
[0077] This application retains both the amplitude-frequency characteristics and the phase-frequency characteristics of the spectrum when generating time domain data. By designing a multi-layer deconvolution network to generate real and imaginary characteristic vectors, then combining them into a complex spectrum, and using inverse Fourier transform to generate time domain signals, it effectively improves the problem of weak ability of convolution and deconvolution networks to express the temporal characteristics of vibration signals, and optimizes the generation effect of time domain signals of the generative adversarial network.
[0078] In a specific embodiment, the specific implementation of outputting the predicted truth of each signal sample and the predicted category of each signal sample by the discriminator includes:
[0079] The discriminator performs the following prediction process for each signal sample:
[0080] The signal samples are processed by Fourier transform to obtain the real and imaginary components of the signal samples in the frequency domain; the real component is input into the first feature extraction network to obtain the real component feature output by the first feature extraction network; and the imaginary component is input into the second feature extraction network to obtain the imaginary component feature output by the second feature extraction network; the real component feature and the imaginary component feature are fused to obtain the fused feature, and the authenticity and prediction category are predicted based on the fused feature output.
[0081] Among them, the first convolutional network and the second convolutional network are two parallel convolutional networks.
[0082] In a specific embodiment, the discriminator includes: a true-false discriminator and a category classifier. The specific implementation of outputting the predicted true-false of each signal sample and the predicted category of each signal sample by the discriminator includes:
[0083] The fused features are input into the authenticity discriminator to obtain the predicted authenticity output by the authenticity discriminator; and the fused features are input into the category classifier to obtain the predicted classification output by the category classifier.
[0084] This application utilizes two parallel feature extraction networks (convolutional networks) corresponding to the generator, and allows the discriminator to perform category prediction while judging the authenticity of the signal sample, which can enable the generative adversarial network to simultaneously generate multiple categories of time domain signals, effectively improving the data generation efficiency and data diversity.
[0085] Specifically, the vibration signal samples and the time domain signal samples are mixed and input into the discriminator, and the input signal samples are Fourier transformed by the discriminator to obtain the real and imaginary components of the signal frequency domain. The real and imaginary components are input into different feature extraction networks, which are composed of a multi-layer convolutional layer-activation function (CELU)-maximum pooling layer (MP) structure. After obtaining the extracted features of the real and imaginary components, the features of the two are combined and input into the authenticity discriminator and category classifier respectively.
[0086] The true-false discriminator consists of a fully connected layer-Dropout layer-activation function-fully connected layer structure. The activation function is the Swish function, and the output result is either true or false. The category classifier consists of a Dropout layer-fully connected layer-activation function layer-fully connected layer structure. The activation function is the Swish function. The data finally passes through the softmax function to become category information. Among them, the aforementioned Dropout layer is used to randomly shield some neurons so that the model does not rely too much on certain neurons, which can effectively reduce the risk of overfitting. The shielded neuron ratio can be 0.5. For details, please refer to Figure 3 .
[0087] In a specific embodiment, in the process of training the generative adversarial network, a preset loss function is used for model training. The preset loss function includes: a first loss function corresponding to the generator and a second loss function corresponding to the discriminator.
[0088] Among them, the first loss function is shown in formula (1):
[0089]
[0090] Among them, L G represents the loss value obtained based on the first loss function, Xreal represents the vibration signal sample, X fake represents the time domain signal sample, C represents the classification, c represents the classification result, P(C=c|X real ) represents the probability of correct classification of vibration signal samples, P(C=c|X fake ) represents the probability of correct classification of time domain signal samples, D(x) represents the discriminator, where x represents the current training input data, P g Represents the data distribution of time-domain signal samples.
[0091] The second loss function is shown in formula (2):
[0092]
[0093] Among them, L D represents the loss value obtained based on the second loss function, λ represents the regularization term coefficient, represents the difference sample between the vibration signal sample and the artificial data interpolation, ε represents the coefficient, || || p represents the p-norm, represents the gradient operator, P data represents the data distribution of vibration signal samples, Represents the data distribution of the difference samples.
[0094] Specifically, the present application obtains a loss function based on the Wasserstein distance to avoid gradient vanishing, and introduces a gradient penalty term for regularization. Since the training of the generator usually lags behind the discriminator, certain measures need to be taken during training to control the training progress of the two. That is, the ratio of the number of training times of the generator and the discriminator is set during each training so that the generator can be more fully trained. After practice, the effect is better when the ratio is 4:1 or above. Users can set the specific ratio according to their actual needs, and this application does not limit it.
[0095] In order to more clearly explain the first loss function and the second loss function, the following is a specific description:
[0096] Generative adversarial networks are an unsupervised deep learning model that continuously generates data close to the real world through the game between the generator G and the discriminator D. During the game, the input signal is transformed through the network to generate data close to the real input. The discriminator is used to distinguish the authenticity of the real data and the generated data. As the iteration proceeds, the data generated by the generator is required to be able to "cheat" the discriminator, and the discriminator is required to continuously improve its identification ability. During the training process, the training objective function is shown in formula (3):
[0097]
[0098] Among them, z represents the input data of the current training G, x represents the input data of the current training D, and P data represents the real data distribution, P z represents Gaussian distribution, G(z) represents the generated data of G, E() represents expectation. When real data is input into D, the expected output tends to 1, and when the generated sample generated by G is input, the expected output tends to 0.
[0099] Among them, the real data corresponds to the vibration signal samples, and the generated data corresponds to the time domain signal samples.
[0100] From formula (3), we can get that the goal of the generative adversarial network is to minimize the real data distribution P data and generate data distribution P g For a given generator G, That means P data and P g Therefore, in order to obtain the smallest difference G, by solving The optimal G* can be obtained. First, G is fixed and the objective function is transformed into formula (4):
[0101]
[0102] To obtain the optimal D*, we need to find f(D) = P data (x)logD(x)+P g The maximum value of (x)log(1-D(x)).
[0103] By solving We can get formula (5)
[0104]
[0105] Therefore, substituting formula (5) into formula (4) yields formula (6):
[0106]
[0107] Among them, KL(P1||P2) represents the KL divergence of the two distributions, JSD represents the JS divergence, P1 and P2 are schematic representations for explaining the physical meaning, and the specific content can be found in the information in the formula. The conversion relationship is shown in formula (7) and formula (8):
[0108]
[0109] Therefore, based on formula (3) to formula (8), the optimal solution G* is obtained, see formula (9):
[0110]
[0111] When JSD(P data (x)||P g When (x)) = 0, it means that the generated data is completely identically distributed to the real data, and the discriminator cannot distinguish them at all.
[0112] However, in GAN, the generator and the discriminator are trained alternately, and it is generally difficult for both to converge at the same time. JSD is symmetric. According to formula (7), when the overlap rate of P1 and P2 distributions is very low, JSD is difficult to distinguish the difference between them, so the divergence between the two is a fixed value. In actual situations, the classification task is usually simpler than the generation task. When the training of the discriminator is ahead of the generator, the training of the generator stagnates due to the vanishing gradient due to the fixed JSD.
[0113] In order to solve the above-mentioned problem of gradient disappearance, a loss function is introduced to solve this problem.
[0114] The optimal transmission distance is also called Wasserstein distance or bulldozer distance, see formula (10):
[0115]
[0116] Among them, Π(P data ,P g ) represents P data With P g The set of all joint distributions, γ represents a possible joint distribution, (x, y) represents a sampling point in the joint distribution, x is the real data, y is the difference data. inf represents the infimum, and E() represents the expectation. Then, based on the difference data y, the difference sample is obtained.
[0117] In all joint distributions, the expected infimum of the distance obtained is the Wasserstein distance. The advantage of the optimal transmission distance over JSD is that even if P data With P g The distributions of G and D do not overlap, and can also reflect the distance between the two distributions, without causing the gradient to disappear due to the different training levels of G and D.
[0118] According to the Kantorovich-Rubinstein duality, formula (10) is transformed into formula (11):
[0119]
[0120] Here, sup represents the supremum, and formula (11) is required to satisfy Lipschitz continuity, that is, there exists a Lipschitz constant K ≥ 0 such that any x in the domain satisfies |f(x1)-f(x2)| ≤ K|x1-x2|.
[0121] At this point, the problem is transformed into finding an f(x) that makes formula (11) obtain the supremum, through a set of functions f defined by the parameter ω ω (x) is used to represent possible solutions, and formula (11) is transformed into formula (12):
[0122]
[0123] Among them, ω:||f ω || L ≤K means that the condition for determining ω is f ω The norm of is less than K, and L represents the preset value.
[0124] Ignore the multiplier of parameter K and transform the function f ω (x) is expressed as the discriminator D(x), then the formula of Wasserstein distance can be obtained, see formula (13):
[0125]
[0126] In order to make the discriminator D strictly satisfy the 1-Lipschitz constraint and avoid the fluctuation of Wasserstein distance caused by gradient explosion during training, the gradient penalty (GP) is introduced to regularize the optimization target of the discriminator and limit the range of its gradient change, resulting in formula (14):
[0127]
[0128] Among them, λ represents the regularization coefficient, represents the difference sample between the vibration signal sample and the artificial data interpolation, ε represents the coefficient, || || p represents the p-norm, Represents the gradient operator.
[0129] After introducing the Wasserstein distance and gradient penalty term, the generator and discriminator losses are shown in formula (1) and formula (2) respectively:
[0130]
[0131] In order to solve the problem of gradient vanishing caused by asynchronous training of the generator and the discriminator, this application introduces Wasserstein distance as the loss formula of the network, which effectively reduces the probability of gradient vanishing during model training. At the same time, the training ratio of the generator and the discriminator is increased, and the training effect of the generator in each round of iterative training is improved.
[0132] In a specific embodiment, the generative adversarial network is trained based on a preset learning rate variation formula to optimize model parameters.
[0133] The learning rate change formula is shown in formula (15):
[0134] lr=lr0 / (1+exp(-k*((e max -e+1) / W-x0)))………………(15)
[0135] Among them, lr represents the learning rate, e represents the number of iterations in the model training process, and e max represents the maximum number of iterations, e∈(1,e max ), W=(e max -1) / C i represents the rate of change of the model function of the generated adversarial network; C i Indicates the number of propagations required for the learning rate to reach the flat stage; x0 = L*(e max +1)(e max -1) / 2, lr0 represents the initial learning rate, k is the coefficient, which is a constant.
[0136] Specifically, in order to improve the convergence performance of the generative adversarial network during training, the present application uses a dynamic learning rate parameter to make the learning rate higher in the early stage of model training so as to learn the distribution characteristics of the data more quickly. Then, as the training progresses, the learning rate gradually decreases until it stops changing.
[0137] This application improves the convergence effect of the model through a dynamic learning rate.
[0138] The embodiment of the present application also provides a method for generating a vibration signal based on a generative adversarial network, wherein the generative adversarial network is obtained based on the training method described in any of the above embodiments, such as Figure 4 As shown, the method includes:
[0139] Step 401, generating a control instruction for instructing a generative adversarial network to generate a vibration signal.
[0140] Step 402 , based on the control instruction, vibration information is generated by a generator of a generative adversarial network, so as to use the vibration signal as a training sample of a fault recognition model to train the fault recognition model.
[0141] Among them, taking the engine as an example, equipment failures include: abnormal fuel injection quantity failure, valve clearance failure, abnormal injection advance angle failure, etc.
[0142] The embodiment of the present application also provides a training device for a generative adversarial network for generating a vibration signal. The specific implementation of the device can refer to the description of the training method for a generative adversarial network for generating a vibration signal, and the repeated parts are not repeated. Figure 5 As shown, the device comprises:
[0143] An acquisition module 501 is used to acquire a vibration signal sample, wherein the vibration signal sample includes: a vibration signal data segment, and a category label sample corresponding to the vibration signal data segment, and the vibration signal sample is obtained based on fault data when a device fails;
[0144] A first generating module 502 is used to generate a time domain signal sample by two parallel deconvolution networks in a generator of a generative adversarial network, wherein the time domain signal sample includes: a time domain signal data segment having a data length consistent with the vibration signal data segment, and a generated category label corresponding to the time domain signal data segment;
[0145] A prediction module 503 is used to input the vibration signal sample and the time domain signal sample into the discriminator of the generative adversarial network, obtain the signal sample features through two parallel feature extraction networks in the discriminator, and output the prediction truth of each signal sample and the prediction category of each signal sample based on the signal sample features, wherein the prediction truth of the signal sample is used to indicate whether the signal sample is generated by the generator;
[0146] The training module 504 is used to optimize the model parameters of the generative adversarial network based on a first consistency between the predicted authenticity and the actual authenticity corresponding to the signal sample, a first size relationship between the first consistency and a first preset value, a second consistency between the predicted category and the category label sample or the generated category label, and a second size relationship between the second consistency and a second preset value, and execute the step of generating a time domain signal sample through a generator of the generative adversarial network until the first consistency is less than the first preset value and the second consistency is greater than the second preset value, wherein the first preset value is less than the second preset value.
[0147] In a specific embodiment, the prediction module 503 is used to perform the following prediction process on each signal sample through the discriminator:
[0148] The signal samples are processed by Fourier transform to obtain the real and imaginary components of the signal samples in the frequency domain; the real component is input into the first feature extraction network to obtain the real component feature output by the first feature extraction network; and the imaginary component is input into the second feature extraction network to obtain the imaginary component feature output by the second feature extraction network, wherein the first feature extraction network and the second feature extraction network are two parallel feature extraction networks; the real component feature and the imaginary component feature are fused to obtain the fused feature, and the authenticity and prediction category are predicted based on the fused feature output.
[0149] In a specific embodiment, the discriminator includes: a true-false discriminator and a category classifier. The prediction module 503 is used to input the fused features into the true-false discriminator to obtain the predicted true-false output of the true-false discriminator; and input the fused features into the category classifier to obtain the predicted category output of the category classifier.
[0150] In a specific embodiment, the first generation module 502 is used to input a random signal sample into a generator, dimensionally integrate the random signal sample and the sample label of the random signal sample through the fully connected layer of the generator to obtain a target vector; input the target vector into the first deconvolution network and the second deconvolution network respectively to obtain the real characteristic vector output by the first deconvolution network and the imaginary characteristic vector output by the second deconvolution network, wherein the first deconvolution network and the second deconvolution network are two parallel deconvolution networks; combine the real characteristic vector and the imaginary characteristic vector into a complex domain spectrum, and perform Fourier transform processing to obtain a time domain signal sample.
[0151] In a specific embodiment, the training module 504 is further used to perform model training using a preset loss function during the training of the generative adversarial network. The preset loss function includes: a first loss function corresponding to the generator and a second loss function corresponding to the discriminator.
[0152] Among them, the first loss function includes:
[0153] L G =-E x~Pg [D(x)]-E[logP(C=c|X real )]-E[logP(C=c|X fake )];
[0154] Among them, L G represents the loss value obtained based on the first loss function, X real represents the vibration signal sample, X fake represents the time domain signal sample, C represents the classification, c represents the classification result, P(C=c|X real ) represents the probability of correct classification of vibration signal samples, P(C=c|X fake ) represents the probability of correct classification of time domain signal samples, D(x) represents the discriminator, where x represents the current training input data, P g Represents the data distribution of time-domain signal samples.
[0155] Among them, the second loss function includes:
[0156]
[0157] Among them, L Drepresents the loss value obtained based on the second loss function, λ represents the regularization term coefficient, represents the difference sample between the vibration signal sample and the artificial data interpolation, ε represents the coefficient, || || p represents the p-norm, represents the gradient operator, P data represents the data distribution of vibration signal samples, Represents the data distribution of the difference samples.
[0158] In a specific embodiment, the training module 504 is used to train the generative adversarial network based on a preset learning rate variation formula to optimize the model parameters.
[0159] Among them, the learning rate change formula includes:
[0160] lr=lr0 / (1+exp(-k*((e max -e+1) / W-x0)));
[0161] Among them, lr represents the learning rate, e represents the number of iterations in the model training process, and e max represents the maximum number of iterations, e∈(1,e max ), W=(e max -1) / C i represents the rate of change of the model function of the generated adversarial network; C i Indicates the number of propagations required for the learning rate to reach the flat stage; x0 = L*(e max +1)(e max -1) / 2, lr0 represents the initial learning rate, k is the coefficient, which is a constant.
[0162] The embodiment of the present application also provides a device for generating a vibration signal based on a generative adversarial network. The specific implementation of the device can refer to the description of the method for generating a vibration signal based on a generative adversarial network, and the repeated parts will not be repeated. Figure 6 As shown, the device comprises:
[0163] The second generating module 601 is used to generate a control instruction for instructing the generative adversarial network to generate a vibration signal;
[0164] The third generating module 602 is used to generate vibration information based on the control instruction through the generator of the generative adversarial network, so as to use the vibration signal as a training sample of the fault recognition model to train the fault recognition model.
[0165] Figure 7 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 7As shown, the electronic device may include: a processor (processor) 701, a communication interface (Communications Interface) 702, a memory (memory) 703 and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704. The processor 701 can call the logic instructions in the memory 703 to execute the training method of the generative adversarial network for generating vibration signals, or the method for generating vibration signals based on the generative adversarial network.
[0166] In addition, the logic instructions in the above-mentioned memory 703 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0167] On the other hand, the present invention also provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, and the computer program includes program instructions. When the program instructions are executed by a computer, the computer can execute the training method of a generative adversarial network for generating vibration signals provided by the above-mentioned methods, or the method for generating vibration signals based on a generative adversarial network.
[0168] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the training method of a generative adversarial network for generating a vibration signal provided in the above-mentioned embodiments, or the method for generating a vibration signal based on a generative adversarial network.
[0169] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0171] Finally, it should be noted that the above is only the preferred implementation of the present application, and the present application is not limited to the above embodiments. It is understood that other improvements and changes directly derived or associated by those skilled in the art without departing from the spirit and concept of the present application should be considered to be included in the scope of protection of the present application.
Claims
1. A training method for a generative adversarial network for generating vibration signals, characterized in that: The method comprises: Acquire a vibration signal sample, wherein the vibration signal sample includes: a vibration signal data segment, and a category label sample corresponding to the vibration signal data segment, and the vibration signal sample is obtained based on fault data when a device fails; Generate a time domain signal sample by two parallel deconvolution networks in a generator of a generative adversarial network, wherein the time domain signal sample includes: a time domain signal data segment having a data length consistent with the vibration signal data segment, and a generated category label corresponding to the time domain signal data segment; Input the vibration signal sample and the time domain signal sample into the discriminator of the generative adversarial network, obtain signal sample features through two parallel feature extraction networks in the discriminator, and output the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features, wherein the predicted truth of the signal sample is used to indicate whether the signal sample is generated by the generator; Based on the first consistency between the predicted truth and the actual truth corresponding to the signal sample, the first size relationship between the first consistency and a first preset value, the second consistency between the predicted category and the category label sample or the generated category label, and the second size relationship between the second consistency and a second preset value, the model parameters of the generative adversarial network are optimized, and the step of generating time domain signal samples through the generator of the generative adversarial network is performed until the first consistency is less than the first preset value and the second consistency is greater than the second preset value, wherein the first preset value is less than the second preset value.
2. The training method of a generative adversarial network for generating a vibration signal according to claim 1, characterized in that: The signal sample features are obtained by two parallel feature extraction networks in the discriminator, and the predicted truth of each signal sample and the predicted category of each signal sample are output based on the signal sample features, including: The discriminator performs the following prediction process on each signal sample: Performing Fourier transform processing on the signal samples to obtain real and imaginary components of the signal samples in the frequency domain; Inputting the real component into a first feature extraction network to obtain a real component feature output by the first feature extraction network; and inputting the imaginary component into a second feature extraction network to obtain an imaginary component feature output by the second feature extraction network, wherein the first feature extraction network and the second feature extraction network are two parallel feature extraction networks; The real component feature and the imaginary component feature are fused to obtain a fused feature, and the predicted truth and the predicted category are output based on the fused feature.
3. The training method of a generative adversarial network for generating a vibration signal according to claim 2, characterized in that: The discriminator includes: a true-false discriminator and a category classifier; The discriminator outputs the predicted truth of each signal sample and the predicted category of each signal sample, including: The fused features are input into the authenticity discriminator to obtain the predicted authenticity output by the authenticity discriminator; and the fused features are input into the category classifier to obtain the predicted classification output by the category classifier.
4. The training method for a generative adversarial network for generating a vibration signal according to any one of claims 1 to 3, characterized in that: The time domain signal samples are generated by two parallel deconvolution networks in the generator of the generative adversarial network, including: Inputting a random signal sample into the generator, and dimensionally integrating the random signal sample and the sample label of the random signal sample through the fully connected layer of the generator to obtain a target vector; Inputting the target vector into the first deconvolution network and the second deconvolution network respectively, to obtain a real feature vector output by the first deconvolution network and an imaginary feature vector output by the second deconvolution network, wherein the first deconvolution network and the second deconvolution network are two parallel deconvolution networks; The real eigenvector and the imaginary eigenvector are combined into a complex domain spectrum, and Fourier transform processing is performed to obtain the time domain signal sample.
5. The training method for a generative adversarial network for generating a vibration signal according to any one of claims 1 to 3, characterized in that: In the process of training the generative adversarial network, a preset loss function is used to perform model training; The preset loss function includes: a first loss function corresponding to the generator and a second loss function corresponding to the discriminator; Wherein, the first loss function includes: L G =-E x~Pg [D(x)]-E[logP(C=c|X real )]-E[logP(C=c|X fake )]; Among them, L G represents the loss value obtained based on the first loss function, X real represents the vibration signal sample, X fake represents the time domain signal sample, C represents the classification, c represents the classification result, P(C=c|X real ) represents the probability of correct classification of vibration signal samples, P(C=c|X fake ) represents the probability of correct classification of time domain signal samples, D(x) represents the discriminator, where x represents the current training input data, P g Represents the data distribution of time domain signal samples; Wherein, the second loss function includes: Among them, L D represents the loss value obtained based on the second loss function, λ represents the regularization term coefficient, represents the difference sample after vibration signal sample and artificial data interpolation, ε represents the coefficient, p represents the p-norm, represents the gradient operator, P data represents the data distribution of vibration signal samples, Represents the data distribution of the difference samples.
6. The training method for a generative adversarial network for generating a vibration signal according to any one of claims 1 to 3, characterized in that: Optimizing the model parameters of the generative adversarial network until the first consistency is less than a first preset value includes: Training the generative adversarial network based on a preset learning rate variation formula to optimize the model parameters; Wherein, the learning rate change formula includes: lr=lr0 / (1+exp(-k*((e max -e+1) / W-x0))); Among them, lr represents the learning rate, e represents the number of iterations in the model training process, and e max represents the maximum number of iterations, e∈(1,e max ), W=(e max -1) / C i represents the rate of change of the model function of the generated adversarial network; C i Indicates the number of propagations required for the learning rate to reach the flat stage; x0 = L*(e max +1)(e max -1) / 2, lr0 represents the initial learning rate, k is the coefficient, which is a constant.
7. A method for generating a vibration signal based on the generative adversarial network according to any one of claims 1 to 6, characterized in that: The method comprises: generating a control instruction for instructing the generative adversarial network to generate a vibration signal; Based on the control instruction, vibration information is generated by a generator of the generative adversarial network, so that the vibration signal is used as a training sample of a fault recognition model to train the fault recognition model.
8. A training device for a generative adversarial network for generating vibration signals, characterized in that: The training device comprises: An acquisition module, used to acquire a vibration signal sample, wherein the vibration signal sample includes: a vibration signal data segment, and a category label sample corresponding to the vibration signal data segment, and the vibration signal sample is obtained based on fault data when a device fails; A first generating module, configured to generate a time domain signal sample by two parallel deconvolution networks in a generator of a generative adversarial network, wherein the time domain signal sample comprises: a time domain signal data segment having a data length consistent with that of the vibration signal data segment, and a generated category label corresponding to the time domain signal data segment; A prediction module, used for inputting the vibration signal sample and the time domain signal sample into the discriminator of the generative adversarial network, obtaining signal sample features through two parallel feature extraction networks in the discriminator, and outputting the predicted truth of each signal sample and the predicted category of each signal sample based on the signal sample features, wherein the predicted truth of the signal sample is used to indicate whether the signal sample is generated by the generator; A training module is used to optimize the model parameters of the generative adversarial network based on a first consistency between the predicted authenticity and the actual authenticity corresponding to the signal sample, a first size relationship between the first consistency and a first preset value, a second consistency between the predicted category and the category label sample or the generated category label, and a second size relationship between the second consistency and a second preset value, and execute the step of generating a time domain signal sample through the generator of the generative adversarial network until the first consistency is less than the first preset value and the second consistency is greater than the second preset value, wherein the first preset value is less than the second preset value.
9. A device for generating a vibration signal based on a generative adversarial network, characterized in that: The generating device comprises: A second generating module is used to generate a control instruction for instructing the generative adversarial network to generate a vibration signal; The third generating module is used to generate vibration information based on the control instruction through the generator of the generative adversarial network, so as to use the vibration signal as a training sample of the fault recognition model to train the fault recognition model.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the steps of the training method of the generative adversarial network for generating vibration signals as described in any one of claims 1 to 6, or implements the steps of the method for generating vibration signals based on the generative adversarial network as described in claim 7.
Citation Information
Patent Citations
Fault diagnosis method based on generative adversarial network and auto-encoder
CN115238747A
Rotary machinery fault diagnosis method based on improved auxiliary classification generative adversarial network
CN117290771A
Method for training a model able to predict a corrected time series signal
EP4418165A1
Device and method for generating training data for a machine learning system
US20230091396A1