A Small Sample Fault Diagnosis Method Based on Multi-Scale Feature Learning and Domain Adaptive Optimization
By constructing a dual-branch feature extraction subnetwork and combining multi-scale feature learning and domain adaptive optimization, the problem of small sample data and data distribution differences in rotating machinery fault diagnosis is solved, the performance and generalization ability of the model are improved, and efficient cross-domain fault diagnosis with small samples is achieved.
Patent Information
- Application Number
- CN202510538788.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-04-27
AI Technical Summary
Deep learning models face challenges in fault diagnosis of rotating machinery due to small sample data conditions and data distribution differences, which leads to a decline in model performance and generalization ability.
A small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization is adopted. By constructing a dual-branch feature extraction sub-network, iterative training is performed using triplet feature embedding distance and joint loss function to obtain a dual-branch fault diagnosis model, thus solving the problem of small-sample cross-domain fault diagnosis.
It effectively alleviates the problem of model performance degradation caused by small sample data conditions and differences in data distribution, improves the accuracy and generalization ability of rotating machinery fault diagnosis, and provides a feasible solution in real industrial scenarios.
Smart Images

Figure CN120448968B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent fault diagnosis technology for rotating machinery, and in particular to a small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization. Background Technology
[0002] With the continuous development of my country's industrial system, rotating machinery, as a common type of equipment, is evolving towards larger scale, higher efficiency, and higher performance. However, due to the harsh conditions of rotating machinery operating under high speed, heavy load, and temperature fluctuations for extended periods, its key components are prone to failure, leading to equipment malfunctions. These malfunctions not only affect processing accuracy and product quality but may also damage equipment or production lines, and even cause safety accidents. Therefore, timely and accurate identification of rotating machinery malfunctions and effective monitoring of their evolution are crucial for ensuring production safety and improving efficiency.
[0003] In recent years, with the rapid advancement of machine learning algorithms, data-driven fault diagnosis methods have become a research hotspot in the field of industrial intelligence. Modern industrial sites utilize high-density sensor networks to collect massive amounts of data on equipment operation in real time, providing multi-dimensional data support for the intelligent diagnosis of rotating machinery. Compared to traditional feature extraction methods that rely on signal analysis (such as Fourier transform and wavelet decomposition) and expert experience, the core advantage of deep learning lies in constructing deep neural networks with multi-level abstraction capabilities, automatically extracting high-level fault features through an end-to-end learning mechanism. This technical approach not only avoids the dependence on expert knowledge for manual feature engineering in traditional methods but also achieves accurate identification and decision analysis of complex fault modes through the stacking of nonlinear functions.
[0004] While deep learning technology has brought about a paradigm shift in rotating machinery fault diagnosis, its industrial application still faces significant data bottlenecks and generalization challenges. The accuracy and generalization ability of deep learning models typically rely on massive amounts of labeled data. However, in actual industrial production, rotating machinery operates in normal condition for up to 95% of its operating cycles, resulting in monitoring systems collecting fault samples that typically account for less than 5%. Therefore, collecting sufficient fault data directly from the industrial field to support the training of deep learning models is particularly difficult. Furthermore, rotating machinery often operates under varying working conditions, leading to different data distributions. This difference in distribution between training and testing data, along with inconsistencies in the label space, severely weakens the model's cross-domain generalization ability. These issues further complicate the application of deep learning in rotating machinery fault diagnosis.
[0005] In conclusion, there is an urgent need to study fault diagnosis under conditions of small sample data. This is not only crucial for ensuring the stable operation of rotating machinery, but also a fundamental prerequisite for promoting the reliable, safe, and efficient development of machinery and equipment in my country. Summary of the Invention
[0006] The purpose of this invention is to provide a small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization, which solves the problem of model performance degradation caused by small-sample data conditions and differences in data distribution.
[0007] To achieve the above objectives, the present invention provides the following solution:
[0008] A small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization includes:
[0009] Historical heterogeneous fault data of several mechanical equipments are obtained as source domain datasets, and historical heterogeneous fault data of target mechanical equipment are obtained as target domain datasets. Label spaces are set for the source domain datasets and the target domain datasets respectively.
[0010] Based on the source domain dataset and the target domain dataset, random sampling combinations are performed to construct a triplet dataset and a domain adaptive dataset.
[0011] The triplet dataset and the domain adaptive dataset are input into the dual-branch feature extraction subnetwork. The triplet feature embedding distance is measured, and iterative training is performed through a joint loss function to obtain a dual-branch fault diagnosis model. The dual-branch feature extraction subnetwork is used to extract features from the triplet dataset and the domain adaptive dataset using two branches respectively. The triplet feature embedding distance is obtained by calculating the Euclidean distance. The joint loss function is composed of triplet loss and domain adaptive loss.
[0012] Collect current heterogeneous fault data of the target mechanical equipment and input it into the dual-branch fault diagnosis model, output the fault classification of the vibration signal of the target mechanical equipment, and complete the small sample cross-domain fault diagnosis.
[0013] Optionally, constructing a triplet dataset and a domain-adaptive dataset by randomly sampling and combining the source domain dataset and the target domain dataset includes:
[0014] Anchor samples, positive samples, and negative samples are randomly extracted from the labeled data of the source domain dataset using a Monte Carlo sampling strategy to construct a triplet dataset containing several combinations of anchor sample-positive sample-negative sample.
[0015] A domain-adaptive source domain dataset is constructed using all data from the source domain dataset, and an equal number of samples are selected from the unlabeled data of the target domain dataset through stratified random sampling as the domain-adaptive target domain dataset. The domain-adaptive source domain dataset and the domain-adaptive target domain dataset are combined to form a domain-adaptive dataset.
[0016] Optionally, the dual-branch feature extraction subnetwork includes a triplet feature extraction subnetwork and a domain adaptive feature extraction subnetwork. Both the triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork adopt a five-layer composite architecture based on Morlet wavelet basis functions. This architecture includes a multi-scale wavelet convolution module using a hybrid Haar and Morlet wavelet kernel, an adaptive wavelet feature attention module with channel-space attention mechanism, a deep residual convolution module with residual connections, a capsule network module with variable dynamic routing iterations, and a regularized fully connected module with an embedded Dropout layer. The triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork achieve synchronous gradient updates and share all network weights through a parameter sharing mechanism.
[0017] Optionally, the multi-scale wavelet convolution module is used to extract multi-scale features through wavelet convolutional networks with several wavelet kernels of different scales, and to perform time-frequency feature decomposition using the Mallat algorithm to output multi-scale wavelet feature maps; the adaptive wavelet feature attention module is used to calculate the internal attention weights of the multi-scale wavelet feature maps through a channel-space attention mechanism, and to perform dynamic weighting processing on the multi-scale wavelet feature maps using Softmax to obtain overall weighted features; the deep residual convolution module is used to perform convolution processing on the overall weighted features through several convolutional layers, and to use skip connections to handle gradient vanishing to obtain convolutional features; the capsule network module is used to update the coupling coefficients through a dynamic routing algorithm, and to refine the convolutional features through several capsule network layers to obtain refined features; the regularized fully connected module is used to output the refined features as the final features through several fully connected layers and Dropout layers, and to introduce an elastic weight solidification strategy to reduce model overfitting.
[0018] Optionally, the triplet feature extraction subnetwork further includes a feature distance metric module. After the anchor sample, positive sample, and negative sample are forward-propagated through the triplet feature extraction subnetwork, the feature distance metric module calculates the feature embedding distance between the anchor sample and the positive and negative samples in the feature space to obtain the similarity relationship between the anchor sample and the positive and negative samples.
[0019] Optionally, Euclidean distance is used as the feature distance metric to calculate the feature embedding distance between the anchor sample and the positive and negative samples in the feature space, wherein the feature distance metric is:
[0020]
[0021] Where, x a x represents the anchor sample in the triplet. p x represents the positive sample in the triplet. nLet f(·) represent the negative samples in the triplet, and let D(x) represent the feature mapping function of the triplet feature extraction subnetwork. a ,x p D(x) represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the triplet. a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the feature space in the triplet, l represents the feature dimension, and s represents the total feature dimension.
[0022] Optionally, the joint loss function formed by combining the triplet loss and the domain adaptive loss is:
[0023] L Combine = (1-α)·L Triplet +α·L MMD ;
[0024] Among them, L Combine For joint loss, α is the weighting factor, and L Triplet For triplet loss, L MMD This is the domain-adaptive loss.
[0025] Optionally, the method for calculating the triplet loss is as follows:
[0026]
[0027] in, This represents the anchor point sample in the i-th triplet. Represents the positive sample in the i-th triplet. This represents the negative sample in the i-th triplet. This represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the i-th triplet. denoted as the feature embedding distance between the anchor sample and the negative sample in the feature space of the i-th triplet, margin represents the preset boundary, λ represents the L2 regularization coefficient, ω represents the model parameters, and N is the total number of triplets in the triplet dataset.
[0028] Optionally, the domain adaptive loss is calculated as follows:
[0029]
[0030] Among them, z i and z i′ w represents different samples in the domain-adaptive source domain dataset, m represents the total number of samples in the domain-adaptive source domain dataset, and w j and w j′ represents different samples in the domain adaptive target domain dataset, n represents the total number of samples in the domain adaptive target domain dataset, and k(,) represents the Gaussian kernel function.
[0031] The beneficial effects of this invention are as follows:
[0032] This invention addresses the challenges of extremely scarce labeled samples in the target fault diagnosis scenario, relatively small source domain data size, and data distribution differences between the source and target domains during fault diagnosis. It proposes a multi-scale triplet weighted capsule network with a dual-branch architecture. Utilizing a joint training strategy, this network fully leverages the feature metric learning capability of triplet networks and the domain generalization capability of the maximum mean difference domain adaptation technique. This effectively alleviates the performance and generalization degradation caused by the extreme scarcity of labeled samples in the target domain, insufficient source domain data, and data distribution differences. This invention effectively solves the model performance degradation problem caused by small sample data conditions and data distribution differences, and different modules can improve model performance from different perspectives, providing a feasible solution for solving small-sample cross-domain fault diagnosis problems in practical industrial scenarios. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0034] Figure 1 This is a flowchart illustrating the construction process of the fault diagnosis model in an embodiment of the present invention.
[0035] Figure 2 This is a schematic diagram of the fault diagnosis model structure according to an embodiment of the present invention;
[0036] Figure 3 This is a schematic diagram of the adaptive wavelet feature attention module structure according to an embodiment of the present invention;
[0037] Figure 4 The graph shows the fault diagnosis accuracy results of the present invention and the comparison method in different small sample cross-condition tasks using the SD dataset in an embodiment of the present invention.
[0038] Figure 5 This is a graph showing the comparison of fault diagnosis accuracy between the present method and the comparative method in small-sample cross-device tasks 1-6 set up using the SD dataset, CWRU dataset and PU dataset in this embodiment of the invention;
[0039] Figure 6 The figure shows the ablation experiment results of the proposed method and the comparison method in a small sample cross-device task 1 set up using the SD dataset, CWRU dataset and PU dataset in this embodiment of the invention. Detailed Implementation
[0040] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0041] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0042] This embodiment provides a small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization, including:
[0043] Historical heterogeneous fault data of several mechanical equipments are obtained as source domain datasets, and historical heterogeneous fault data of target mechanical equipment are obtained as target domain datasets. Label spaces are set for the source domain datasets and the target domain datasets respectively.
[0044] Based on the source domain dataset and the target domain dataset, random sampling combinations are performed to construct a triplet dataset and a domain adaptive dataset.
[0045] The triplet dataset and the domain adaptive dataset are input into the dual-branch feature extraction subnetwork. The triplet feature embedding distance is measured, and iterative training is performed through a joint loss function to obtain a dual-branch fault diagnosis model. The dual-branch feature extraction subnetwork is used to extract features from the triplet dataset and the domain adaptive dataset using two branches respectively. The triplet feature embedding distance is obtained by calculating the Euclidean distance. The joint loss function is composed of triplet loss and domain adaptive loss.
[0046] Collect current heterogeneous fault data of the target mechanical equipment and input it into the dual-branch fault diagnosis model, output the fault classification of the vibration signal of the target mechanical equipment, and complete the small sample cross-domain fault diagnosis.
[0047] Specifically, this embodiment addresses the challenges of extremely scarce labeled samples in the target fault diagnosis scenario, relatively small source domain data size, and data distribution differences between the source and target domains during fault diagnosis. It proposes a multi-scale triplet weighted capsule network with a dual-branch architecture. This network utilizes a joint training strategy to fully leverage the feature metric learning capability of triplet networks and the domain generalization capability of the maximum mean difference domain adaptation technique. This effectively alleviates the decline in model performance and generalization caused by the extreme scarcity of labeled samples in the target domain, insufficient source domain data, and data distribution differences. It can effectively solve the model performance degradation problem caused by small sample data conditions and data distribution differences, and different modules can improve model performance from different perspectives, providing a feasible solution for solving small-sample cross-domain fault diagnosis problems in practical industrial scenarios.
[0048] In this embodiment, data acquisition and calibration are performed by designing various experimental equipment failure experiments to obtain heterogeneous failure data of several mechanical devices and target mechanical devices, and setting source domain datasets and target domain datasets.
[0049] Source domain dataset From probability distribution P Source Sampled from (X,Y), where x i Representing the source domain sample, y i This represents the corresponding fault category label, and M represents the number of samples in the source domain dataset, M = M c ×C, where M c M represents the number of samples in each fault category, C represents the number of fault categories, and M represents the number of samples in each fault category. c ≤10. Target domain dataset D Target From probability distribution P Target D was obtained by sampling from (X,Y). Target It consists of two parts, namely the labeled dataset. Compared with unlabeled datasets in This represents labeled samples in the target domain. N represents the corresponding fault category label. L This represents the number of labeled samples in the target domain. N represents unlabeled data in the target domain. U This represents the number of unlabeled data samples in the target domain. in represents the number of samples in each fault category of the labeled dataset in the target domain, where C represents the number of fault categories. Use L Source L represents the source domain data label space. Target This represents the label space of the target domain labeled data.
[0050] When the source domain data and target domain data come from the same device but under different operating conditions, their probability distribution and label space are represented as follows:
[0051]
[0052] When the source domain data and target domain data come from different devices, their probability distribution and label space are represented as follows:
[0053]
[0054] Furthermore, based on the source domain dataset and the target domain dataset, random sampling is performed to construct a triplet dataset and a domain-adaptive dataset, including:
[0055] Anchor samples, positive samples, and negative samples are randomly extracted from the labeled data of the source domain dataset using a Monte Carlo sampling strategy to construct a triplet dataset containing several combinations of anchor sample-positive sample-negative sample.
[0056] A domain-adaptive source domain dataset is constructed using all data from the source domain dataset, and an equal number of samples are selected from the unlabeled data of the target domain dataset through stratified random sampling as the domain-adaptive target domain dataset. The domain-adaptive source domain dataset and the domain-adaptive target domain dataset are combined to form a domain-adaptive dataset.
[0057] Furthermore, the dual-branch feature extraction subnetwork includes a triplet feature extraction subnetwork and a domain adaptive feature extraction subnetwork. Both the triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork adopt a five-layer composite architecture based on Morlet wavelet basis functions. This includes a multi-scale wavelet convolution module using a hybrid Haar and Morlet wavelet kernel, an adaptive wavelet feature attention module with channel-space attention mechanism, a deep residual convolution module with residual connections, a capsule network module with variable dynamic routing iterations, and a regularized fully connected module with Dropout layer embedded in sequence. The triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork achieve synchronous gradient updates and share all network weights through a parameter sharing mechanism.
[0058] The multi-scale wavelet convolution module extracts multi-scale features through wavelet convolutional networks with several wavelet kernels of different scales, and performs time-frequency feature decomposition using the Mallat algorithm to output multi-scale wavelet feature maps. The adaptive wavelet feature attention module calculates the internal attention weights of the multi-scale wavelet feature maps using a channel-space attention mechanism, and dynamically weights the multi-scale wavelet feature maps using Softmax to obtain overall weighted features. The deep residual convolution module performs convolution processing on the overall weighted features through several convolutional layers and uses skip connections to handle gradient vanishing to obtain convolutional features. The capsule network module updates the coupling coefficients through a dynamic routing algorithm and refines the convolutional features using several capsule network layers to obtain refined features. The regularized fully connected module outputs the refined features as the final features through several fully connected layers and Dropout layers, and introduces an elastic weight solidification strategy to reduce model overfitting.
[0059] Specifically, in this embodiment, the multi-scale wavelet convolution module extracts multi-scale features through a wavelet convolutional network with six layers of complex wavelet kernels at different scales. It uses the Mallat algorithm to perform time-frequency feature decomposition to obtain multi-scale wavelet features. The kernel size is halved layer by layer from 64 to 2, forming an exponentially decreasing six-level scale pyramid. The stride decreases from 16 to 1, achieving coarse-grained to fine-grained feature capture. The adaptive wavelet feature attention module calculates the attention weights within the multi-scale wavelet feature map through a convolutional attention mechanism and uses Softmax to dynamically weight the feature maps output from wavelet convolutional layers at different scales to obtain... Overall weighted features; the deep residual convolution module performs convolution processing on the weighted features through several convolutional layers in multiple residual blocks, adopts He initialization and batch normalization to obtain convolutional features, and uses skip connections to overcome gradient vanishing; the capsule network module updates the coupling coefficients through a dynamic routing algorithm, uses several capsule network layers to refine the convolutional features to obtain refined features, the primary capsule layer constructs part-level features, and the digital capsule layer realizes system-level diagnosis; the regularized fully connected module outputs the refined features as the final features through several fully connected layers and Dropout layers, and introduces an elastic weight solidification strategy to reduce model overfitting.
[0060] Furthermore, the triplet feature extraction subnetwork also includes a feature distance metric module. After the anchor sample, positive sample, and negative sample are forward-propagated through the triplet feature extraction subnetwork, the feature distance metric module calculates the feature embedding distance between the anchor sample and the positive and negative samples in the feature space, thereby obtaining the similarity relationship between the anchor sample and the positive and negative samples.
[0061] Specifically, Euclidean distance is used as the feature distance metric to calculate the feature embedding distance between the anchor sample and the positive and negative samples in the feature space. The feature distance metric is:
[0062]
[0063] Where, x a x represents the anchor sample in the triplet. p x represents the positive sample in the triplet. n Let f(·) represent the negative samples in the triplet, and let D(x) represent the feature mapping function of the triplet feature extraction subnetwork. a ,x p D(x) represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the triplet. a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the feature space in the triplet, l represents the feature dimension, and s represents the total feature dimension.
[0064] Furthermore, the joint loss function formed by combining the triplet loss and the domain adaptive loss is:
[0065] L Combine = (1-α)·L Triplet +α·L MMD ;
[0066] Among them, L Combine For joint loss, α is the weighting factor, and L Triplet For triplet loss, L MMD This is the domain-adaptive loss.
[0067] The method for calculating the triplet loss is as follows:
[0068]
[0069] in, This represents the anchor point sample in the i-th triplet. Represents the positive sample in the i-th triplet. This represents the negative sample in the i-th triplet. This represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the i-th triplet. denoted as the feature embedding distance between the anchor sample and the negative sample in the feature space of the i-th triplet, margin represents the preset boundary, λ represents the L2 regularization coefficient, ω represents the model parameters, and N is the total number of triplets in the triplet dataset.
[0070] The method for calculating the domain adaptive loss is as follows:
[0071]
[0072] Among them, z i and z i′ w represents different samples in the domain-adaptive source domain dataset, m represents the total number of samples in the domain-adaptive source domain dataset, and w j and w j′ represents different samples in the domain adaptive target domain dataset, n represents the total number of samples in the domain adaptive target domain dataset, and k(·,·) represents the Gaussian kernel function.
[0073] Specifically, such as Figure 1 As shown, the fault diagnosis model construction process in this embodiment is as follows:
[0074] S1. Construction of the triplet dataset: From a small number of labeled datasets in the pre-trained dataset (source domain) of the model, anchor samples, positive samples, and negative samples are randomly selected to form triplets.
[0075] S2. Construction of the domain-adaptive dataset: Randomly extract the same number of data from the source domain and the new dataset (target domain) to which the model will be applied to form the domain-adaptive dataset;
[0076] S3. Construction of the fault diagnosis model: A multi-scale triplet wavelet attention weighted capsule network model with a dual-branch architecture is built as a model to complete the small-sample cross-domain fault diagnosis task.
[0077] S4. Model Training: The model is optimized simultaneously through a triplet branch and a domain adaptation branch. The triplet branch calculates the embedding distance between the anchor point and the positive and negative samples through the feature extraction network and generates a triplet contrastive loss. The domain adaptation branch processes the source and target domain samples through the feature extraction network and calculates the MMD loss. The two are combined using a weighted factor to form a joint loss, which is used to update the model parameters until training is complete.
[0078] S5. Construction of Support Sample Set: From each fault category of a very small number of labeled datasets in the target domain, n samples are randomly selected to form a support sample set according to different task requirements.
[0079] S6. Construction of the Test Sample Pair Dataset: Based on the task requirements, randomly select multiple test samples from the unlabeled samples in the target domain that were not selected as domain adaptation target data, and pair each test sample with a sample in the support sample set to form a test sample pair. The label of each sample pair is determined by the category label of its supporting sample;
[0080] S7. Model Testing: Group the test sample pairs according to the test samples, with each group containing all sample pairs of the same test sample. Input the sample pairs into the trained model, and calculate the feature embeddings and measure the distances through the feature extraction network. In each group, select the label of the sample pair with the smallest feature distance as the predicted label of the test sample. Repeat this process until all test samples are labeled to evaluate the model's classification performance.
[0081] Furthermore, in step S1, a sample is randomly selected from a small amount of labeled data in the source domain using Monte Carlo sampling as the anchor sample, and a sample is randomly selected from the same fault category as the positive sample. Then, a sample is randomly selected from different fault categories as the negative sample, thus forming a triplet. Through this construction, the triplet network can simultaneously optimize the distance between the anchor point and the positive sample, as well as the distance between the anchor point and the negative sample in the feature space. It also more accurately captures the relative positional relationships of samples in the feature space, thereby effectively learning the similarity between samples and improving the discriminative power of the feature representation.
[0082] Furthermore, in step S2, all source domain samples are selected to form a domain-adaptive source domain dataset. And from the unlabeled dataset of the target domain In this process, the same number of samples are randomly selected stratified as the domain-adaptive target domain dataset to ensure that the sampling probability of each failure mode satisfies the following:
[0083]
[0084] Finally, construct the domain-aligned dataset. in Achieve cross-domain distribution matching.
[0085] Furthermore, in step S3, the model construction is as follows:
[0086] This model employs a dual-branch architecture. One branch focuses on metric learning of triplet features to capture the similarities and differences between the source and target domain data. The other branch aims to narrow the data distribution gap between the source and target domains, ensuring improved diagnostic performance in the target domain. Both branches share the same feature extraction subnetwork structure and weights. Their detailed architecture is as follows: Figure 2 As shown.
[0087] Each feature extraction subnetwork consists of several key modules, including: a multi-scale wavelet convolution module, an adaptive wavelet feature attention module, three convolution modules, a capsule network module, and a fully connected module. The multi-scale wavelet convolution module comprises six wavelet convolutional networks containing wavelet kernels of different scales. Each layer uses a wavelet convolutional layer (ReLU nonlinear activation layer + batch normalization layer (BN)) and a max pooling layer, serving as the first layer of the feature extraction subnetwork. It utilizes wavelet convolution kernels of different scales to perform multi-dimensional feature extraction and mining on the original signal, extracting multi-scale features through wavelet transform to enhance the time-frequency representation capability of the features. The specific structure of the module is shown in Table 1. The adaptive wavelet feature attention module combines the convolutional attention mechanism (CBAM) to calculate the attention weights within different wavelet feature maps and uses Softmax to weight the overall features, dynamically highlighting features more recognizable for fault diagnosis tasks, thereby improving model performance. The specific structure is shown in Table 1. Figure 3 .
[0088] In the convolutional module, a max-pooling layer is removed after each convolutional layer to retain more fine-grained information. After three convolutions, L”=71 is maintained, and the feature length is maintained through zero padding. The capsule network module consists of two capsule network layers: the primary capsule layer constructs component-level features, and the digital capsule layer realizes system-level diagnosis, which can further refine the features extracted by the preceding convolutional module and improve the model's generalization ability in few-shot learning scenarios. The fully connected module contains two fully connected layers with a Dropout layer to reduce the risk of overfitting.
[0089] Unlike conventional feature extraction, the triplet network introduces an additional feature distance metric module. This module is used to calculate the embedding distance between the anchor sample and the positive and negative samples in the feature space, thereby optimizing the relative distance relationship between samples through metric learning and further improving the model's discriminative ability.
[0090] Table 1
[0091]
[0092] Furthermore, in step S4, the model needs to be trained simultaneously on both the triplet branch and the domain adaptation branch. Specifically, this includes:
[0093] For the feature extraction subnetwork, assuming the multi-scale wavelet convolution module consists of N wavelet convolutional layers with different wavelet kernels, feature extraction is achieved using the triplet dataset constructed by S1 and S2 and the domain-adaptive dataset. The output feature map of each wavelet convolutional layer is denoted as F. i , i∈{1,2,...,N}, where all feature maps have the same number of channels and size.
[0094] In the Adaptive Wavelet Feature Attention (AWFA) module, for each feature map F i The corresponding CBAM attention weight A is calculated through the Convolutional Attention Mechanism (CBAM) module. i The obtained CBAM attention weights A i By concatenating them together, we obtain a joint weight vector A. Concat , is represented as:
[0095] A Concat =Concat(A1,A2,…,A) N );
[0096] The obtained joint weight vector A Concat The final weight ratio W is calculated using the Softmax function:
[0097] W = [W1, W2, ..., W i ,...,W N ] = Softmax(A Concat );
[0098] The Softmax function ensures that the sum of the weights of all feature maps is 1, i.e.
[0099] Based on the calculated weight ratio W, for each feature map F i The weighted feature map F′ is obtained by performing weighted processing. i for:
[0100] F′ i =W i ×F i ;
[0101] All weighted feature maps are concatenated along the channel direction to obtain the final fused feature map F. final , is represented as:
[0102] F final =Concat(F′1,F′2,...,F′ N );
[0103] After feature map fusion, the network further utilizes three convolutional modules, each containing a one-dimensional convolutional layer, a batch normalization (BN) layer, and a ReLU non-linear activation layer. By employing convolutional kernels of different sizes, it performs further in-depth feature extraction on the fused features extracted by the previous module. Subsequently, two capsule network layers are used to further refine the features extracted by the preceding convolutional modules, improving the network's performance in solving small sample problems. Finally, two fully connected layers with dropout layers are used to reduce model overfitting.
[0104] After dual-branch feature extraction, the feature distance metric module in the triplet network calculates the feature embedding distance between the anchor sample and the positive and negative samples in the feature space. Euclidean distance is used as the feature distance metric function, and its formula can be expressed as:
[0105]
[0106] Where, x a x represents the anchor sample in the triplet. p x represents the positive sample in the triplet. n Let f(·) represent the negative samples in the triplet, and let D(x) represent the feature mapping function of the triplet feature extraction subnetwork. a ,x p D(x) represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the triplet. a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the feature space in the triplet, l represents the feature dimension, and s represents the total feature dimension.
[0107] This branch then utilizes the triplet loss function for metric learning to optimize the feature space, bringing samples of the same class closer together and maximizing the distance between samples of different classes. The triplet loss function used by the model is:
[0108]
[0109] in, This represents the anchor point sample in the i-th triplet. Represents the positive sample in the i-th triplet. This represents the negative sample in the i-th triplet. This represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the i-th triplet. denoted as the feature embedding distance between the anchor sample and the negative sample in the feature space of the i-th triplet, margin represents the preset boundary, λ represents the L2 regularization coefficient, and w represents the model parameters.
[0110] In the second branch of the model, transfer learning techniques are needed to reduce the distributional discrepancy between the source and target domain data during training, and loss calculations are performed on the domain adaptive feature extraction sub-network. For this purpose, the Correlation Alignment (CORAL) method is typically used to align the feature covariance matrices of the source and target domains, thereby reducing distributional bias at the feature level. Alternatively, a Domain Adversarial Neural Network (DANN) can be introduced, using a domain classifier to determine the sample's domain affiliation and a Gradient Reversal Layer (GRL) to suppress domain classification during backpropagation, making the features of the source and target domains indistinguishable, thus improving the model's generalization ability.
[0111] Furthermore, to further optimize the domain adaptation effect, a maximum mean difference (MMD) loss function based on the Radial Basis Function (RBF) is adopted to measure the distribution difference between the source and target domains in the high-dimensional feature space. This loss is minimized during training, thereby effectively achieving cross-domain feature alignment. The Gaussian kernel function is a function used to calculate the similarity between two samples, and its expression is:
[0112]
[0113] Where x and y represent two samples, ||xy|| 2 σ represents the square of the Euclidean distance between two samples, σ represents the kernel width parameter, and exp(·) represents the natural exponential function.
[0114] The expression for the MMD loss function based on the Gaussian kernel function is:
[0115]
[0116] z i and z i′ w represents different samples in the source domain j and w j′ represents different samples in the target domain, and k(,·) represents the Gaussian kernel function.
[0117] After calculating the two-branch loss function, the joint loss function is calculated using the triplet loss function and the maximum mean difference loss function. This joint loss function is then constructed by weighting the sums using a weighting factor α. Its expression is:
[0118] L Combine = (1-α)·L Triplet +α·L MMD ;
[0119] Furthermore, in step S5, the construction of the support sample set first involves dividing the data according to fault categories based on all labeled data in the target domain. Then, within each fault category, n samples are randomly selected based on specific task requirements; the choice of n can be determined according to the actual situation. Although the sampling is random, it is crucial that the selected samples represent the characteristics of that fault category, which is essential for the accuracy of subsequent diagnosis.
[0120] Further, in step S6, after removing the data already used for domain adaptation from the target domain, several test samples are randomly selected from the remaining unlabeled samples. For each test sample, it is paired with all samples in the support sample set constructed in step S5 (each fault category has several support samples). In each sample pair, the test sample has no label, but the support samples have explicit fault category labels. Therefore, the labels of the support samples can be used as the reference labels for that sample pair. In subsequent model testing, this label is used to determine whether the model correctly classifies the test sample into the fault category.
[0121] Further, in step S7, all test sample pairs are grouped according to the test sample. Each group contains one test sample and multiple pairs of supporting samples from each fault category. Each sample pair is input into the trained model. The model obtains the feature embeddings of the test sample and the supporting samples through the feature extraction sub-network, and then calculates the distance or similarity between them in the embedding space. For each test sample, Euclidean distance is used to compare its distance with all supporting samples, and the fault category corresponding to the sample with the smallest distance (or the highest similarity) is selected as the predicted label. This process is repeated until all test samples are labeled to measure the model's performance in the target domain fault classification task.
[0122] Experimental verification:
[0123] 1. Experiment Introduction:
[0124] This study investigates two different small-sample cross-domain fault diagnosis problems: 1) small-sample cross-domain fault diagnosis between the same equipment under different operating conditions, and 2) small-sample cross-domain fault diagnosis between different equipment. Experiments were conducted using three different datasets for validation. Dataset A is the CWRU dataset; dataset B is the Paderborn University Dataset (PU); and dataset C is the Spindle Dataset (SD) for laboratory machine tool spindle bearing faults.
[0125] The experimental platform for dataset A includes a test motor, a force gauge, a torque sensor, and the bearing under test. Vibration signals were acquired by accelerometers located on the drive end and fan end housings, with sampling frequencies of 12kHz and 48kHz, respectively. The dataset contains artificially engineered single-point faults, including rolling element faults (BF), outer ring faults (OF), and inner ring faults (IF). Each fault is categorized into three severity levels: mild (0.007 inches), moderate (0.014 inches), and severe (0.021 inches). Data was collected under different loads and speeds, resulting in ten fault types.
[0126] The experiment in dataset B simulated different operating conditions by adjusting the spindle speed, transmission system load torque, and bearing radial force. Data were collected for three bearing states: normal state, artificial failure, and natural degradation failure. Normal bearing data came from six bearings with different operating times but the same operating conditions; artificial failure bearing data came from 12 bearings, all of the same model, and the outer and inner ring failures were created through drilling, electrical etching, and electrical discharge machining. The severity of the failures was divided into mild (level one) and severe (level two).
[0127] Dataset C was collected from the spindle internal shaft angular contact ball bearing using two data acquisition systems: IFM and NI. The IFM system used the VSE100 data acquisition box, while the NI system used the NI9234 data acquisition card and the NI CDAQ9189 data acquisition box. The fault signal sampling frequency was 25kHz. A unidirectional accelerometer collected signals in one direction, and a tridirectional accelerometer collected signals in three directions in the machine tool coordinate system. The dataset included four health states: normal (NC), outer ring fault (OF), inner ring fault (IF), and cage fault (CF), and experiments were conducted at four speeds (6000, 7000, 8000, and 9000 RPM) and three load conditions (no load, light load, and heavy load).
[0128] 2. Method Validation:
[0129] The parameters of the feature extraction sub-network in the constructed fault diagnosis model are shown in Table 2. The proposed feature extraction sub-network consists of five core modules, including a multi-scale wavelet convolution module, an adaptive wavelet feature attention module, a convolution module, a capsule network module, and a fully connected module. Table 2 shows the other four modules except for the adaptive wavelet feature attention module. Each building block consists of different layers. Among them, B1 (multi-scale wavelet convolution module) contains six sub-units, each of which consists of a wavelet convolution layer, a batch normalization layer (BN), a ReLU nonlinear activation layer, and a max pooling layer. B2 (convolution module) consists of three sub-units, each of which includes a one-dimensional convolution layer, a batch normalization layer (BN), and a ReLU nonlinear activation layer, and the max pooling layer has been removed. B3 (capsule network module) contains two capsule network layers and uses the Squashing function as the activation function. B4 (fully connected module) consists of two fully connected layers with a Dropout layer added between the two layers.
[0130] The proposed domain-adaptive model of the multi-scale triplet attention wavelet capsule network needs to be fully trained on the dataset. During optimization, the Adadelta algorithm is used with a learning rate of 0.25, a batch size of 32, an L2 regularization coefficient of 0.00025, and a loss function weighting factor of 0.6, followed by 50 iterations of training.
[0131] Table 2
[0132]
[0133] Two sets of experiments were designed to explore the performance of small-sample cross-domain fault diagnosis. The first set of experiments, designed on dataset C, included three experiments (Experiments 1-3) focusing on small-sample cross-domain fault diagnosis under different equipment conditions. The second set of experiments, Experiment 4, focused on small-sample cross-domain fault diagnosis under different equipment conditions, setting up six cross-equipment tasks across the three datasets. During the construction of the diagnostic tasks for the SD bearing dataset, experimental tasks were designed for different operating conditions in the source and target domains. For example, in Experiment 1, under no-load conditions, six cross-speed tasks were set up, ensuring that the speeds in the source and target domains were different, to simulate small-sample cross-speed fault diagnosis scenarios. Experiment 3 was somewhat unique, only using load and speed in the source and target domains in Tasks 1 and 3 to analyze the impact of different factors on the diagnostic effect. Furthermore, when constructing the diagnostic tasks for the three datasets, experiments were conducted on six cross-equipment tasks using the fault categories, dataset types, and operating conditions of the source and target domains to simulate different small-sample cross-equipment fault diagnosis scenarios. The specific experimental tasks are designed as shown in Tables 3 and 4.
[0134] Table 3
[0135]
[0136] Table 4
[0137]
[0138] To construct the training and testing sets for the network, a triplet dataset and a domain-adaptive source domain dataset are constructed by randomly sampling from the source domain dataset. Specifically, the source domain dataset contains four fault categories, with 10 labeled samples selected from each category, totaling 40 samples. 100 triplets are then constructed based on these samples for training. Simultaneously, 40 unlabeled samples are randomly sampled from the target domain dataset to form the domain-adaptive target domain dataset. Furthermore, to construct the support sample set, four fault categories are selected from the target domain dataset, each containing one labeled sample, ensuring no overlap with the domain-adaptive target domain dataset. The test sample pair dataset is randomly sampled from the target domain dataset, with 100 unlabeled samples from each fault category, totaling 400 test samples, ensuring no overlap with either the domain-adaptive target domain dataset or the support sample set.
[0139] (1) Comparison of this method with other classic algorithms:
[0140] To verify the superiority of our proposed method, several classic algorithms were compared in four experiments, including MWFW, MWFK, and MWPN. To ensure fairness, all methods employed the same feature extraction subnetwork structure. To prevent randomness, each experiment was independently repeated five times, and the mean of the results was used as the statistical standard.
[0141] Table 5
[0142]
[0143] The domain-adaptive model of the multi-scale triplet attention wavelet capsule network was compared with the traditional three-class multi-scale wavelet models, and the results are shown in Table 5. Using the SD, CWRU, and PU datasets, and comparing different small-sample cross-domain fault diagnosis methods such as MWPN, MWFK, and MWFW, the performance of the proposed method in different small-sample cross-domain fault diagnosis scenarios was comprehensively evaluated from the perspectives of fault diagnosis accuracy and feature visualization. To evaluate the superiority of the proposed method, bar charts and radar charts were used to evaluate the fault diagnosis accuracy of the four methods. Figure 4 The method demonstrates that by setting different small-sample cross-condition tasks using the SD dataset, the average fault diagnosis accuracy remains above 90%, which is more than 10% higher than other comparative methods. Figure 5 The results demonstrate that, in a few-sample cross-device task using the SD, CWRU, and PU datasets, the proposed model achieves an average fault diagnosis accuracy of 92.87%, which is 12.07% higher than other comparative methods. Therefore, this method exhibits superior fault classification and feature clustering capabilities compared to other comparative methods.
[0144] (2) Ablation experiments using this method:
[0145] Furthermore, ablation experiments were constructed to further demonstrate the performance trend of the model. A small-sample cross-device fault diagnosis task 1 was selected to complete the ablation experiment of the proposed model. The experimental setup is shown in Table 6. Figure 6As shown, the proposed method performs reasonably well in the small-sample cross-device fault diagnosis task 1, achieving an average fault diagnosis accuracy of 87.19%. Removing the domain adaptation module (A1) significantly reduces model performance because this module effectively reduces the data distribution difference between the source and target domains, thereby improving the model's generalization ability in the target domain. Simplifying the triplet network to a Siamese network (A2) slightly reduces model performance, but the decrease is small. This is because the triplet network has a stronger feature metric learning ability, enabling the model to more accurately capture the similarities and differences between samples. Removing the adaptive wavelet feature attention mechanism (A3) significantly degrades model performance. This mechanism highlights key information and suppresses irrelevant features, thereby improving the model's effectiveness and robustness. Removing the capsule network module (A4) again significantly reduces model performance. This is because the capsule network can further refine feature extraction and, with its powerful feature representation capabilities, improve the accuracy of small-sample fault diagnosis.
[0146] Table 6
[0147]
[0148] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization, characterized in that, include: Historical heterogeneous fault data of several mechanical equipments are obtained as source domain datasets, and historical heterogeneous fault data of target mechanical equipment are obtained as target domain datasets. Label spaces are set for the source domain datasets and the target domain datasets respectively. Based on the source domain dataset and the target domain dataset, random sampling combinations are performed to construct a triplet dataset and a domain adaptive dataset. The triplet dataset and the domain adaptive dataset are input into the dual-branch feature extraction subnetwork. The triplet feature embedding distance is measured, and iterative training is performed through a joint loss function to obtain a dual-branch fault diagnosis model. The dual-branch feature extraction subnetwork is used to extract features from the triplet dataset and the domain adaptive dataset using two branches respectively. The triplet feature embedding distance is obtained by calculating the Euclidean distance. The joint loss function is composed of triplet loss and domain adaptive loss. Collect current heterogeneous fault data of the target mechanical equipment and input it into the dual-branch fault diagnosis model, output the fault classification of the vibration signal of the target mechanical equipment, and complete the small sample cross-domain fault diagnosis.
2. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 1, characterized in that, Based on the source domain dataset and the target domain dataset, random sampling combinations are used to construct a triplet dataset and a domain-adaptive dataset, including: Anchor samples, positive samples, and negative samples are randomly extracted from the labeled data of the source domain dataset using a Monte Carlo sampling strategy to construct a triplet dataset containing several combinations of anchor sample-positive sample-negative sample. A domain-adaptive source domain dataset is constructed using all data from the source domain dataset, and an equal number of samples are selected from the unlabeled data of the target domain dataset through stratified random sampling as the domain-adaptive target domain dataset. The domain-adaptive source domain dataset and the domain-adaptive target domain dataset are combined to form a domain-adaptive dataset.
3. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 1, characterized in that, The dual-branch feature extraction subnetwork includes a triplet feature extraction subnetwork and a domain adaptive feature extraction subnetwork. Both the triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork adopt a five-layer composite architecture based on Morlet wavelet basis functions. These include a multi-scale wavelet convolution module using a hybrid Haar and Morlet wavelet kernel, an adaptive wavelet feature attention module with channel-space attention mechanism, a deep residual convolution module with residual connections, a capsule network module with variable dynamic routing iterations, and a regularized fully connected module with Dropout layer embedded in sequence. The triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork achieve synchronous gradient updates and share all network weights through a parameter sharing mechanism.
4. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 3, characterized in that, The multi-scale wavelet convolution module extracts multi-scale features through wavelet convolutional networks with several wavelet kernels of different scales, and performs time-frequency feature decomposition using the Mallat algorithm to output multi-scale wavelet feature maps. The adaptive wavelet feature attention module calculates the internal attention weights of the multi-scale wavelet feature maps through a channel-spatial attention mechanism, and uses Softmax to dynamically weight the multi-scale wavelet feature maps to obtain overall weighted features. The deep residual convolution module performs convolution processing on the overall weighted features through several convolutional layers, and uses skip connections to handle gradient vanishing to obtain convolutional features. The capsule network module updates the coupling coefficients through a dynamic routing algorithm, and uses several capsule network layers to refine the convolutional features to obtain refined features. The regularized fully connected module outputs the refined features as the final features through several fully connected layers and Dropout layers, and introduces an elastic weight solidification strategy to reduce model overfitting.
5. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 3, characterized in that, The triplet feature extraction subnetwork also includes a feature distance metric module. After the anchor sample, positive sample, and negative sample are forward-propagated through the triplet feature extraction subnetwork, the feature distance metric module calculates the feature embedding distance between the anchor sample and the positive and negative samples in the feature space to obtain the similarity relationship between the anchor sample and the positive and negative samples.
6. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 5, characterized in that, The feature embedding distance between the anchor sample and the positive and negative samples in the feature space is calculated using Euclidean distance as the feature distance metric function. The feature distance metric function is: Where, x a x represents the anchor sample in the triplet. p x represents the positive sample in the triplet. n Let f(·) represent the negative samples in the triplet, and let D(x) represent the feature mapping function of the triplet feature extraction subnetwork. a ,x p D(x) represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the triplet. a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the feature space in the triplet, l represents the feature dimension, and s represents the total feature dimension.
7. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 1, characterized in that, The joint loss function, combining the triplet loss and the domain adaptive loss, is as follows: L Combine =(1-a)·L Triplet +α·L MMD ; Among them, L Combine For joint loss, α is the weighting factor, and L Triplet For triplet loss, L MMD This is the domain-adaptive loss.
8. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 7, characterized in that, The method for calculating the triplet loss is as follows: in, Represents the anchor point sample in the i-th triplet. Represents the positive sample in the i-th triplet. This represents the negative sample in the i-th triplet. This represents the feature embedding distance between the anchor sample and the positive sample in the feature space of the i-th triplet. denoted as the feature embedding distance between the anchor sample and the negative sample in the feature space of the i-th triplet, margin represents the preset boundary, λ represents the L2 regularization coefficient, ω represents the model parameters, and N is the total number of triplets in the triplet dataset.
9. The small-sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 7, characterized in that, The method for calculating the domain adaptive loss is as follows: Among them, z i and z i′ w represents different samples in the domain-adaptive source domain dataset, m represents the total number of samples in the domain-adaptive source domain dataset, and w j and w j′ represents different samples in the domain adaptive target domain dataset, n represents the total number of samples in the domain adaptive target domain dataset, and k(·,·) represents the Gaussian kernel function.
Citation Information
Patent Citations
Rotary machinery fault diagnosis method under complex working condition based on meta transfer learning
CN113469219A
Multi-working-condition process industrial fault detection and diagnosis method based on deep transfer learning
WO2023071217A1