Gearbox fault diagnosis method based on multi-scale feature fusion of self-attention mechanism

By employing a multi-scale feature fusion method based on a self-attention mechanism, the problem of feature extraction from gearbox vibration signals is solved, enabling high-precision fault diagnosis, adapting to complex working conditions, and possessing cross-domain diagnostic performance.

CN116010900BActive Publication Date: 2026-03-17HANGZHOU GENGRONG MASCH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-06
Publication Date
2026-03-17

AI Technical Summary

Technical Problem

Fault diagnosis of gearbox vibration signals faces challenges in feature extraction, especially under complex background noise and changing operating conditions. Traditional multi-scale feature fusion methods lead to information redundancy, reducing diagnostic accuracy.

Method used

A multi-scale feature fusion method based on self-attention mechanism is adopted. Through low-frequency and local temporal feature extraction pathways, feature fusion is performed by combining multi-head self-attention and improved convolutional self-attention modules. An end-to-end fault diagnosis model is constructed by using adaptive pooling and batch normalization layers.

Benefits of technology

It effectively extracts fault-sensitive information, improves diagnostic accuracy, adapts to changes in operating conditions, and achieves end-to-end intelligent fault diagnosis without the need for preprocessing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010900B_ABST
    Figure CN116010900B_ABST
Patent Text Reader

Abstract

The application discloses a multi-scale feature fusion gearbox fault diagnosis method based on a self-attention mechanism, and relates to the technical field of fault diagnosis. The method comprises the following steps: obtaining fixed-length diagnosis samples by randomly windowing one-dimensional original vibration signals of a gearbox; constructing a multi-scale feature fusion fault diagnosis model based on a self-attention mechanism and using a Softmax function as a classifier to perform training; performing model training by using a dynamic clipping Adam optimizer through a back propagation method; and saving the trained fault diagnosis model to perform online diagnosis. The application extracts low-frequency features and local time-domain features of original vibration signals of a gearbox through convolution kernels of different scales, introduces an improved self-attention mechanism to construct a multi-scale feature fusion network instead of a traditional splicing method, further mines the internal relationship of time-frequency features of vibration signals to improve the diagnosis performance of the model, and simultaneously introduces batch normalization to reduce internal variable deviation, thereby realizing intelligent and efficient end-to-end fault diagnosis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of fault diagnosis technology, and in particular to a multi-scale feature fusion gearbox fault diagnosis method based on a self-attention mechanism. Background Technology

[0002] Gearboxes are common components in rotating machinery. Due to their advantages such as high transmission ratio, strong load-bearing capacity, and compact structure, they are widely used in aerospace, industrial production, and wind power generation. However, because they operate in harsh environments with frequent changes in speed and load, they are prone to various faults, affecting normal equipment operation and even causing safety accidents. Therefore, fault diagnosis methods for gearboxes are of great value in improving equipment reliability and reducing accidents.

[0003] Gearbox vibration signals carry a wealth of information reflecting their fault categories. Fault diagnosis based on vibration signals hinges on acquiring fault-sensitive information from these signals. However, changes in the vibration signals generated by faults are easily obscured by complex background noise and interference signals. Furthermore, considering their multi-scale temporal characteristics, feature extraction becomes difficult. Moreover, the distribution of fault-sensitive information in the original vibration signals under varying operating conditions differs from that under the training set conditions, leading to aliasing between different fault features and changes in the signal's nonlinearity, making diagnosis under varying operating conditions challenging. Therefore, how to extract fault-sensitive features from multi-level, nonlinear, and non-stationary vibration signals is the primary issue in gearbox fault diagnosis.

[0004] In recent years, deep learning algorithms have been frequently used to automatically extract deeper abstract features from large-scale data. Among them, convolutional neural networks have received widespread attention in the fields of prediction and classification due to their outstanding feature extraction capabilities. For the multi-level characteristics of vibration signals, using convolutional kernels of different scales has become an effective feature extraction method. However, traditional concatenation methods merely mechanically combine multi-scale features, resulting in information redundancy, increasing the difficulty of network training, and reducing diagnostic accuracy. Therefore, a more effective feature fusion strategy is needed. Summary of the Invention

