Unbalanced Fault Diagnosis Method Based on LSTM-QDM

By adopting the LSTM-QDM method in troubleshooting, a quad-tuple timing data pair is constructed and the loss function is designed, which solves the data imbalance problem and improves the accuracy and performance of fault diagnosis.

CN114090953BActive Publication Date: 2025-06-13RES INST OF YIBIN UNIV OF ELECTRONIC SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111240363.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2025-06-13
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

In the field of fault diagnosis, the prior art faces the problem of data imbalance, resulting in performance degradation of deep learning-based methods when processing unbalanced data, overfitting and classification performance degradation.

Method used

The imbalanced fault diagnosis method based on LSTM-QDM is adopted, and the corresponding loss function is designed to improve the model's characterization ability and training effect under unbalanced data.

Benefits of technology

It improves the accuracy and performance of industrial equipment fault diagnosis, effectively alleviates the negative impact of data imbalance, and improves the classification capabilities of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114090953B_ABST
    Figure CN114090953B_ABST
Patent Text Reader

Abstract

The present invention discloses an unbalanced fault diagnosis method based on LSTM-QDM. First, the measurement data of each measurement device under K fault states of industrial equipment is collected to construct a time-series data matrix. Then, time-series data samples are extracted through a sliding window. Next, the fault type analysis is performed on the time-series data samples to obtain the division of unbalanced faults and normal faults. The proposed quadruple time-series data pair construction strategy is used to construct quadruple time-series data pairs, and an LSTM-QDM fault diagnosis model is built. The quadruple time-series data pairs and the labels of the anchor samples therein are used to train the fault diagnosis model. During the operation of industrial equipment, actual operation data is collected and time-series data samples are constructed and input into the LSTM-QDM fault diagnosis model to obtain the fault recognition result. The present invention combines the LSTM network and the QDM algorithm to improve the fault diagnosis performance of industrial equipment under the state of data imbalance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of industrial equipment fault diagnosis, and more specifically, relates to an unbalance fault diagnosis method based on LSTM-QDM. Background Art

[0002] With the rapid development of modern industry and intelligent manufacturing, fault diagnosis of key equipment and production processes in intelligent factories has become increasingly important for production safety and economic benefits. To ensure accurate and timely fault diagnosis, it is usually necessary to extract useful information from a large number of sensor signals. In recent years, data-driven methods have been extensively studied because they can perform effective process monitoring and fault diagnosis in automated equipment or systems where it is difficult to establish a specific physical model.

[0003] Although deep learning-based methods have achieved certain results in the field of fault diagnosis, there are still many challenges. Sufficient and high-quality collected data is the primary requirement to ensure the performance of deep learning-based fault diagnosis methods. However, in the field of fault diagnosis, due to the very small number of fault data, especially severe fault data, the problem of serious data imbalance is often faced. Therefore, the processing of unbalanced data is a key step in data-driven and deep learning-based fault diagnosis methods. Currently, the methods for processing unbalanced data are usually based on oversampling strategies, but these methods do not provide additional information and even lead to overfitting. With the development of generative models, generative adversarial networks have been widely applied to unbalanced tasks. However, most data generation-based methods are two-stage, and the losses caused by the generation stage will accumulate to the classification stage, which may lead to the degradation of classification performance.

[0004] The optimization of data representation may be an effective way to alleviate the negative impact brought by imbalance. Since Deep Metric Learning (DML) can effectively represent data, fault diagnosis methods based on DML have been extensively studied. DML extracts more representative features from the original data by constructing reasonable data pairs and metric loss functions, thereby improving the fault diagnosis effect. However, the current DML-based methods do not consider optimizing the model from the perspectives of data pair construction and loss function adjustment to improve the diagnosis effect in unbalanced scenarios. Summary of the Invention

[0005] The purpose of the present invention is to overcome the deficiencies of the prior art and provide an unbalanced fault diagnosis method based on LSTM-QDM, which combines the LSTM (long short-term memory) network and the QDM (quadruplet deep metric learning) algorithm to improve the fault diagnosis performance of industrial equipment under the condition of data imbalance.

[0006] To achieve the above invention purpose, the unbalanced fault diagnosis method based on LSTM-QDM of the present invention includes the following steps:

