Small sample fault diagnosis method based on twin neural network
By adopting a small sample fault diagnosis method based on twin neural networks in industrial equipment, combining traditional statistical features and deep learning features, a new feature extraction model is built, which solves the key problems of small sample fault diagnosis, and achieves a high accuracy and strong interpretability fault diagnosis effect.
Patent Information
- Application Number
- CN202411668833.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-28
AI Technical Summary
In industrial equipment, there is less fault data, which makes small sample fault diagnosis a key problem. The existing technologies such as transfer learning and data generation methods have limitations, making it difficult to effectively solve fault diagnosis under small sample conditions.
A small sample fault diagnosis method based on twin neural networks is adopted, combined with traditional statistical features and deep learning features, a new feature extraction model is built, and the similarity of sample pairs is learned through twin neural networks to improve the diagnostic accuracy.
Effectively expand the sample size, improve the accuracy of fault diagnosis, provide more explanatory feature information, and avoid the problem of weak overfitting and generalization capabilities of deep learning models.
Smart Images

Figure CN119537919A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of hydraulic system fault diagnosis, and in particular to a small sample fault diagnosis method based on a twin neural network. Background Art
[0002] Fault diagnosis plays an increasingly important role in the health management of industrial equipment. Being able to identify the fault status of the system in a timely and accurate manner helps reduce operating costs, prevent accidents, and enhance the stability and reliability of the system. Therefore, the problem of fault diagnosis has always received widespread attention from industry experts and engineers. However, in actual application scenarios, industrial equipment usually operates under normal conditions, and there is less fault data available for collection. It is costly to collect exactly the same fault data in the laboratory, and the fault data obtained by computer simulation has low practicality, which makes it very difficult to build a training data set containing a large amount of labeled data. Therefore, in actual industrial environments, fault diagnosis is a typical small sample problem, so solving fault diagnosis under small sample conditions has become a key issue in this field.
[0003] In response to the small sample problem, some scholars consider using transfer learning to assist target domain data in diagnostic training through source domain data. Although the transfer learning method has achieved good results, transfer learning requires source domain data similar to the target domain to assist in building the model. The selection of source domain data will greatly affect the final diagnostic effect, but it is difficult to obtain sufficiently similar source domain data in practical applications. In addition to transfer learning, strategies based on data generation are usually used to deal with small sample problems. This method mainly includes generative adversarial networks and oversampling technology. These two methods do not require auxiliary data and solve the small sample problem through data generation. However, data generation technology may result in poor data quality, which has limited impact on the performance improvement of diagnostic models and may have a negative impact.
[0004] Siamese Neural Network (SNN) is a special neural network that has two sub-networks with the same structure and shared weights. With this special structure, the Siamese Neural Network can learn the deep features of the input data, so that the distance between different samples in the feature space can accurately reflect their similarities. At the same time, SNN is trained by comparing the similarity of sample pairs, which enables SNN to learn effective feature representation even with a small number of samples.
[0005] The twin neural network has a strong feature mining capability, can build a more accurate diagnosis model, and can effectively avoid the limitations of transfer learning and data expansion methods. Therefore, it is necessary to study the selection of twin neural networks based on feature learning strategies to solve fault diagnosis problems under small sample conditions. Summary of the invention
[0006] The technical problem to be solved by the present invention is to provide a small sample fault diagnosis method based on twin neural networks in response to the above-mentioned problems. A new feature extraction model is constructed by combining traditional statistical features with deep learning features based on SNN sub-models to improve the accuracy of diagnosis.
[0007] The embodiment of the present application is implemented as follows:
[0008] The embodiment of the present application provides a small sample fault diagnosis method based on a twin neural network, characterized in that it includes the following steps:
[0009] Step a, statistical feature extraction: extract statistical features from the selected sensor data, and normalize the extracted statistical features;
[0010] Step b, dividing sample pairs: the statistical features after normalization in step a are divided into positive and negative sample pairs according to whether the original labels are the same. If the original labels are the same, they are positive sample pairs; if the original labels are different, they are negative sample pairs. These sample pairs serve as the input of the twin neural network in the next step;
[0011] Step c, twin neural network model training: combine the processed statistical feature data into pairs of samples to train the twin neural network model. The label S of the sample i,j Represents the similarity between sample i and sample j. If two samples belong to the same class, then S i,j =1, otherwise S i,j =0;
[0012] Step d, constructing a classifier: constructing a classifier using the features extracted by the feature extractor trained in step c, and training using the mapping relationship from features to state categories, combining the trained classifier and feature extractor to obtain the final fault diagnosis model.
[0013] In some optional embodiments, the statistical features described in step a include: mean, standard deviation, peak value, maximum or minimum value, median value, and variance.
[0014] In some optional embodiments, step b includes the following:
[0015] In order to eliminate the dimensional differences between different features, the extracted statistical features need to be standardized. The Z-score standardization method is used to convert the original data into a standard normal distribution with a mean of 0 and a standard deviation of 1. The Z-score standardization calculation formula is as follows:
[0016]
[0017]
[0018] Where: X i is the original data, μ is the mean, σ is the standard deviation, Z i The data are processed by standardization.
[0019] In some optional embodiments, step d includes the following:
[0020] According to the extracted features, a multi-layer perceptron network model classifier is used to identify the target. The basic unit of the multi-layer perceptron is a neuron, and its mathematical expression is as follows:
[0021] Z=∑W i X i +b
[0022] Where: W i Represents input X i The corresponding weight coefficient, b is the bias term;
[0023] The multi-layer perceptron network model classifier learns the appropriate parameter weights and bias terms from the input data through neurons, and uses the activation function to convert the linear relationship into a nonlinear signal. The activation function is the Relu activation function, and the calculation formula is as follows:
[0024]
[0025] The training of the multi-layer perceptron network model classifier involves two stages: forward propagation and back propagation. Forward propagation calculates the output value from the input layer to the output layer, while back propagation reduces the error between the predicted label and the true label by adjusting the weight W and bias b. The training process is iterative until the preset number of training rounds is met or convergence is reached.
[0026] In some optional implementation schemes, the evaluation criteria for fault diagnosis in step d include: accuracy, precision, recall and F1 score.
[0027] In some optional implementation schemes, the calculation formula of the accuracy is as follows:
[0028]
[0029] Among them: TP is the number of correct classifications in the presence of faults, TN is the number of correct classifications in the absence of faults, FP is the number of wrong classifications in the presence of faults, and FN is the number of wrong classifications in the absence of faults for a specific classification model.
[0030] In some optional implementation schemes, the calculation formula of the precision is as follows:
[0031]
[0032] In some optional implementation schemes, the calculation formula of the recall rate is as follows:
[0033]
[0034] In some optional implementation schemes, the calculation formula of the F1 score F1-score is as follows:
[0035]
[0036] A storage medium storing a computer program, characterized in that:
[0037] When the computer program is executed, it is used to implement the small sample fault diagnosis method based on twin neural network as described in any one of claims 1 to 9.
[0038] The beneficial effects of the present invention are: 1. It provides a small sample fault diagnosis method based on twin neural networks. The twin neural networks can effectively expand the number of samples, and utilize the powerful feature extraction and information mining capabilities of SNN. A method combining traditional statistical features with deep learning features based on SNN sub-models is adopted to construct a new feature extraction model, thereby improving the accuracy of diagnosis; 2. By extracting the statistical features of sensor data, and then inputting the statistical features into the deep learning neural network to extract feature vectors, the finally extracted features are used in the classifier for fault diagnosis. Compared with directly using deep learning neural networks to extract features for fault diagnosis, the features extracted by deep learning neural networks are usually more abstract and lack intuitive interpretation; while statistical features can generally reflect the overall distribution and characteristics of the data, help understand the laws and features in the data, and by extracting statistical features, more explanatory information can be provided for subsequent fault diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 This is a structural diagram of a fault diagnosis model according to an embodiment of the present application;
[0041] Figure 2This is a structural diagram of a twin neural network according to an embodiment of the present application;
[0042] Figure 3 This is a diagram of the multi-layer perceptron network structure of an embodiment of the present application. DETAILED DESCRIPTION
[0043] 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, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0044] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0045] The features and performance of the present application are further described in detail below in conjunction with the embodiments.
[0046] The present invention adopts a method based on feature extraction and uses a deep learning network to construct a feature extractor. It can learn key features related to faults under small sample conditions to improve the model's diagnostic ability. However, commonly used deep learning classification algorithms can lead to problems such as model overfitting or weak generalization ability, which leads to a decrease in diagnostic accuracy. Moreover, the features extracted by deep learning networks are usually relatively abstract and have poor interpretability. Therefore, the present invention adopts a method of combining traditional statistical features with deep learning features based on SNN sub-models to construct a new feature extraction model, thereby improving the accuracy of diagnosis. The method flow is as follows: Figure 1 shown.
[0047] The key steps include:
[0048] S1. Statistical feature extraction:
[0049] Statistical features are extracted from the selected sensor data, and the extracted statistical features are normalized.
[0050] S2, divide the sample pairs:
[0051] The statistical features after normalization in step S1 are divided into positive and negative sample pairs according to whether the original labels are the same. If the original labels are the same, they are positive sample pairs, and if the original labels are different, they are negative sample pairs. These sample pairs serve as the input of the twin neural network in the next step.
[0052] S3, SNN training:
[0053] The processed statistical feature data are combined into paired samples to train SNN. The label S of the sample i.j Represents the similarity between sample i and sample j. If two samples belong to the same class, then S i.j =1, otherwise S i.j =0.
[0054] S4. Build a classifier:
[0055] The classifier is constructed using the features extracted by the feature extractor trained in step S3, and is trained using the mapping relationship from features to state categories.
[0056] 1. Statistical feature extraction and data processing:
[0057] In small sample fault diagnosis tasks, statistical feature extraction is an effective method that can capture key information in the data and provide strong support for the subsequent training of deep learning models. Statistical feature extraction mainly extracts key statistics that can reflect the system status by performing statistical analysis on sensor data.
[0058] Example 1
[0059] In this embodiment, seven common statistical features of sensor data are extracted:
[0060] (1) Mean: reflects the average level of data. For parameters such as pressure and flow collected by sensors, changes in the mean can reflect the working status of the system.
[0061] (2) Standard deviation: It measures the degree of dispersion of data. The change of standard deviation can reveal the fluctuation of system parameters.
[0062] (3) Peak: reflects the sharpness of data distribution and helps identify abnormal peaks or valleys in the system;
[0063] (4) Maximum / minimum value: directly reflects the range of parameter variation and is very useful for detecting the extreme state of the system;
[0064] (5) Median value: The median value of sensor data can reflect the general level or typical state of system parameters.
[0065] (6) Variance: The variance of sensor data can reveal the fluctuation or stability of system parameters.
[0066] In order to eliminate the dimensional differences between different features, it is often necessary to standardize the extracted statistical features. The Z-score standard is a commonly used standardization method that can convert the original data into a standard normal distribution with a mean of 0 and a standard deviation of 1. This standardization method not only simplifies the data analysis process, but also helps to improve the performance and stability of machine learning algorithms. The Z-score standardization calculation formula is shown in (1):
[0067]
[0068] Where: X i is the original data, μ is the mean, σ is the standard deviation, Z i The data are processed by standardization.
[0069] 2. Construction of twin neural network:
[0070] In this embodiment, a twin neural network sub-model based on Transformer and sparse self-attention mechanism is proposed. The sub-model structure is shown in Figure 2 . This sub-model aims to improve the performance of the twin neural network by leveraging the powerful feature extraction capabilities of the Transformer and the efficient computational efficiency of the sparse self-attention mechanism. Specifically, our sub-model first encodes the input data through the Transformer structure. Through methods such as self-attention mechanism and position encoding, the Transformer is able to capture long-term dependencies and sequence information in the input data, thereby generating more representative feature representations. Subsequently, a sparse self-attention mechanism is introduced on the output of the Transformer, which limits the calculation scope of the attention weights, so that the model can still maintain high performance while reducing computational complexity and memory consumption.
[0071] In order to make full use of the information in the data and improve the accuracy and efficiency of fault diagnosis, we first need to extract statistical features from the sensor data and normalize it. Then, the positive and negative sample pairs are divided according to whether the label information of the samples is the same. If the labels of the two samples are the same, they constitute a positive sample pair; if the labels of the two samples are different, they constitute a negative sample pair, which is used as the input of the twin neural network. Finally, the sample pairs are input into the two sub-models of the SNN that share weights, and the model is trained to extract the deep learning feature vectors respectively.
[0072] 3. Classifier Design:
[0073] According to the extracted features, the corresponding classifier is designed to identify the target. Classifier or model training is a supervised learning process, that is, a set of training data sets with known labels is used to optimize and adjust the parameters of the model until the model reaches a satisfactory performance level on the training data set, and then the test samples are input into the trained model or classifier for category classification. Commonly used classification algorithms include: support vector machine classifier, Bayesian classifier, multi-layer perceptron classifier, etc.
[0074] The Multi-Layer Perceptron (MLP) network model is a neural network with many hidden layers. Compared with shallow neural networks, the multi-layer perceptron has more network parameters, can better solve the local optimal problem, and better obtain more important information from massive data. In view of the problem of small number of fault diagnosis samples, traditional machine learning methods will find it difficult to fully train the model due to insufficient data. The MLP classifier, due to its powerful feature extraction ability and controllable generalization ability, can improve the accuracy of fault diagnosis with limited data. The basic multi-layer perceptron network structure is as follows: Figure 3 As shown in the figure, the first layer is the input layer, the middle two layers are hidden layers, the layers are fully connected, and the last layer is the output layer. The basic unit of the multilayer perceptron is the neuron, and its mathematical expression is shown in (2):
[0075]
[0076] Where: W i Represents input X i The corresponding weight coefficient, b is the bias term.
[0077] The multilayer perceptron learns appropriate parameter weights and bias terms from input data through neurons, and uses activation functions to transform linear relationships into nonlinear signals. The activation function used by the classifier of this model is the Relu activation function, and the calculation formula is shown in (3):
[0078]
[0079] The training of multilayer perceptron involves two stages: forward propagation and back propagation. Forward propagation calculates the output value from the input layer to the output layer, while back propagation reduces the error between the predicted label and the true label by adjusting the weight W and bias b. The training process is iterative until the preset number of training rounds is met or convergence is reached. After training, the multilayer perceptron can be used for classification tasks to predict the data category through forward propagation. The deep learning features after secondary feature extraction of the SNN sub-model are used as input and the corresponding fault simulation is used as output to train the classifier. The trained classifier and feature extractor are combined to obtain the final fault diagnosis model.
[0080] Example 2
[0081] A hydraulic system data set is used as an example for verification. The hydraulic test system consists of two hydraulic circuits. The upper circuit is the primary working circuit, and the lower circuit is the secondary cooling-filtration circuit. The two circuits are connected by an oil tank. By adjusting the proportional control valve to generate data of various load levels and test conditions, each operation cycle of the test system is 60 seconds, and a total of 2205 instances are tested. The sensors used in the test system are summarized in Table 1. The first column is the abbreviation code corresponding to the sensor. The last three sensors in the table (CE, CP, and SE) are virtual sensors, and the other sensors correspond to physical sensors in the hydraulic circuit. The second column is the physical quantity measured by the sensor, among which PS1-PS6 are pressure sensors, FS1 and FS2 are flow sensors, TS1-TS5 are temperature sensors, EPS1 is a motor power sensor, and VS1 is a vibration sensor. CE and CP represent sensors that record cooling efficiency and cooling power, respectively, and SE represents a sensor that records system efficiency. The third column represents the unit of the physical quantity measured by the sensor, and the last column represents the sampling frequency of the sensor, ranging from 100Hz to 1Hz. The dataset also contains descriptions of the fault states of the four main hydraulic components: hydraulic accumulator, cooler, internal pump leakage, and valve. See Table 2 for detailed information.
[0082] Table 1 Summary of hydraulic circuit sensors
[0083]
[0084] Table 2 Hydraulic component information
[0085]
[0086] The data set contains data from a total of 17 sensors, including 14 physical sensors and 3 virtual sensors. In the present invention, only real physical sensors are used (CE, CP, SE are not used). The pressure sensor S4 contains too many 0 values, so the pressure sensor S4 data is not used. In fact, only 13 sensor data are used. That is, five pressure sensors (PS1, PS2, PS3, PS5, PS6), one motor power sensor (EPS1), two flow sensors (FS1 and FS2), four temperature sensors (TS1-TS4) and one vibration sensor (VS1).
[0087] Each instance contains a large number of attributes. At this time, the data combination of sensors with different sampling frequencies is (100Hz×6 sensors)+(10Hz×2 sensors)+(1Hz×5 sensors)]×60S / instance=37500 attributes / instance. Since each instance contains a large amount of attribute data, it is very time-consuming and laborious for deep learning methods to process such a large amount of data. At the same time, the sensor data values are time series, and these values usually fluctuate around the average value in every second. Therefore, instead of directly using the instance of the data set as input, each sensor data is first segmented, and then the 13 sensor data are converted into seven standard statistics. The extracted statistical features are imported into the sub-model feature extractor of SNN for deep learning feature extraction, and then the classifier is used to map fault features and sample labels to achieve the purpose of fault diagnosis.
[0088] The evaluation indicators used in the present invention are accuracy, precision, recall and F1-score, and the relevant calculation formulas are shown in (4), (5), (6) and (7) respectively.
[0089]
[0090] Among them, TP is the number of correct classifications in the presence of faults, TN is the number of correct classifications in the absence of faults, FP is the number of incorrect classifications in the presence of faults, and FN is the number of incorrect classifications in the absence of faults for a specific classification model.
[0091] In order to verify the advantages of the constructed model under small sample conditions, considering that the sample size of the original hydraulic system data set is relatively abundant, the present invention adopts a strategic sampling method to select a limited number of samples from the data set to simulate a small sample scenario, thereby evaluating and verifying the performance of the model. By using the random module in Python to randomly extract 20%, 40%, 60% of the data and 100% of the data for experiments, and then extract 80% of the data for model training, the remaining 20% of the data for testing, and calculate the accuracy, recall rate, F1 score and precision of the fault diagnosis of the four hydraulic components under different data conditions according to the test results, which are used as evaluation indicators. The relevant experimental results are shown in Table 3. It can be seen from the experiment that under all sample conditions, the four evaluation indicators of the four hydraulic components basically reach about 0.95.
[0092] Table 3 100% experimental results
[0093]
[0094] Tables 4 to 6 show the corresponding accuracy, recall, F1 score and precision of the fault diagnosis of the four hydraulic components when 60%, 40% and 20% of the data are extracted. The experiment shows that as the number of samples decreases, the diagnostic accuracy of the four hydraulic components decreases, but it can still reach about 0.92 in the end, and the other three indicators can still reach about 0.93.
[0095] Table 4 Experimental results under 60% data condition
[0096]
[0097]
[0098] Table 5 Experimental results under 40% data condition
[0099]
[0100] Table 6 Experimental results under 20% data condition
[0101]
[0102] In order to solve the problem that it is difficult to obtain fault data in industrial scenarios, which leads to difficulties in training deep learning models, this paper proposes a new fault diagnosis method based on twin neural networks. To verify the performance advantages of this model, we conducted relevant experiments on the UCI hydraulic system public dataset. The experimental results show that even when only 20% of the original dataset is extracted as samples for small sample simulation experiments, the various evaluation indicators of the model can still be maintained above 0.91, proving that this model has certain advantages in fault diagnosis problems under small sample conditions.
Claims
1. A small sample fault diagnosis method based on twin neural network, characterized in that: The steps include: Step a, statistical feature extraction: extract statistical features from the selected sensor data, and normalize the extracted statistical features; Step b, dividing sample pairs: the statistical features after normalization in step a are divided into positive and negative sample pairs according to whether the original labels are the same. If the original labels are the same, they are positive sample pairs; if the original labels are different, they are negative sample pairs. These sample pairs serve as the input of the twin neural network in the next step; Step c, twin neural network model training: combine the processed statistical feature data into pairs of samples to train the twin neural network model. The label S of the sample i,j Represents the similarity between sample i and sample j. If two samples belong to the same class, then S i,j =1, otherwise S i,j =0; Step d, constructing a classifier: constructing a classifier using the features extracted by the feature extractor trained in step c, and training using the mapping relationship from features to state categories, combining the trained classifier and feature extractor to obtain the final fault diagnosis model.
2. The small sample fault diagnosis method based on twin neural network according to claim 1 is characterized in that: The statistical features described in step a include: mean, standard deviation, peak value, maximum or minimum value, median value, and variance.
3. The small sample fault diagnosis method based on twin neural network according to claim 1 or 2, characterized in that: Step b includes the following: In order to eliminate the dimensional differences between different features, the extracted statistical features need to be standardized. The Z-score standardization method is used to convert the original data into a standard normal distribution with a mean of 0 and a standard deviation of 1. The Z-score standardization calculation formula is as follows: Where: X i is the original data, μ is the mean, σ is the standard deviation, Z i The data are processed by standardization.
4. The small sample fault diagnosis method based on twin neural network according to claim 3 is characterized in that: Step d includes the following: According to the extracted features, a multi-layer perceptron network model classifier is used to identify the target. The basic unit of the multi-layer perceptron is a neuron, and its mathematical expression is as follows: Z=∑W i X i +b Where: W i Represents input X i The corresponding weight coefficient, b is the bias term; The multi-layer perceptron network model classifier learns the appropriate parameter weights and bias terms from the input data through neurons, and uses the activation function to convert the linear relationship into a nonlinear signal. The activation function is the Relu activation function, and the calculation formula is as follows: The training of the multi-layer perceptron network model classifier involves two stages: forward propagation and back propagation. Forward propagation calculates the output value from the input layer to the output layer, while back propagation reduces the error between the predicted label and the true label by adjusting the weight W and bias b. The training process is iterative until the preset number of training rounds is met or convergence is reached.
5. The small sample fault diagnosis method based on twin neural network according to claim 1 is characterized in that: The evaluation criteria for fault diagnosis in step d include: accuracy, precision, recall and F1 score.
6. The small sample fault diagnosis method based on twin neural network according to claim 5 is characterized in that: The calculation formula of the accuracy is as follows: Among them: TP is the number of correct classifications in the presence of faults, TN is the number of correct classifications in the absence of faults, FP is the number of wrong classifications in the presence of faults, and FN is the number of wrong classifications in the absence of faults for a specific classification model.
7. The small sample fault diagnosis method based on twin neural network according to claim 6 is characterized in that: The calculation formula of the precision is as follows:
8. The small sample fault diagnosis method based on twin neural network according to claim 7 is characterized in that: The calculation formula of the recall rate recall is as follows:
9. The small sample fault diagnosis method based on twin neural network according to claim 8 is characterized in that: The calculation formula of the F1 score F1-score is as follows:
10. A storage medium storing a computer program, characterized in that: When the computer program is executed, it is used to implement the small sample fault diagnosis method based on twin neural network as described in any one of claims 1 to 9.