[0005] To address the aforementioned problems and technical requirements, the inventors have proposed a multi-scale feature fusion gearbox fault diagnosis method based on a self-attention mechanism. The technical solution of this invention is as follows:

[0006] A multi-scale feature fusion gearbox fault diagnosis method based on self-attention mechanism includes the following steps:

[0007] Step 1: Obtain vibration signals under different fault modes of the gearbox. The vibration signals are one-dimensional time-series data.

[0008] Step 2: Divide the collected samples into training set, validation set and test set according to a preset ratio, including: using a sliding window of the same size to extract one-dimensional time series data to obtain samples, and setting labels for each sample according to the actual fault type; dividing the obtained samples into training set, validation set and test set according to a preset ratio.

[0009] Step 3: Construct a multi-scale feature fusion fault diagnosis model based on self-attention mechanism;

[0010] The multi-scale feature fusion fault diagnosis model based on self-attention mechanism includes parallel low-frequency feature extraction pathways and local temporal feature extraction pathways, feature fusion networks, and classification networks.

[0011] Both the low-frequency feature extraction path and the local temporal feature extraction path include convolutional layers, pooling layers, and batch normalization layers. The input is the original vibration signal of the gearbox. Each path includes three convolutional layers, and the output is a feature vector of the same size. The low-frequency feature extraction path uses a large convolutional kernel, while the local temporal feature extraction path uses a small convolutional kernel. The feature fusion network includes a multi-head self-attention (MHSA) module, an improved convolutional self-attention (CBAM) module, and a batch normalization layer. The classification network includes pooling layers, fully connected layers, and a Softmax classifier. Average pooling is used to reduce the feature dimensionality and prevent overfitting. A fully connected layer and a Softmax classifier are used for fault feature classification. The activation function of the CBAM module is Sigmoid, and the remaining activation functions of the model are ReLU.

[0012] Step 4: Train the fault diagnosis model by inputting the training set into it;

[0013] During training, labeled samples from the training set are first input into the fault diagnosis model to obtain the predicted output. Then, the cross-entropy loss is calculated with the real labels. The Adam optimizer is then used to backpropagate and optimize the network parameters until the training loss stabilizes below the set value or reaches the number of iterations.

[0014] Step 5: Cut the vibration signal sample to be detected into a certain length and input it into the fault diagnosis model trained in Step 4 to obtain the fault diagnosis result.

[0015] The further technical solution is as follows: In step two:

[0016] The sliding window size is 1024, and the truncation method is random truncation; the ratio of training set, validation set, and test set is 6:3:1, and the sample labels are set to... , The number of gearbox fault types is used to batch input the training set into the fault diagnosis model for training.

[0017] The further technical solution is as follows: In step three:

[0018] The low-frequency feature extraction pathway structure consists of a first convolutional layer, a second convolutional layer, a first pooling layer, a third convolutional layer, and an adaptive pooling layer 1 connected sequentially. The local temporal feature extraction pathway structure consists of a fourth convolutional layer, a second pooling layer, a fifth convolutional layer, a third pooling layer, a sixth convolutional layer, and a fourth pooling layer connected sequentially. For a one-dimensional gearbox vibration signal input, each convolutional layer uses a one-dimensional convolutional neural network. The first to fourth pooling layers employ max pooling. The adaptive pooling layer 1 performs average pooling on the input according to the given output dimension and is used for dimension trimming. Each convolutional layer and the MHSA module are followed by a batch normalization layer to adjust the covariate shift and improve training performance. For batch input samples... The batch normalization layer performs the following operations:

[0019] ;

[0020] ;

[0021] ;

[0022] ;

[0023] in, and For the mean and variance, m To input the total number of samples, It is a constant. and For learnable parameters, This is the output.

[0024] The further technical solution is as follows: In step three:

[0025] The MHSA module utilizes projections under different parameters for similarity-based vibration signal fusion feature learning. The MHSA module has three inputs of the same dimension: a query matrix Q, a key matrix K, and a value matrix V. The low-frequency feature vectors output from the low-frequency feature extraction path are used as inputs to Q and K, respectively, serving as the primary features. The local temporal feature vectors output from the local temporal feature extraction path are used as input V, serving as the auxiliary features. Attention is calculated for both the primary and auxiliary features through multiple linear projections, using the following formula:

