Rolling bearing domain adaptive fault diagnosis method based on attention mechanism
By constructing a domain-adaptive fault diagnosis method for rolling bearings based on an attention mechanism, the lack of interpretability of existing models and the problem of transfer learning under complex variable working conditions are solved, achieving higher fault diagnosis accuracy and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENYANG INST OF AUTOMATION - CHINESE ACAD OF SCI
- Filing Date
- 2021-11-11
- Publication Date
- 2026-04-21
AI Technical Summary
Existing deep learning-based fault diagnosis algorithms lack interpretability and fail to effectively address transfer learning problems under complex and variable operating conditions, especially when the transferability of different signals and signal segments varies.
A domain-adaptive fault diagnosis method for rolling bearings based on an attention mechanism is adopted. By constructing a feature extractor and a domain adaptation module, including local and global attention modules, the model is optimized to improve its generalization ability and interpretability.
The model's domain adaptability has been enhanced, improving the accuracy and robustness of fault diagnosis. It can handle various fault diagnosis problems under varying operating conditions and also possesses a certain degree of interpretability.
Smart Images

Figure CN116106012B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of variable operating condition bearing fault diagnosis, specifically a domain adaptation fault diagnosis method for rolling bearings based on attention mechanism. Background Technology
[0002] With the rapid rise of technologies such as the Industrial Internet of Things (IIoT), mechanical fault diagnosis is gradually entering the "big data" era, and intelligent fault diagnosis algorithms based on deep learning and other methods have become a research hotspot in recent years. However, existing deep learning-based fault diagnosis algorithms are generally based on the assumption that the training and test sets are independent and identically distributed, which does not match the conditions of noisy environments and complex variable working conditions in actual work. Therefore, transfer learning algorithms that can address this issue have gradually become a research hotspot for intelligent fault diagnosis algorithms.
[0003] However, existing transfer learning-based intelligent fault diagnosis algorithms lack interpretability and do not take into account the different transferability that different signals and signal segments may have. Therefore, it is crucial to propose an intelligent fault diagnosis technique with stronger generalization ability and a certain degree of interpretability. Summary of the Invention
[0004] To address the shortcomings of existing technologies, this invention provides a rolling bearing domain adaptive fault diagnosis method based on an attention mechanism, which improves the generalization ability of the model, enabling it to handle various fault diagnosis problems, and also enhances the interpretability of the model.
[0005] The technical solution adopted by the present invention to achieve the above objectives is as follows:
[0006] A domain-adaptive fault diagnosis method for rolling bearings based on an attention mechanism includes the following steps:
[0007] For the same bearing system, vibration monitoring data of various bearing health conditions under different working conditions are collected, and the data are labeled according to the fault type to obtain bearing datasets for different working conditions.
[0008] The data in the bearing dataset is divided into source domain dataset and target domain dataset, and then further divided into training set and validation set;
[0009] A rolling bearing domain adaptive fault diagnosis model is constructed, and the model is trained using the training sets of the source domain dataset and the target domain dataset.
[0010] Optimize the domain-adaptive fault diagnosis model for rolling bearings;
[0011] The test set from the target domain data is input into the optimized rolling bearing domain adaptive fault diagnosis model to obtain the fault type of the target domain data.
[0012] The source domain data consists of vibration monitoring data with a quantity greater than the threshold and complete labels, while the target domain data consists of vibration monitoring data under the working condition to be detected.
[0013] The construction of the rolling bearing domain-adaptive fault diagnosis model includes:
[0014] Feature extractor is used to extract fault features from bearing datasets and divide the fault features into multiple segments;
[0015] The local attention domain adaptation module is used to calculate the local attention value of the fault feature of each segment, perform weighted processing, and merge the weighted local attention values of each segment in terms of dimensions.
[0016] The global attention domain adaptation module is used to calculate the global attention value based on the local attention values after dimension merging, and add it to a classification loss to complete the classification of fault types in the input data.
[0017] The feature extractor includes sequentially connected spatial convolutions, length attention modules, channel convolutions, channel attention modules, and pooling layers.
[0018] The local attention domain adaptation module includes: a maximum mean difference module, multiple domain classifiers, and a residual connection module. The fault features of multiple segments output by the feature extractor are processed by the maximum mean difference module. The fault features of each segment are then input into a domain classifier to calculate the probability that the corresponding segment belongs to the source domain. An entropy function is used to calculate the local attention value of each segment's fault features to weight the fault features. After dimensionality merging of all weighted fault features, the results are output through the residual connection module.
[0019] The global attention domain adaptation module includes: a domain classifier, which inputs the weighted fault features into the domain classifier, calculates the probability that the fault features belong to the source domain, and uses an entropy function to calculate the global attention value of the fault features in order to weight the fault features.
[0020] In constructing the rolling bearing domain adaptive fault diagnosis model, four types of loss functions are set, specifically:
[0021] 1) Bearing fault classification loss for the source domain dataset:
[0022]
[0023] in, The number of samples in the source domain. For the source domain sample space, Let cross-entropy be the loss function. For classifiers, For local attention-weighted features, For sample labels;
[0024] 2) MMD loss used to reduce classification discrepancies between the source and target domains:
[0025]
[0026] in, The number of samples in the target domain. and Signal samples from the source and target domains; It is a nonlinear mapping used to map samples from the source and target domains to the same Hilbert space. For kernel functions;
[0027] 3) Local attention domain adaptation loss for extracting local and global invariant features from signal segments and signal samples, respectively. and global attention domain adaptation loss :
[0028]
[0029]
[0030] in, Represents the source domain sample space; Represents the target domain sample space. Represents signal samples The domain tag; It is the cross-entropy loss used for domain classification;
[0031] 4) Globally weighted entropy loss used for auxiliary classification:
[0032]
[0033] in, Indicates the number of fault types; Represents signal samples Divided into tags The probability value.
[0034] The total loss function is:
[0035]
[0036] in, , , and These are the model parameters for the feature extractor, label classifier, global attention domain adaptation module, and local attention domain adaptation module, respectively. , and These are the corrected weights.
[0037] The rolling bearing domain adaptive fault diagnosis model is optimized using backpropagation and the Adam optimization algorithm to minimize the total loss function.
[0038] The model parameters are updated using the following formula:
[0039]
[0040]
[0041]
[0042]
[0043] in, This is the learning rate.
[0044] The present invention has the following beneficial effects and advantages:
[0045] 1. This invention can autonomously select signals and signal segments with better transferability, enhance the domain adaptability of the model, and improve the accuracy of fault diagnosis.
[0046] 2. Compared with several popular transfer learning intelligent fault diagnosis algorithms, this invention has the best performance and robustness, and can handle various fault diagnosis problems under different operating conditions.
[0047] 3. The present invention has a certain degree of interpretability in the selection of transferable features. Attached Figure Description
[0048] Figure 1 This is a model structure diagram of the attention mechanism-based rolling bearing domain adaptive fault diagnosis method of the present invention. Detailed Implementation
[0049] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments.
[0050] A domain-adaptive fault diagnosis method for rolling bearings based on an attention mechanism includes the following steps:
[0051] Step 1: For the same bearing system, collect vibration monitoring signals of various bearing health conditions under different working conditions, and label the data according to the fault type to obtain bearing datasets for different working conditions.
[0052] Step 2: Select two types of datasets from the different working conditions obtained in Step 1 as the source domain and target domain respectively, and divide them into corresponding training sets and test sets;
[0053] Step 3: Use the training set data of the source domain and the target domain as model input to train the model, use the grid search method to optimize the hyperparameters, select the training model with the highest diagnostic accuracy as the final diagnostic model, and fix this model.
[0054] Step 4: Perform performance testing on the final model obtained in Step 3 on the test set data of the target domain.
[0055] The one-dimensional separable convolution embedding channel attention and length attention mechanisms is described in this invention as follows: This invention uses one-dimensional separable convolution to replace traditional convolution, embedding two attention mechanisms within it. The model mainly includes the following parts: a spatial convolution that filters signal samples in each channel and has a specific kernel size; a length attention mechanism module that aggregates feature information from each channel to obtain the importance of each signal segment in fault diagnosis; a channel convolution module that uses a set of convolution kernels to learn the relationships between channels and simultaneously improve the feature dimension; and a channel attention module that captures the interdependencies between channels to determine feature importance and promotes network focus on important features.
[0056] The specific kernel size of the spatial convolution is equivalent to the kernel size of the conventional convolution it replaces.
[0057] The transfer learning module, consisting of a local attention domain adaptation module and a global attention domain adaptation module, is as follows:
[0058] This invention applies a local attention domain adaptation module and a global attention domain adaptation module, whose basic structures are based on the domain classifiers in the DANN model. The features output from the feature extractor are divided into K segments and input into the local attention domain adaptation module, which contains K domain classifiers, meaning each signal segment corresponds to one domain classifier. The system calculates the probability that a corresponding segment belongs to the source domain, thereby determining the transferability of the segment. It also uses an entropy function to calculate local attention values, weighting the features. To prevent excessive feature differences between the source and target domains from causing negative transfer, the maximum mean difference (MMD) is used to reduce the distribution difference between the source and target domains before inputting the features into the local attention domain adaptation module. The locally attention-weighted features are then input into the global attention domain adaptation module to measure which signals have stronger transferability. The global attention domain adaptation module consists of a domain classifier. The output of the function represents the probability that the corresponding input signal belongs to the source domain. Similarly, the attention value is calculated using the overentropy function and weighted into a classification loss to assist in classification.
[0059] The number of blocks K for the input feature in the local attention domain adaptation module is determined based on the output size of the last layer of the feature extractor. It should be the product of the height and width of the feature map. Since this invention is aimed at one-dimensional vibration signals, the height is 1, and the number of blocks K is equal to the width of the input feature map.
[0060] The global parameters for training the model are set as follows: learning rate of 0.001, batch size of 32, and training iterations of 500.
[0061] like Figure 1 The diagram shown is a model structure diagram of the attention mechanism-based rolling bearing domain adaptive fault diagnosis method of the present invention.
[0062] The present invention proposes a domain-adaptive fault diagnosis method for rolling bearings based on an attention mechanism. The network structure consists of two parts: a feature extractor and a domain adaptation module. The feature extractor is composed of stacked one-dimensional separable convolutions embedded with channel attention and length attention mechanisms, used to extract fault-related features. The domain adaptation module consists of a local attention domain adaptation module and a global attention domain adaptation module, which screen signals and signal segments with good transferability, thereby improving the generalization ability of the model and enabling the model to better cope with fault diagnosis problems under varying operating conditions.
[0063] The specific steps are as follows:
[0064] Step 1: Data acquisition and preprocessing.
[0065] For the same bearing system, vibration monitoring signals of various bearing health conditions under different working conditions are collected, and the data are labeled according to the fault type to obtain bearing datasets for different working conditions. Two types of the obtained datasets under different working conditions are selected as the source domain and target domain, and corresponding training sets and test sets are divided.
[0066] Step 2: Extract fault features using the optimized feature extractor.
[0067] Applying one-dimensional separable convolution to replace traditional convolution reduces the number of model parameters without affecting diagnostic accuracy. Simultaneously, length attention and channel attention mechanisms are embedded after the two steps of the one-dimensional separable convolution. This is because the spatial convolution in the one-dimensional separable convolution uses independent kernels to filter different channels, giving each channel its own unique features. The length attention mechanism mainly summarizes the feature information from different channels; placing it after the spatial convolution layer allows it to play a richer role. Furthermore, spatial convolution does not change the feature dimension. In this invention, the channel convolution in the one-dimensional separable convolution is not only used to learn the relationships between channels by aggregating the output of the spatial convolution, but also to increase the dimensionality of the feature space. Placing the channel attention mechanism after the channel convolution ensures that this attention module is applied to a higher-dimensional feature space. Input signal samples... After feature extractor Fault-related features can then be obtained effectively.
[0068] Step 3: Extract domain invariant features using the optimized domain adaptation module.
[0069] signal samples After feature extractor The features were then divided into K segments, each segment having the following features: Input it into the corresponding local domain classifier Then, the probability that the fragment belongs to the source domain can be obtained. The domain classifier and feature extractor form an adversarial relationship. Through training, the domain classifier becomes unable to distinguish whether the features generated by the feature extractor belong to the source domain or the target domain, thus achieving the extraction of domain-invariant features. When the probability value... A value close to 0 or 1 indicates that the signal segment can be classified by a domain classifier, but its transferability is poor. This probability value cannot be directly used to weight features; therefore, an entropy function is used instead. Calculate the local attention value for each segment, where For discrete random variables The variable values in For discrete random variables The probability distribution function and the final formula for calculating the local attention value for each segment are as follows:
[0070]
[0071] Meanwhile, a residual connection module was added to the local domain classifier to prevent negative transfer caused by erroneous attention values. Therefore, the final features of each segment after local attention weighting are as follows:
[0072]
[0073] Then, based on the positions of the segments before segmentation, the corresponding segments after local attention weighting are merged in terms of dimensions, resulting in features. The dimension of the feature is consistent with the dimension of the feature before segmentation. Local attention-weighted features are then applied. Input global domain classifier Then, the probability that the signal belongs to the source domain can be obtained. Similarly, using the entropy function to calculate the attention value, the global attention value is obtained as follows:
[0074]
[0075] Step 4: Set the loss function.
[0076] The loss functions of this invention include the following four categories:
[0077] 1) Bearing fault classification loss for the source domain dataset:
[0078]
[0079] in, The number of samples in the source domain. For the source domain sample space, Let cross-entropy be the loss function. For classifiers, For local attention-weighted features, For sample labels;
[0080] 2) MMD loss used to reduce classification discrepancies between the source and target domains:
[0081]
[0082] in, The number of samples in the target domain. and Signal samples from the source and target domains; It is a nonlinear mapping used to map samples from the source and target domains to the same Hilbert space. Here, the kernel function is used to calculate the inner product of two mappings, as shown in the formula above. The inner product of the source domain samples and the target domain samples after mapping is... ;
[0083] 3) Local attention domain adaptation loss used to extract local and global invariant features from signal segments and signal samples, respectively. and global attention domain adaptation loss :
[0084] The signal segment is a sample obtained by uniformly dividing the signal sample according to a certain number of segments, the number of segments being consistent with the number of blocks when the feature extractor segments the fault features.
[0085]
[0086]
[0087] in, Represents the source domain sample space; Represents the target domain sample space; Represents vibration signal samples The domain tag; It is the cross-entropy loss used for domain classification;
[0088] 4) Globally weighted entropy loss used for auxiliary classification:
[0089]
[0090] in, Indicates the number of fault types; Represents signal samples Divided into tags The probability value.
[0091] Therefore, the total loss function of this invention is:
[0092]
[0093] in, , , and These are the model parameters for the feature extractor, label classifier, global domain classifier, and local domain classifier, respectively. , and These are the corrected weights.
[0094] Step 5: Optimize strategy settings.
[0095] The network minimizes the total loss function during training using standard backpropagation and the Adam optimization algorithm. The parameters of each network structure are updated according to the following formula:
[0096]
[0097]
[0098]
[0099]
[0100] in, This is the learning rate.
[0101] Step 6: Perform fault diagnosis on the target domain test set.
[0102] The optimal combination of hyperparameters is found using a grid search method, and the training model is fixed under the optimal combination of hyperparameters. The performance of the model is then tested for fault diagnosis on the target domain test set.
Claims
1. A domain-adaptive fault diagnosis method for rolling bearings based on an attention mechanism, characterized in that, Includes the following steps: For the same bearing system, vibration monitoring data of various bearing health conditions under different working conditions are collected, and the data are labeled according to the fault type to obtain bearing datasets for different working conditions. The data in the bearing dataset is divided into source domain dataset and target domain dataset, and then further divided into training set and validation set; A rolling bearing domain adaptive fault diagnosis model is constructed, and the model is trained using the training sets of the source domain dataset and the target domain dataset. Optimize the domain-adaptive fault diagnosis model for rolling bearings; The test set from the target domain data is input into the optimized rolling bearing domain adaptive fault diagnosis model to obtain the fault type of the target domain data. The source domain data consists of vibration monitoring data with a quantity greater than the threshold and complete labels, while the target domain data consists of vibration monitoring data under the working condition to be detected. The construction of the rolling bearing domain-adaptive fault diagnosis model includes: Feature extractor is used to extract fault features from bearing datasets and divide the fault features into multiple segments; The local attention domain adaptation module is used to calculate the local attention value of the fault feature of each segment, perform weighted processing, and merge the weighted local attention values of each segment in terms of dimensions. The global attention domain adaptation module is used to calculate the global attention value based on the local attention values after dimension merging, and add it to a classification loss to complete the classification of fault types in the input data; The local attention domain adaptation module includes: a maximum mean difference module, multiple domain classifiers, and a residual connection module. The fault features of multiple segments output by the feature extractor are processed by the maximum mean difference module. The fault features of each segment are then input into a domain classifier to calculate the probability that the corresponding segment belongs to the source domain. The local attention value of each segment's fault features is calculated using an entropy function to weight the fault features. After dimensionality merging of all weighted fault features, the results are output through the residual connection module. The global attention domain adaptation module includes: a domain classifier, which inputs the weighted fault features into the domain classifier, calculates the probability that the fault features belong to the source domain, and uses an entropy function to calculate the global attention value of the fault features in order to weight the fault features.
2. The method for domain adaptation fault diagnosis of rolling bearings based on attention mechanism according to claim 1, characterized in that, The feature extractor includes sequentially connected spatial convolutions, length attention modules, channel convolutions, channel attention modules, and pooling layers.
3. The method for domain adaptation fault diagnosis of rolling bearings based on an attention mechanism according to claim 1, characterized in that, In constructing the rolling bearing domain adaptive fault diagnosis model, four types of loss functions are set, specifically: 1) Bearing fault classification loss for the source domain dataset: in, The number of samples in the source domain. For the source domain sample space, Let cross-entropy be the loss function. For classifiers, For local attention-weighted features, For sample labels; 2) MMD loss used to reduce classification discrepancies between the source and target domains: in, The number of samples in the target domain. and Signal samples from the source and target domains; It is a nonlinear mapping used to map samples from the source and target domains to the same Hilbert space. For kernel functions; 3) Local attention domain adaptation loss for extracting local and global invariant features from signal segments and signal samples, respectively. and global attention domain adaptation loss : in, Represents the source domain sample space; Represents the target domain sample space. Represents signal samples The domain tag; It is the cross-entropy loss used for domain classification; 4) Globally weighted entropy loss used for auxiliary classification: in, Indicates the number of fault types; Represents signal samples Divided into tags The probability value.
4. The method for domain adaptation fault diagnosis of rolling bearings based on an attention mechanism according to claim 3, characterized in that, The total loss function is: in, , , and These are the model parameters for the feature extractor, label classifier, global attention domain adaptation module, and local attention domain adaptation module, respectively. , and These are the corrected weights.
5. A method for domain adaptation fault diagnosis of rolling bearings based on an attention mechanism according to claim 1 or 4, characterized in that, The rolling bearing domain adaptive fault diagnosis model is optimized using backpropagation and the Adam optimization algorithm to minimize the total loss function.
6. The method for domain adaptation fault diagnosis of rolling bearings based on an attention mechanism according to claim 4, characterized in that, The model parameters are updated using the following formula: in, This is the learning rate.
Citation Information
Patent Citations
Intelligent fault diagnosis method based on deep adversarial domain self-adaption
CN111898634A
System and methodology for vibration analysis and condition monitoring
US20050209814A1