Small sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization
Through the dual branch fault diagnosis method of multi-scale feature learning and domain adaptive optimization, the fault diagnosis problem under the condition of small sample data of rotating machinery is solved, and the accuracy and generalization ability of the model in cross-domain fault diagnosis are improved.
Patent Information
- Application Number
- CN202510538788.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2045-04-27
AI Technical Summary
In rotary mechanical fault diagnosis, there is a problem that the performance of the deep learning model is degraded due to the differences in small sample data conditions and data distribution. Especially in the case of extremely lack of target domain label samples and insufficient source domain data, the accuracy and generalization of the model are severely weakened.
Using a method based on multi-scale feature learning and domain adaptive optimization, a double branch feature extraction subnet is constructed, and iterative training is performed using triple feature embedding distance and domain adaptive loss function to obtain a dual branch fault diagnosis model to realize cross-domain fault diagnosis.
It effectively alleviates the problem of model performance degradation caused by the differences in small sample data conditions and data distribution, and improves the cross-domain fault diagnosis capabilities of the model in actual industrial scenarios.
Smart Images

Figure CN120448968A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of intelligent fault diagnosis of rotating machinery, and in particular to a small sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization. Background Art
[0002] With the continuous development of my country's industrial system, rotating machinery, as a common type of equipment, is moving towards larger sizes, higher efficiency, and higher performance. However, due to the long-term harsh conditions of rotating machinery, such as high speeds, heavy loads, and temperature fluctuations, its key components are prone to failure, leading to equipment failure. These failures not only affect machining accuracy and product quality, but can also damage equipment or production lines, and even cause safety accidents. Therefore, timely and accurate identification of rotating machinery faults and effective monitoring of fault evolution are crucial to 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 collect massive amounts of data on equipment operation in real time through high-density sensor networks, providing multi-dimensional data support for the intelligent diagnosis of rotating machinery. Compared with 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 the construction of deep neural networks with multi-level abstraction capabilities, which automatically extract high-level fault features of faults through end-to-end learning mechanisms. This technical approach not only avoids the reliance of manual feature engineering on expert knowledge in traditional methods, but also achieves accurate identification and decision analysis of complex fault modes through the stacking of nonlinear functions.
[0004] Although deep learning technology has revolutionized rotating machinery fault diagnosis, its industrial implementation still faces significant data bottlenecks and generalization challenges. The accuracy and generalization of deep learning models typically rely on massive amounts of labeled data. However, in real industrial production, rotating machinery operates normally for up to 95% of its operating cycles, resulting in less than 5% of fault samples collected by monitoring systems. Therefore, collecting sufficient fault data directly from industrial sites to support deep learning model training is particularly difficult. Furthermore, rotating machinery often operates under diverse operating conditions, resulting in collected data with varying data distributions. This distribution difference between training and test data, as well as inconsistencies in the label space, severely impairs the model's cross-domain generalization capabilities. These issues further complicate the application of deep learning in rotating machinery fault diagnosis.
[0005] In summary, there is an urgent need to study the problem of fault diagnosis under small sample data conditions. This is not only the key to ensuring the stable operation of rotating machinery, but also the basic premise for promoting the reliable, safe and efficient development of mechanical 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 to solve the problem of model performance degradation caused by small sample data conditions and data distribution differences.
[0007] To achieve the above object, the present invention provides the following solutions:
[0008] A small sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization, including:
[0009] Obtain historical heterogeneous fault data of several mechanical devices as a source domain dataset, obtain historical heterogeneous fault data of a target mechanical device as a target domain dataset, and set label spaces for the source domain dataset and the target domain dataset respectively;
[0010] Based on the source domain dataset and the target domain dataset, a random sampling combination is performed to construct a triple dataset and a domain adaptation dataset;
[0011] Inputting the triplet dataset and the domain adaptation dataset into a dual-branch feature extraction subnetwork, measuring the triplet feature embedding distance, and iteratively training using a joint loss function to obtain a dual-branch fault diagnosis model, wherein the dual-branch feature extraction subnetwork is used to respectively extract features from the triplet dataset and the domain adaptation dataset using two branches, the triplet feature embedding distance is obtained by calculating the Euclidean distance, and the joint loss function is composed of a combination of triplet loss and domain adaptation loss;
[0012] The current heterogeneous fault data of the target mechanical equipment is collected and input into the dual-branch fault diagnosis model, and the fault classification of the vibration signal of the target mechanical equipment is output to complete the small sample cross-domain fault diagnosis.
[0013] Optionally, constructing a triplet dataset and a domain adaptation dataset based on random sampling and combination of 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 anchor sample-positive sample-negative sample combinations.
[0015] A domain adaptation source domain dataset is constructed using all the data in the source domain dataset, and the same number of samples are selected from the unlabeled data of the target domain dataset through stratified random sampling as the domain adaptation target domain dataset. The domain adaptation source domain dataset and the domain adaptation target domain dataset are combined to form a domain adaptation 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 the Morlet wavelet basis function, including a multi-scale wavelet convolution module using a Haar and Morlet mixed wavelet kernel, an adaptive wavelet feature attention module integrating a channel-space attention mechanism, a deep residual convolution module with a residual connection, a capsule network module with a variable number of dynamic routing iterations, and a regularized fully connected module embedded in a Dropout layer. The triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork realize gradient synchronization update 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 a wavelet convolution network of several wavelet kernels of different scales, and perform time-frequency feature decomposition through the Mallat algorithm to output a multi-scale wavelet feature map; the adaptive wavelet feature attention module is used to calculate the internal attention weights of the multi-scale wavelet feature map through the channel-space attention mechanism, and use Softmax to dynamically weight the multi-scale wavelet feature map to obtain overall weighted features; the deep residual convolution module is used to convolve the overall weighted features through several convolution layers, and use jump connections to process gradient disappearance to obtain convolution features; the capsule network module is used to update the coupling coefficient through a dynamic routing algorithm, and use several capsule network layers to refine the convolution features to obtain refined features; the regularized fully connected module is used to output the refined features as final features through several fully connected layers and Dropout layers, and introduce an elastic weight solidification strategy to reduce model overfitting.
[0018] Optionally, the triple feature extraction subnetwork also includes a feature distance measurement module. After the anchor sample-positive sample-negative sample is forward propagated through the triple feature extraction subnetwork, the feature distance measurement module is used to calculate the feature embedding distance between the anchor sample and the positive sample and the negative sample in the feature space to obtain the similarity relationship between the anchor sample and the positive sample and the negative sample.
[0019] Optionally, the Euclidean distance is used as a feature distance metric function to calculate the feature embedding distance between the anchor sample and the positive sample and the negative sample in the feature space, wherein the feature distance metric function is:
[0020]
[0021] Among them, x a Represents the anchor point sample in the triplet, x p represents the positive sample in the triplet, x nrepresents the negative sample in the triplet, f(·) represents the feature mapping function of the triplet feature extraction sub-network, D(x a ,x p ) represents the feature embedding distance between the anchor sample and the positive sample in the triplet in the feature space, D(x a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the triplet in the feature space, 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 adaptation loss is:
[0023] L Combine =(1-α)·L Triplet +α·L MMD ;
[0024] Among them, L Combine is the joint loss, α is the weighting factor, L Triplet is the triplet loss, L MMD is the domain adaptation loss.
[0025] Optionally, the triplet loss is calculated as follows:
[0026]
[0027] in, represents the anchor point sample in the i-th triplet, represents the positive sample in the i-th triplet, represents the negative sample in the i-th triplet, represents the feature embedding distance between the anchor sample and the positive sample in the i-th triplet in the feature space, represents the feature embedding distance between the anchor sample and the negative sample in the i-th triplet in the feature space, margin represents the preset boundary, λ represents the L2 regularization coefficient, ω represents the model parameter, and N is the total number of triplets in the triplet dataset.
[0028] Optionally, the domain adaptation loss is calculated as follows:
[0029]
[0030] Among them, z i and z i′ represents different samples in the domain adaptation source domain dataset, m represents the total number of samples in the domain adaptation source domain dataset, and w j and w j′ represents different samples in the domain adaptation target domain dataset, n represents the total number of samples in the domain adaptation target domain dataset, and k(,) represents the Gaussian kernel function.
[0031] The beneficial effects of the present invention are:
[0032] The present invention aims to solve the problems in the fault diagnosis process such as the extreme lack of labeled samples in the target fault diagnosis scenario, the relatively small scale of source domain data, and the data distribution differences between the source domain and the target domain data. The multi-scale triplet weighted capsule network with a dual-branch architecture is proposed by a joint training strategy to give full play to the feature metric learning ability of the triplet network and the domain generalization ability of the maximum mean difference domain adaptation technology, effectively alleviating the problem of decreased model performance and generalization caused by the extreme lack of labeled samples in the target domain, insufficient source domain data and data distribution differences. The present invention can effectively solve the problem of decreased model performance caused by small sample data conditions and data distribution differences, and different modules can improve the performance of the model from different angles, providing a feasible solution to the problem of small sample cross-domain fault diagnosis in actual industrial scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0034] Figure 1 A flow chart for constructing a fault diagnosis model according to an embodiment of the present invention;
[0035] Figure 2 A schematic diagram of the structure of a fault diagnosis model according to an embodiment of the present invention;
[0036] Figure 3 Schematic diagram of the structure of the adaptive wavelet feature attention module according to an embodiment of the present invention;
[0037] Figure 4 This is a graph showing the fault diagnosis accuracy results of the present method and the comparative method in different small sample cross-operating condition tasks using the SD dataset according to an embodiment of the present invention;
[0038] Figure 5 This is a graph comparing the fault diagnosis accuracy of the present method and the comparative method in small sample cross-device tasks 1-6 set using the SD dataset, CWRU dataset, and PU dataset according to an embodiment of the present invention;
[0039] Figure 6 This is a graph showing the ablation experiment results of the present method and the comparison method in the small sample cross-device task 1 set using the SD dataset, CWRU dataset, and PU dataset according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0041] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is 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] Obtain historical heterogeneous fault data of several mechanical devices as a source domain dataset, obtain historical heterogeneous fault data of a target mechanical device as a target domain dataset, and set label spaces for the source domain dataset and the target domain dataset respectively;
[0044] Based on the source domain dataset and the target domain dataset, a random sampling combination is performed to construct a triple dataset and a domain adaptation dataset;
[0045] Inputting the triplet dataset and the domain adaptation dataset into a dual-branch feature extraction subnetwork, measuring the triplet feature embedding distance, and iteratively training using a joint loss function to obtain a dual-branch fault diagnosis model, wherein the dual-branch feature extraction subnetwork is used to respectively extract features from the triplet dataset and the domain adaptation dataset using two branches, the triplet feature embedding distance is obtained by calculating the Euclidean distance, and the joint loss function is composed of a combination of triplet loss and domain adaptation loss;
[0046] The current heterogeneous fault data of the target mechanical equipment is collected and input into the dual-branch fault diagnosis model, and the fault classification of the vibration signal of the target mechanical equipment is output to complete the small sample cross-domain fault diagnosis.
[0047] Specifically, this embodiment addresses the problems in the fault diagnosis process, such as the extreme lack of labeled samples in the target fault diagnosis scenario, the relatively small scale of source domain data, and the data distribution differences between the source domain and the target domain data. The proposed multi-scale triplet weighted capsule network with a dual-branch architecture utilizes a joint training strategy to give full play to the feature metric learning ability of the triplet network and the domain generalization ability of the maximum mean difference domain adaptation technology, effectively alleviating the problem of decreased model performance and generalization caused by the extreme lack of labeled samples in the target domain, insufficient source domain data, and data distribution differences; it can effectively solve the problem of decreased model performance caused by small sample data conditions and data distribution differences, and different modules can improve the performance of the model from different angles, providing a feasible solution to the problem of small sample cross-domain fault diagnosis in actual industrial scenarios.
[0048] In the data collection and calibration of this embodiment, by designing various test equipment failure experiments, heterogeneous failure data of several mechanical devices and target mechanical devices are obtained, and source domain data sets and target domain data sets are set.
[0049] Source domain dataset From the probability distribution P Source (X,Y) is sampled, where x i represents the source domain sample, y i represents the corresponding fault category label, M represents the number of samples in the source domain dataset, M=M c ×C, where M c represents the number of samples in each fault category, C represents the number of fault categories, and M c ≤10. Target domain dataset D Target From the probability distribution P Target (X, Y) is sampled, D Target It consists of two parts: labeled dataset With unlabeled dataset in represents the labeled samples in the target domain, Represents the corresponding fault category label, N L represents the number of labeled samples in the target domain, represents the unlabeled data in the target domain, N U Represents the number of unlabeled data samples in the target domain. in represents the number of samples in each fault category of the target domain labeled dataset, C represents the number of fault categories, Use L Source represents the source domain data label space, L Target Represents the target domain labeled data label space.
[0050] When the source domain data and target domain data come from the same device but different working conditions, their probability distribution and label space are expressed as follows:
[0051]
[0052] When the source domain data and target domain data come from different devices, their probability distribution and label space are expressed as:
[0053]
[0054] Furthermore, constructing a triplet dataset and a domain adaptation dataset based on random sampling and combination of the source domain dataset and the target domain dataset includes:
[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 anchor sample-positive sample-negative sample combinations.
[0056] A domain adaptation source domain dataset is constructed using all the data in the source domain dataset, and the same number of samples are selected from the unlabeled data of the target domain dataset through stratified random sampling as the domain adaptation target domain dataset. The domain adaptation source domain dataset and the domain adaptation target domain dataset are combined to form a domain adaptation 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 the Morlet wavelet basis function, including a multi-scale wavelet convolution module using a Haar and Morlet mixed wavelet kernel, an adaptive wavelet feature attention module integrating a channel-space attention mechanism, a deep residual convolution module with a residual connection, a capsule network module with a variable number of dynamic routing iterations, and a regularized fully connected module embedded in a Dropout layer. The triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork realize gradient synchronization update and share all network weights through a parameter sharing mechanism.
[0058] Among them, the multi-scale wavelet convolution module is used to extract multi-scale features through a wavelet convolution network of several wavelet kernels of different scales, and perform time-frequency feature decomposition through the Mallat algorithm to output a multi-scale wavelet feature map; the adaptive wavelet feature attention module is used to calculate the internal attention weight of the multi-scale wavelet feature map through the channel-space attention mechanism, and use Softmax to dynamically weight the multi-scale wavelet feature map to obtain the overall weighted features; the deep residual convolution module is used to convolve the overall weighted features through several convolution layers, and use jump connections to process the gradient disappearance to obtain convolution features; the capsule network module is used to update the coupling coefficient through a dynamic routing algorithm, and use several capsule network layers to refine the convolution features to obtain refined features; the regularized fully connected module is used to output the refined features as final features through several fully connected layers and Dropout layers, and introduce 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 convolution network with 6 layers of complex wavelet kernels of different scales, and obtains multi-scale wavelet features by time-frequency feature decomposition through the Mallat algorithm. The kernel size is halved layer by layer from 64 to 2, forming an exponentially decreasing 6-level scale pyramid, and the step size is gradient decreased from 16 to 1 to achieve feature capture from coarse-grained to fine-grained; the adaptive wavelet feature attention module calculates the internal attention weight of the multi-scale wavelet feature map through the convolution attention mechanism, and uses Softmax to dynamically weight the feature maps output by the wavelet convolution layer of different scales to obtain Overall weighted features; the deep residual convolution module convolves the weighted features through several convolution layers in multiple residual blocks, adopts He initialization and batch normalization to obtain convolution features, and uses jump connections to overcome gradient vanishing; the capsule network module updates the coupling coefficient through a dynamic routing algorithm, adopts several capsule network layers to refine the convolution features, obtains 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 triple feature extraction subnetwork also includes a feature distance measurement module. After the anchor sample-positive sample-negative sample is forward propagated through the triple feature extraction subnetwork, the feature distance measurement module is used to calculate the feature embedding distance between the anchor sample and the positive sample and the negative sample in the feature space to obtain the similarity relationship between the anchor sample and the positive sample and the negative sample.
[0061] The Euclidean distance is used as the feature distance metric function to calculate the feature embedding distance between the anchor sample and the positive sample and the negative sample in the feature space, wherein the feature distance metric function is:
[0062]
[0063] Among them, x a Represents the anchor point sample in the triplet, x p represents the positive sample in the triplet, x n represents the negative sample in the triplet, f(·) represents the feature mapping function of the triplet feature extraction sub-network, D(x a ,x p ) represents the feature embedding distance between the anchor sample and the positive sample in the triplet in the feature space, D(x a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the triplet in the feature space, l represents the feature dimension, and s represents the total feature dimension.
[0064] Furthermore, the joint loss function composed of the triple loss and the domain adaptation loss is:
[0065] L Combine =(1-α)·L Triplet +α·L MMD ;
[0066] Among them, L Combine is the joint loss, α is the weighting factor, L Triplet is the triplet loss, L MMD is the domain adaptation loss.
[0067] The triplet loss is calculated as follows:
[0068]
[0069] in, represents the anchor point sample in the i-th triplet, represents the positive sample in the i-th triplet, represents the negative sample in the i-th triplet, represents the feature embedding distance between the anchor sample and the positive sample in the i-th triplet in the feature space, represents the feature embedding distance between the anchor sample and the negative sample in the i-th triplet in the feature space, margin represents the preset boundary, λ represents the L2 regularization coefficient, ω represents the model parameter, and N is the total number of triplets in the triplet dataset.
[0070] The domain adaptation loss is calculated as follows:
[0071]
[0072] Among them, z i and z i′ represents different samples in the domain adaptation source domain dataset, m represents the total number of samples in the domain adaptation source domain dataset, and w j and w j′ represents different samples in the domain adaptation target domain dataset, n represents the total number of samples in the domain adaptation 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 triplet dataset: Randomly extract anchor samples, positive samples, and negative samples from a small amount of labeled dataset (source domain) used for model pre-training to form triplets;
[0075] S2. Construction of domain adaptation dataset: Randomly extract the same amount of data from the source domain and the new dataset (target domain) to which the model will be applied to form a domain adaptation dataset;
[0076] S3. Construction of fault diagnosis model: Build a multi-scale triplet wavelet attention weighted capsule network model with a dual-branch architecture as a model for completing small-sample cross-domain fault diagnosis tasks;
[0077] S4. Model training: The model is optimized simultaneously through the triplet branch and the 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 contrast 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 into a joint loss using a weighting factor and used to update the model parameters until training is complete.
[0078] S5. Construction of support sample set: From each fault category of the very few 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 are not selected as domain adaptation target data, and pair each test sample with a sample from the support sample set to form a test sample pair. The label of each sample pair is determined by the category label of its support sample;
[0080] S7. Model testing: Group the test sample pairs by the test sample, with each group containing all sample pairs for the same test sample. Input the sample pairs into the trained model, and compute feature embeddings and measure distances using the feature extraction network. Within each group, select the label of the sample pair with the smallest feature distance as the predicted label for 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 extracted from a small amount of labeled data in the source domain as an anchor sample based on Monte Carlo sampling. A sample from the same fault category is randomly extracted as a positive sample, and a sample from a different fault category is randomly extracted as a negative sample, thereby forming a triplet. Through this construction method, the triplet network can simultaneously optimize the distance between the anchor point and the positive sample and the distance between the anchor point and the negative sample in the feature space, and more accurately capture the relative position relationship of the samples in the feature space, thereby effectively learning the similarity between samples and improving the discriminative ability 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 , the same number of samples are randomly selected as the domain adaptation target domain dataset to ensure that the sampling probability of each fault mode satisfies:
[0083]
[0084] Finally, construct the domain alignment dataset in Achieve cross-domain distributed matching.
[0085] Furthermore, in step S3, the model is constructed as follows:
[0086] The model adopts a dual-branch architecture, one of which focuses on metric learning of triplet features to capture the similarities and differences between source and target domain data; the other branch aims to narrow the data distribution gap between the source and target domains to ensure that the model's diagnostic performance on the target domain is improved. The two branches share the same feature extraction subnetwork structure and share weights. The detailed architecture is shown in the figure. Figure 2 shown.
[0087] Each feature extraction subnetwork is composed of multiple key modules, including: multi-scale wavelet convolution module, adaptive wavelet feature attention module, three convolution modules, capsule network module and fully connected module. Among them, the multi-scale wavelet convolution module is composed of six wavelet convolution networks containing wavelet kernels of different scales. Each layer uses a wavelet convolution layer (ReLU nonlinear activation layer + batch normalization layer (BN)) and a maximum pooling layer as the first layer of the feature extraction subnetwork. Wavelet convolution kernels of different scales are used to perform multi-dimensional feature extraction and mining on the original signal, and multi-scale features are extracted through wavelet transform to enhance the time-frequency representation ability of the features. The specific structure of the module is shown in Table 1. The adaptive wavelet feature attention module combines the convolution attention mechanism (CBAM) to calculate the attention weights within different wavelet feature maps, and uses Softmax to weight the overall features to dynamically highlight the features that are more recognizable for fault diagnosis tasks, thereby improving the model performance. The specific structure is shown in Figure 3 .
[0088] In the convolutional module, the maximum pooling layer is removed after each convolutional layer to retain more fine-grained information. After three convolutions, L" = 71 is maintained, and zero padding is used to maintain feature length. The capsule network module consists of two capsule network layers. The primary capsule layer constructs part-level features, and the digital capsule layer implements system-level diagnosis. It can further refine the features extracted by the previous convolutional module and improve the model's generalization ability in small-sample learning scenarios. The fully connected module contains two fully connected layers, and a dropout layer is added to reduce the risk of overfitting.
[0089] Unlike conventional feature extraction, the triplet network additionally introduces a feature distance measurement module, which 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 training needs to be performed simultaneously on the triple branch and the domain adaptation branch. Specifically, it includes:
[0093] For the feature extraction subnetwork, assume that the multi-scale wavelet convolution module consists of N wavelet convolution layers with wavelet kernels of different scales. Using the triplet dataset constructed by S1 and S2 and the domain adaptation dataset, wavelet convolution is used to realize feature extraction. The output feature map of each wavelet convolution layer is denoted as F i , i∈{1,2,...,N}, where the number of channels and sizes of all feature maps are equal.
[0094] In the Adaptive Wavelet Feature Attention (AWFA) module, for each feature map F i , calculate the corresponding CBAM attention weight A through the convolutional attention mechanism (CBAM) module i The obtained CBAM attention weight A i Spliced together, we get a joint weight vector A Concat , expressed as:
[0095] A Concat =Concat(A1,A2,…,A N );
[0096] The obtained joint weight vector A Concat Through the Softmax function processing, the final weight ratio W is calculated as:
[0097] W=[W1,W2,...,W i ,...,W N ]=Softmax(A Concat );
[0098] Among them, the Softmax function can ensure that the sum of the weights of all feature maps is 1, that is,
[0099] According to the calculated weight ratio W, for each feature map F i Perform weighted processing to obtain the weighted feature map F′ i for:
[0100] F′ i =W i ×F i ;
[0101] All weighted feature maps are spliced along the channel direction to obtain the final fusion feature map F final , expressed as:
[0102] F final =Concat(F′1,F′2,...,F′ N );
[0103] After the feature map fusion, the network further uses three convolution modules consisting of a one-dimensional convolution layer, a batch normalization layer (BN), and a ReLU nonlinear activation layer. By adopting convolution kernels of different sizes, it further performs in-depth feature extraction on the fused features extracted by the previous module. Subsequently, two capsule network layers are used to further refine the feature extraction of the features extracted by the previous convolution module to improve 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 the dual-branch feature extraction, the feature distance measurement module in the triplet network calculates the feature embedding distance between the anchor sample and the positive and negative samples in the triplet in the feature space, using the Euclidean distance as the feature distance measurement function, which can be expressed as follows:
[0105]
[0106] Among them, x a Represents the anchor point sample in the triplet, x p represents the positive sample in the triplet, x n represents the negative sample in the triplet, f(·) represents the feature mapping function of the triplet feature extraction sub-network, D(x a ,x p ) represents the feature embedding distance between the anchor sample and the positive sample in the triplet in the feature space, D(x a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the triplet in the feature space, l represents the feature dimension, and s represents the total feature dimension.
[0107] This branch then uses the triplet loss function for metric learning to optimize the feature space so that samples of the same category are closer and samples of different categories are farther apart. The triplet loss function used by the model is:
[0108]
[0109] in, represents the anchor point sample in the i-th triplet, represents the positive sample in the i-th triplet, represents the negative sample in the i-th triplet, represents the feature embedding distance between the anchor sample and the positive sample in the i-th triplet in the feature space, represents the feature embedding distance between the anchor sample and the negative sample in the i-th triplet in the feature space, margin represents the preset boundary, λ represents the L2 regularization coefficient, and w represents the model parameter.
[0110] In the second branch of the model, transfer learning techniques are used to reduce the distribution difference between the source and target domain data during training, and loss calculation is performed on the domain adaptive feature extraction subnetwork. To this end, the Correlation Alignment (CORAL) method is often used to align the feature covariance matrices of the source and target domains, thereby reducing distribution bias at the feature level. Alternatively, a Domain Adversarial Neural Network (DANN) can be introduced to identify the domain to which a sample belongs using a domain classifier. A Gradient Reversal Layer (GRL) is used during backpropagation to suppress domain classification capabilities, rendering the features of the source and target domains indistinguishable, thereby improving the model's generalization capabilities.
[0111] In addition, to further optimize the domain adaptation effect, the maximum mean difference (MMD) loss function based on the Gaussian kernel function (Radial Basis Function, RBF) is used to measure the distribution difference between the source domain and the target domain in the high-dimensional feature space, and minimize this loss during the training process, 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] Among them, x and y represent two samples, ||xy|| 2 represents the square of the Euclidean distance between two samples, σ represents the kernel function width parameter, and exp(·) represents the natural exponential function.
[0114] The expression of the MMD loss function based on the Gaussian kernel function is:
[0115]
[0116] z i and z i′ Represents different samples in the source domain, w j and w j′ represents different samples in the target domain, and k(,·) represents the Gaussian kernel function.
[0117] After calculating the dual-branch loss function, the triple loss function and the maximum mean difference loss function are used to calculate the joint loss function, which is weighted summed by a weighting factor α. Its expression is:
[0118] L Combine =(1-α)·L Triplet +α·L MMD ;
[0119] Furthermore, in step S5, the support sample set is constructed by first dividing the data into fault categories based on all labeled data in the target domain. Then, within each fault category, n samples are randomly selected based on the specific task requirements. The choice of n can be determined based on the actual situation. Although the sampling is random, it is crucial to ensure that the selected samples are representative of the characteristics of the fault category. This is crucial for the subsequent diagnostic accuracy.
[0120] Furthermore, in step S6, after removing the data that has been used for domain adaptation from the target domain, multiple 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 sample has a clear fault category label. Therefore, the label of the support sample can be used as the reference label for the 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] Furthermore, in step S7, all test sample pairs are grouped according to the samples to be tested. Each group contains a sample to be tested and multiple pairs of support 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 support sample respectively through the feature extraction subnetwork, and then calculates the distance or similarity between the two in the embedding space. For each sample to be tested, the Euclidean distance is used to compare the distance between it and all support 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 samples to be tested are labeled to measure the performance of the model in the target domain fault classification task.
[0122] Experimental verification:
[0123] 1. Experimental introduction:
[0124] We study two different small-sample cross-domain fault diagnosis problems: 1) small-sample cross-domain fault diagnosis between the same device and different operating conditions, and 2) small-sample cross-domain fault diagnosis between different devices. We experimentally validate this problem using three different datasets. Dataset A is the CWRU dataset; Dataset B is the Paderborn University Dataset (PU); and Dataset C is the Spindle Dataset (SD).
[0125] The experimental platform for Dataset A includes a test motor, a dynamometer, a torque sensor, and the bearing under test. Vibration signals are collected by accelerometers located on the drive-end and fan-end housings, with sampling frequencies of 12kHz and 48kHz, respectively. The dataset contains artificially generated single-point faults, including rolling element faults (BF), outer race faults (OF), and inner race faults (IF). Each fault is classified into three severity levels: mild (0.007 inch), moderate (0.014 inch), and severe (0.021 inch). The data are collected under different loads and speeds, resulting in ten fault types.
[0126] The experiments in Dataset B simulated different operating conditions by adjusting the spindle speed, drivetrain load torque, and bearing radial force. Data was collected for three bearing conditions: normal, artificially faulted, and naturally degraded. The normal bearing data came from six bearings with varying operating times but identical operating conditions. The artificially faulted bearing data came from 12 identical bearings with outer and inner race faults created using drilling, electro-etching, and electrical discharge machining. Fault severity was categorized as mild (Level 1) or severe (Level 2).
[0127] Dataset C collects data from an internal shaft angular contact ball bearing on an autonomous shaft using two data acquisition systems: IFM and National Instruments. The IFM system uses a VSE100 data acquisition box, while the National Instruments system uses an NI9234 data acquisition card and an NI CDAQ9189 data acquisition box. The fault signal sampling frequency is 25kHz. A unidirectional accelerometer collects signals in one direction, while a triaxial accelerometer collects signals in three directions within the machine tool coordinate system. The dataset contains four health states: normal (NC), outer race fault (OF), inner race fault (IF), and cage fault (CF). Experiments were conducted at four speeds: 6000, 7000, 8000, and 9000, and under three load conditions: no load, light load, and heavy load.
[0128] 2. Method validation:
[0129] The parameters of the feature extraction subnetwork in the constructed fault diagnosis model are shown in Table 2. The proposed feature extraction subnetwork consists of five core modules: 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 remaining four modules, excluding the adaptive wavelet feature attention module. Each building block consists of different layers. Specifically, B1 (the multi-scale wavelet convolution module) contains six subunits, each consisting of a wavelet convolution layer, a batch normalization (BN) layer, a ReLU nonlinear activation layer, and a maximum pooling layer. B2 (the convolution module) consists of three subunits, each consisting of a one-dimensional convolution layer, a batch normalization (BN) layer, and a ReLU nonlinear activation layer, with the maximum pooling layer removed. B3 (the capsule network module) contains two capsule networks with a squashing function as the activation function. B4 (the fully connected module) consists of two fully connected layers with a dropout layer added between them.
[0130] The proposed domain adaptation model of the multi-scale triplet attention wavelet capsule network needs to be fully trained on the dataset. The Adadelta algorithm is used in the optimization process, with a learning rate of 0.25, a batch size of 32, an L2 regularization coefficient of 0.00025, a loss function weighting factor of 0.6, and 50 training iterations.
[0131] Table 2
[0132]
[0133] Two sets of experiments were conducted to investigate the performance of small-sample cross-domain fault diagnosis. The first set of experiments focused on small-sample cross-domain fault diagnosis for the same equipment but different operating conditions. Experiments 1, 2, and 3 were designed on Dataset C, totaling three sets of experiments. The second set of experiments focused on small-sample cross-domain fault diagnosis for different equipment conditions. Experiment 4 included six cross-equipment tasks across the three datasets. During the construction of diagnostic tasks for the SD bearing dataset, experimental tasks were designed to address different operating conditions in the source and target domains. For example, in Experiment 1, six cross-speed tasks were set under no-load conditions, resulting in different speeds in the source and target domains to simulate small-sample cross-speed fault diagnosis scenarios. Experiment 3 was more specialized, utilizing the load and speed of the source and target domains only in Tasks 1 and 3 to analyze the impact of different factors on the diagnostic performance. Furthermore, when constructing 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 task designs are shown in Tables 3 and 4.
[0134] Table 3
[0135]
[0136] Table 4
[0137]
[0138] To construct the training and test sets for the network, random samples are taken from the source domain dataset to construct a triplet dataset and a domain adaptation source domain dataset. Specifically, the source domain dataset contains four fault categories, with 10 labeled samples selected for each category, for a total of 40 samples. Based on these samples, 100 triplets are constructed for training. At the same time, 40 unlabeled samples are randomly sampled from the target domain dataset to form the domain adaptation 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, and ensuring that there is no overlap with the domain adaptation target domain dataset. The test sample pair dataset is randomly sampled from the target domain dataset, with 100 unlabeled samples for each fault category, for a total of 400 test samples, and ensuring that there is no intersection with the domain adaptation target domain dataset and the support sample set.
[0139] (1) Comparison of this method with other classic algorithms:
[0140] To validate the superiority of this method, we compared it across four experiments using several classic algorithms, including MWFW, MWFK, and MWPN. To ensure fairness, all methods used the same feature extraction subnetwork structure. To mitigate experimental contingencies, each experiment was independently repeated five times, and the mean of the results was used as the standard.
[0141] Table 5
[0142]
[0143] The domain adaptation model of the multi-scale triplet attention wavelet capsule network was compared with three traditional multi-scale wavelet models, with the results 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 this method in various small-sample cross-domain fault diagnosis scenarios was comprehensively evaluated from the perspectives of fault diagnosis accuracy and feature visualization. To demonstrate the superiority of this method, histograms and radar plots were used to evaluate the fault diagnosis accuracy of the four methods. Figure 4 The results show that the average fault diagnosis accuracy of this method remains above 90% when using the SD dataset to set different small-sample cross-operation tasks, which is more than 10% higher than that of other comparison methods. Figure 5 The proposed model achieved an average fault diagnosis accuracy of 92.87% in a small-sample cross-device task using the SD, CWRU, and PU datasets, surpassing the average fault diagnosis accuracy of other comparison methods by 12.07%. Therefore, this method demonstrates superior fault classification and feature clustering capabilities compared to other comparison methods.
[0144] (2) Ablation experiment of this method:
[0145] In addition, an ablation experiment is constructed to further demonstrate the performance change trend of the model. The small sample cross-device fault diagnosis task 1 is selected to complete the ablation experiment of the model proposed by this method. The experimental settings are shown in Table 6. Figure 6As shown, this 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. This is because the module effectively narrows the data distribution gap between the source and target domains, thereby improving the model's generalization ability in the target domain. Simplifying the triplet network to a twin network (A2) reduces model performance somewhat, but to a lesser extent. This is because the triplet network has a stronger feature metric learning capability, enabling the model to more accurately capture the similarities and differences between samples. Removing the adaptive wavelet feature attention mechanism (A3) significantly reduces 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) further significantly reduces model performance. This is because the capsule network further refines feature extraction and, through its powerful feature representation capabilities, improves the accuracy of small-sample fault diagnosis.
[0146] Table 6
[0147]
[0148] The embodiments described above are merely descriptions of preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Without departing from the spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by persons skilled in the art should fall within the scope of protection 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 by: include: Obtain historical heterogeneous fault data of several mechanical devices as a source domain dataset, obtain historical heterogeneous fault data of a target mechanical device as a target domain dataset, and set label spaces for the source domain dataset and the target domain dataset respectively; Based on the source domain dataset and the target domain dataset, a random sampling combination is performed to construct a triple dataset and a domain adaptation dataset; Inputting the triplet dataset and the domain adaptation dataset into a dual-branch feature extraction subnetwork, measuring the triplet feature embedding distance, and iteratively training using a joint loss function to obtain a dual-branch fault diagnosis model, wherein the dual-branch feature extraction subnetwork is used to respectively extract features from the triplet dataset and the domain adaptation dataset using two branches, the triplet feature embedding distance is obtained by calculating the Euclidean distance, and the joint loss function is composed of a combination of triplet loss and domain adaptation loss; The current heterogeneous fault data of the target mechanical equipment is collected and input into the dual-branch fault diagnosis model, and the fault classification of the vibration signal of the target mechanical equipment is output to 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 is characterized in that: Based on the source domain dataset and the target domain dataset, random sampling and combination are performed to construct a triplet dataset and a domain adaptation 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 anchor sample-positive sample-negative sample combinations. A domain adaptation source domain dataset is constructed using all the data in the source domain dataset, and the same number of samples are selected from the unlabeled data of the target domain dataset through stratified random sampling as the domain adaptation target domain dataset. The domain adaptation source domain dataset and the domain adaptation target domain dataset are combined to form a domain adaptation dataset.
3. The small sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 1 is 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 the Morlet wavelet basis function, including a multi-scale wavelet convolution module using a Haar and Morlet mixed wavelet kernel, an adaptive wavelet feature attention module integrating a channel-spatial attention mechanism, a deep residual convolution module with a residual connection, a capsule network module with a variable number of dynamic routing iterations, and a regularized fully connected module embedded in a Dropout layer. The triplet feature extraction subnetwork and the domain adaptive feature extraction subnetwork achieve gradient synchronization 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 is characterized in that: The multi-scale wavelet convolution module is used to extract multi-scale features through a wavelet convolution network with several wavelet kernels of different scales, and perform time-frequency feature decomposition through the Mallat algorithm to output a multi-scale wavelet feature map; the adaptive wavelet feature attention module is used to calculate the internal attention weights of the multi-scale wavelet feature map through the channel-space attention mechanism, and use Softmax to dynamically weight the multi-scale wavelet feature map to obtain the overall weighted features; the deep residual convolution module is used to convolve the overall weighted features through several convolution layers, and use jump connections to process the gradient disappearance to obtain the convolution features; the capsule network module is used to update the coupling coefficient through a dynamic routing algorithm, and use several capsule network layers to refine the convolution features to obtain refined features; the regularized fully connected module is used to output the refined features as final features through several fully connected layers and Dropout layers, and introduce 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 is characterized in that: The triple feature extraction subnetwork also includes a feature distance measurement module. After the anchor sample-positive sample-negative sample is forward propagated through the triple feature extraction subnetwork, the feature distance measurement module is used to calculate the feature embedding distance between the anchor sample and the positive sample and the negative sample in the feature space to obtain the similarity relationship between the anchor sample and the positive sample and the negative sample.
6. The small sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 5 is characterized in that: The Euclidean distance is used as the feature distance metric function to calculate the feature embedding distance between the anchor sample and the positive sample and the negative sample in the feature space, wherein the feature distance metric function is: Among them, x a Represents the anchor point sample in the triplet, x p represents the positive sample in the triplet, x n represents the negative sample in the triplet, f(·) represents the feature mapping function of the triplet feature extraction sub-network, D(x a ,x p ) represents the feature embedding distance between the anchor sample and the positive sample in the triplet in the feature space, D(x a ,x n ) represents the feature embedding distance between the anchor sample and the negative sample in the triplet in the feature space, 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 is characterized in that: The joint loss function composed of the triple loss and the domain adaptation loss is: L Combine =(1-a)·L Triplet +α·L MMD ; Among them, L Combine is the joint loss, α is the weighting factor, L Triplet is the triplet loss, L MMD is the domain adaptation loss.
8. The small sample fault diagnosis method based on multi-scale feature learning and domain adaptive optimization according to claim 7 is characterized in that: The triplet loss is calculated as follows: in, represents the anchor point sample in the i-th triplet, represents the positive sample in the i-th triplet, represents the negative sample in the i-th triplet, represents the feature embedding distance between the anchor sample and the positive sample in the i-th triplet in the feature space, represents the feature embedding distance between the anchor sample and the negative sample in the i-th triplet in the feature space, margin represents the preset boundary, λ represents the L2 regularization coefficient, ω represents the model parameter, 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 is characterized in that: The domain adaptation loss is calculated as follows: Among them, z i and z i′ represents different samples in the domain adaptation source domain dataset, m represents the total number of samples in the domain adaptation source domain dataset, and w j and w j′ represents different samples in the domain adaptation target domain dataset, n represents the total number of samples in the domain adaptation 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
Mechanical transmission part small sample fault diagnosis method based on twin network
CN119167086A
Wind power plant equipment fault intelligent diagnosis method and system
CN119398756A
Method for constructing target prediction model in multicenter small sample scenario and prediction method
US20250013898A1
Multi-working-condition process industrial fault detection and diagnosis method based on deep transfer learning
WO2023071217A1
Cited By
Landslide prediction method based on multi-scale hierarchical attention mechanism
CN121278419A
Wind turbine generator improved domain self-adaptive cross-domain diagnosis method based on uncertainty quantization
CN121327465A
Model optimization method, electronic equipment and computer readable storage medium
CN121561424A