[0026] ;

[0027] in, For the dimension of the query vector, , and These are the corresponding vectors after projection;

[0028] The CBAM module injects attention maps along two independent dimensions of the feature vector: channel and space. In channel attention, a method is used to compress the spatial dimension of the input feature map. In spatial attention, average pooling and max pooling are performed along the channel dimension, and these are concatenated to describe the feature information. By assigning individual attention weights, adaptive feature refinement is performed on the input feature vector to further learn fault-sensitive information. The input of the CBAM module is the output of the MHSA module, which undergoes batch normalization before input. The mathematical model of the CBAM module is as follows:

[0029] ;

[0030] ;

[0031] ;

[0032] ;

[0033] in, The feature vector output by the MHSA module. and These are channel attention and spatial attention, respectively. This indicates that elements at corresponding positions are multiplied. This represents a multilayer perceptron. and These represent average pooling and max pooling, respectively. For convolution operations, This is the Sigmod activation function.

[0034] A further technical solution is that the method also includes:

[0035] Since this paper uses a one-dimensional convolutional path for feature extraction, the spatial attention mechanism is improved. The spatial attention of the improved 1D-CBAM module is the same as that of the original channel attention, both using parallel fully connected layers to replace convolutional operations. Compared to the local connections of convolutional kernels, fully connected structures have a global receptive field, enabling overall attention weight allocation. Furthermore, to prevent gradient decay caused by the sigmoid function, a residual connection is introduced between the output of the MHSA module and the main feature input. Therefore, the mathematical model for the spatial attention of the improved 1D-CBAM module is updated as follows:

[0036] ;

[0037] ;

[0038] The feature fusion network first uses the MHSA module to perform preliminary fusion of the multi-scale features of the input, capturing the joint correspondence of fault information. A residual connection is introduced between the output of the MHSA module and the main feature input to emphasize the role of low-frequency features. Secondly, batch normalization is used to adjust the covariate offset to improve the model training performance. Finally, the CBAM module highlights the fault-sensitive part of the fused features, and the output is in the same dimension as the input, which improves the information representation ability.

[0039] The further technical solution is as follows: In step three:

[0040] The classification network structure consists of a Flatten layer, an adaptive pooling layer 2, a fully connected layer, and a Softmax classifier, connected in sequence. The adaptive pooling layer 2 is used to reduce the dimensionality of the fused features and prevent overfitting. The Softmax classifier is a supervised learning classifier that outputs a one-dimensional feature vector, where each value corresponds to the probability of each fault type. Assume the total number of samples in the training set is... N Divided into C The category, recorded as the first i The predicted output for each sample is Input Sample Belongs to the c The probability of a class is used This indicates that the corresponding output value g at each position of the Softmax function is... w,b ( x i ) is represented as:

[0041]

[0042] in, and These are the parameters for each fault type; the final classification result of the Softmax classifier is the fault type corresponding to the position with the highest probability value.

[0043] The further technical solution is as follows: In step four:

[0044] The cross-entropy loss function is combined with the Softmax classifier to calculate the difference between the predicted class and the fault class. Backpropagation updates the model's internal parameters with the goal of minimizing the loss function. The mathematical expression of the cross-entropy loss function is as follows:

[0045] ;

[0046] in: This represents the number of samples for this type of fault; and The first The true and predicted values ​​of each sample;

[0047] The Adam optimizer is a first-order optimization algorithm that can replace the traditional stochastic gradient descent process. It can accelerate network convergence and prevent the model from getting trapped in local optima. The iterative process of the Adam optimizer is as follows:

[0048]

[0049] In the formula, and gradient of the objective function First-order and second-order matrices, Indicates the current iteration batch. Indicates the previous batch; and This represents the exponential decay rate of the matrix. and Yes and Correction; Indicates model parameters, Indicates the learning rate. Pick ;

[0050] Because the Adam optimizer can exhibit extreme learning rates in the later stages of training, affecting model convergence, it is necessary to dynamically prune the learning rate, specifying upper and lower bounds to stabilize model convergence in the later stages.