[0007] S1: When the industrial equipment is in different fault conditions, a plurality of pre-set measuring devices continuously measure the working signals of the industrial equipment. Denote the number of measurement data obtained at each sampling moment as M, and denote the working signal at the r-th sampling moment as where x rm represents the m-th measurement data in the working signal at the r-th sampling moment, m = 1, 2, …, M, r = 1, 2, …, R, and R represents the number of samplings; according to the fault condition of the industrial equipment at each sampling moment, mark the fault label y r for the measurement data at this sampling moment, where y r = 1, 2, …, K, and K represents the number of fault types; then, according to the working signals obtained from R samplings, construct a time series data matrix of size R×M

[0008]

[0009] S2: For the time series data matrix slide a window of length L with a preset step size s by rows to extract sub-matrices as time series data samples. Denote the number of obtained time series data samples as represents rounding up. Then the expression of the d-th time series data sample X d is as follows:

[0010]

[0011] where d = 1, 2, …, D;

[0012] Then mark the fault label Y d = y (d-1)s+L ;

[0013] S3: Classify the D time series data samples according to the fault labels of each time series data sample to obtain a set φ of time series data samples corresponding to each fault k, where \(k = 1, 2, \ldots, K\). Then, count the number of time-series data samples for each type of fault. When the number of time-series data samples for a certain type of fault is less than the preset threshold, set this type of fault as an imbalanced fault; otherwise, set it as a normal fault.

[0014] S4: Randomly select a time-series data sample from the \(D\) time-series data samples as the anchor sample, and then select three other time-series data samples according to the anchor sample to form a quadruple time-series data pair. The specific method is as follows:

[0015] When the fault type of the anchor sample is a normal fault, randomly select a time-series data sample with the same fault type as the anchor sample as the positive sample, randomly select a time-series data sample with a different fault type from the anchor sample as the negative sample, and randomly select one from the time-series data samples corresponding to the imbalanced fault as the few-shot sample to form a quadruple time-series data pair;

[0016] When the fault type of the anchor sample is an imbalanced fault and there is only one type of imbalanced fault among the fault types, randomly select a time-series data sample with the same fault type as the anchor sample as the positive sample, randomly select two time-series data samples with different fault types from the anchor sample as the negative sample and the few-shot sample to form a quadruple time-series data pair;

[0017] When the fault type of the anchor sample is an imbalanced fault and there are more than two types of imbalanced faults among the fault types, randomly select a time-series data sample with the same fault type as the anchor sample as the positive sample, randomly select a time-series data sample with a different fault type from the anchor sample as the negative sample, and randomly select a time-series data sample of an imbalanced fault with a different fault type from the anchor sample as the few-shot sample to form a quadruple time-series data pair;

[0018] Repeat the above operations of selecting the anchor sample and the other three time-series data samples several times to obtain several quadruple time-series data pairs;

[0019] S5: Construct an LSTM-QDM fault diagnosis model, including 4 LSTM network branches and a Softmax layer. Each LSTM network branch includes a multi-layer LSTM network and a fully connected layer, where:

[0020] The 4 LSTM network branches are respectively used to process the four time-series data samples in the quadruple time-series data pair, and the 4 multi-layer LSTMs in the 4 LSTM network branches share parameters, and the 4 fully connected layers share parameters. Among them, the multi-layer LSTM is used to extract the features of the time-series data sample and input them into the fully connected layer, and the fully connected layer performs feature mapping on the received features and then outputs; the Softmax layer is used to receive the output features of the fully connected layer corresponding to the anchor sample, process to obtain the probability that the anchor sample belongs to each fault type, and obtain the fault diagnosis result;

[0021] S6: Use each of the quadruple time-series data pairs obtained in step S4 as the input of the LSTM-QDM fault diagnosis model, and use the label of the anchor sample in the quadruple time-series data pair as the expected output of the Softmax layer in the LSTM-QDM fault diagnosis model to train the LSTM-QDM fault diagnosis model. The loss function is calculated using the following method:

[0022] Denote each quadruple time-series data pair as Pair = (x, x pos , x neg , x minor ), where x represents the anchor sample, x pos represents the positive sample, x neg represents the negative sample, x minor represents the few-shot sample. Denote the features obtained by processing each sample through the corresponding LSTM network branch as p, p pos , p neg , p minor respectively. Calculate the distances between the anchor sample feature p and the other several features:

