Rolling bearing fault diagnosis method based on deep learning
By adopting a TCN-Transformer model with a dual-path structure in rolling bearing fault diagnosis, time features and global features are extracted, and the problems of poor robustness and insufficient accuracy of the existing models are solved, achieving higher diagnostic accuracy and reliability.
Patent Information
- Application Number
- CN202411811395.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-04-18
AI Technical Summary
The existing rolling bearing fault diagnosis model has poor robustness, unstable performance and insufficient accuracy.
The TCN-Transformer fault diagnosis model with a dual-path structure is used to extract time features and Transformer paths through the TCN path, and the global features are extracted through the global average pooling layer and the Softmax layer.
It significantly improves the robustness and accuracy of the model, reduces manual intervention, and improves the accuracy and reliability of fault diagnosis.
Smart Images

Figure CN119848655A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of bearing diagnosis and machine learning, and in particular to a rolling bearing fault diagnosis method based on deep learning. Background Art
[0002] With the rapid development of industrial automation and mechanization, the performance and reliability of rolling bearings, as key mechanical transmission components, play a vital role in the operating efficiency and safety of the entire equipment. During long-term operation, rolling bearings may suffer from wear, fracture, and damage, which will not only cause equipment downtime and economic losses, but also may cause serious safety accidents. Therefore, accurate and efficient diagnosis of rolling bearing failures is of great significance to ensure the normal operation of mechanical systems.
[0003] Traditional rolling bearing fault diagnosis methods mainly rely on signal processing technology and empirical rules, such as time-frequency analysis, wavelet transform and envelope analysis, and other feature extraction methods, using shallow machine learning models such as BP neural network and support vector machine for fault classification. Although these methods have achieved certain results, they still have the following shortcomings in the era of big data: the feature extraction and selection process is cumbersome, requires a lot of manual intervention, and mainly relies on engineering experience; manual feature extraction simplifies the complexity of input data, but leads to the loss of rich information in the original data; traditional signal feature extraction technology has difficulties in separating the coupled features of complex faults.
[0004] Although deep learning methods have been widely used in the field of fault diagnosis and have improved the effect of fault diagnosis to a certain extent, existing models still have limitations in extracting long-term dependencies and global features. In addition, these single models show poor robustness when facing abnormal data and complex industrial environments, which often leads to unstable model performance and insufficient accuracy. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a rolling bearing fault diagnosis method based on deep learning, so as to solve the problems of poor robustness, unstable performance and insufficient accuracy of the existing rolling bearing fault diagnosis model.
[0006] On the one hand, an embodiment of the present invention provides a rolling bearing fault diagnosis method based on deep learning, the method comprising:
[0007] Collect the vibration signal of the rolling bearing, input the collected vibration signal into the constructed TCN-Transformer fault diagnosis model, and obtain the diagnosis result of the rolling bearing;
[0008] Among them, the TCN-Transformer fault diagnosis model is a dual-path structure, including a TCN path, a Transformer path, a global average pooling layer and a Softmax layer; the TCN path is connected in parallel with the Transformer path, and the outputs of the TCN path and the Transformer path are used as the input of the global average pooling layer; the TCN path extracts temporal features based on the input vibration signal, and the Transformer path extracts global features based on the input vibration signal; the global average pooling layer performs pooling operations on the temporal features extracted by the TCN path and the global features extracted by the Transformer path to obtain temporal feature vectors and global feature vectors, which are classified by the Softmax layer to obtain diagnosis results.
[0009] As a further improvement of the present application, the TCN path includes three residual modules connected in series, each residual module includes two residual units connected end to end, and the output of the previous residual unit is the input of the next residual unit; each residual unit includes a dilated causal convolution layer, a batch normalization layer and a LeakyReLU activation function connected in sequence, and the dilated causal convolution layer is used to extract the characteristics of the input signal; the batch normalization layer performs batch normalization processing on the output value of the dilated causal convolution layer, scales and offsets the normalized output value to obtain the output value of the batch normalization layer, and the LeakyReLU activation function performs nonlinear activation processing on the output value of the batch normalization layer; for each residual module, the input value of the residual module is convolved to obtain a convolution result, and the convolution result is added to the output of the residual module as the input of the next residual module.
[0010] As a further improvement of the present application, the Transformer path includes a feature expansion module, a multi-head self-attention mechanism module and a feedforward neural network; the feature expansion module is the input of the Transformer path, and projects the vibration signal into a 32-dimensional signal; the multi-head self-attention mechanism module linearly maps the received 32-dimensional signal to obtain the Key vector, Value vector and Query vector, calculates the weights of the Key vector, Value vector and Query vector, and then splices them; the feedforward neural network receives the splicing result output by the multi-head self-attention mechanism module, performs feature conversion and fusion processing, and outputs it to the global average pooling layer.
[0011] As a further improvement of the present application, the multi-head self-attention mechanism module includes a linear transformation layer, a scaled dot product attention layer, a connection layer and a linear output layer connected in sequence; the linear transformation layer includes 3 parallel linear transformation units, which linearly transform the 32-dimensional signal input by the feature expansion module into a Key vector, a Value vector and a Query vector respectively; the scaled dot product attention layer calculates the attention weights of the Key vector, the Value vector and the Query vector, and obtains the weighted Key vector, the Value vector and the Query vector after weighted processing; the connection layer connects the weighted vectors output by the scaled dot product attention layer, and the linear output layer linearly transforms the output result of the connection layer, and outputs it to the feedforward neural network.
[0012] As a further improvement of the present application, the feedforward neural network includes a first fully connected layer, a first Dropout layer, a second fully connected layer, and a second Dropout layer connected in sequence;
[0013] The first fully connected layer performs a fully connected operation on the output of the linear output layer; the first Dropout layer sets the output of some neurons in the first fully connected layer to 0; the second fully connected layer performs a fully connected operation on the output of the first Dropout layer; the second Dropout layer sets the output of some neurons in the second fully connected layer to 0.
[0014] As a further improvement of the present application, the Transformer path also includes a first-layer normalization module and a second-layer normalization module. The input of the first-layer normalization module is connected to the output of the multi-head self-attention mechanism module, and the original output of the multi-head self-attention mechanism module is layer-normalized, and the output is connected to the input of the feedforward neural network; the input of the second-layer normalization module is connected to the output of the feedforward neural network, and the original output of the feedforward neural network is layer-normalized.
[0015] As a further improvement of the present application, the multi-head self-attention mechanism module is residually connected to the first-layer normalization module, and the feedforward neural network is residually connected to the second-layer normalization module; the input data of the multi-head self-attention mechanism module is added to the output data of the first-layer normalization module as the input data of the feedforward neural network, and the input data of the feedforward neural network is added to the output data of the second-layer normalization module as the output data of the Transformer path.
[0016] As a further improvement of the present application, the TCN-Transformer fault diagnosis model also includes a feature expansion layer, a feature splicing layer and a fully connected layer connected in sequence; the input of the feature expansion layer is connected to the output of the global average pooling layer, the output of the fully connected layer is connected to the input of the Softmax layer, the feature expansion layer performs feature expansion on the time feature vector and the global feature vector output by the global average pooling layer, the feature splicing layer performs feature splicing on the output of the feature expansion layer, and the fully connected layer performs fusion mapping on the output of the feature splicing layer, and outputs it to the Softmax layer.
[0017] As a further improvement of the present application, the dilated causal convolution layer is provided with three convolution kernels, and the dilation rates are 1, 2, and 4 respectively.
[0018] In a second aspect, an embodiment of the present invention provides a rolling bearing fault diagnosis device based on deep learning, the device comprising:
[0019] A collection module, used for collecting vibration signals of rolling bearings;
[0020] A fault diagnosis module is used to input the collected vibration signal into the constructed TCN-Transformer fault diagnosis model to obtain the diagnosis result of the rolling bearing;
[0021] Among them, the TCN-Transformer fault diagnosis model is a dual-path structure, including a TCN path, a Transformer path, a global average pooling layer and a Softmax layer; the TCN path is connected in parallel with the Transformer path, and the outputs of the TCN path and the Transformer path are used as the input of the global average pooling layer; the TCN path extracts temporal features based on the input vibration signal, and the Transformer path extracts global features based on the input vibration signal; the global average pooling layer performs pooling operations on the temporal features extracted by the TCN path and the global features extracted by the Transformer path to obtain temporal feature vectors and global feature vectors, which are classified by the Softmax layer to obtain diagnosis results.
[0022] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0023] 1. The TCN-Transformer fault diagnosis model of the present invention has a dual-path structure, which extracts temporal features and global features at the same time. By setting a residual module and an expanded causal convolution layer in the TCN path, and setting a multi-head self-attention mechanism module and a feedforward neural network in the Transformer path, the problem of poor robustness of the existing rolling bearing fault diagnosis model is solved;
[0024] 2. By directly inputting the collected vibration signals of rolling bearings into the TCN-Transformer fault diagnosis model, TCN-Transformer automatically captures the features of different time scales and performs fault diagnosis, reducing manual intervention and improving the accuracy of fault diagnosis.
[0025] 3. The features extracted by the TCN path and the Transformer path are pooled through the global average pooling layer, which effectively retains the temporal feature vector and the global feature vector and avoids information loss. The feature expansion layer, feature concatenation layer and fully connected layer further expand and fuse the features, ensuring that the model can fully utilize the feature information extracted from the original data, improving the utilization efficiency of the features, and thus improving the accuracy and reliability of the diagnosis results.
[0026] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;
[0028] Figure 1 A schematic diagram of the structure of a TCN-Transformer fault diagnosis model provided by an embodiment of the present invention;
[0029] Figure 2 A schematic diagram of the structure of a TCN path provided by an embodiment of the present invention;
[0030] Figure 3 A schematic diagram of causal convolution provided by an embodiment of the present invention;
[0031] Figure 4 A schematic diagram of dilated convolution provided by an embodiment of the present invention;
[0032] Figure 5 A schematic diagram of the structure of a Transformer path provided by an embodiment of the present invention;
[0033] Figure 6 A schematic diagram of a multi-head self-attention mechanism module provided by an embodiment of the present invention;
[0034] Figure 7 A schematic diagram of a feedforward neural network provided by an embodiment of the present invention;
[0035] Figure 8 A schematic diagram of model training provided by an embodiment of the present invention;
[0036] Fig. 9 A schematic diagram of resampling using window width along the time axis provided by an embodiment of the present invention;
[0037] Fig.10 A schematic diagram of the convergence state of a model training process provided by an embodiment of the present invention;
[0038] Fig.11 A schematic diagram of the final diagnosis result of the fully connected layer provided by an embodiment of the present invention;
[0039] Fig.12 A schematic diagram of the classification accuracy of a model provided by an embodiment of the present invention;
[0040] Fig.13 A schematic diagram of a transfer learning process provided by an embodiment of the present invention;
[0041] Fig.14 A schematic diagram of the accuracy and loss function of the model training process provided by one embodiment of the present invention;
[0042] Fig.15 A schematic diagram of the results of using t-SNE to classify a test set provided in one embodiment of the present invention. DETAILED DESCRIPTION
[0043] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0044] A specific embodiment of the present invention discloses a rolling bearing fault diagnosis method based on deep learning, the method comprising:
[0045] The vibration signal of the rolling bearing is collected, and the collected vibration signal is input into the constructed TCN-Transformer fault diagnosis model to obtain the diagnosis result of the rolling bearing.
[0046] The vibration signal of the rolling bearing can be collected by a vibration sensor arranged on the bearing seat or shaft. The collected vibration signal is input into the TCN-Transformer fault diagnosis model to obtain the diagnosis result of the rolling bearing. The diagnosis result includes whether there is a fault and the specific type of fault, such as inner ring fault, outer ring fault, rolling element fault, etc.
[0047] like Figure 1As shown in the figure. The TCN-Transformer fault diagnosis model is a dual-path structure, including a TCN path, a Transformer path, a global average pooling layer and a Softmax layer; the TCN path is connected in parallel with the Transformer path, and the outputs of the TCN path and the Transformer path are used as the input of the global average pooling layer; the TCN path extracts time features based on the input vibration signal, and the Transformer path extracts global features based on the input vibration signal; the global average pooling layer performs pooling operations on the time features extracted by the TCN path and the global features extracted by the Transformer path to obtain time feature vectors and global feature vectors, which are classified by the Softmax layer to obtain the diagnosis results.
[0048] Furthermore, the TCN-Transformer fault diagnosis model also includes a feature expansion layer, a feature splicing layer and a fully connected layer connected in sequence; the input of the feature expansion layer is connected to the output of the global average pooling layer, the output of the fully connected layer is connected to the input of the Softmax layer, the feature expansion layer performs feature expansion on the temporal feature vector and the global feature vector output by the global average pooling layer, the feature splicing layer performs feature splicing on the output of the feature expansion layer, and the fully connected layer performs fusion mapping on the output of the feature splicing layer, and outputs it to the Softmax layer.
[0049] The detailed structure and parameters of the TCN-Transformer fault diagnosis model are shown in Table 1.
[0050] Table 1 TCN-Transformer network structure
[0051]
[0052] like Figure 2 As shown. The TCN path includes three residual modules connected in series, each residual module includes two residual units connected end to end, and the output of the previous residual unit is the input of the next residual unit; each residual unit includes a dilated causal convolution layer, a batch normalization layer and a LeakyReLU activation function connected in sequence, and the dilated causal convolution layer is used to extract the features of the input signal; the batch normalization layer batch normalizes the output values of the dilated causal convolution layer, scales and offsets the normalized output values to obtain the output values of the batch normalization layer, and the LeakyReLU activation function performs nonlinear activation processing on the output values of the batch normalization layer; for each residual module, the input value of the residual module is convolved to obtain the convolution result, and the convolution result is added to the output of the residual module as the input of the next residual module.
[0053] Specifically, the LeakyReLU activation function is shown in formula (1);
[0054]
[0055] Among them, α is a negative slope constant, ranging from 0.01 to 0.1. Compared with the ReLU activation function, LeakyReLU has a smaller negative slope when the input is less than zero, thus avoiding the problem of invalid output of neurons.
[0056] The batch normalization process is shown in formula (2);
[0057]
[0058] is the output value after batch normalization, x (k) is the output value of the kth batch of the expanded causal convolutional layer, μ (k) is the mean of the output values of the kth batch of the dilated causal convolutional layer; (σ (k) ) 2 is the variance of the output value of the kth batch of the expanded causal convolutional layer; ∈ is a normalization constant, which can be between 0.0001 and 0.000001 to avoid division by zero; y (k) is the output value of the batch normalization layer after scaling and offset processing, γ (k) is the scaling parameter; β (k) is the offset parameter.
[0059] The scaling parameter is a learnable weight used to adjust the scale of the normalized data, and the offset parameter is a learnable bias used to adjust the position of the data. The scaling parameter and offset parameter are usually initialized to 1 and 0, and can be optimized during the training process through the back-propagation algorithm.
[0060] The dilated causal convolution layer is used to extract the features of the input signal by combining causal convolution and dilated convolution operations. Specifically, Figure 3 As shown in the figure. During the causal convolution operation, the sliding of the convolution kernel is limited and can only slide to the left from the current position of the input sequence, but not to the right. When calculating the output of the current time step, the convolution kernel can only consider the data of the current and previous time steps, ensuring that the output of the model does not violate the causal principle of the time series.
[0061] like Figure 4As shown. The dilated convolution increases the receptive field of the convolution kernel by inserting fixed intervals of zeros (dilation rate) between the elements of the convolution kernel, so that the convolution kernel can cover a wider input range and thus capture longer-distance dependencies. The receptive field is the area size of the input data that the convolution kernel can capture, and the dilation rate is a parameter that controls the size of the receptive field. The larger the dilation rate, the larger the receptive field, and the wider the range of input features that the convolution kernel can capture. The dilated causal convolution layer is set with 3 convolution kernels, and the dilation rates are 1, 2, and 4, respectively, so that the dilated causal convolution layer can simultaneously capture short-term, medium-term, and long-term dependencies in the input signal.
[0062] like Figure 5 As shown in the figure. The Transformer path includes a feature expansion module, a multi-head self-attention mechanism module and a feedforward neural network; the feature expansion module is the input of the Transformer path, and projects the vibration signal into a multi-dimensional signal; the multi-head self-attention mechanism module obtains the Key vector, the Value vector and the Query vector through linear mapping of the received multi-dimensional signal, calculates the weights of the Key vector, the Value vector and the Query vector, and then splices them; the feedforward neural network receives the splicing result output by the multi-head self-attention mechanism module, performs feature conversion and fusion processing, and then outputs it to the global average pooling layer.
[0063] like Figure 6 As shown in the figure, the multi-head self-attention mechanism module includes a linear transformation layer, a scaled dot product attention layer, a connection layer and a linear output layer connected in sequence; the linear transformation layer includes three parallel linear transformation units, which linearly transform the multi-dimensional signal input by the feature expansion module into a Key vector, a Value vector and a Query vector respectively; the scaled dot product attention layer calculates the attention weights of the Key vector, the Value vector and the Query vector, and obtains the weighted Key vector, the Value vector and the Query vector after weighted processing; the connection layer connects the weighted vectors output by the scaled dot product attention layer, and the linear output layer linearly transforms the output result of the connection layer and outputs it to the feedforward neural network.
[0064] like Figure 7 The feedforward neural network includes a first fully connected layer, a first Dropout layer, a second fully connected layer, and a second Dropout layer connected in sequence; the first fully connected layer performs a fully connected operation on the output of the linear output layer; the first Dropout layer sets the output of some neurons in the first fully connected layer to 0; the second fully connected layer performs a fully connected operation on the output of the first Dropout layer; the second Dropout layer sets the output of some neurons in the second fully connected layer to 0.
[0065] The first Dropout layer and the second Dropout layer are used to prevent overfitting of the feedforward neural network. Randomly "discarding" (i.e. setting to 0) the outputs of some neurons in the fully connected layer can reduce the mutual dependence between neurons to enhance the generalization ability of the model.
[0066] The full connection operation is shown in formula (3);
[0067] h out =σ(Wh in +b)(3)
[0068] Where W is the weight matrix of the first and second fully connected layers, b is the bias vector of the first and second fully connected layers, and σ(·) is the activation function of the first and second fully connected layers.
[0069] Furthermore, the Transformer path also includes a first-layer normalization module and a second-layer normalization module. The input of the first-layer normalization module is connected to the output of the multi-head self-attention mechanism module, and the original output of the multi-head self-attention mechanism module is layer-normalized, and the output is connected to the input of the feedforward neural network; the input of the second-layer normalization module is connected to the output of the feedforward neural network, and the original output of the feedforward neural network is layer-normalized.
[0070] The multi-head self-attention mechanism module is residually connected to the first-layer normalization module, and the feedforward neural network is residually connected to the second-layer normalization module; the input data of the multi-head self-attention mechanism module is added to the output data of the first-layer normalization module as the input data of the feedforward neural network, and the input data of the feedforward neural network is added to the output data of the second-layer normalization module as the output data of the Transformer path.
[0071] The layer normalization process is shown in formula (4);
[0072]
[0073] in, is the activation value of the normalization module of the lth layer; is the average value of the output of the normalization module at layer l; is the variance of the output of the normalization module at layer l; is the output of the normalization module at layer l; γ is the scaling parameter; β (l) is the translation parameter; ε is the layer normalization constant, which can be between 0.0001 and 0.000001, used to avoid division by zero; n (l) is the number of activation values of the normalization module in layer k.
[0074] It should be noted that in order to reduce the training time, improve the operation speed of the model, and facilitate residual connection, the output dimensions of all sub-layers in the Transformer encoder of this application can be dimension d model .
[0075] Compared with the prior art, the rolling bearing fault diagnosis method based on deep learning provided in this embodiment adopts a dual-path structure, which effectively solves the problem of poor robustness in the existing rolling bearing fault diagnosis; in the TCN path, the time features are extracted through the residual module and the dilated causal convolution layer, and in the Transformer path, the multi-head self-attention mechanism module and the feedforward neural network are used to capture the global features, so that the model can automatically capture the features of different time scales from the collected vibration signals, which significantly improves the accuracy of the model. The features extracted from the two paths are pooled by the global average pooling layer, which effectively retains the time feature vector and the global feature vector and avoids information loss; the feature expansion layer, the feature splicing layer and the fully connected layer further expand and fuse these features to ensure that the model can fully utilize the feature information extracted from the original data and improve the stability of the model.
[0076] In order to verify the present invention, the present invention experiment is based on the 64-bit Windows 11 operating system, and all algorithms use the deep learning framework Pytorch to build the network model. The basic information of the deep learning platform is as follows: the graphics card version is NVIDIA RTX4050GPU, the GPU version is Intel(R) Core(TM) i7-12650H, and Python3.10 and TensorFlow2.10 frameworks are used.
[0077] (1) Prepare experimental data
[0078] like Figure 8As shown. The experiments used the vibration datasets of Jiangnan University Bearing (JNU) and Case Western Reserve University (CWRU) Bearing Center respectively. The CWRU dataset is a standard bearing dataset collected from the Case Western Reserve University simulation bearing experimental platform. The signal is collected by an accelerometer mounted on the drive end housing of the motor (2 horsepower), including 4 loads, and the sampling frequency is 12kHz. Single-point damage of different diameters is introduced by electrospark machining technology, and the bearing faults are divided into inner ring damage (ID), ball damage (BD) and outer ring damage (OD). Four different motor speeds (1797rpm, 1772rpm, 1750rpm and 1730rpm) are applied to the test bearing, which are regarded as four different working conditions (A, B, C and D). Table 2 summarizes the characteristics of the CWRU bearing dataset. Each dataset consists of 9 fault samples with different characteristics and 1 normal sample. The number of data samples of each type is 300, and each data sample contains 1024 data points. There are 3000 samples in total, including 10 fault types, divided into 1800 training samples, 600 validation samples and 600 test samples.
[0079] Table 2 CWRU bearing data set
[0080]
[0081] The JNU bearing dataset is provided by Jiangnan University. It consists of three bearing vibration sub-datasets at different speeds, with a data acquisition frequency of 50kHz. The sub-dataset contains 1 normal state and 3 fault states: ID, BD, and OD. Depending on the working environment, the fault types are divided into 12 types. The characteristics of the JNU bearing dataset are summarized in Table 3. The number of data samples of each type is 300, and each data sample contains 1024 data points. There are a total of 3600 samples, including 12 fault types, divided into 2160 training samples, 720 validation samples, and 720 test samples.
[0082] Table 3 JNU dataset
[0083]
[0084]
[0085] (2) Data preprocessing
[0086] The data enhancement method used in this paper is resampling. Figure 8 As shown, it is performed by using a window width w along the time axis. The resampling can be expressed as formula (5).
[0087] w=r+s (5)
[0088] Where w is the window width, r is the repetition rate, and s is the step size of the sliding window.
[0089] (3) Model training parameter setting
[0090] During the experiment, we used the Adaptive Moment Estimation (Adam) optimizer to update the training parameters of each model, and used cross entropy to calculate the loss value. Dropout was set to 0.2. Batch size has a significant impact on generalization performance and convergence speed. Too small a batch size may have a greater impact on the training process, while too large a batch size makes it difficult to achieve the ideal accuracy in a limited time. Therefore, we set the batch size to 32. In the initial stage, a higher learning rate can help the model quickly approach the optimal solution. As the training progresses, the learning rate decay strategy can enable the model to make more precise parameter adjustments near the optimal solution. The initial learning rate is set to 0.01, and the learning rate decay strategy is used to optimize the training process. The accuracy of the validation set is used as an indicator, and the learning rate is adjusted when the accuracy no longer increases. The experimental variable settings are shown in Table 4.
[0091] Table 4 Experimental variable definitions and settings
[0092] variable definition value Batchsize The number of samples to be processed per batch 32 Initial learning rate The learning rate set during initial setup 0.01 Learning rate decay Automatically adjust learning rate 0.1 Dropout Randomly delete neurons 0.2
[0093] (4) Results and analysis
[0094] In order to explore the effectiveness of the bearing fault diagnosis model based on TCN-Transformer fusion, the classification accuracy of four constant loads (0, 1, 2 and 3HP) of the CWRU bearing dataset was tested. The convergence status of the model training process is shown in Figure 2. Fig.10 As shown. Fig.10 From the accuracy of the four loads, the proposed model can converge to 1 quickly and stably under all loads.
[0095] The t-SNE method can effectively map features from high-dimensional space to low-dimensional space. The final diagnostic results of the fully connected layer of the test set are visualized by t-SNE, as shown in Fig.11 As shown in Figure 2, it is clear that the model proposed in this paper has clear classification boundaries and clear clustering.
[0096] In order to further evaluate the superior performance of the model, the proposed model was compared with five models including CNN, CNN-BiLSTM, MSCNN, TCN, and Transformer. The testing methods of the above models are the same as TCN-Transformer, and the performance of these six models is compared on the same test dataset. Each model is trained 20 times to reduce the impact of random initial values. The average value is taken. To ensure the reliability of the experimental results, the average value of 10 experiments is taken as the result. The classification accuracy of the six fault diagnosis models under four constant loads (0, 1, 2 and 3HP) is shown in the figure. Fig.12 As shown. The horizontal axis represents different load conditions, and the vertical axis represents classification accuracy. Each bar graph represents the performance of different models. It can be seen that the model structure without Transformer is relatively simple. CNN and TCN can only extract partial feature information of the signal, and are relatively weak in the ability to extract fault features. The Transformer model usually requires a large amount of data for effective training. If the data set is small, the Transformer may not be able to fully learn the patterns and features in the data, resulting in performance degradation. TCN has its advantages in processing long-range dependencies, while Transformer is strong in capturing global features. TCN-Transformer combines the advantages of both and shows high classification accuracy under different load conditions.
[0097] (5) Multi-condition diagnosis based on model transfer learning
[0098] like Fig.13 As shown. The entire transfer learning experiment was conducted on the CWRU dataset. We conducted 12 groups of transfer learning tasks, namely A→B, A→C, A→D, B→A, B→C, B→D, C→A, C→B, C→D, D→A, D→B and D→C. When using the source domain pre-training model, the Adam optimizer was selected, the learning rate was set to 0.001, the number of training epochs was set to 20, and there were 3000 samples in total, including 10 types of faults, divided into 1800 training samples, 600 validation samples and 600 test samples. When testing the model in the target domain, the Adam optimizer with a learning rate of 0.001 was still used, and the number of training epochs was reduced to 10. For each fault type, 5, 10, 20, 30, and 40 small samples were used for training in the target domain. The experiment aims to evaluate the effect of transfer learning under different conditions and the performance of small sample learning in fault diagnosis. Table 5 shows the accuracy of the model under five small sample learning conditions.
[0099] Table 5 Multi-condition diagnosis results of model transfer learning
[0100]
[0101] (5) Verify the model optimization capability under multiple working conditions
[0102] In order to verify the generalization of the model, a test experiment was conducted on the JNU bearing dataset. The data preprocessing here is the same as that of the CWRU dataset. Fig.14 The accuracy and loss function of the model training process are shown. The accuracy on the training set and the validation set gradually converges, and the loss function gradually shrinks to a smaller range. The model shows good performance on the JNU bearing dataset.
[0103] Fig.15 The figure shows the result of using t-SNE to classify the test set. Different types of bearing failures have clear classification boundaries. It is observed that the model performs well on most defect types, and data points of different categories form clear and compact clusters in low-dimensional space. The clear boundaries between clusters reflect the efficiency and stability of the model in feature extraction and classification tasks.
[0104] The comparative analysis of the results of the CWRU dataset and the JNU dataset shows that the model has good generalization performance on different datasets.
[0105] Another specific embodiment of the present invention discloses a rolling bearing fault diagnosis device based on deep learning, the device comprising:
[0106] A collection module, used for collecting vibration signals of rolling bearings;
[0107] A fault diagnosis module is used to input the collected vibration signal into the constructed TCN-Transformer fault diagnosis model to obtain the diagnosis result of the rolling bearing;
[0108] Among them, the TCN-Transformer fault diagnosis model is a dual-path structure, including a TCN path, a Transformer path, a global average pooling layer and a Softmax layer; the TCN path is connected in parallel with the Transformer path, and the outputs of the TCN path and the Transformer path are used as the input of the global average pooling layer; the TCN path extracts temporal features based on the input vibration signal, and the Transformer path extracts global features based on the input vibration signal; the global average pooling layer performs pooling operations on the temporal features extracted by the TCN path and the global features extracted by the Transformer path to obtain temporal feature vectors and global feature vectors, which are classified by the Softmax layer to obtain diagnosis results.
[0109] It can be understood that the rolling bearing fault diagnosis device based on deep learning corresponds to the various processes in the rolling bearing fault diagnosis method based on deep learning, and will not be repeated here.
[0110] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0111] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A rolling bearing fault diagnosis method based on deep learning, characterized in that: The method comprises: Collect the vibration signal of the rolling bearing, input the collected vibration signal into the constructed TCN-Transformer fault diagnosis model, and obtain the diagnosis result of the rolling bearing; Among them, the TCN-Transformer fault diagnosis model is a dual-path structure, including a TCN path, a Transformer path, a global average pooling layer and a Softmax layer; the TCN path is connected in parallel with the Transformer path, and the outputs of the TCN path and the Transformer path are used as the input of the global average pooling layer; the TCN path extracts temporal features based on the input vibration signal, and the Transformer path extracts global features based on the input vibration signal; the global average pooling layer performs pooling operations on the temporal features extracted by the TCN path and the global features extracted by the Transformer path to obtain temporal feature vectors and global feature vectors, which are classified by the Softmax layer to obtain diagnosis results.
2. The method according to claim 1, characterized in that The TCN path includes three residual modules connected in series, each residual module includes two residual units connected end to end, and the output of the previous residual unit is the input of the next residual unit; each residual unit includes a dilated causal convolution layer, a batch normalization layer and a LeakyReLU activation function connected in sequence, and the dilated causal convolution layer is used to extract the features of the input signal; The batch normalization layer batch normalizes the output values of the dilated causal convolutional layer, scales and offsets the normalized output values to obtain the output values of the batch normalization layer, and the LeakyReLU activation function performs nonlinear activation processing on the output values of the batch normalization layer; for each residual module, the input value of the residual module is convolved to obtain the convolution result, and the convolution result is added to the output of the residual module as the input of the next residual module.
3. The method according to claim 1, characterized in that The Transformer path includes a feature expansion module, a multi-head self-attention mechanism module and a feedforward neural network; The feature expansion module is the input of the Transformer path and projects the vibration signal into a multi-dimensional signal. The multi-head self-attention mechanism module obtains the Key vector, Value vector and Query vector through linear mapping of the received multi-dimensional signal, calculates the weights of the Key vector, Value vector and Query vector, and then splices them. The feedforward neural network receives the splicing result output by the multi-head self-attention mechanism module, performs feature conversion and fusion processing, and then outputs it to the global average pooling layer.
4. The method according to claim 1, characterized in that The multi-head self-attention mechanism module includes a linear transformation layer, a scaled dot product attention layer, a connection layer and a linear output layer connected in sequence; the linear transformation layer includes three parallel linear transformation units, which linearly transform the 32-dimensional signal input by the feature expansion module into a Key vector, a Value vector and a Query vector respectively; the scaled dot product attention layer calculates the attention weights of the Key vector, the Value vector and the Query vector, and obtains the weighted Key vector, the Value vector and the Query vector after weighted processing; the connection layer connects the weighted vectors output by the scaled dot product attention layer, and the linear output layer linearly transforms the output result of the connection layer and outputs it to the feedforward neural network.
5. The method according to claim 4, characterized in that The feedforward neural network includes a first fully connected layer, a first Dropout layer, a second fully connected layer, and a second Dropout layer connected in sequence; The first fully connected layer performs a fully connected operation on the output of the linear output layer; the first Dropout layer sets the output of some neurons in the first fully connected layer to 0; the second fully connected layer performs a fully connected operation on the output of the first Dropout layer; The second Dropout layer sets the outputs of some neurons in the second fully connected layer to 0.
6. The method according to claim 5, characterized in that The Transformer path also includes a first-layer normalization module and a second-layer normalization module. The input of the first-layer normalization module is connected to the output of the multi-head self-attention mechanism module, and the original output of the multi-head self-attention mechanism module is subjected to layer normalization processing, and the output is connected to the input of the feedforward neural network; the input of the second-layer normalization module is connected to the output of the feedforward neural network, and the original output of the feedforward neural network is subjected to layer normalization processing.
7. The method according to claim 6, characterized in that The multi-head self-attention mechanism module is residually connected to the first-layer normalization module, and the feedforward neural network is residually connected to the second-layer normalization module; the input data of the multi-head self-attention mechanism module is added to the output data of the first-layer normalization module as the input data of the feedforward neural network, and the input data of the feedforward neural network is added to the output data of the second-layer normalization module as the output data of the Transformer path.
8. The method according to claim 1, characterized in that The TCN-Transformer fault diagnosis model also includes a feature expansion layer, a feature splicing layer and a fully connected layer connected in sequence; the input of the feature expansion layer is connected to the output of the global average pooling layer, the output of the fully connected layer is connected to the input of the Softmax layer, the feature expansion layer performs feature expansion on the temporal feature vector and the global feature vector output by the global average pooling layer, the feature splicing layer performs feature splicing on the output of the feature expansion layer, and the fully connected layer performs fusion mapping on the output of the feature splicing layer, and outputs it to the Softmax layer.
9. The method according to claim 2, characterized in that: The dilated causal convolutional layer is set with 3 convolution kernels, and the dilation rates are 1, 2, and 4 respectively.
10. A rolling bearing fault diagnosis device based on deep learning, characterized in that: The device comprises: A collection module, used for collecting vibration signals of rolling bearings; A fault diagnosis module is used to input the collected vibration signal into the constructed TCN-Transformer fault diagnosis model to obtain the diagnosis result of the rolling bearing; Among them, the TCN-Transformer fault diagnosis model is a dual-path structure, including a TCN path, a Transformer path, a global average pooling layer and a Softmax layer; the TCN path is connected in parallel with the Transformer path, and the outputs of the TCN path and the Transformer path are used as the input of the global average pooling layer; the TCN path extracts temporal features based on the input vibration signal, and the Transformer path extracts global features based on the input vibration signal; the global average pooling layer performs pooling operations on the temporal features extracted by the TCN path and the global features extracted by the Transformer path to obtain temporal feature vectors and global feature vectors, which are classified by the Softmax layer to obtain diagnosis results.