[0051] The beneficial technical effects of this invention are:

[0052] 1) The multi-scale feature fusion gearbox fault diagnosis method based on self-attention mechanism proposed in this application can effectively extract fault-sensitive information from the original vibration signal of the gearbox for fault diagnosis through multi-scale feature extraction method and effective feature fusion strategy;

[0053] 2) By embedding an improved self-attention mechanism for feature fusion, the problem of redundant feature information caused by direct concat in traditional multi-scale models is solved, which affects the classification performance of the model. The input feature dimension and the fused feature dimension are the same, which improves the feature information expression capability. The feature fusion strategy with frequency domain features as the main feature and local time domain features as the auxiliary feature can effectively adapt to the gearbox operating environment with changing working conditions, and the model has a certain cross-domain diagnostic performance.

[0054] 3) This application can automatically obtain the underlying fault characteristics, highlight the fault-sensitive information, and finally directly output the fault category of the gearbox through the constructed fault diagnosis model without relying on traditional signal processing technology to preprocess the input, thereby realizing end-to-end intelligent fault diagnosis. Attached Figure Description

[0055] Figure 1This is a flowchart of the gearbox fault diagnosis method provided in this application.

[0056] Figure 2 This is a schematic diagram of the multi-scale feature extraction principle provided in this application.

[0057] Figure 3 This is a schematic diagram of the multi-scale feature fusion network based on the self-attention mechanism provided in this application.

[0058] Figure 4 This is a structural diagram of the multi-scale feature fusion fault diagnosis model based on self-attention mechanism provided in this application. Detailed Implementation

[0059] The specific embodiments of the present invention will be further described below with reference to the accompanying drawings.

[0060] This application provides a gearbox fault diagnosis method based on multi-scale feature fusion (hereinafter referred to as MSC-MHSA-CBAM) with a self-attention mechanism, such as... Figure 1 As shown, the specific implementation of this method includes the following steps:

[0061] Step 1: Obtain vibration signals of the gearbox under different fault modes using signal acquisition equipment.

[0062] Specifically, the accelerometer collects changes in the vibration signal from the side of the gearbox over a period of time and inputs it into a computer via a data cable for storage, obtaining a one-dimensional time-series data signal sample to record the gearbox failure mode at that time. The experimental platform consists of a drive motor, controller, planetary gearbox, parallel gearbox, and brake. The motor is a 3-phase, 3 HP motor powered by three-phase AC (230V, 60 / 50Hz). Four planetary gear failure modes and four bearing failure modes were pre-programmed on the planetary gearbox. Gear failures include tooth surface wear, missing teeth, root cracks, and tooth breakage. Bearing failures include spherical bearing failure, inner ring failure, outer ring failure, and a combination of the above three bearing failures. Therefore, under normal conditions, a total of nine vibration signals were collected.

[0063] Step 2: Divide the collected raw vibration signal samples into training set, validation set and test set.

[0064] Specifically, a random sliding window method is used to truncate the one-dimensional vibration data, with a truncation length of 1024. For each fault type, 240 samples are selected for the training set, 120 samples for the validation set, and 40 samples for the test set. The sample set is shuffled before being input into the model.

[0065] Step 3: Construct the MSC-MHSA-CBAM fault diagnosis model.

[0066] The model is built using the PyTorch deep learning framework. The MSC-MHSA-CBAM model consists of three parts: a multi-scale feature extraction network, a feature fusion network, and an end-class classification network. The multi-scale feature extraction network includes a low-frequency feature extraction path and a local temporal feature extraction path. For gearbox vibration signals, the principle of the multi-scale feature extraction network is as follows: Figure 2 As shown, convolutional pathways of different scales are constructed to extract periodic low-frequency features and local temporal detail features of the original vibration signal, initially extracting fault features at different levels of the signal; then, a feature fusion network is constructed using a self-attention mechanism, such as... Figure 3 As shown, it captures fault-sensitive information; finally, it outputs predicted labels through a pooled fully connected classification network. The overall structure of the MSC-MHSA-CBAM model is as follows: Figure 4 As shown.

[0067] Step 4: Input the training set samples in batches into the MSC-MHSA-CBAM fault diagnosis model for training, and adjust the model parameters based on the diagnostic performance on the validation set.