[0023] D pos = ||p - p pos || 2

[0024] D neg = ||p - p neg || 2

[0025] D minor = ||p - p minor || 2

[0026] where || || 2 represents taking the two-norm;

[0027] Calculate the positive sample loss L pos using the following formula:

[0028] L pos = (1 - f)D pos + λ pos fD pos

[0029] where when the anchor sample belongs to an imbalanced fault, the flag parameter f = 1, otherwise the flag parameter f = 0; λ pos is a preset constant greater than 1;

[0030] Calculate the negative sample loss L neg using the following formula:

[0031] L neg= max(0, M 1 - D neg )

[0032] The few - shot loss L is calculated using the following formula minor :

[0033] L minor = max(0, M 2 - D minor ) * λ minor

[0034] where λ minor is a preset constant greater than 1, M 1 is the expected margin between the preset anchor sample and the negative sample, M 2 is the expected margin between the preset anchor sample and the few - shot sample, and M 2 > M 1 ;

[0035] The quadruple loss L is calculated using the following formula quadruplet :

[0036]

[0037] The opposite of the probability value corresponding to the true fault label in the probability values obtained by the softmax layer for the anchor sample is used as the class loss L softmax ;

[0038] The following formula is used to fuse the quadruple loss L quadruplet and the classification loss L softmax to obtain the loss L for each quadruple of time - series data pairs:

[0039] L = βL quadruplet + L softmax

[0040] where β is a preset weight parameter;

[0041] S7: During the operation of the industrial equipment, several pre - set measuring devices continuously measure the working signals of the industrial equipment, and the measurement data obtained at the current sampling moment t and the previous L - 1 sampling moments constitute the time - series data sample X t :

[0042]

[0043] The time - series data sample X t is input into the LSTM network corresponding to the anchor sample in the LSTM - QDM fault diagnosis model, and the fault diagnosis result is obtained according to the probability output by the Softmax layer.

[0044] The unbalanced fault diagnosis method based on LSTM-QDM of the present invention first collects the measurement data of each measuring device under K fault states of industrial equipment, constructs a time series data matrix, then extracts time series data samples through a sliding window, and then analyzes the fault types of the time series data samples to obtain the division of unbalanced faults and normal faults. The proposed quadruple time series data pair construction strategy is used to construct quadruple time series data pairs, and an LSTM-QDM fault diagnosis model is constructed. The quadruple time series data pairs and the labels of the anchor samples therein are used to train the fault diagnosis model. During the operation of industrial equipment, actual operation data is collected and time series data samples are constructed and input into the LSTM-QDM fault diagnosis model to obtain fault recognition results.

[0045] The present invention has the following beneficial effects:

[0046] 1) In the present invention, time series data samples are extracted through a sliding window, considering the time series characteristics in the operation data of industrial equipment, thereby improving the accuracy of fault diagnosis;

[0047] 2) In the present invention, quadruple time series data pairs including anchor samples, positive samples, negative samples and few samples are constructed, and a corresponding LSTM-QDM fault diagnosis model is designed, enhancing the representation ability for unbalanced data;

[0048] 3) In the present invention, a loss function is designed according to the quadruple time series data pairs, improving the training effect of the LSTM-QDM fault diagnosis model. Description of the Drawings

[0049] Figure 1 is the flowchart of the specific implementation manner of the unbalanced fault diagnosis method based on LSTM-QDM of the present invention;

[0050] Figure 2 is the structural diagram of the LSTM-QDM fault diagnosis model in the present invention. Specific Embodiments

[0051] The following describes the specific implementation manner of the present invention with reference to the drawings, so that those skilled in the art can better understand the present invention. It should be particularly noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0052] Embodiment

[0053] Figure 1 is the flowchart of the specific implementation manner of the unbalanced fault diagnosis method based on LSTM-QDM of the present invention. As Figure 1 shown, the specific steps of the unbalanced fault diagnosis method based on LSTM-QDM of the present invention include:

[0054] S101: Collect training data:

[0055] Under different fault conditions of the industrial equipment, several pre-set measuring devices continuously measure the working signals of the industrial equipment. Denote the number of measurement data obtained at each sampling moment as M, and denote the working signal at the r-th sampling moment as where x rm represents the m-th measurement data in the working signal at the r-th sampling moment, m = 1, 2, …, M, r = 1, 2, …, R, and R represents the number of samplings. Mark the fault label y r for the measurement data at each sampling moment according to the fault condition of the industrial equipment at that sampling moment, where y r = 1, 2, …, K, and K represents the number of fault types. Then, construct a time series data matrix of size R×M based on the working signals obtained from R samplings

[0056]

[0057] In practical applications, the measuring devices can be set according to needs. Generally, common sensors in the industrial system such as pressure sensors and temperature sensors can be set, or industrial equipment such as bearing speed measuring devices can be used.

[0058] S102: Construct time series data samples:

[0059] For the time series data matrix slide a window of length L by a preset step size s row by row to extract sub-matrices as time series data samples. Denote the number of obtained time series data samples as represents rounding up. Then, the expression of the d-th time series data sample X d is as follows:

[0060]

[0061] where d = 1, 2, …, D.

[0062] Then, mark the fault label Y d = y (d-1)s+L for each time series data sub-matrix, that is, the fault label of the time series data sub-matrix is the same as the label of the measurement data at the last sampling moment in it.

[0063] S103: Fault type analysis:

[0064] Classify the D time series data samples according to the fault labels of each time series data sample to obtain the set φ of time series data samples corresponding to each fault k, where \(k = 1, 2, \ldots, K\). Then, count the number of time-series data samples for each type of fault. If the number of time-series data samples for a certain type of fault is less than the preset threshold, set this fault as an imbalanced fault; otherwise, set it as a normal fault.

[0065] S104: Construct quadruple time-series data pairs:

[0066] Randomly select a time-series data sample from the \(D\) time-series data samples as the anchor sample, and then select three other time-series data samples according to the anchor sample to form a quadruple time-series data pair. The specific method is as follows:

[0067] When the fault type of the anchor sample is a normal fault, randomly select a time-series data sample with the same fault type as the anchor sample as the positive sample, randomly select a time-series data sample with a different fault type from the anchor sample as the negative sample, and randomly select one from the time-series data samples corresponding to the imbalanced fault as the few-shot sample to form a quadruple time-series data pair.

[0068] When the fault type of the anchor sample is an imbalanced fault and there is only one type of imbalanced fault among the fault types, randomly select a time-series data sample with the same fault type as the anchor sample as the positive sample, and randomly select two time-series data samples with different fault types from the anchor sample as the negative sample and the few-shot sample to form a quadruple time-series data pair.

[0069] When the fault type of the anchor sample is an imbalanced fault and there are more than two types of imbalanced faults among the fault types, randomly select a time-series data sample with the same fault type as the anchor sample as the positive sample, randomly select a time-series data sample with a different fault type from the anchor sample as the negative sample, and randomly select a time-series data sample of an imbalanced fault with a different fault type from the anchor sample as the few-shot sample to form a quadruple time-series data pair.

[0070] Repeat the above operations of selecting the anchor sample and the other three time-series data samples several times to obtain several quadruple time-series data pairs.

[0071] According to the above description, it can be seen that the quadruple time-series data pairs formed by the present invention consider the cases of single-fault imbalance and multi-fault imbalance. This data design ensures that the anchor sample and the few-shot sample come from different categories, and at least one comes from the imbalanced category, making the subsequent model training more effective and further improving the accuracy of fault diagnosis.

[0072] S105: Construct an LSTM-QDM fault diagnosis model:

[0073] To achieve fault diagnosis under sample imbalance, the present invention proposes an LSTM-QDM fault diagnosis model. Figure 2 is the structural diagram of the LSTM-QDM fault diagnosis model in the present invention. AsFigure 2 As shown, the LSTM-QDM fault diagnosis model constructed in the present invention includes 4 LSTM network branches and a Softmax layer. Each LSTM network branch includes a multi-layer LSTM network and a fully connected layer. The following will separately elaborate on each component module in detail:

[0074] The 4 LSTM network branches are respectively used to process the four time-series data samples in the quadruple time-series data pair, and the 4 multi-layer LSTMs in the 4 LSTM network branches share parameters, and the 4 fully connected layers share parameters. Among them, the multi-layer LSTM is used to extract the features of the time-series data sample and input them into the fully connected layer. The fully connected layer performs feature mapping on the received features and then outputs. The Softmax layer is used to receive the output features of the fully connected layer corresponding to the anchor sample, process to obtain the probabilities of the anchor sample belonging to each fault type, and obtain the fault diagnosis result.

