Bearing fault diagnosis method based on time-frequency enhancement CNN-Transformer
By applying the time-frequency enhanced CNN-Transformer model in bearing fault diagnosis, combined with the FFT algorithm, the problem of insufficient real-time and robustness of traditional methods is solved, and more accurate and reliable fault prediction is achieved.
Patent Information
- Application Number
- CN202510583587.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-07
- Publication Date
- 2025-06-03
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional bearing fault diagnosis methods rely on time and frequency domain analysis, and lack real-time and robustness, making it difficult to adapt to the demand of modern industry for intelligent diagnosis.
The CNN-Transformer model based on time-frequency enhancement is adopted, combined with the fast Fourier transform (FFT) algorithm, and the time-domain and frequency-domain characteristics in bearing fault data are captured to achieve more accurate fault prediction through deep learning.
This method can capture data characteristics more comprehensively, improve the accuracy and reliability of fault prediction, and adapt to the needs of modern industry for intelligent diagnosis.
Smart Images

Figure CN120086668A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a bearing fault diagnosis method, and particularly to a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer. Background Art
[0002] Since the health status of rolling bearings is directly related to the safe and stable operation of equipment, it is crucial to detect faults in key rolling bearings in a timely manner to ensure the reliability and safety of mechanical equipment. Once a fault occurs in the rolling bearings of mechanical equipment, it may lead to equipment shutdown, production interruption, and even safety accidents, having a serious impact on production and operation. Therefore, fault diagnosis of bearings can effectively reduce economic losses and ensure the stable operation of mechanical components.
[0003] However, traditional bearing fault diagnosis mainly relies on time-domain analysis, frequency-domain analysis, etc. These traditional methods generally rely on expert experience, with insufficient real-time performance and robustness, and are difficult to meet the requirements of modern industry for intelligent diagnosis. Summary of the Invention
[0004] Aiming at the above technical problems, the present invention provides a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer, which can simultaneously capture key features in the time domain and frequency domain, compare data features with fault features, and thus achieve more accurate fault prediction.
[0005] In recent years, with the continuous rise of machine learning research, intelligent fault diagnosis algorithms have gradually become the mainstream algorithms in the field of fault diagnosis.
[0006] The present invention proposes a fault diagnosis method combining time-frequency analysis and deep learning. Deep learning integrates a convolutional neural network (CNN) and a Transformer. The CNN part can effectively capture local feature patterns in bearing fault data, while the Transformer models the global dependencies in long-sequence data through the self-attention mechanism. Combining with the fast Fourier transform (FFT) algorithm, making full use of the complementarity of time-domain and frequency-domain features, converting the time-domain information of the signal into frequency-domain information, and combining the characteristics of CNN and Transformer, the model can simultaneously capture key features in the time domain and frequency domain. This method can capture data features more comprehensively, compare data features with fault features, and thus achieve more accurate fault prediction, providing a new idea for bearing fault diagnosis.
[0007] Based on this, a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer proposed by the present invention includes: Step 1: Obtain the bearing vibration signal and perform preprocessing on it; Step 2: Select the window size, interval step, and overlap rate, and use a sliding window to divide the preprocessed bearing vibration signal data into a training dataset, a validation dataset, and a test dataset; Step 3: Construct an FFT-CNN-Transformer network model; Step 4: Use the Adam optimizer and the cross-entropy loss function to train the FFT-CNN-Transformer network model, adjust the hyperparameters of the FFT-CNN-Transformer network model through the validation dataset, and evaluate the performance of the FFT-CNN-Transformer network model using the test dataset; Step 5: By plotting a confusion matrix, display the classification effect of the FFT-CNN-Transformer network model on different fault categories.
[0008] Further, the preprocessing of the bearing vibration signal includes: converting the bearing vibration signal into a two-dimensional array to obtain a two-dimensional bearing vibration signal; obtaining different fault types according to the bearing vibration signal, and intercepting the data length of each fault type to ensure that the intercepted data lengths are the same.
[0009] Further, the said Step 3 includes: Use convolution to extract the time-domain local features of the bearing vibration signal; Perform a fast Fourier transform on the bearing vibration signal to obtain frequency-domain spectral features, and then use convolution to extract the frequency-domain local features of the bearing vibration signal; Use Transformer to perform global dependence modeling on the time-domain local features and frequency-domain local features respectively through the multi-head self-attention mechanism to obtain the time-domain global features and frequency-domain global features; Fuse the time-domain global features and frequency-domain global features; Complete fault classification on the data after feature fusion through a fully connected layer.
[0010] Further, the said Step 4 includes: Initialize the parameters of the FFT-CNN-Transformer network model; Input the training dataset, obtain the prediction results of the training dataset through forward propagation, calculate the error using the cross-entropy loss function according to the prediction results, calculate the gradient using backpropagation, and then update the parameters of the FFT-CNN-Transformer network model using the Adam optimizer; Input the validation dataset to adjust the hyperparameters of the FFT-CNN-Transformer network model; Repeat until the preset number of rounds is reached to obtain an optimized FFT-CNN-Transformer network model; The test data set is input into the optimized FFT-CNN-Transformer network model, and the performance of the FFT-CNN-Transformer network model is evaluated by calculating accuracy, precision, F1-score, recall, and macro-average metrics.
[0011] Furthermore, the division ratio of the sliding window is 70% for the training data set, 10% for the validation data set, and 20% for the test data set.
[0012] Furthermore, the data after feature fusion is passed through a fully connected layer to complete fault classification, including: mapping the data after feature fusion to the classification space through the fully connected layer, and outputting the probability distribution of each bearing fault type.
[0013] Furthermore, the fault categories include 10 types: normal state, inner race fault, outer race fault, rolling element fault, and each fault contains three sizes: 0.007 inches, 0.014 inches, and 0.021 inches.
[0014] Compared with the prior art, the improvement of the present invention lies in: integrating the convolutional neural network (CNN) and Transformer. The CNN part can effectively capture the local feature patterns in the bearing fault data, while Transformer models the global dependencies in the long sequence data through the self-attention mechanism. Combining with the fast Fourier transform (FFT) algorithm, making full use of the complementarity of time-domain and frequency-domain features, converting the time-domain information of the signal into frequency-domain information, and combining the characteristics of CNN and Transformer, the model can capture the key features in both time domain and frequency domain simultaneously. This method can capture data features more comprehensively, compare the data features with the fault features, so as to achieve more accurate fault prediction.
[0015] The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented according to the content of the specification. And in order to make the above and other purposes, features, and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given and described in detail in conjunction with the accompanying drawings. Brief Description of the Drawings
[0016] Figure 1 It is a flowchart of a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer of the present invention; Figure 2 It is a confusion matrix diagram of the CNN-Transformer model of the present invention; Figure 3 It is a confusion matrix diagram of the FFT-CNN-Transformer model of the present invention. Detailed Description of the Preferred Embodiment
[0017] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0018] As Figure 1 shown, a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer proposed by the present invention includes: Step 1: Obtain the bearing vibration signal and preprocess it; Specifically, extract the bearing signal data from the rolling bearing dataset, and separately extract the bearing signal data in the normal state and the bearing signal data in the other nine fault states. For each bearing signal data, according to the cask principle, select the first 119,808 data points for analysis. Then preprocess it. Among them, the preprocessing includes: converting the bearing vibration signal into a two-dimensional array to obtain a two-dimensional bearing vibration signal; obtaining different fault types according to the bearing vibration signal, and intercepting the length of the data for each fault type to ensure that the length of the intercepted data is the same. And in the data preprocessing stage, missing value detection and so on are performed on the intercepted sequence.
[0019] The present invention uses the rolling bearing dataset of Case Western Reserve University (CWRU) as the experimental object. This dataset provides experimental data under different working conditions, including parameters such as different rotational speeds, loads, and working times. Each fault mode has multiple samples under different working conditions, and there are various classification forms according to different condition constraints. The present invention conducts a 10-classification experiment with this dataset.
[0020] Step 2: Select the window size, interval step, and overlap rate, and use a sliding window to divide the preprocessed bearing vibration signal data into a training dataset, a validation dataset, and a test dataset; Specifically, the interval step is defined as the fixed interval amount set between two adjacent operations. In the present invention, the interval step is set to 1024; the overlap rate is used to quantitatively describe the proportion of the overlapping part between different objects, regions, or datasets. In the present invention, the overlap rate is determined to be 50%. The above settings for the interval step and the overlap rate are made by the present invention after fully referring to and comprehensively considering the research results of a large number of relevant academic papers. The division ratio of the sliding window is 70% for the training dataset, 10% for the validation dataset, and 20% for the test dataset.
[0021] Step 3: Construct an FFT-CNN-Transformer network model; Specifically, an FFT-CNN-Transformer network model is established for feature extraction and fault classification. The CNN layer performs spatial feature extraction, while the Transformer is used for data classification. Each head of the multi-head attention mechanism learns different features, capturing rich dependencies in the sequence, and concatenating multiple heads enables the model to have a global perspective.
[0022] The network structure includes the following parts: (1) Convolutional feature extraction layer First, perform feature extraction operations on the input bearing vibration signal: Time-domain feature extraction: Use convolution (Conv1d) to capture local features of the time-domain signal, which can effectively extract impact features and periodic information in the bearing vibration signal.
[0023] Frequency-domain feature extraction: Perform a fast Fourier transform (FFT) on the bearing vibration signal to obtain frequency-domain spectral features, and then further extract local features in the frequency domain through convolution. The convolutional layer enhances the perception ability of local abnormal patterns by optimizing the convolution kernel size, stride, and number of channels.
[0024] Among them, the fast Fourier transform (FFT) is an efficient mathematical algorithm for quickly calculating the discrete Fourier transform (DFT). It can quickly transform discrete signals in the time domain to the frequency domain, thus clearly revealing the frequency components of the signal and providing a powerful tool for signal analysis. Compared with directly calculating the discrete Fourier transform, FFT significantly reduces the computational amount and improves the calculation efficiency by cleverly using the periodicity and symmetry of the rotation factor. Therefore, FFT shows outstanding advantages of fast calculation speed, low resource consumption, and wide application range in many signal processing fields, such as fault diagnosis, audio processing, image processing, etc.
[0025] The basic idea of FFT is to gradually decompose a discrete Fourier transform of length N into multiple discrete Fourier transforms of shorter lengths for calculation. Specifically, for the discrete signal (x[n]), its discrete Fourier transform is defined as: where k = 0, 1,..., N - 1. (1) The FFT algorithm is based on the divide-and-conquer strategy. Taking the radix-2 FFT as an example, when N is even, the DFT of length N is decomposed into two DFTs of length Let N = 2M, then: In the formula: (x[n]) —— The discrete input signal sequence in the time domain; (X[k]) —— The discrete output signal sequence in the frequency domain; (n) —— Time-domain sequence index; (k) —— Frequency-domain sequence index; (N) —— Length of the discrete signal; ( ) —— Rotation factor, which reflects the transformation relationship between the time domain and the frequency domain.
[0026] By continuously and recursively decomposing the DFT of a long sequence into the DFT of short sequences, the FFT greatly reduces the number of operations, realizes the fast conversion of the signal from the time domain to the frequency domain, and lays a foundation for subsequent signal analysis and processing.
[0027] (2)Batch Normalization layer (BN layer) After the convolution operation, a Batch Normalization (BatchNorm1d) layer is added to normalize the distribution of intermediate features, reduce internal covariate shift, improve the stability and convergence speed of the training process, and avoid the problems of gradient explosion or disappearance. Among them, the "intermediate features" are the feature maps output by the convolution layer, and they are normalized by the Batch Normalization (BatchNorm1d) layer before entering the pooling layer. This operation can solve the problem of internal covariate shift in the training of deep networks by stabilizing the feature distribution, and improve the stability and efficiency of model training.
[0028] (3)Pooling layer MaxPooling and AdaptiveAvgPool1d operations are used to downsample the feature maps, reduce the feature dimension, reduce the computational burden, and retain key information at the same time. After the output of the Transformer module, a sequence pooling operation is further performed to obtain a global feature representation.
[0029] (4)Transformer encoder layer Transformer encoders (TransformerEncoder) are introduced for time-domain features and frequency-domain features respectively, and the long-term and short-term dependencies in the vibration signal sequence are mined through the self-attention mechanism: Time-domain Transformer: Capture time-series dependent features such as impact patterns and periodic changes in vibration signals.
[0030] Frequency-domain Transformer: Learn the energy distribution and mutual relationship between different frequency bands, and improve the model's ability to identify frequency-domain fault features.
[0031] Among them, the number of heads in the multi-head attention of the Transformer encoder is set to 4. First, from the perspective of structural constraints, the attention mechanism in the Transformer module requires that the hidden layer dimension (here 128) can be divisible by the number of heads. When set to 4, each attention head is responsible for the subspace calculation of 32 dimensions, meeting the requirements of structural integrity and ensuring that each head can learn sufficient feature information. Second, from the trade-off between model performance and computing resources, 4 heads can parallelly model diverse temporal dependencies in different subspaces, improving the expressive ability. At the same time, compared with more heads (such as 8 or 16), the computational complexity and video memory occupancy are relatively low, making it suitable for medium-scale temporal tasks. In addition, according to existing research and engineering practices, the commonly used number of attention heads in Transformer usually fluctuates between 2 and 8. Among them, 2 to 4 heads are suitable for lightweight models or small and medium-sized datasets, and 6 to 8 heads are more commonly used in large-scale pre-trained models. In the current task scenario, setting it to 4 achieves a good balance in terms of accuracy and convergence speed. Therefore, choosing 4 attention heads is the result of a comprehensive consideration among structural rationality, modeling ability, and resource efficiency.
[0032] (5)Multi-modal Feature Fusion Layer Perform a concatenation operation on the global features encoded by the Transformer in the time domain and frequency domain to achieve deep fusion of multi-modal features and fully exploit the complementarity of time-domain and frequency-domain information.
[0033] (6)Fully Connected Layer (Decision Layer) The fused features are mapped to the classification space through a fully connected layer (Linear layer), and finally the probability distribution of each bearing fault type is output, including the normal state and different fault types (such as inner raceway fault, outer raceway fault, rolling element fault, etc.), to achieve accurate classification.
[0034] Among them, the fault classification includes 10 categories: normal state, inner raceway fault or outer raceway fault or rolling element fault, and each category of fault includes three sizes: 0.007 inches, 0.014 inches, and 0.021 inches.
[0035] Specifically, as shown in Table 1, in the present invention, ten rows of data are extracted from the dataset. The first row of data represents the normal state, corresponding to category 0 in the table, that is, "no fault". The second row of data corresponds to category 1 in the table, characterizing the "inner ring 0.007-inch fault type"; the third row corresponds to category 2, which is the "inner ring 0.014-inch fault type"; the fourth row corresponds to category 3, presenting the "inner ring 0.021-inch fault type". The fifth row of data corresponds to category 4, that is, the "outer ring 0.007-inch fault type"; the sixth row corresponds to category 5, which is the "outer ring 0.014-inch fault type"; the seventh row corresponds to category 6, characterizing the "outer ring 0.021-inch fault type". The eighth row of data corresponds to category 7, presenting the "rolling element 0.007-inch fault type"; the ninth row corresponds to category 8, which is the "rolling element 0.014-inch fault type"; the tenth row corresponds to category 9, characterizing the "rolling element 0.021-inch fault type".
[0036]
[0037] Step 4: Train the FFT-CNN-Transformer network model using the Adam optimizer and the cross-entropy loss function, adjust the hyperparameters of the FFT-CNN-Transformer network model through the validation dataset, and evaluate the performance of the FFT-CNN-Transformer network model using the test dataset; Specifically, Step 4 includes: Initialize the parameters of the FFT-CNN-Transformer network model; Specifically, it includes initializing the parameters of the convolutional layer, the Transformer encoder layer, the fully connected layer, and the batch normalization layer. The convolutional layer extracts local features of the data through convolutional kernels, and its weights and biases are randomly initialized, providing diverse initial states for the model to learn features and enabling the model to capture different feature patterns; the Transformer encoder layer contains multi-head attention and a feed-forward network, and the weight matrices, weights, and biases are randomly initialized, allowing the model to explore different long-range dependencies in the initial stage and facilitating the learning of complex patterns in the sequence; the fully connected layer is responsible for mapping the fused features to the output categories, and its weights and biases are randomly initialized, establishing an initial mapping between the features and the categories and laying a foundation for subsequent training adjustments; the scaling and translation parameters of the batch normalization layer are initialized, which can accelerate the convergence of the model, reduce the internal covariate shift, make the model training more stable, and enhance the generalization ability.
[0038] Input the training dataset, obtain the prediction results of the training dataset through forward propagation, calculate the error using the cross-entropy loss function according to the prediction results, calculate the gradient using backpropagation, and then update the parameters of the FFT-CNN-Transformer network model using the Adam optimizer; Specifically, during model training, the output of the forward propagation of the FFT-CNN-Transformer network model is the prediction result of the model for the input training samples. Specifically, it is the probability distribution of the model for each input sample belonging to different fault types (such as normal, inner race fault, outer race fault, etc.). In a 10-classification problem, the output is a vector of length 10, and each element in the vector represents the probability that the sample belongs to the corresponding class.
[0039] The cross-entropy loss function is used to calculate the error. The cross-entropy loss function is used to measure the difference between the model's prediction result and the true label. Due to its multiple advantages in theoretical rigor, optimization efficiency, and task adaptability, it has become the standard choice for probability prediction and parameter optimization in classification models. Its core goal is to accurately model the class labels by minimizing the distribution difference. For a sample, assuming the predicted probability distribution of the model is, where is the number of classes, and the true label is, the calculation formula for the cross-entropy loss is: Backpropagation is based on the chain rule to calculate the gradient of the loss function with respect to the model parameters. In a deep learning framework, this process will be automatically completed. Simply put, starting from the loss function, it propagates backward along the computational graph, and calculates the gradients of each intermediate variable and parameter in turn.
[0040] The Adam optimizer is used to update the model's parameters according to the calculated gradients. The role of the optimizer is to adjust the model parameters according to the gradient information, so that the value of the loss function gradually decreases, and minimize the loss on the training set by continuously adjusting the parameters.
[0041] The input validation dataset is used to adjust the hyperparameters of the FFT-CNN-Transformer network model; Specifically, after each round of training, the validation set is input into the model for evaluation. During training, after each round (epoch) of training, that is, after the model has performed a forward propagation and a backward propagation on all samples in the training set, the validation set is used to calculate metrics such as the loss and accuracy of the model on the validation set. By observing the changes in these metrics, it can be judged whether the model is overfitting or underfitting, so as to adjust the training strategy or hyperparameters.
[0042] Among them, hyperparameters are parameters that need to be manually set during training, such as the learning rate, batch size, number of layers of the model, etc. During training, by evaluating the performance of the model under different hyperparameter combinations on the validation set, the hyperparameter combination that performs the best on the validation set is selected.
[0043] Repeat this process until the preset number of rounds is reached, and an optimized FFT-CNN-Transformer network model is obtained; Specifically, the preset number of rounds in the present invention is 50 epochs, and the loss and accuracy monitoring of each round are recorded, and finally the optimized FFT-CNN-Transformer network model is obtained.
[0044] The test data set is input into the optimized FFT-CNN-Transformer network model, and the performance of the FFT-CNN-Transformer network model is evaluated by calculating accuracy, precision, F1 score, recall rate, and macro-average metrics.
[0045] Among them, the test set is used to evaluate the finally trained model. After completing the model training and hyperparameter tuning, the test set is used to evaluate the generalization ability of the model on unseen data, and the final performance metrics of the model are obtained.
[0046] Specifically, in order to fully demonstrate the effectiveness and superiority of the present invention and comprehensively evaluate the performance of the proposed algorithm, the present invention uses accuracy, precision, recall rate, F1 score, and macro-average metrics to evaluate the fault diagnosis effect of each model.
[0047] The calculation formulas for each evaluation metric are as follows: Accuracy = (4) Precision = (5) Recall = (6) F1 score = 2 × (7) In the formula: TP is the number of true positive samples, TN is the number of true negative samples, FP is the number of false positive samples, and FN is the number of false negative samples; Accuracy - Precision; Precision - Precision; Recall - Recall rate.
[0048] Macro-averaging first calculates the average of the precision and recall rates of each category, and then obtains the corresponding macro F1. Different from the F1 score which pays more attention to large-category samples, macro-averaging pays more attention to small-category samples and can better measure the performance of the classifier on the automotive fault data set with too few fault-category samples.
[0049] Specifically, macro-average precision (Macro-Precision) (8) C represents the number of categories, P Cis the precision of the C-th category, and this formula calculates the macro-average precision by taking the arithmetic mean of the precisions of all categories.
[0050] Macro-average Recall (9) R C is the recall of the C-th category, and this formula calculates the macro-average recall by taking the arithmetic mean of the recalls of all categories.
[0051] Macro-average F1 Score (10) Formula (10) is based on the previously calculated macro-average precision and macro-average recall, and uses the general formula for the F1 score to calculate the macro-average F1 score. Different from the F1 score which pays more attention to large-category samples, the macro-average pays more attention to small-category samples, and can better measure the performance of the classifier on the automotive fault dataset with too few fault-category samples, and is used to comprehensively evaluate the performance of the classification model on multiple categories.
[0052] As shown in Tables 2 and 3, it can be seen that: the accuracy, precision, recall, and F1 score of the training results using the FFT-CNN-Transformer model are all significantly higher than those of the FFT-CNN-Transformer model. Among them, in Tables 2 and 3,'support' represents the number of supported samples, that is, the actual number of samples of each category that appear in the dataset. This indicator intuitively reflects the scale status of each category of samples. When dividing the training set, test set, and validation set, in order to improve the accuracy of evaluation, this study scrambled the dataset. The values below'support' in Tables 2 and 3 represent the number of occurrences of each category of samples in the test set.
[0053] As shown in Table 4, it can be seen that by adopting this solution, the macro-average F1 score reaches 0.981 under complex processes, and the accuracy of 98.21% is significantly higher than the result of using the FFT-CNN-Transformer model. Therefore, adopting the present invention can significantly improve the accuracy and reliability of bearing fault diagnosis under complex working conditions.
[0054]
[0055] Step Five: Draw a confusion matrix to show the classification effect of the FFT-CNN-Transformer network model on different fault categories.
[0056] Specifically, draw the cross-entropy loss function curve and the accuracy curve to observe the convergence of the FFT-CNN-Transformer network model, as Figure 2 , Figure 3 shown. Draw the confusion matrix to show the classification effect of the FFT-CNN-Transformer network model on different fault categories. It can be seen that the classification effect of the FFT-CNN-Transformer network model on different fault categories is far better than that of the CNN-Transformer network model.
[0057] In the present invention, bearing vibration signals are acquired and preprocessed; a window size, an interval step length, and an overlap rate are selected, and the preprocessed bearing vibration signal data is divided into a training data set, a validation data set, and a test data set by using a sliding window; an FFT-CNN-Transformer network model is constructed; the FFT-CNN-Transformer network model is trained by using an Adam optimizer and a cross-entropy loss function, the hyperparameters of the FFT-CNN-Transformer network model are adjusted through the validation data set, and the performance of the FFT-CNN-Transformer network model is evaluated by the test data set; the classification effect of the FFT-CNN-Transformer network model on different fault categories is shown by drawing a confusion matrix. It can capture the key features in both the time domain and the frequency domain, compare the data features with the fault features, so as to achieve more accurate fault prediction.
[0058] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer, characterized in that: include: Step 1: Obtain bearing vibration signal and pre-process it; Step 2: Select the window size, interval step size and overlap rate, and use a sliding window to divide the preprocessed bearing vibration signal data into a training data set, a verification data set and a test data set; Step 3: Build the FFT-CNN-Transformer network model; Step 4: Use the Adam optimizer and cross entropy loss function to train the FFT-CNN-Transformer network model, adjust the hyperparameters of the FFT-CNN-Transformer network model through the validation data set, and evaluate the performance of the FFT-CNN-Transformer network model through the test data set; Step 5: Draw the confusion matrix to show the classification effect of the FFT-CNN-Transformer network model on different fault categories.
2. According to claim 1, a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer is characterized in that: The specific process of preprocessing the bearing vibration signal is as follows: converting the bearing vibration signal into a two-dimensional array to obtain a two-dimensional bearing vibration signal; obtaining different fault types according to the bearing vibration signal, and cutting the length of the data of each fault type to ensure that the length of the cut data is consistent.
3. According to claim 1, a bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer is characterized in that: The step three comprises: Convolution is used to extract the time domain local features of bearing vibration signals; Perform fast Fourier transform on the bearing vibration signal to obtain the frequency domain spectrum characteristics, and then use convolution to extract the frequency domain local characteristics of the bearing vibration signal; Transformer is used to perform global dependency modeling on the local features in the time domain and the local features in the frequency domain through a multi-head self-attention mechanism to obtain the global features in the time domain and the global features in the frequency domain. Fuse the time domain global features and the frequency domain global features; The feature-fused data is passed through a fully connected layer to complete fault classification.
4. The bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer according to claim 1 is characterized in that: The fourth step comprises: Initialize the FFT-CNN-Transformer network model parameters; Input the training data set, obtain the prediction results of the training data set through forward propagation, calculate the error based on the prediction results using the cross entropy loss function, calculate the gradient using back propagation, and then use the Adam optimizer to update the FFT-CNN-Transformer network model parameters; Input the validation data set to adjust the hyperparameters of the FFT-CNN-Transformer network model; Repeat the process until the preset number of rounds is reached to obtain the optimized FFT-CNN-Transformer network model; The test dataset is input into the optimized FFT-CNN-Transformer network model, and the performance of the FFT-CNN-Transformer network model is evaluated by calculating the accuracy, precision, F1 score, recall rate and macro-average indicators.
5. The bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer according to claim 4 is characterized in that: The sliding window is divided into 70% for the training data set, 10% for the validation data set, and 20% for the test data set.
6. The bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer according to claim 3 is characterized in that: The specific process of completing fault classification by passing the feature fused data through the fully connected layer is as follows: mapping the feature fused data to the classification space through the fully connected layer, and outputting the probability distribution of each bearing fault type.
7. The bearing fault diagnosis method based on time-frequency enhanced CNN-Transformer according to claim 1 is characterized in that: There are 10 types of faults: normal state, inner ring fault, outer ring fault, and rolling element fault. Each fault type includes three sizes: 0.007 inch, 0.014 inch, and 0.021 inch.
Citation Information
Cited By
A bearing intelligent fault diagnosis method using DWA Transformer
CN120705542B
Self-adaptive modulation identification method based on time-frequency double flow and domain adversarial learning
CN121356955A
Pump fault detection method based on data fragmentation and gated double-attention neural network
CN121614957A
Pump Fault Detection Method Based on Data Slicing and Gated Dual Attention Neural Network
CN121614957B
Rolling bearing fault diagnosis method based on deep learning
CN121808461A
