Fault prediction method and device based on gan and lstm
By using GANs to generate simulated data to expand the dataset and combining it with LSTM networks for fault prediction, the problems of relying on human experience and lack of data in traditional methods are solved, and more efficient fault prediction accuracy and adaptability are achieved.
Patent Information
- Application Number
- CN202510077767.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-12-19
- Estimated Expiration
- 2045-01-17
AI Technical Summary
Traditional fault prediction methods rely on human experience and cannot adapt to the dynamic changes of equipment under different operating conditions. Furthermore, deep learning methods have insufficient generalization ability when data is scarce, which limits the accuracy of prediction.
We use GANs networks to generate simulated data to expand the dataset, and combine it with LSTM networks for fault prediction. We generate simulated data and expand the dataset through a data generation model, and train the LSTM network to improve the generalization ability of the prediction model.
It overcomes the problem of data scarcity, improves the accuracy and generalization ability of fault prediction, and can better adapt to the changing operating characteristics of equipment under different working conditions.
Smart Images

Figure CN119882650B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of failure prediction. More particularly, the present application relates to a failure prediction method and device based on GANs and LSTM. BACKGROUND
[0002] In modern industry and daily life, the wide application of various complex devices greatly improves production efficiency and improves people's quality of life. However, these devices will inevitably fail during long-term operation, and if the failure cannot be found and handled in time, it may not only cause damage to the device itself, but also cause production interruption, service stagnation and economic loss and other serious consequences. Therefore, accurate and efficient failure prediction has become a key link to ensure reliable operation of the device.
[0003] Traditional failure prediction methods are mainly based on empirical rules and simple statistical analysis; for example, maintenance personnel summarize some typical characteristics exhibited by the device before some failures occur based on past accumulated maintenance cases and experience knowledge, and then determine whether the failure is about to occur by manually checking whether the device related parameters are abnormal through regular inspection. In addition, some statistical methods will perform simple mean, variance and other statistical analysis on the device operation data, and set a fixed threshold. When the data exceeds the threshold range, it is determined that a failure may occur. Obviously, these traditional methods have many limitations, such as high dependence on professional knowledge and experience accumulation of maintenance personnel, inability to adapt to dynamic changes of device operation data under different working conditions and different environments, and prone to false positives or false negatives.
[0004] With the rapid development of big data technology and artificial intelligence, using deep learning methods to analyze device operation data and then realizing failure prediction has become a research hotspot. However, in practical applications, deep learning methods for failure prediction face a key problem - data scarcity. Although normal operation data is relatively easy to obtain, the general type is relatively single, and failure data is very rare, which makes it difficult for the model to fully learn the characteristics corresponding to the failure, resulting in insufficient generalization ability when facing actual complex working conditions, and limited prediction accuracy.
[0005] Therefore, it is necessary to design a technical solution that can overcome the above-mentioned defects. SUMMARY
[0006] An object of the present application is to provide a failure prediction method and device based on GANs and LSTM, which can overcome the problem of data scarcity in the failure prediction process to some extent.
[0007] In order to achieve the objects and other advantages of the present application, according to one aspect of the present application, a GANs and LSTM based fault prediction method is provided, comprising: S1: obtaining historical operation data of a target device; S2: constructing a data set by using the historical operation data, training a GANs network, and obtaining a data generation model; S3: generating simulation data by using the data generation model, combining the simulation data with the data set, and obtaining an expanded data set; S4: training an LSTM network by using the expanded data set, and obtaining a fault prediction model; and S5: performing fault prediction on the target device by using the fault prediction model.
[0008] Further, in the S2, normal data and abnormal data in the historical operation data are extracted; the normal data and the abnormal data are respectively clustered to obtain classification clusters; and when the GANs network is trained, different feature parameters are respectively assigned to the normal data or the abnormal data belonging to different classification clusters.
[0009] Further, the clustering method comprises: dividing the normal data and the abnormal data into a plurality of subsets respectively, each of the subsets containing at least one kind of operation data; clustering each of the subsets to obtain a plurality of sub-classification clusters; assigning a weight to each of the subsets according to the contribution of each of the subsets to the operation of the target device; determining the score of each of the normal data or the abnormal data on each of the sub-classification clusters according to the weight of each of the subsets, and selecting the sub-classification cluster with the highest score as the classification cluster of each of the normal data or the abnormal data.
[0010] Further, each of the subsets is clustered by using a K-Means algorithm.
[0011] Further, the feature parameter is a mean square error corresponding to each kind of operation data contained in the sub-classification cluster.
[0012] Further, the S4 comprises: training a labeling model, adding labels to the simulation data, combining the simulation data with the data set to obtain an expanded data set, training the LSTM network by using the expanded data set to obtain the fault prediction model, and the LSTM network containing two LSTM layers and one fully connected layer.
[0013] Further, a random forest model and a support vector machine model are trained by using the labeled data set to obtain a first labeling model and a second labeling model, and the labels of the simulation data are determined according to the first labeling model and the second labeling model.
[0014] According to another aspect of the present application, there is also provided a GANs and LSTM based fault prediction apparatus, comprising a processor and a memory, the memory being configured to store program instructions, and the processor being configured to invoke the program instructions to perform the GANs and LSTM based fault prediction method.
[0015] According to yet another aspect of the present application, there is also provided a computer readable storage medium storing a computer program, which, when executed by a processor, implements the GANs and LSTM based fault prediction method.
[0016] The present application at least has the following beneficial effects:
[0017] The present application utilizes historical operation data to construct a data set, trains a GANs network to obtain a data generation model, generates simulation data by using the data generation model, combines the simulation data with the data set to obtain an expanded data set, trains an LSTM network by using the expanded data set to obtain a fault prediction model, and performs fault prediction.
[0018] Other advantages, objects, and features of the present application will be understood by those skilled in the art from the following specification in conjunction with the appended claims. BRIEF DESCRIPTION OF DRAWINGS
[0019] Figure 1 Flow chart of one embodiment of the present application. DETAILED DESCRIPTION
[0020] The present application will be further described with reference to the drawings, which enable those skilled in the art to carry out the application according to the description herein.
[0021] It should be understood that the terms such as "have", "contain" and "include" used in the embodiments of the present application do not exclude the presence or addition of one or more other elements. All directional indications (such as up, down, left, right, front, back, etc.) in the embodiments of the present application are only used to explain the relative position relationship, movement condition, etc. between components in a certain posture, and when the certain posture changes, the directional indications also change accordingly. When an element is referred to as "fixed to" or "disposed on" another element, it can be directly on another element or can have a middle element. When an element is referred to as "connected" to another element, it can be directly connected to another element or indirectly connected to another element through a middle element. The description of "first", "second" and the like in the embodiments of the present application is only for the purpose of description and cannot be understood as indicating or implying the relative importance of the technical features indicated or implying the number of technical features indicated. Therefore, the features defined as "first", "second" can explicitly or implicitly include at least one of the features.
[0022] It should be noted that the technical solutions of various embodiments of the present application can be combined with each other, but it must be based on the fact that a person skilled in the art can realize it, and when the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist and is not within the protection scope claimed by the present application.
[0023] As shown in Figure 1 The embodiments of the present application provide a fault prediction method based on GANs and LSTM, which comprises:
[0024] S1: obtaining historical running data of a target device;
[0025] Exemplarily, the target device refers to air conditioning equipment, ground source heat pump, fresh air equipment, etc., and the following mainly takes air conditioning equipment as an example for illustration, and a person skilled in the art can easily analogize the relevant principles and methods to ground source heat pump and fresh air equipment in view of the corresponding professional knowledge and experience;
[0026] Exemplarily, the historical running data is collected from each sensor of the target device, and taking air conditioning as an example, such as temperature sensor (such as indoor unit evaporator temperature, outlet temperature, outdoor unit condenser temperature, compressor temperature, etc.), pressure sensor (high and low pressure side pressure of refrigeration system), current sensor (compressor, indoor and outdoor fan motor current) and wind speed sensor (indoor and outdoor fan outlet wind speed) and the like; further, due to the large difference in data magnitude collected by different sensors, the Min-Max normalization method is used to unify each data feature to the interval of 0-1, so that the data of different dimensions can participate in subsequent model training on the same scale, facilitating the model to better learn data features and perform parameter updating and the like operations;
[0027] S2: constructing a data set using the historical operation data, training a GANs network, and obtaining a data generation model;
[0028] Exemplarily, the GANs network includes a generator and a discriminator. The generator includes an input layer, three hidden layers and an output layer. The input layer is used to receive a 100-dimensional random noise vector, each element of the noise vector being randomly sampled from a standard normal distribution. The first hidden layer has 512 neurons and uses a ReLU activation function for nonlinear transformation, to perform feature mapping and expansion on the input noise vector. The second hidden layer is provided with 256 neurons and also uses a ReLU activation function, to further extract and integrate features. The third hidden layer has 128 neurons, to continue feature transformation. The number of neurons in the output layer is the same as the dimension of the operation data (e.g., 7 dimensions), and the final output is the generated simulation data.
[0029] The discriminator includes an input layer, two hidden layers and an output layer. The input layer directly receives data with the same dimension as the real data and the simulation data output by the generator, i.e., 7 dimensions, covering various air conditioner operation-related features mentioned above. The first hidden layer is provided with 256 neurons, and a LeakyReLU activation function is used here. When the discriminator faces the task of distinguishing between real and fake data, it can capture data features more subtly and enhance its nonlinear expression ability, so as to better judge the authenticity of the input data. The second hidden layer is provided with 128 neurons, and also uses a LeakyReLU activation function, to further extract feature information in the data. By analyzing the association and change between different features, the input data is comprehensively judged to be real air conditioner operation data collected or simulation data generated by the generator, to continuously improve the discrimination accuracy of the discriminator for real and fake data. The output layer has only one neuron, and uses a Sigmoid activation function to compress the output result into the [0,1] interval. When the output value is close to 1, it means that the discriminator considers the input data to be real historical operation data, and when the output value is close to 0, it means that the discriminator judges it to be simulation data generated by the generator, to realize quantitative judgment of the authenticity of the input data.
[0030] During specific training, a batch of real data is randomly extracted from the preprocessed real historical operation data set and input into the discriminator. At this time, it is hoped that the discriminator can accurately judge these real data to be true, that is, the probability (output in the [0,1] interval by the Sigmoid function) of the discriminator output indicating that the data is real data is as close to 1 as possible.
[0031] Meanwhile, a batch of noise vectors is randomly generated from the standard normal distribution. These noise vectors are input into the generator to generate a batch of simulated data. Then, these simulated data are also input into the discriminator. At this point, it is expected that the discriminator can accurately identify that these simulated data are fake, that is, the probability of the output judgment being real data is as close to 0 as possible.
[0032] The discriminator's judgment results for real and simulated data are compared with the corresponding real labels. The accuracy of the discriminator's judgment is measured by calculating the binary cross-entropy loss function, resulting in a total loss value. This loss value comprehensively reflects the discriminator's performance in distinguishing between real and fake data. Then, based on this loss value, the gradients of each parameter of the discriminator are calculated using the backpropagation algorithm. Finally, the selected Adam optimizer is used to update the discriminator's parameters according to the calculated gradient direction and magnitude, so that its ability to distinguish between real and fake data can be continuously enhanced in subsequent operations.
[0033] After training the discriminator, the discriminator is fixed, and the generator is trained again. A batch of noise vectors is generated from the standard normal distribution and input into the generator to generate simulated data. This simulated data is then input into the discriminator, which has already been trained once (with fixed parameters). At this point, the generator wants the discriminator to have a higher probability of judging these simulated data as real data, meaning the generated simulated data is more likely to fool the discriminator and is closer to the real data. Based on the discriminator's judgment of the simulated data (output probability values), the gradient of the generator parameters is calculated using the backpropagation algorithm, and then the Adam optimizer is used to update the generator parameters, enabling the generator to generate higher quality simulated data that is more difficult for the discriminator to distinguish. This process is repeated, with the generator and discriminator alternating in each training round. Through continuous adversarial game, their performance gradually improves. After 200 rounds of training, the generator can finally generate simulated data of a certain quality that is relatively similar to the distribution of real historical running data.
[0034] S3: Use the data generation model to generate simulated data, and merge the simulated data with the dataset to obtain an expanded dataset;
[0035] In this step, simulated data is generated using the simulated data generation method mentioned in S2, and then merged with the original historical running dataset to construct an expanded dataset. During the merging process, it is necessary to ensure the consistency of the data format so that the expanded dataset can still be easily processed and analyzed in subsequent steps.
[0036] S4: Train an LSTM network using the augmented dataset to obtain a fault prediction model;
[0037] Exemplarily, the LSTM network includes an input layer, a hidden layer and an output layer, 10 key features such as evaporator temperature and condenser temperature are selected from the expanded data set as input, data of the past 30 time points are considered, two hidden layers are set, 128 LSTM units are used in the first layer, the hyperbolic tangent function (tanh) is selected as the activation function and the hidden state of each time step is output, 64 LSTM units are used in the second layer, the tanh activation function is also used and only the hidden state of the last time step is output, the output layer can be according to four situations of normal operation, refrigerant leakage fault, compressor fault and fan fault, so four neurons are set, the Softmax activation function is used to convert the output into a probability distribution of each category, the model is constructed and the adam optimizer is specified; during training, the training set data is input into the network according to the batch size, forward propagation, loss calculation and parameter update are performed, the performance is evaluated on the validation set after each round, the parameters are adjusted according to the situation, and the fault prediction model is obtained after 100 rounds of training;
[0038] S5: using the fault prediction model to predict the fault of the target device, that is, collecting the current operation data of the target device in real time, taking the data of the past 30 time points as input, inputting the fault prediction model, obtaining the probability values of four situations of normal operation, refrigerant leakage fault, compressor fault and fan fault, if the fault probability value exceeds the threshold value, an alarm signal is sent, and an email and a short message are sent to the operation and maintenance personnel for notification, so that timely maintenance and processing are facilitated;
[0039] It can be seen that the embodiment generates simulation data by using the data generation model, which is used for training of the fault prediction model, overcomes the problem of data deficiency, and improves the generalization ability and prediction accuracy.
[0040] In another embodiment, in the S2, normal data and abnormal data in the historical operation data are extracted; the normal data and the abnormal data are respectively clustered to obtain classification clusters; when the GANS network is trained, different feature parameters are respectively assigned to the normal data or the abnormal data belonging to different classification clusters;
[0041] Exemplarily, the distinction between normal data and abnormal data is determined according to a preset threshold, the normal data is clustered by using a K-Means clustering algorithm, the elbow method is used to determine that the optimal number of clusters is three classification clusters, the data characteristics in the first cluster are low wind speed, low load operation, the evaporator temperature is close to 5 DEG C, the condenser temperature is about 30 DEG C, and the compressor current is small; the second cluster is normal wind speed, medium load operation, the evaporator temperature is about 10 DEG C, the condenser temperature is about 40 DEG C, and the compressor current is moderate; the third cluster is high wind speed, high load operation, the evaporator temperature is about 15 DEG C, the condenser temperature is close to 50 DEG C, and the compressor current is large; the abnormal data clustering also uses the K-Means clustering algorithm, and two classification clusters are determined, one cluster represents the refrigerant leakage fault related abnormality, and the data characteristics are that the evaporator temperature continuously rises, the condenser temperature drops, and the compressor current gradually decreases, and the other cluster corresponds to the fan fault abnormality, which is manifested as unstable fan speed and occasional instantaneous fluctuation of the compressor current;
[0042] For the first cluster, the second cluster and the third cluster in the normal data, different feature parameters are assigned, and the generator generates data fitting the corresponding normal working conditions based on different initial conditions; for the first cluster and the second cluster of abnormal data, different feature parameters are assigned to guide the generation of data simulating different fault characteristics;
[0043] The operation of classifying and clustering the historical operation data and assigning feature parameters makes the use of data more targeted, avoids the information redundancy and mutual interference in the data, fully excavates the value contained in each type of data, and meets the condition that the data amount is relatively limited but needs to cover various faults in the fault prediction process.
[0044] In another embodiment, the clustering method comprises: dividing the normal data and the abnormal data into a plurality of subsets respectively, each of the subsets containing at least one operating data; clustering each of the subsets to obtain a plurality of sub-classification clusters; assigning a weight to each of the subsets according to the contribution of each of the subsets to the operation of the target device; determining the score of each of the normal data or the abnormal data in each of the sub-classification clusters according to the weight of each of the subsets, and selecting the sub-classification cluster with the highest score as the classification cluster of each of the normal data or the abnormal data;
[0045] Exemplarily, the K-Means algorithm is used for clustering each of the subsets respectively;
[0046] Exemplarily, the feature parameter is the mean square error of each operating data contained in the sub-classification cluster;
[0047] Exemplarily, the normal data is divided into 3 subsets, the first subset contains the evaporator temperature and the condenser temperature, which are two operating data related to heat exchange, the second subset contains the compressor current, and the third subset contains the fan wind speed data; similarly, the abnormal data is divided into 2 subsets, the first subset contains the evaporator temperature and the compressor current, and the second subset contains the fan wind speed data;
[0048] For normal data, the weight of subset one is set to 0.4, because the speed and temperature have a significant impact on the stable operation of the motor and heat dissipation; the weight of subset two is 0.35, the current and the running time are related to the load and the overall use; the weight of subset three is 0.25, mainly focusing on the fan wind speed; for abnormal data, the weight of subset one is set to 0.6, the current and temperature anomalies are often the key fault representation; the weight of subset two is 0.4, reflecting the fan wind speed situation;
[0049] The 5 subsets are respectively clustered using the K-Means algorithm, and the same clustering center (corresponding operating data) is selected for clustering each time to obtain multiple sub-class clusters;
[0050] For a normal operating data X, determine the classification cluster to which it belongs in each subset clustering process, such as belonging to cluster A in subset one and subset two, belonging to cluster B in subset two, and not belonging to cluster C, the score of cluster A is 0.75, the score of cluster B is 0.25, and the score of cluster C is 0, at this time, it is determined that the operating data belongs to cluster A; for an abnormal operating data Y, in subset one cluster C, in subset two cluster D, the score of cluster C is 0.6, the score of cluster D is 0.4, at this time, it is also determined that the operating data belongs to cluster C; repeat the above operation to determine the classification cluster for each operating data, and then use the mean square error of all operating data in the corresponding classification cluster as a characteristic parameter, in subsequent training using the GANs network, the generator can be guided to learn to generate data that conforms to the characteristics of this normal operating state, so that the generated data is more consistent with the actual situation.
[0051] In another embodiment, in order to improve the labeling accuracy and efficiency, further comprising: training a labeling model and adding labels to the simulation data, and then combining with the data set to obtain an expanded data set; training the LSTM network using the expanded data set to obtain the fault prediction model, the LSTM network comprising two LSTM layers and one fully connected layer.
[0052] Exemplarily, a random forest model and a support vector machine model are trained using the labeled data set to obtain a first labeling model and a second labeling model, and the labels of the simulation data are determined according to the first labeling model and the second labeling model;
[0053] Specifically, the existing historical operation data set is first divided into a training set and a test set, such as a 70%, 30% ratio, the training set is used to train the labeling model, and the test set is used to evaluate the model effect; This historical operation data set contains various operation data of air conditioners under normal operation and different fault conditions such as refrigerant leakage, compressor failure, and fan failure, and each data has a corresponding accurate fault label (for example, 0 represents normal operation, 1 represents refrigerant leakage failure, 2 represents compressor failure, and 3 represents fan failure);
[0054] The data features in the training set are taken as input, and the corresponding fault label is taken as output label. The random forest algorithm is used for training. Similarly, the operation data features in the training set are taken as input, and the fault label is taken as output label. The support vector machine algorithm is used for training. The label of the simulation data is determined
[0055] A batch of simulation data is extracted from the simulation data set generated by the data generation model. These simulation data contain various parameter values of the simulated air conditioning equipment under different operating conditions, but initially have no fault label.
[0056] Each simulation data is input into the trained first labeling model (random forest model) and second labeling model (support vector machine model) respectively, and the fault prediction results (that is, the corresponding label prediction value) given by the two models are obtained. If the prediction results of the two models are consistent, the result is directly used as the label of the simulation data; If not, manual intervention is performed; By this method, the label of each simulation data is determined. Random forest may grasp the overall trend better, but it may not be sensitive to some subtle feature differences. Support vector machine may be more advantageous in capturing local features. The combination of the two can more comprehensively consider the characteristics of the data, thereby improving the accuracy of labeling.
[0057] The following table shows the comparison of fault prediction models obtained by different data and the same model.
[0058]
[0059] The embodiments of the application also provide a fault prediction device based on GANs and LSTM, comprising a processor and a memory, the memory is used to store program instructions, and the processor is used to call the program instructions to execute the fault prediction method based on GANs and LSTM. The device of the embodiment can be a mobile phone, a notebook computer, a tablet computer, etc., which is internally provided with a memory and a processor to execute the fault prediction method of the above-mentioned embodiments.
[0060] The embodiment of the present application further provides a computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the fault prediction method based on GANs and LSTM; in the embodiment, the computer readable medium can be a portable computer disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device, etc., capable of storing a computer program to execute the fault prediction method of the above embodiment.
[0061] Although the embodiments of the present application have been disclosed as above, they are not limited only to the applications listed in the specification and the embodiments, and can be fully applied to various fields suitable for the present application, and additional modifications can be easily made by those skilled in the art, and thus the present application is not limited to specific details and the figures shown and described herein, without departing from the general concept defined by the claims and the equivalent scope.
Claims
1. A method for failure prediction based on GANs and LSTM, characterized in that, The method comprises the following steps: S1: obtaining historical running data of a target device, wherein the target device is an air conditioner; S2: constructing a data set by using the historical running data, training a GANs network, and obtaining a data generation model; S3: generating simulation data by using the data generation model, combining the simulation data with the data set, and obtaining an expanded data set; S4: training an LSTM network by using the expanded data set, and obtaining a fault prediction model; S5: performing fault prediction on the target device by using the fault prediction model. In the S2, normal data and abnormal data in the historical running data are extracted; The normal data and the abnormal data are clustered respectively to obtain classification clusters; When the GANS network is trained, different feature parameters are assigned to the normal data or the abnormal data belonging to different classification clusters, so that the generator generates data fitting the corresponding normal working condition based on different initial conditions, and guides the generation of data simulating different fault characteristics; The clustering method comprises the following steps: The normal data and the abnormal data are divided into a plurality of subsets respectively, and each subset contains at least one running data; the normal data is divided into three subsets, the first subset contains two running data related to heat exchange, i.e., evaporator temperature and condenser temperature, the second subset contains compressor current, and the third subset contains fan speed data; the abnormal data is divided into two subsets, the first subset contains evaporator temperature and compressor current, and the second subset contains fan speed data; each subset is clustered respectively to obtain a plurality of sub-classification clusters; According to the contribution of each subset to the running of the target device, a weight is assigned to each subset; According to the weight of each subset, the score of each normal data or abnormal data on each sub-classification cluster is determined, the sub-classification cluster with the highest score is selected as the classification cluster of each normal data or abnormal data; Each subset is clustered by using a K-Means algorithm respectively; The feature parameter is the mean square error of each running data contained in the sub-classification cluster. 2.The GANs and LSTM based failure prediction method of claim 1, wherein, The S4 comprises the following steps: A labeling model is trained, and labels are added to the simulation data, which are then combined with the data to obtain an expanded data set; The LSTM network is trained by using the expanded data set to obtain the fault prediction model, and the LSTM network comprises two LSTM layers and one fully connected layer. 3.The GANs and LSTM based failure prediction method of claim 2, wherein, A random forest model and a support vector machine model are trained by using the labeled data set to obtain a first labeling model and a second labeling model, and the labels of the simulation data are determined according to the first labeling model and the second labeling model.
4. A failure prediction apparatus based on GANs and LSTM, characterized by, The method comprises a processor and a memory, the memory is used to store program instructions, and the processor is used to call the program instructions to execute the fault prediction method based on GANs and LSTM according to any one of claims 1-3.
5. A computer readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to implement the fault prediction method based on GANs and LSTM in any one of claims 1-3.
Citation Information
Patent Citations
Charging pile fault diagnosis method, device, equipment and medium
CN116578873A