[0075] In the LSTM network, compared with the ordinary fully connected neural network, a hidden state vector representing the hidden state, as well as various control gate signals and memory signals, are added. The hidden state vector is controlled by complex control gates and memory signals, enabling the network to selectively delete or remember time-series information, thereby better extracting the features of the time-series data samples in the present invention and improving the accuracy of fault diagnosis. The specific principle and working process of the LSTM network can refer to the literature "Shi X, Chen Z, Wang H, et al. Convolutional LSTM Network: A Machine Learning Approach for Precipitation Nowcasting[J]. MIT Press, 2015."

[0076] The features obtained by the LSTM network often have a large dimension, resulting in the failure of the Euclidean distance metric to a certain extent. In order to make QDM converge more easily, the present invention uses a fully connected layer for feature mapping, mapping the high-dimensional space to a low-dimensional space.

[0077] The Softmax layer is also a commonly used module in neural networks. The specific principle and working process can refer to the literature "Bishop C M. Pattern recognition[J]. Machine learning, 2006, 128(9)."

[0078] S106: Train the LSTM-QDM fault diagnosis model:

[0079] Taking each of the obtained quadruple time-series data pairs in step S104 as the input of the LSTM-QDM fault diagnosis model, and taking the label of the anchor sample in the quadruple time-series data pair as the expected output of the Softmax layer in the LSTM-QDM fault diagnosis model, the LSTM-QDM fault diagnosis model is trained.

[0080] The setting of the loss function is very important for the training effect of the LSTM-QDM fault diagnosis model. The calculation method of the loss function adopted in the present invention is as follows:

[0081] In the present invention, two parts of losses are adopted: Quadruplet Loss and Softmax Loss.

[0082] The optimization goal of the Quadruplet Loss is to reduce the variance within the class and increase the distance between different classes. In addition, for imbalanced classes, ideally, the distance between the anchor sample and the imbalanced sample is larger, which can provide a more discriminative representation for the imbalanced class. Denote each quadruple time-series data pair as Pair=(x, x pos , x neg , x minor ), where x represents the anchor sample, x pos represents the positive sample, x neg represents the negative sample, x minor represents the few-shot sample. Denote the features obtained after processing each sample through the corresponding LSTM network branch as p, p pos , p neg , p minor , and calculate the distances between the feature p of the anchor sample and the other several features respectively:

[0083] D pos = ||p - p pos || 2

[0084] D neg = ||p - p neg || 2

[0085] D minor = ||p - p minor || 2

[0086] where, |||| 2 represents taking the second norm.

[0087] For sample pairs of the same class, it is hoped that the distance between samples is as small as possible, that is, D posAs small as possible. At the same time, in the case of imbalanced categories, because the number of common fault samples and their positive sample data pairs is much larger than the number of imbalanced category samples and their positive sample data pairs, the model should try to mine better features from multi-category sample pairs. Under this feature, the multi-category samples are dense enough to make their variance as small as possible, so as to improve the classification effect. Therefore, the present invention adopts a flag parameter f defined according to whether the anchor sample belongs to an imbalanced fault, which is used to calculate the positive sample loss L pos :

[0088] L pos =(1-f)D pos +λ pos f pos

[0089] Among them, when the anchor sample belongs to an unbalanced fault, the flag parameter f = 1, otherwise the flag parameter f = 0. pos It is a preset constant greater than 1, used to emphasize the compactness of balanced data.

[0090] For pairs of samples from different categories, the distance between samples is expected to be as large as possible. minor Expected to be greater than D neg , in order to increase the discrimination of unbalanced samples. Based on this, for the negative sample loss L neg and the few-shot loss L minor They are:

[0091] L neg =max(0,M 1 -D neg )

[0092] L minor =max(0,M 2 -D minor )*λ minor

[0093] Among them, λ minor is a preset constant greater than 1, M 1 is the expected margin between the preset anchor sample and the negative sample, M 2 is the expected margin between the preset anchor sample and the minority sample, and M 2 >M 1 . M 1 and M 2 The setting of can increase the distance between negative samples and minority samples and anchor samples, but different margins determine the distance from the anchor sample. For the minority sample part loss, the margin is larger, so the distance between the anchor sample and the minority sample is larger. At the same time, by adding a hyperparameter λ minor The model pays more attention to the data pairs of minority samples and anchor samples to alleviate the impact of imbalance.