[0068] In this embodiment, the batch size is set to 64, the upper limit of the initial learning rate and dynamic pruning of the Adam optimizer is 0.01, and the lower limit is 0.001. The training limit is 3000 iterations. The internal parameters are updated by minimizing the cross-entropy loss function until the training loss stabilizes below the set value or the number of iterations is reached. The model batch size, learning rate, and network parameters are adjusted through experience and repeated experiments. The final model is saved, and the parameter settings are shown in Table 1.

[0069] Table 1 Parameters of MSC-MHSA-CBAM Model

[0070]

[0071] Step 5: Input the validation set into the trained gearbox fault diagnosis model for online fault diagnosis, obtain the diagnosis results, and verify the model's fault diagnosis performance.

[0072] The above descriptions are merely preferred embodiments of this application, and the present invention is not limited to the above embodiments. It is understood that other improvements and variations directly derived or conceived by those skilled in the art without departing from the spirit and concept of the present invention should be considered to be included within the protection scope of the present invention.

Claims

1. A multi-scale feature fusion gearbox fault diagnosis method based on a self-attention mechanism, characterized in that, The method comprises the following steps: Step 1: obtaining vibration signals of different failure modes of a gearbox, the vibration signals being one-dimensional time series data; Step 2: using a sliding window of the same size to intercept the one-dimensional time series data to obtain samples, and setting labels of the samples according to actual failure types; dividing the obtained samples into a training set, a validation set and a test set according to a preset proportion; Step 3: constructing a multi-scale feature fusion fault diagnosis model based on a self-attention mechanism; The multi-scale feature fusion fault diagnosis model based on the self-attention mechanism comprises parallel low-frequency feature extraction paths and local time-domain feature extraction paths, a feature fusion network and a classification network; The low-frequency feature extraction path and the local time-domain feature extraction path each comprise a convolution layer, a pooling layer and a batch normalization layer, the input is a raw vibration signal of the gearbox, and the output is a feature vector of the same size; the low-frequency feature extraction path uses a large convolution kernel, and the local time-domain feature extraction path uses a small convolution kernel; the feature fusion network comprises an MHSA module, an improved CBAM module and a batch normalization layer; the classification network comprises a pooling layer, a fully connected layer and a Softmax classifier, the feature dimension is reduced by using average pooling, and one layer of fully connected and the Softmax classifier are used for fault feature classification; the activation function of the CBAM module is selected as Sigmoid, and the activation functions of the rest of the model are all selected as Relu; Step 4: inputting the training set into the constructed fault diagnosis model for training; During training, the labeled samples in the training set are input into the fault diagnosis model to obtain predicted output, and then the cross-entropy loss is calculated with the real labels, and then the network parameters are optimized by using the Adam optimizer to perform back propagation until the training loss is stable below a set value or the number of iterations is reached; Step 5: intercepting a to-be-detected vibration signal sample according to a certain length, inputting the vibration signal sample into the fault diagnosis model trained in step 4, and obtaining a fault diagnosis result; The CBAM module injects attention mapping along two independent dimensions of a channel and a space of a feature vector; in channel attention, the spatial dimension of the input feature mapping is compressed; in space attention, average pooling and maximum pooling are performed along the channel dimension, and they are connected to describe feature information; respective attention weights are allocated to perform adaptive feature refinement on the input feature vector, and fault sensitive information is further learned; the input of the CBAM module is the output of the MHSA module, and the input is processed by batch normalization before being input into the CBAM module, and the mathematical model of the CBAM module is as follows: ; ; ; ; wherein, is the feature vector output by the MHSA module, is the feature vector output by the MHSA module, are channel attention and spatial attention, respectively, denotes multiplication of corresponding position elements, denotes a multi-layer perceptron, are average pooling and max pooling, respectively, are average pooling and max pooling, respectively, is a convolution operation, is a Sigmod activation function; The space attention is improved, the space attention of the improved 1D-CBAM module is the same as the original channel attention, and parallel fully connected layers are used to replace convolution operations; meanwhile, a residual connection is introduced between the output of the MHSA module and the main feature input, and the mathematical model of the space attention of the improved 1D-CBAM module is updated as follows: ; 。 2. The self-attention mechanism based multi-scale feature fusion gearbox fault diagnosis method according to claim 1, characterized in that, In step 2: The size of the sliding window is 1024, and the interception mode is random interception; the proportion of the training set, the validation set and the test set is 6:3:1, and the sample label is set to , is the number of gearbox fault types, and the training set is input into a fault diagnosis model for training.

