Small sample cross-operating condition fault diagnosis method and system based on improved twin capsule network
Through the twin multi-scale attention wavelet capsule network, the accuracy problem in small sample and cross-operating condition fault diagnosis of rotating machinery is solved, and efficient fault identification and diagnosis is achieved.
Patent Information
- Application Number
- CN202410301194.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-15
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-03-15
AI Technical Summary
Existing technologies face small sample and cross-operating condition problems in rotating machinery fault diagnosis, and it is difficult to effectively solve the poor diagnostic accuracy caused by rare faults and changes in operating conditions.
A twin multi-scale attention wavelet capsule network is adopted. By combining the multi-scale attention wavelet input feature extraction module and the capsule network module, a twin network structure is constructed to perform fault feature extraction and similarity judgment, thereby realizing small sample cross-working condition fault diagnosis.
The accuracy and robustness of rotating machinery fault diagnosis are improved, and it can maintain efficient diagnostic performance and good generalization ability under limited samples and changing working conditions.
Smart Images

Figure CN118245798B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of small-sample mechanical fault diagnosis, and in particular to a small-sample cross-operating-condition fault diagnosis method and system based on an improved twin capsule network. Background Art
[0002] Rotating machinery, such as bearings, gears, motors, and pumps, is one of the most common equipment in industrial production and plays a vital role in fields such as machinery manufacturing, aerospace, rail transportation, automobile production, and water conservancy and hydropower. With the rapid development of modern industrial technology, rotating machinery has become larger, more complex, and more high-performance. During the manufacturing process, since rotating machinery is often affected by a variety of complex factors during operation, failures are often inevitable. Therefore, developing an accurate and efficient fault diagnosis method is of great practical significance and practical need for preventing failures in advance, reducing downtime, and lowering maintenance costs.
[0003] In recent years, rotating machinery fault diagnosis methods based on deep learning have developed rapidly. Because they can automatically learn complex feature representations from large amounts of equipment operating data and subsequently identify various fault modes, they no longer rely on expert knowledge or dynamic models. Therefore, they have been widely used in various rotating machinery fault diagnosis tasks. Deep learning-based fault diagnosis research typically involves a variety of deep learning models, such as convolutional neural networks (CNNs), recurrent neural networks (RNNs), deep belief networks (DBNs), and autoencoders. These models can process a wide variety of data forms, including time series vibration signal data, spectrum data, and image data, which are most commonly used in the field of fault diagnosis.
[0004] Deep learning-based fault diagnosis methods often require a large amount of high-quality labeled data to train deep learning models to achieve good fault diagnosis performance. However, in actual industrial production scenarios, they often face the following challenges: (1) In some industrial equipment, rare faults may occur. Since the equipment is in a stable operating state for a long time, the probability of these faults occurring is very small, making it difficult to collect a sufficient number of samples to support the training of traditional deep learning models; (2) In some industrial fields, such as aircraft engines and nuclear power plant water pumps, due to the high complexity and high risk of the equipment, it is difficult to obtain sufficient high-quality labeled data for fault diagnosis research; (3) In actual industrial production scenarios, there are constantly changing working conditions and many different equipment. The characteristic frequency and amplitude information of key components of the equipment, such as gears, bearings, and shafts, will change. The training set data used to train the deep learning model and the test set data used in the actual deployment process often have large data distribution differences. Therefore, it is difficult to achieve good cross-domain diagnosis performance using traditional deep learning models.
[0005] In order to solve the above-mentioned problems of difficulty in obtaining fault data and poor fault diagnosis effects under different working conditions, some deep learning fault diagnosis methods for solving small sample problems and cross-working condition problems have been proposed. Among them, methods based on meta-transfer learning have become a research hotspot in recent times. The Chinese patent "A method and system for small sample fault diagnosis of bearings based on meta-transfer learning" (application date: 2023.02.16; application number: 202310121756.0; application publication date: 2023.07.21; application publication number: CN 116465630 A) discloses a small sample fault diagnosis method for bearings based on meta-transfer learning. This method is a small sample bearing fault diagnosis method and system, which collects vibration signals, converts them into feature images, and uses meta-transfer learning to train and optimize the deep learning model to achieve efficient small sample fault diagnosis. While meta-transfer learning has shown promise in small-sample fault diagnosis scenarios, finding target domain data that is highly similar to the source domain training set is challenging. Furthermore, selecting appropriate meta-tasks and adjusting parameters during meta-transfer learning are complex, all of which can impact the performance of fault diagnosis models. Therefore, it is crucial to find an effective method that simultaneously addresses both the small sample size and cross-operational challenges faced in fault diagnosis, thereby improving the generalization and reliability of fault diagnosis methods. Summary of the Invention
[0006] The purpose of the present invention is to overcome the shortcomings and deficiencies of the existing technology and provide a small-sample cross-operating-condition fault diagnosis method based on an improved twin capsule network. This method can effectively improve the diagnostic accuracy of deep learning models in small-sample fault diagnosis and cross-operating-condition fault diagnosis of rotating machinery, and effectively improve the intelligent fault diagnosis tasks in small-sample variable-operating-condition scenarios.
[0007] In order to achieve the purpose of the present invention, the present invention provides a rotating machinery fault diagnosis method based on a twin multi-scale attention wavelet capsule network, the steps of which are as follows:
[0008] Step 1: Fault data collection and calibration: Use a vibration acceleration sensor to collect vibration acceleration signals of rotating machinery under different experimental conditions and set category labels. From the acquired vibration acceleration signals, use sliding window technology to intercept data segments of a certain length to form samples;
[0009] Step 2: Construct a source domain training sample pair dataset: Select a dataset of a certain working condition as the source domain dataset, and randomly extract two samples from the source domain dataset to form a sample pair. Sample pairs consisting of samples from the same fault category are called positive sample pairs, and sample pairs consisting of samples from different fault categories are called negative sample pairs. All positive and negative sample pairs constitute the source domain training sample pair dataset;
[0010] Step 3: Construct the target domain support sample set and test sample set that meet the n-shot test: select a working condition dataset other than the source domain dataset working condition as the target domain dataset, and divide the target domain dataset into a support sample set consisting of n labeled samples of each class and a test sample set consisting of the remaining unlabeled samples;
[0011] Step 4. Construct a feature extractor: The feature extractor is used to extract features from the original fault vibration signal, including two branch feature extractors connected in parallel. Each branch feature extractor includes a multi-scale attention wavelet input feature extraction module and a capsule network module connected in series. The multi-scale attention wavelet input feature extraction module is used to extract features of different scales from the original vibration signal by using multiple wavelet convolution layers with the same wavelet kernel function but different kernel sizes or multiple wavelet convolution layers with different wavelet kernel functions to extract more useful information. The capsule network module is used to further extract the features extracted by the multi-scale attention wavelet input feature extraction module to obtain finer-grained features.
[0012] Step 5: Build a metric learner: The metric learner is used to calculate the distance between feature vectors in the feature space and determine the similarity between sample pairs.
[0013] Step 6: Construct a twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model: Combine the feature extractor constructed in step 4 and the metric learner constructed in step 5 to form a rotating machinery fault diagnosis model that can complete small sample and cross-operating condition cases;
[0014] Step 7: Model training: The sample pairs in the source domain training sample pair dataset constructed in step 2 are input into the small sample cross-operating condition fault diagnosis model constructed in step 6 in batches to train the model's feature extractor and metric learner.
[0015] Step 8, model testing: Pair the samples in the test sample set constructed in step 3 with the samples in the support sample set, and input them in batches into the small sample cross-operating condition fault diagnosis model that has been trained in step 7 for diagnosis, to obtain the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
[0016] Finally, the trained small sample cross-operating condition fault diagnosis model can be used for fault diagnosis.
[0017] Furthermore, in step 1, the different operating condition data for the rotating machinery refers to 1) vibration signals at different speeds under the same load and 2) vibration signals at different loads under the same speed, ensuring that raw vibration signal data covering various conditions is obtained. After collecting the raw vibration signals under each operating condition, a sliding window technique is used to intercept data segments of a specific length as samples, so that all samples under the same operating condition constitute the data set for that condition. When intercepting the samples, ensure that the sample data points do not overlap.
[0018] Furthermore, in step 2, a dataset of specific working conditions is selected as the source domain dataset, ensuring that each sample has a fault category label and controlling the number of samples for each fault category, such as no more than 20 labeled samples per category. Two samples are randomly selected from the source domain dataset to form a sample pair. Sample pairs from the same fault category are defined as positive sample pairs and assigned a label of "1"; sample pairs from different fault categories are defined as negative sample pairs and assigned a label of "0". Ensure that the number of positive and negative sample pairs is equal, where the number of positive sample pairs does not exceed the maximum number of all possible non-repeated sample pairs in the same fault category. All positive and negative sample pairs together constitute the source domain training sample pair dataset.
[0019] Furthermore, in step 3, different operating conditions are selected, including those with different loads at the same speed and those with different speeds at the same load. Based on the specific requirements of n-shot testing, the target domain dataset is divided into two parts: a support sample set, consisting of a specified number n of labeled sample groups for each fault category, used to identify the target domain fault category; and a test sample set, consisting of the remaining unlabeled samples in the target domain dataset excluding the support sample set, used to test the model's diagnostic performance in the target domain.
[0020] Furthermore, in step 4, by constructing a multi-scale attention wavelet input feature extraction module, using wavelet convolution kernels of different sizes or using different wavelet kernel functions to extract features, and using the improved pyramid attention weighting module to weight the importance of the extracted features, the expressive power of the features is optimized. This module includes a series of wavelet convolution modules, each of which includes a wavelet convolution layer, a one-dimensional BatchChannelNormalization layer, a ReLU layer, and a one-dimensional MaxPool layer. The improved pyramid attention weighting module weights the features through the CBAM attention weight module and the Softmax function, so that different features are appropriately amplified according to their importance in the whole. Its main workflow is to extract the features from different wavelet convolution modules. They are sent to the CBAM attention weight module respectively to obtain the corresponding CBAM attention weights Then, these weights are concatenated and fed into the Softmax function module to calculate the proportion of each feature weight in all feature weights W. i , get the importance of the features extracted by different wavelet convolution modules among all features; And the corresponding W i Multiply to get weighted features And spliced along the channel direction to obtain a multi-scale attention wavelet feature.
[0021] Furthermore, in step 4, the capsule network module is composed of three convolution modules with convolution kernels of different sizes, a one-dimensional capsule network module, and an expansion layer connected in series. The convolution module contains a one-dimensional convolution layer, a one-dimensional BatchChannelNormal layer, and a ReLU layer. The one-dimensional capsule network module is composed of two one-dimensional capsule networks with shared weights connected in series. The multi-scale attention wavelet input feature extraction module is connected in series with the capsule network module to form a branch feature extractor of the model. In order to construct the twin network structure, the branch feature extractor is copied to obtain two branches with the same structure and shared weights, and they are connected in parallel to complete the construction of the twin multi-scale attention wavelet capsule network feature extractor. This step realizes efficient feature extraction of the original fault vibration signal, providing strong support for subsequent fault diagnosis and analysis.
[0022] Furthermore, in step 5, a metric learner combining a fully connected network and a dropout layer is constructed to calculate the distance between feature vectors and determine the similarity of sample pairs. This metric learner primarily consists of two fully connected modules, with a dropout layer located between them. The first fully connected module consists of a fully connected layer followed by a Reluctant Unit (ReLU) activation layer, performing a preliminary nonlinear transformation and activation on the input feature vector. The introduction of a dropout layer enhances the learner's generalization ability and effectively reduces the risk of overfitting. The second fully connected module, consisting of only a single fully connected layer, further transforms the feature vector for the final similarity calculation.
[0023] Furthermore, in step 6, the twin multi-scale attention wavelet capsule network feature extractor and the metric learner are combined to form an efficient small-sample cross-operating-condition fault diagnosis model. This model, by cascading the feature extractor developed in step 4 and the metric learner designed in step 5, achieves deep learning and precise measurement of rotating machinery fault characteristics. The feature extractor extracts key information from the raw fault vibration signal, and the metric learner accurately calculates the similarity between feature vectors, thereby enabling small-sample cross-operating-condition fault diagnosis.
[0024] Furthermore, in step 7, the twin multi-scale attention wavelet capsule network small-sample cross-condition fault diagnosis model is trained using the Mini-Batch learning method. Training is performed using a source domain training sample pair dataset, with the sample pair size per batch set to 32. During training, a contrastive loss function is used to optimize the model, along with the Adadelta optimizer with a learning rate of 0.0003. The entire training process is scheduled to last 50 epochs, stopping after reaching the specified training cycle, to complete model training and optimize its performance.
[0025] Furthermore, in step 8, the samples in the test sample set constructed in step 3 are paired with the samples in the support sample set to form test sample pairs. Subsequently, these test sample pairs are input in batches into the twin multi-scale attention wavelet capsule network fault diagnosis model trained and optimized in step 7 for processing. During the model testing process, the distance between the two samples in each test sample pair in the feature space is calculated to evaluate the similarity of the sample pairs. The model identifies the sample pair with the smallest feature space distance and determines the fault category label of the support sample of the most similar sample pair as the predicted label of the test sample, thereby realizing the diagnosis of rotating machinery faults in the test sample set, thereby verifying the diagnostic performance and accuracy of the model under small sample cross-operating conditions.
[0026] The present invention also provides a small sample cross-operating condition fault diagnosis system based on an improved twin capsule network, which is used to implement the above method. The system includes the following modules:
[0027] A signal acquisition module is used to acquire vibration acceleration signals of rotating machinery under different experimental conditions, set category labels, and construct samples based on the vibration acceleration signals;
[0028] The dataset construction module is used to select a dataset of a certain working condition as the source domain dataset and randomly extract two samples from the source domain dataset to form a sample pair. The sample pairs composed of samples from the same fault category are called positive sample pairs, and the sample pairs composed of samples from different fault categories are called negative sample pairs. All positive and negative sample pairs constitute the source domain training sample pair dataset, and a working condition dataset other than the source domain dataset working condition is selected as the target domain dataset. The target domain dataset is divided into a support sample set consisting of n labeled samples of each category and a test sample set consisting of the remaining unlabeled samples;
[0029] A feature extractor construction module is used to construct a feature extractor. The feature extractor is used to extract features from the original fault vibration signal. The feature extractor includes two branch feature extractors connected in parallel. Each branch feature extractor includes a multi-scale attention wavelet input feature extraction module and a capsule network module connected in series. The multi-scale attention wavelet input feature extraction module is used to extract features of different scales from the original vibration signal by using multiple wavelet convolution layers with the same wavelet kernel function but different kernel sizes or multiple wavelet convolution layers with different wavelet kernel functions to extract more useful information. The capsule network module is used to further extract the features extracted by the multi-scale attention wavelet input feature extraction module to obtain more fine-grained features.
[0030] The metric learner building module is used to build a metric learner to calculate the distance between feature vectors in the feature space and determine the similarity of sample pairs;
[0031] A module construction module is used to construct a twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model, combining the feature extractor constructed in the above and the metric learner to form a rotating machinery fault diagnosis model for completing small sample and cross-operating condition situations;
[0032] A model training module is used to input the sample pairs in the constructed source domain training sample pair dataset into the twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model in batches to train the feature extractor and metric learner;
[0033] The diagnosis module is used to input the test data into the trained twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model to obtain the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
[0034] Compared with the prior art, the present invention has at least the following beneficial effects:
[0035] 1. The present invention uses a twin neural network as a framework to solve the fault diagnosis problem of rotating machinery with small samples across different operating conditions. Through sophisticated feature extraction and a learning mechanism based on contrast loss, it can effectively capture and compare subtle differences between samples, thereby achieving accurate diagnosis of different fault categories. Even in the face of challenges such as limited sample size and large variations in operating conditions, it can maintain excellent diagnostic performance and good generalization ability.
[0036] 2. This invention significantly improves the performance of cross-operating-condition fault diagnosis for rotating machinery by integrating multi-scale wavelet convolution with an innovatively introduced attention mechanism module. Multi-scale wavelet convolution combines the multi-scale decomposition capabilities of wavelet transform technology with the feature extraction capabilities of convolutional neural networks. By performing multi-scale decomposition of the signal through the wavelet transform, the local features of the signal at different frequencies and scales can be accurately captured, while the convolutional neural network can automatically learn useful feature representations from these decomposed signals. The application of multi-scale wavelet convolution enables this model to deeply explore and utilize the characteristic information of rotating machinery signals at different frequencies and scales, ensuring efficient identification of complex fault modes. At the same time, the introduced attention mechanism module optimizes the model's focus on key fault features by dynamically adjusting the weight distribution of features at different scales, further enhancing the accuracy and robustness of fault diagnosis. The application of this technology, especially in scenarios with limited sample size and changing experimental conditions, not only improves the accuracy and reliability of fault detection, but also significantly enhances the model's generalization ability, providing an efficient and reliable technical solution for rotating machinery fault diagnosis.
[0037] 3. The present invention further improves the performance of small-sample fault diagnosis of rotating machinery by using a capsule network module. The structure of the capsule network module allows it to capture the hierarchical spatial relationship of the input data. The one-dimensional capsule network can effectively learn the part-to-whole relationship between features through its own dynamic routing mechanism. Unlike traditional convolutional neural networks (CNNs), which can only capture local features while ignoring their spatial hierarchical structure, the capsule network can capture information such as the direction and size of features through its internal vector representation. This allows the model to more effectively identify and learn complex fault features when only a small number of samples are used for training. This allows the model to understand fault signals at a finer granularity, achieving more accurate and robust fault diagnosis in small sample cross-operating conditions.
[0038] 4. The method proposed in the present invention fully considers its application in actual industrial practice. Even when the target domain data is extremely limited and the source domain data volume is small, it can achieve high-precision fault diagnosis. It demonstrates the practical application potential of extreme optimization of resource utilization and technological innovation while meeting actual production needs, and has certain industrial application value. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 This is a fault diagnosis flowchart of a small sample cross-operating condition fault diagnosis method based on an improved twin capsule network provided by an embodiment of the present invention;
[0040] Figure 2 2 is a schematic diagram of the model structure of a small sample cross-operating condition fault diagnosis method based on an improved twin capsule network according to an embodiment of the present invention;
[0041] Figure 3 is a comparison chart of the diagnostic accuracy of the present invention in Example 1 and the diagnostic accuracy of other comparison methods;
[0042] Figure 4 3 is a comparison chart of the diagnostic accuracy of the present invention in Example 2 and the diagnostic accuracy of other comparison methods. DETAILED DESCRIPTION
[0043] In order to more clearly illustrate the purpose and technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific implementation steps described herein are only used to better illustrate the application of the present invention, and the technical features involved in the embodiments of the present invention are not limited thereto.
[0044] like Figure 1 As shown, the small sample cross-operating condition fault diagnosis method based on the improved twin capsule network provided by the present invention is implemented in the following steps:
[0045] Step 1: Data Collection and Calibration. Use a vibration accelerometer to collect vibration acceleration signals from rotating machinery under different experimental conditions and assign category labels. Use sliding window technology to intercept data segments of a specific length (e.g., 2048 bytes) as samples, ensuring that the data points do not overlap. This ensures that all samples under the same operating condition constitute a data set for that condition. When intercepting samples, ensure that the data points do not overlap.
[0046] In some embodiments of the present invention, different experimental operating condition signals include: 1) vibration signals at different speeds under the same load; and 2) vibration signals at different loads under the same speed, to ensure that raw vibration signal data covering various conditions is obtained.
[0047] Step 2: Construct a source domain training sample pair dataset. A dataset of specific working conditions is selected as the source domain dataset, with a maximum of 20 samples for each fault category. Sample pairs are formed by randomly extracting two samples from the source domain dataset. Samples from the same category are positive sample pairs (marked "1"), and samples from different categories are negative sample pairs (marked "0"). The number of positive and negative sample pairs is kept equal, and all positive and negative sample pairs together constitute the source domain training sample pair dataset. The number of positive sample pairs does not exceed the maximum number of all possible non-repeated sample pairs within the same fault category.
[0048] Step 3: Construct a target domain support sample set and a test sample set that meet n-shot testing requirements. The target domain dataset is selected from a dataset with different operating conditions from the source domain and further subdivided into two parts: one is a labeled support sample set with a specified number n of faults per type, and the other is the remaining unlabeled test sample set, which is used to evaluate the model's target domain diagnostic capabilities.
[0049] Different operating conditions include the same speed at different loads and the same load at different speeds. In this step, based on the specific requirements of n-shot testing, the target domain dataset is divided into two parts: a support sample set, consisting of a specified number n of labeled sample groups for each fault category, used to identify the target domain fault category; and a test sample set, consisting of the remaining unlabeled samples in the target domain dataset excluding the support sample set, used to test the model's diagnostic performance on the target domain.
[0050] Step 4: Construct a feature extractor: Construct a feature extractor to extract features from the original fault vibration signal and extract high-dimensional complex features.
[0051] The feature extractor includes two branch feature extractors connected in parallel, each of which includes a multi-scale attention wavelet input feature extraction module and a capsule network module. The multi-scale attention wavelet input feature extraction module is used to extract features at different scales from the original vibration signal by using multiple wavelet convolution layers with the same wavelet kernel function but different kernel sizes, or multiple wavelet convolution layers with different wavelet kernel functions, to extract more useful information from limited data. Specifically, in the multi-scale attention wavelet input feature extraction module, "multi-scale" can be achieved in two ways: one is to use the same wavelet kernel function but with varying kernel sizes at different scales; the other is to implement multi-scale processing using different types of wavelet kernel functions, such as but not limited to Haar wavelet kernels, Daubechies wavelet kernels, Meyer wavelet kernels, Morlet wavelet kernels, and Laplace wavelet kernels. That is, the first method realizes the multi-scale function in the dimension of wavelet kernel size, and the second method realizes the multi-scale function in the dimension of wavelet kernel type, thereby enhancing the ability and flexibility of the module in feature extraction.
[0052] The capsule network module is used to further extract the features extracted by the multi-scale attention wavelet input feature extraction module to obtain finer-grained features for the subsequent metric learning module.
[0053] Figure 2Schematic diagram of the model structure for improving the small sample cross-operating condition fault diagnosis method of the twin capsule network. The multi-scale attention wavelet input feature extraction module includes a multi-scale wavelet module and an attention module. The multi-scale wavelet module includes 6 wavelet convolution modules with different wavelet convolution kernel sizes. The wavelet convolution module is the basic unit for constructing the multi-scale wavelet module. Each wavelet convolution module includes a one-dimensional Laplace wavelet convolution layer (which can also be replaced by a wavelet convolution layer using other wavelet kernel functions, such as Haar wavelet convolution layer, Daubechies wavelet convolution layer, Meyer wavelet convolution layer, Morlet wavelet convolution layer, etc.), a BatchChannelNormalization layer, a ReLU layer, and a MaxPool layer. The one-dimensional Laplace wavelet convolution layer is used to extract fault features from the original vibration signal. Unlike the standard one-dimensional convolution layer, the one-dimensional Laplace wavelet convolution layer uses a wavelet function as the convolution kernel, which can accurately capture the local features of the signal at different frequencies and scales. The BatchChannelNormalization layer is used to improve the convergence speed of the model, improve the stability of training, and improve the robustness of the model. The ReLU layer is used to introduce nonlinearity into the neural network, enabling the network to learn and simulate complex functions. The Maxpool layer is used to downsample the extracted fault features, reducing the data dimension and computational complexity while retaining the most important feature information. In some embodiments of the present invention, the wavelet convolution kernel sizes of the wavelet convolution module are 64x1, 32x1, 16x1, 8x1, 4x1 and 2x1, respectively, and the step sizes of the Maxpool layer are 2, 2, 2, 4, 8, and 16, respectively. In this embodiment, multi-scale is achieved by using the same wavelet kernel function but changing the kernel sizes in different wavelet convolution modules. In other embodiments, multi-scale can also be achieved by using the wavelet convolution layers in each wavelet convolution module using wavelet kernel functions of the same kernel size but different types.
[0054] Among them, in some embodiments of the present invention, the BatchChannelNormalization layer reduces the input dimension of the original BCN from two dimensions to one dimension, so that it can be applied to one-dimensional vibration signals for fault diagnosis. By improving the BatchChannelNormalization (BCN) in the field of image recognition, it can be applied to the field of rotating machinery fault diagnosis. The improved BCN is used instead of the traditional BatchNormalization (BN), which utilizes both channel and batch dimensions and adaptively combines the normalized outputs. This targeted normalization processing not only improves the learning efficiency and stability of the model under complex working conditions, but also shows significant advantages in improving the diagnostic accuracy of small samples and across working conditions.
[0055] Improved pyramid attention weighting module is the attention module mentioned above, which is used to weight the importance of the extracted features, thereby optimizing the expressiveness of the features. First, the features extracted by different wavelet convolution modules are Pass them into the CBAM attention weight module respectively to obtain the corresponding CBAM attention weight These weights are then concatenated and fed into the Softmax function to calculate the contribution of each feature weight to the total weight. i , get the importance of the features extracted by different wavelet convolution modules among all features; then each feature The corresponding ratio W i Multiply to get weighted features Finally, by concatenating these weighted features along the channel direction, the final multi-scale attention wavelet features are generated. The attention module weights the features through the CBAM attention weight module and the Softmax function, so that different features are appropriately scaled according to their importance in the whole.
[0056] The capsule network module consists of three different convolutional modules, two one-dimensional capsule network modules, and an expansion layer. The convolutional modules, one-dimensional capsule network modules, and expansion layer are connected in series. The convolutional modules are used to further extract useful information from previously extracted features. The expansion layer is used to flatten multidimensional data into one-dimensional data to prepare for subsequent input into the metric learner. The one-dimensional capsule network module is used to further improve the model's small-sample classification capabilities. The one-dimensional capsule network is composed of two one-dimensional capsule networks connected in series with shared weights. The one-dimensional capsule network is the basic building block of the one-dimensional capsule network module and is used to further extract fine-grained fault features. Each convolutional module consists of a one-dimensional convolutional layer, a one-dimensional BatchChannelNormal layer, and a ReLU layer. The convolution kernel sizes of the one-dimensional convolutional layers in the three convolutional modules are 64x1, 5x1, and 3x1, respectively.
[0057] The branch feature extractor consists of a multi-scale attention wavelet input feature extraction module and a capsule network module connected in series. Two weight-sharing, identically structured branch feature extractors are connected in parallel to form a twin-structure feature extractor. This feature extractor efficiently extracts features from the original fault vibration signal, providing powerful support for subsequent fault diagnosis and analysis.
[0058] Step 5. Construct a metric learner. Construct a metric learner consisting of two fully connected modules and one dropout module. The first fully connected module includes a fully connected layer and a ReLU activation layer, which are connected in series. The first fully connected module is used to perform preliminary nonlinear transformation and activation on the input feature vector; the second fully connected module contains a single fully connected layer, which is used to further transform the feature vector for the final similarity calculation; between the two fully connected modules, a dropout layer is included. By introducing the dropout layer, the generalization ability of the learner is enhanced and the risk of overfitting is effectively reduced.
[0059] Step 6: Construct a twin multi-scale attention wavelet capsule network small-sample cross-operating-condition fault diagnosis model. By cascading the feature extractor from step 4 and the metric learner from step 5, an efficient twin network model suitable for small-sample and cross-operating-condition fault diagnosis is constructed. This model uses the feature extractor to deeply learn the fault signal characteristics of rotating machinery and the metric learner to accurately calculate the similarity between feature vectors.
[0060] This model achieves deep learning and precise measurement of rotating machinery fault features by cascading the feature extractor developed in step 4 and the metric learner designed in step 5. The feature extractor extracts key information from the raw fault vibration signal, and the metric learner accurately calculates the similarity between feature vectors, enabling fault diagnosis with a small sample size and across operating conditions.
[0061] Step 7: Model training. The source domain training sample pairs constructed in Step 2 are fed into the twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model in batches. Using the Mini-Batch method, with 32 samples per batch, the sample pair contrast loss is calculated using the contrastive loss function and the model parameters are updated through backpropagation. The model is then optimized using the Adadelta optimizer with a learning rate of 0.0003. The iteration stopping condition is determined. If not, a new round of training optimization is performed. Otherwise, model training is completed.
[0062] In some embodiments of the present invention, the completion of 50 training cycles is used as a condition for stopping iteration to achieve optimal model performance.
[0063] Step 8: Model testing. By pairing the test sample set constructed in Step 3 with samples from the support sample set and inputting them into the model in batches, the model calculates the distance between the paired samples in the feature space to assess similarity and uses this to diagnose the fault category of the rotating machinery, completing the testing of the trained twin multi-scale attention wavelet capsule network model.
[0064] The test data is input into the trained twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model to obtain the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
[0065] The samples in the step test sample set are paired with the samples in the support sample set to form test sample pairs; then, these test sample pairs are input in batches into the trained and optimized twin multi-scale attention wavelet capsule network fault diagnosis model for processing; during the model testing process, the distance between the two samples in each test sample pair in the feature space is calculated to evaluate the similarity of the sample pairs; the model identifies the sample pair with the smallest feature space distance and determines the fault category label of the support sample of the most similar sample pair as the predicted label of the test sample, thereby realizing the diagnosis of rotating machinery faults in the test sample set, thereby verifying the diagnostic performance and accuracy of the model under small sample cross-operating conditions.
[0066] The present invention is further described below with reference to the accompanying drawings and experimental cases:
[0067] To validate the superiority of the proposed method, we compared it with four other fault diagnosis methods: a wide convolutional neural network (WDCNN), a dual-path wavelet convolutional recurrent neural network (DLWCB), a prototype network (PN), and a matching network (MN). WDCNN and DLWCB are both standard supervised learning methods; PN and MN are both meta-learning methods, with WDCNN serving as the baseline model. By comparing multiple different fault diagnosis methods, the experimental results are more convincing.
[0068] As Example 1, the public Paderborn University bearing dataset (PU bearing dataset) was used to design relevant experiments. The bearings used in the PU bearing dataset consist of three types: normal bearings, artificial fault bearings, and real fault bearings, including 6 normal bearings, 12 artificial fault bearings, and 14 real fault bearings. The artificial fault bearings were produced by three methods: electrospark machining, drilling, and electric engraving, while the real fault bearings were produced by real faults including pitting and plastic deformation generated by accelerated bearing life experiments. The PU dataset contains four working conditions, all of which are measured by piezoelectric accelerometers with a sampling frequency of 64KHz.
[0069] As Example 1, three working conditions were selected as the working conditions used in the experiment, and their specific working conditions are shown in Table 1:
[0070]
[0071] Table 1 PU data set working condition parameters
[0072] As Example 1, five bearing data sets were selected for designing a small-sample, cross-operation fault diagnosis task. This data set includes one normal bearing data set and four artificially faulted bearing data sets. Table 2 provides a detailed description of the experimental data, which includes two fault locations, two fault modes, and one fault severity level. Fault locations include inner race and outer race faults; fault modes include electrical discharge machining (EDM) and electric engraving; and fault severity level 1 (fault size less than or equal to 2 mm).
[0073]
[0074] Table 2. PU data set fault information table
[0075] As Example 1, the sliding window technology is used to collect data samples under different working conditions with a fixed length of 2048 sampling points under the condition of non-overlapping sampling points. Data sets under different working conditions are selected as source domain data sets and target domain data sets. In the source domain data set, the number of labeled samples contained in each type of fault is 10; in the target domain data set, the number of labeled samples contained in each type of fault in the support sample set is 1, and the number of unlabeled samples contained in each type of fault in the test sample set is 125. For the two standard supervised learning methods, WDCNN and DLWCB, all labeled samples in the source domain data set are used to train the model; for the two meta-learning methods, PN and MN, the labeled samples of the source domain data set are used to construct meta-tasks; for the method of the present invention, all labeled samples in the source domain data set are used to construct training sample pairs for network training. Six groups of small sample cross-working condition fault diagnosis experiments were constructed using three different working conditions. The specific experimental settings are shown in Table 3:
[0076]
[0077] Table 3 Experimental setup of Example 1
[0078] As Example 1, the diagnostic test results are as follows Figure 3As shown. The experimental results show that in all six groups of experiments, the test accuracy of the two standard supervised learning methods, WDCNN and DLWCB, is relatively low, with diagnostic accuracy of only 48.89% and 26.56% in Experiment B. This type of method is prone to overfitting under the condition of fewer data samples. The meta-learning-based PN and MN methods are significantly better than the previous two methods in diagnostic accuracy results, with diagnostic accuracy of 58.81% and 68.32% in Experiment B. This is because the meta-learning method has more outstanding rapid adaptability and high generalization ability than the standard supervised learning method. By optimizing the model's learning process itself, the model can learn more effectively from each sample, thereby achieving good performance even when the amount of data is very limited. The meta-learning-based method can capture and apply commonalities across tasks, improving the accuracy of cross-working condition diagnosis. The method of the present invention achieved the highest diagnostic accuracy in all six groups of experiments, with a diagnostic accuracy of 98.23% in Experiment B, which is 39.42% and 29.91% higher than the PN and MN methods, respectively. The above experimental results fully demonstrate the effectiveness and advancement of the proposed method in small sample cross-operating condition fault diagnosis.
[0079] As Example 2, the public Case Western Reserve University bearing dataset (CWRU bearing dataset) is used to design relevant experiments. The bearings used in the CWRU bearing dataset are composed of normal bearings and artificial fault bearings. The dataset mainly contains four categories of data: 1) normal data, 2) drive-end fault data with a sampling frequency of 12KHz, 3) drive-end fault data with a sampling frequency of 48KHz, and 4) fan-end fault data. The CWRU dataset contains four working conditions, namely 0HP, 1HP, 2HP, and 3HP, all of which are data measured by vibration acceleration sensors. In this embodiment, the three working conditions of 0HP, 1HP, and 2HP are selected as the working conditions used in the experiment.
[0080] As Example 2, drive-end data with a sampling frequency of 12 kHz was selected as experimental data. Table 4 provides a detailed description of the experimental data, which includes three fault locations and three fault severity levels. Fault locations include inner race fault, outer race fault, and roller fault; and fault severity levels include level 1 (fault diameter 0.007 inches), level 2 (fault diameter 0.014 inches), and level 3 (fault diameter 0.021 inches).
[0081]
[0082] Table 4. CWRU dataset fault information table
[0083] As Example 2, the sliding window technology is used to collect data samples under different working conditions with a fixed length of 2048 sampling points under the condition of non-overlapping sampling points. Data sets under different working conditions are selected as source domain data sets and target domain data sets. In the source domain data set, the number of labeled samples contained in each type of fault is 10; in the target domain data set, the number of labeled samples contained in each type of fault in the support sample set is 1, and the number of unlabeled samples contained in each type of fault in the test sample set is 50. For the two standard supervised learning methods, WDCNN and DLWCB, all labeled samples in the source domain data set are used to train the model; for the two meta-learning methods, PN and MN, the labeled samples of the source domain data set are used to construct meta-tasks; for the proposed method, all labeled samples in the source domain data set are used to construct training sample pairs for network training. Six groups of small sample cross-working condition fault diagnosis experiments were constructed using three different working conditions. The specific experimental settings are shown in Table 5:
[0084]
[0085] Table 5. Experimental setup table for Example 2
[0086] As Example 2, the diagnostic test results are as follows Figure 4 As shown in Figure 3 , the experimental results show that in all six sets of experiments, the test accuracy of the two standard supervised learning methods, WDCNN and DLWCB, was relatively low, with diagnostic accuracies of only 50.13% and 25.85% in Experiment A. These methods are prone to overfitting when given limited data samples. The meta-learning-based PN and MN methods significantly outperformed the previous two methods in diagnostic accuracy, achieving accuracies of 72.14% and 68.85% in Experiment A. This is because meta-learning methods have superior rapid adaptability and high generalization capabilities compared to standard supervised learning methods. By optimizing the model's learning process, they enable the model to learn more effectively from each sample, achieving good performance even with very limited data. Meta-learning-based methods can capture and apply commonalities across tasks, improving the accuracy of cross-condition diagnosis. The proposed method achieved the highest diagnostic accuracy in all six sets of experiments, reaching 99.79% in Experiment A, an improvement of 27.65% and 30.94% over the PN and MN methods. The above experimental results fully demonstrate the effectiveness and advancement of the proposed method in small sample cross-operating condition fault diagnosis.
[0087] In some embodiments of the present invention, a small sample cross-operating condition fault diagnosis system based on an improved twin capsule network is provided to implement the method provided in the aforementioned embodiments. The system includes the following modules:
[0088] A signal acquisition module is used to acquire vibration acceleration signals of rotating machinery under different experimental conditions, set category labels, and construct samples based on the vibration acceleration signals;
[0089] The dataset construction module is used to select a dataset of a certain working condition as the source domain dataset and randomly extract two samples from the source domain dataset to form a sample pair. The sample pairs composed of samples from the same fault category are called positive sample pairs, and the sample pairs composed of samples from different fault categories are called negative sample pairs. All positive and negative sample pairs constitute the source domain training sample pair dataset, and a working condition dataset other than the source domain dataset working condition is selected as the target domain dataset. The target domain dataset is divided into a support sample set consisting of n labeled samples of each category and a test sample set consisting of the remaining unlabeled samples;
[0090] A feature extractor construction module is used to construct a feature extractor. The feature extractor is used to extract features from the original fault vibration signal. The feature extractor includes two branch feature extractors connected in parallel. Each branch feature extractor includes a multi-scale attention wavelet input feature extraction module and a capsule network module connected in series.
[0091] The metric learner building module is used to build a metric learner to calculate the distance between feature vectors in the feature space and determine the similarity of sample pairs;
[0092] A model construction module is used to construct a twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model, combining the feature extractor constructed in the above and the metric learner to form a rotating machinery fault diagnosis model for completing small sample and cross-operating condition situations;
[0093] A model training module is used to input the sample pairs in the constructed source domain training sample pair dataset into the twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model in batches to train the feature extractor and metric learner;
[0094] The diagnosis module is used to input the test data into the trained twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model to obtain the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
[0095] In some embodiments of the present invention, an electronic device is provided, comprising: a processor and a memory; the memory is used to store instructions or computer programs; and the processor is used to execute the instructions or computer programs in the memory, so that the electronic device performs the methods provided in the aforementioned embodiments.
[0096] In some embodiments of the present invention, a computer-readable storage medium is provided, in which instructions are stored. When the instructions are executed on a device, the device executes the method provided in the aforementioned embodiment.
[0097] For the small sample cross-operating condition fault diagnosis system, equipment and medium based on the improved twin capsule network disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method part.
[0098] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention is not limited to the embodiments shown herein but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A small sample cross-operating condition fault diagnosis method based on an improved twin capsule network is characterized by: The following steps are involved: Acquire vibration acceleration signals of the rotating machinery under different experimental working conditions, set category labels, and construct samples based on the vibration acceleration signals; A dataset of a certain working condition is selected as the source domain dataset, and two samples are randomly extracted from the source domain dataset to form a sample pair. The sample pairs composed of samples from the same fault category are called positive sample pairs, and the sample pairs composed of samples from different fault categories are called negative sample pairs. All positive and negative sample pairs constitute the source domain training sample pair dataset. A working condition dataset other than the source domain dataset working condition is selected as the target domain dataset. The target domain dataset is divided into a support sample set consisting of n labeled samples of each category and a test sample set consisting of the remaining unlabeled samples; Construct a feature extractor. The feature extractor is used to extract features from the original fault vibration signal. The feature extractor includes two parallel branch feature extractors. Each branch feature extractor includes a multi-scale attention wavelet input feature extraction module and a capsule network module connected in series. The multi-scale attention wavelet input feature extraction module is used to extract features of different scales from the original vibration signal by using multiple wavelet convolution layers with the same wavelet kernel function but different kernel sizes, or multiple wavelet convolution layers with different wavelet kernel functions, to extract more useful information. The capsule network module is used to further extract the features extracted by the multi-scale attention wavelet input feature extraction module to obtain more fine-grained features. Construct a metric learner to calculate the distance between feature vectors in the feature space and determine the similarity between sample pairs; Combining the feature extractor and the metric learner to construct a twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model; The sample pairs in the constructed source domain training sample pair dataset are input into the twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model in batches to train the feature extractor and metric learner; The test data is input into the trained twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model to obtain the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
2. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 1 is characterized in that: The model is tested using the target domain dataset. During model testing, the samples in the test sample set are paired with the samples in the support sample set, and are input in batches into the trained twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model for diagnosis, thereby obtaining the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
3. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 2 is characterized in that: Pair the samples in the test sample set with the samples in the support sample set to form a test sample pair; Subsequently, these test sample pairs are input in batches into the trained and optimized twin multi-scale attention wavelet capsule network fault diagnosis model for processing; during the model testing process, the distance between the two samples in each test sample pair in the feature space is calculated to evaluate the similarity of the sample pairs; the model identifies the sample pair with the smallest feature space distance and determines the fault category label of the supporting sample of the most similar sample pair as the predicted label of the test sample, thereby realizing the diagnosis of rotating machinery faults in the test sample set.
4. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 1 is characterized in that: In step 1, the different operating condition data of the rotating machinery include: vibration signals at different speeds under the same load, and vibration signals at different loads under the same speed.
5. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 1 is characterized in that: The multi-scale attention wavelet input feature extraction module includes a multi-scale wavelet module and an attention module. The multi-scale wavelet module is used to use wavelet convolution kernels of different sizes or different wavelet kernel functions to extract features of different scales, and the attention module is used to weight the importance of the extracted features.
6. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 5 is characterized in that: The multi-scale wavelet module includes multiple wavelet convolution modules of different scales. Each wavelet convolution module includes a wavelet convolution layer, a one-dimensional BatchChannelNormalization layer, a ReLU layer, and a one-dimensional MaxPool layer. The wavelet convolution layer is used to extract fault features from the original vibration signal. The BatchChannelNormalization layer is used to improve the convergence speed of the model, improve the stability of training, and improve the robustness of the model. The ReLU layer is used to introduce nonlinearity in the neural network. The Maxpool layer is used to downsample the extracted fault features. The wavelet kernel function type of the wavelet convolution layers in multiple wavelet convolution modules is the same but the kernel sizes are different to achieve multi-scale, or the wavelet convolution layers in multiple wavelet convolution modules use different types of wavelet kernel functions to achieve multi-scale. The attention module extracts the features from different wavelet convolution modules They are sent to the CBAM attention weight module respectively to obtain the corresponding CBAM attention weights Then all the obtained CBAM attention weights Splice them together and send them to the Softmax function module to calculate the proportion of each feature weight in all feature weights W i , get the importance of the features extracted by different wavelet convolution modules among all features; And the corresponding CBAM attention weight W i Multiply to get weighted features And spliced along the channel direction to obtain a multi-scale attention wavelet feature.
7. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 1 is characterized in that: The capsule network module includes three convolution modules with convolution kernels of different sizes, a one-dimensional capsule network module and an expansion layer. The convolution module, the one-dimensional capsule network module and the expansion layer are connected in series. Each convolution module includes a one-dimensional convolution layer, a one-dimensional BatchChannelNormal layer and a ReLU layer. The one-dimensional capsule network module includes two one-dimensional capsule networks with shared weights connected in series.
8. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to claim 1 is characterized in that: The metric learner includes two fully connected modules and a dropout layer located between the two fully connected modules. The first fully connected module includes a fully connected layer and a ReLU activation layer connected in series, which is used to perform preliminary nonlinear transformation and activation on the input feature vector. The dropout layer is used to enhance the generalization ability of the learner; the second fully connected module only contains one fully connected layer, which is used to further transform the feature vector for the final similarity calculation.
9. The small sample cross-operating condition fault diagnosis method based on the improved twin capsule network according to any one of claims 1 to 8, characterized in that: The twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model is trained using the Mini-Batch learning method. The training uses the source domain training sample pair dataset and sets the sample pair size for each batch. During the training process, the contrast loss function is used to optimize the model, and the Adadelta optimizer is used for optimization.
10. A small sample cross-operating condition fault diagnosis system based on an improved twin capsule network, characterized by: For implementing the method according to any one of claims 1 to 9, the system comprises the following modules: A signal acquisition module is used to acquire vibration acceleration signals of rotating machinery under different experimental conditions, set category labels, and construct samples based on the vibration acceleration signals; The dataset construction module is used to select a dataset of a certain working condition as the source domain dataset and randomly extract two samples from the source domain dataset to form a sample pair. The sample pairs composed of samples from the same fault category are called positive sample pairs, and the sample pairs composed of samples from different fault categories are called negative sample pairs. All positive and negative sample pairs constitute the source domain training sample pair dataset, and a working condition dataset other than the source domain dataset working condition is selected as the target domain dataset. The target domain dataset is divided into a support sample set consisting of n labeled samples of each category and a test sample set consisting of the remaining unlabeled samples; A feature extractor construction module is used to construct a feature extractor. The feature extractor is used to extract features from the original fault vibration signal. The feature extractor includes two branch feature extractors connected in parallel. Each branch feature extractor includes a multi-scale attention wavelet input feature extraction module and a capsule network module connected in series. The multi-scale attention wavelet input feature extraction module is used to extract features of different scales from the original vibration signal by using multiple wavelet convolution layers with the same wavelet kernel function but different kernel sizes or multiple wavelet convolution layers with different wavelet kernel functions to extract more useful information. The capsule network module is used to further extract the features extracted by the multi-scale attention wavelet input feature extraction module to obtain more fine-grained features. The metric learner building module is used to build a metric learner to calculate the distance between feature vectors in the feature space and determine the similarity of sample pairs; A module construction module is used to construct a twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model, combining the constructed feature extractor and the metric learner to form a rotating machinery fault diagnosis model for completing small sample and cross-operating condition situations; A model training module is used to input the sample pairs in the constructed source domain training sample pair dataset into the twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model in batches to train the feature extractor and metric learner; The diagnosis module is used to input the test data into the trained twin multi-scale attention wavelet capsule network small sample cross-operating condition fault diagnosis model to obtain the rotating machinery fault diagnosis results under small sample cross-operating condition conditions.
Citation Information
Patent Citations
Bearing small sample fault diagnosis method and system based on meta transfer learning
CN116465630A
Semi-supervised mechanical fault diagnosis method based on adaptive migration neural network
CN112183581A
Bearing fault diagnosis method and system based on small samples
CN115081490A