[0094] Combining the above three parts of losses, the quadruple loss L is calculated using the following formula quadruplet :

[0095]

[0096] The classification loss is the most widely used classification loss function in deep learning because it is simple and performs excellently in many classification tasks. The classification loss L in the present invention softmax is the negative of the probability value corresponding to the true fault label among the probability values obtained by the softmax layer for the anchor sample.

[0097] The purposes of the quadruple loss and the classification loss are different. The classification loss optimizes the classification effect of the model, while the quadruple loss optimizes the data distribution in the embedding space. The fault diagnosis task ultimately focuses on the classification effect of the model. Although the tasks of the two losses are different, the quadruple loss has a positive effect on the classification loss. Since the training set is unbalanced, using only the classification loss model cannot well fit the decision boundary, and the performance on the test set will decline. However, by optimizing the representation of the training set using the quadruple loss, the distance between classes is made larger, and the data distribution of each class is made more compact, so as to better fit the decision surface. In the classification loss, the true label information of the anchor sample is utilized, and the number of different classes is explicitly considered. However, the label information does not directly appear in the quadruple loss. In addition, samples belonging to unbalanced classes will form data pairs with data of multiple other classes, thereby reducing the impact of imbalance.

[0098] Therefore, the present invention uses the following formula for the quadruple loss L quadruplet and the classification loss L softmax to be fused, while enhancing the representation ability and classification ability of the LSTM-QDM fault diagnosis model, to obtain the loss L of each quadruple time series data pair:

[0099] L = βL quadruplet + L softmax

[0100] where β is a preset weight parameter.

[0101] In the actual training process, the quadruple time series data pairs are usually input in batches. Therefore, by averaging the losses of all quadruple time series data pairs in the current batch, the loss of the current batch can be obtained, and then backpropagation is used to update the parameters of the LSTM-QDM fault diagnosis model.

[0102] S107: Fault diagnosis:

[0103] During the operation of industrial equipment, a number of pre-set measuring devices continuously measure the working signals of the industrial equipment, and the measurement obtains the current sampling moment t and the measurement data sampled at the previous L - 1 sampling moments. These constitute a time - series data sample X. t :

[0104]

[0105] Input the time - series data sample X t into the LSTM network corresponding to the anchor sample in the LSTM - QDM fault diagnosis model, and obtain the fault diagnosis result according to the probability output by the Softmax layer.

[0106] To better illustrate the technical solution and technical effect of the present invention, a specific example is used to conduct experimental verification on the present invention. In this embodiment, the bearing fault data collected by Case Western Reserve University (CWRU) is used. On the CWRU bearing experimental platform, an experiment is carried out using a motor, and vibration data is measured from the motor bearing. The main components of this experimental device include a 2 - horsepower motor, a torque sensor, and a dynamometer. The rolling bearing is tested under different loads (0, 1, and 2 HP). The fault locations are mainly ball - type defect (BD), outer - race defect (OR), and inner - race defect (IR), and the defect diameters are 0.007, 0.014, and 0.021 inches respectively. The vibration signal is collected by an acceleration sensor at a frequency of 12 kHz. It can simulate 1 normal working condition and 9 fault working conditions.

[0107] First, training data is collected. In this embodiment, the collected signal is a vibration signal, that is, the dimension M of the working signal is 1. Then, 20,000 samples at sampling moments are collected, and the imbalance degree of the fault samples is controlled by adjusting the fault duration. Then, the method in the present invention is used to construct time - series data samples and determine the sample labels. 90% of the time - series data samples are used as training samples, and the remaining 10% are used as test samples. Then, the quadruple time - series data pairs of the training samples and the quadruple time - series data pairs of the test samples are constructed respectively.

[0108] To demonstrate the technical effects of the present invention, a fault diagnosis method based on the original LSTM network (i.e., only using the anchor samples as input), a fault diagnosis method based on the LSTM network and oversampling (LSTM-Oversample), and a fault diagnosis method based on the LSTM network and generative adversarial network (LSTM-GAN) are used as comparative methods. The recall rate and average recall rate of unbalanced class faults are used as evaluation indicators to compare the fault diagnosis performance of the present invention and the three comparative methods. The larger the recall rate, the closer the predicted value and the actual value of the fault diagnosis model, and the more accurate the classification.