3. The self-attention mechanism based multi-scale feature fusion gearbox fault diagnosis method according to claim 1, characterized in that, In step 3: The low-frequency feature extraction path structure comprises a first convolutional layer, a second convolutional layer, a first pooling layer, a third convolutional layer and an adaptive pooling layer I connected in sequence; the local time domain feature extraction path structure comprises a fourth convolutional layer, a second pooling layer, a fifth convolutional layer, a third pooling layer, a sixth convolutional layer and a fourth pooling layer connected in sequence; for a one-dimensional gearbox vibration signal input, each convolutional layer uses a one-dimensional convolutional neural network; the first to fourth pooling layers adopt maximum pooling; the adaptive pooling layer I performs average pooling on the input according to a given output dimension, and is used for dimension trimming; a batch normalization layer is introduced after each convolutional layer and the MHSA module to adjust the covariance offset and improve the training performance; for batch input samples , the batch normalization layer performs the following operations: ; ; ; ; wherein, and are mean and variance, m is the total number of input samples, is a constant, and are learnable parameters, is the output.

4. The self-attention mechanism based multi-scale feature fusion gearbox fault diagnosis method according to claim 1, characterized in that, In step 3: The MHSA module uses projection under different parameters to learn vibration signal fusion features based on similarity; The MHSA module has three isometric inputs, namely a query matrix Q, a key matrix K and a value matrix V, the low-frequency feature vector output by the low-frequency feature extraction channel is taken as the Q and K inputs, as the main feature, and the local time domain feature vector output by the local time domain feature extraction channel is taken as the V input, as the auxiliary feature, the main feature and the auxiliary feature are subjected to multiple linear projections for attention calculation, and the calculation formula is as follows: ; wherein, is the dimension of the query vector, , and are the corresponding vectors after projection, respectively.

5. The self-attention mechanism based multi-scale feature fusion gearbox fault diagnosis method according to claim 1, characterized in that, In step three: The classification network structure comprises a Flatten layer, an adaptive pooling layer two, a full connection layer and a Softmax classifier connected in sequence; the adaptive pooling layer two is used for reducing the fusion feature dimension and preventing overfitting; the Softmax classifier is a kind of supervised learning classifier, and the output is a one-dimensional feature vector, and the value of each position of the vector corresponds to the probability of each fault type; assuming that the total amount of samples of the training set is N , and is divided into C categories, the predicted output of the i sample is denoted as , the input sample belongs to the c category, and the probability is denoted as , then the output value g w,b ( x i ) of each position corresponding to the Softmax function is represented as: wherein, and are parameters for each fault type; the final classification result of the Softmax classifier is the fault type corresponding to the position with the largest probability value.

6. The self-attention mechanism based multi-scale feature fusion gearbox fault diagnosis method according to claim 1, characterized in that, In step four: The cross-entropy loss function is combined with the Softmax classifier to calculate the difference between the predicted category and the fault category, and the model internal parameters are updated by back propagation to minimize the loss function, and the mathematical expression of the cross-entropy loss function is as follows: ; wherein: is the number of samples of this class of faults; and are the true and predicted values, respectively, of the th sample. The iteration process of the Adam optimizer is as follows: wherein and is a first order matrix and a second order matrix of the gradient of the objective function denotes the current iteration batch denotes the previous batch and denotes the matrix exponential decay rate and is a correction to and denotes the model parameters denotes the learning rate takes the value ;​​ The learning rate is dynamically clipped, and the upper and lower bounds of the given learning rate are given to stabilize the model convergence in the later stage.

Citation Information

Patent Citations

  • Convolutional neural network fault diagnosis method based on multi-channel attention module

    CN112284736A

  • End-to-end rolling bearing intelligent fault diagnosis method adopting multi-attention mechanism

    CN112304614A