[0109] Table 1 is a comparison table of the fault diagnosis results of the present invention and the three comparative methods for unbalanced faults.

[0110] Fault condition LSTM LSTM - Oversample LSTM - GAN LSTM - QDM 1 92.83% 96.50% 93.10% 97.00% 2 99.10% 99.80% 99.20% 99.80% 3 11.23% 45.05% 52.72% 48.05% 4 99.58% 99.60% 99.80% 99.80% 5 90.68% 95.64% 98.55% 99.70% 6 91.94% 92.61% 94.70% 97.25% 7 53.33% 59.11% 65.20% 69.07% 8 90.94% 96.60% 98.85% 99.00% 9 90.22% 95.94% 96.00% 96.70%

[0111] Table 1

[0112] Since the higher the value of the fault recall rate, the better the detection effect of the fault. As shown in Table 1, when different faults are set as unbalanced faults, the comprehensive diagnosis ability of the present invention for unbalanced faults is better than that of the three comparative methods.

[0113] Then, when different faults are set as unbalanced faults, the faults regarded as ordinary faults are also diagnosed respectively, and then the fault recall rates of 9 times are averaged. Table 2 is a comparison table of the average fault diagnosis results of the present invention and the three comparative methods for all fault types.

[0114] Fault condition LSTM LSTM - Oversample LSTM - GAN LSTM - QDM 1 98.74% 99.12% 97.74% 97.37% 2 99.04% 99.19% 98.50% 99.74% 3 90.03% 93.97% 94.95% 94.18% 4 99.36% 98.26% 99.55% 99.70% 5 96.46% 99.02% 99.47% 98.75% 6 98.04% 98.27% 98.66% 99.04% 7 94.37% 94.60% 95.44% 95.97% 8 96.51% 99.19% 97.55% 99.61% 9 97.57% 98.09% 99.20% 98.83%

[0115] Table 2

[0116] It can be seen from Table 2 that the method of the present invention also has excellent detection effects on all faults.

[0117] Although the illustrative specific embodiments of the present invention are described above for those skilled in the art of the present technology to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art of the present technology, as long as various changes are within the spirit and scope of the present invention defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concept of the present invention are within the scope of protection.

Claims

1. An unbalanced fault diagnosis method based on LSTM-QDM, characterized in that, it includes the following steps: S1: When the industrial equipment is in different fault conditions, a number of pre-set measuring devices continuously measure the working signals of the industrial equipment. Denote the number of measurement data obtained at each sampling moment as M, and denote the working signal at the r-th sampling moment as where x rm represents the m-th measurement data in the working signal at the r-th sampling moment, m = 1, 2, …, M, r = 1, 2, …, R, and R represents the number of samplings; Mark the fault label y for the measurement data at each sampling moment according to the fault condition of the industrial equipment at that sampling moment r where y r = 1, 2, …, K, and K represents the number of fault types; Then, construct a time series data matrix of size R×M based on the working signals obtained from R samplings S2: For the time series data matrix Extract sub - matrices as time series data samples by sliding a window of length L row - by - row according to a preset step size s, and denote the number of obtained time series data samples as denotes rounding up, then the d - th time series data sample X d has the following expression: where d = 1, 2, …, D; Then mark the fault label Y of each time-series data sub-matrix d = y (d-1)s+L ; S3: Classify the D time series data samples according to the fault labels of each time series data sample to obtain a set φ of time series data samples corresponding to each type of fault k , where k = 1, 2, …, K. Then, count the number of time series data samples under each type of fault. If the number of time series data samples of a certain type of fault is less than a preset threshold, set this type of fault as an imbalanced fault; otherwise, set this type of fault as a normal fault. S4: Randomly select a time series data sample from D time series data samples as the anchor sample, and then select three other time series data samples according to the anchor sample to form a quadruple time series data pair. The specific method is as follows: When the fault type of the anchor sample is a common fault, randomly select a time series data sample with the same fault type as the anchor sample as the positive sample, randomly select a time series data sample with a different fault type from the anchor sample as the negative sample, and randomly select one from the time series data samples corresponding to the unbalanced fault as the few-shot sample to form a quadruple time series data pair; When the fault type of the anchor sample is an unbalanced fault and only one type of fault is an unbalanced fault among the fault types, randomly select a time series data sample with the same fault type as the anchor sample as the positive sample, randomly select two time series data samples with different fault types from the anchor sample as the negative sample and the few-shot sample to form a quadruple time series data pair; When the fault type of the anchor sample is an unbalanced fault and there are more than two types of unbalanced faults among the fault types, randomly select a time series data sample with the same fault type as the anchor sample as the positive sample, randomly select a time series data sample with a different fault type from the anchor sample as the negative sample, and randomly select a time series data sample of an unbalanced fault with a different fault type from the anchor sample as the few-shot sample to form a quadruple time series data pair; Repeat the operation of selecting the anchor sample and the other three time series data samples several times to obtain several quadruple time series data pairs; S5: Construct an LSTM-QDM fault diagnosis model, including 4 LSTM network branches and a Softmax layer. Each LSTM network branch includes a multi-layer LSTM network and a fully connected layer, where: The 4 LSTM network branches are respectively used to process the four time series data samples in the quadruple time series data pair, and the 4 multi-layer LSTMs in the 4 LSTM network branches share parameters, and the 4 fully connected layers share parameters. The multi-layer LSTM is used to extract the features of the time series data sample and input them into the fully connected layer, and the fully connected layer performs feature mapping on the received features and then outputs; The Softmax layer is used to receive the output features of the fully connected layer corresponding to the anchor sample, process to obtain the probability that the anchor sample belongs to each fault type, and obtain the fault diagnosis result; S6: Use each quadruple time series data pair obtained in step S4 as the input of the LSTM-QDM fault diagnosis model, and use the label of the anchor sample in the quadruple time series data pair as the expected output of the Softmax layer in the LSTM-QDM fault diagnosis model to train the LSTM-QDM fault diagnosis model; The loss function is calculated by the following method: Denote each time-series data pair of the quadruple as Pair = (x, x pos , x neg , x minor ), where x represents the anchor sample, x pos represents the positive sample, x neg represents the negative sample, x minor represents the few-shot sample. Denote the features obtained by processing each sample through the corresponding LSTM network branch as p, p pos , p neg , p minor respectively. Calculate the distances between the feature p of the anchor sample and the other several features: D pos = ||p - p pos || 2 D neg = ||p - p neg || 2 D minor = ||p - p minor || 2 Among them, |||| 2 represents the calculation of the second norm; The positive sample loss L is calculated using the following formula pos :[[]]END]] L pos = (1 - f)D pos + λ pos fD pos Among them, when the anchor sample belongs to an unbalanced fault, the flag parameter f = 1, otherwise the flag parameter f = 0; λ pos is a preset constant greater than 1; The negative sample loss L is calculated using the following formula neg :[[]] L neg = max(0, M 1 - D neg ) The few-shot loss L is calculated using the following formula minor :[[]]END]] L minor = max(0, M 2 - D minor ) * λ minor where λ minor is a preset constant greater than 1, M 1 is the expected margin between the preset anchor sample and the negative sample, M 2 is the expected margin between the preset anchor sample and the few-shot sample, and M 2 > M 1 ; The quadruple loss L is calculated using the following formula quadruplet : The negative value of the probability corresponding to the true fault label among the probability values obtained by the Softmax layer for the anchor sample is used as the class loss L softmax ; The quadruple loss L is fused using the following formula quadruplet and the classification loss L softmax to obtain the loss L for each quadruple time series data pair: L = βL quadruplet + L softmax where β is a preset weight parameter; S7: During the operation of the industrial equipment, a number of pre-set measuring devices continuously measure the working signals of the industrial equipment, and the measurement data obtained at the current sampling moment t and the previous L - 1 sampling moments are obtained j = 0, 1, …, L - 1, constituting the time-series data sample X t : Input the time series data sample X t into the LSTM network corresponding to the anchor sample in the LSTM-QDM fault diagnosis model, and obtain the fault diagnosis result according to the probability output by the Softmax layer.

Citation Information

Patent Citations

  • NLP-based electronic medical record data quality management method

    CN108447534A

  • Fault diagnosis method based on Stacked LSTM

    CN111273623A