An improved small sample fault diagnosis method based on MHSA dual-path feature fusion
By using the improved MHSA dual-path feature fusion method, the frequency-relative position features of vibration signals are extracted by continuous wavelet transform and multi-head self-attention mechanism, which solves the problem of insufficient deep feature mining in the existing technology and achieves high-precision and high-stability fault diagnosis effect.
Patent Information
- Application Number
- CN202310461787.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-26
- Publication Date
- 2026-01-09
- Estimated Expiration
- 2043-04-26
AI Technical Summary
Existing technologies fail to effectively extract the relative position information between frequencies in vibration signals during fault diagnosis, resulting in insufficient deep feature mining and low accuracy, especially in cases with small sample data, making accurate classification difficult.
An improved MHSA dual-path feature fusion method is adopted to convert the one-dimensional vibration signal into a two-dimensional time-frequency map through continuous wavelet transform. Combined with an improved multi-head self-attention mechanism and dual-position coding, the frequency-relative position features of the vibration signal are extracted. The dual-path feature fusion mechanism balances global and local information to prevent overfitting.
It improves the accuracy and stability of fault diagnosis on small sample datasets of rolling bearings in rotating machinery, and can accurately identify deep features in noisy environments, providing high-precision and highly stable fault classification results.
Smart Images

Figure CN116558825B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application provides an improved MHSA double-path feature fusion small sample fault diagnosis method, and belongs to the field of fault diagnosis. BACKGROUND
[0002] Rolling bearings are important components in mechanical rotation, and have been widely used in rotating machinery due to low cost, replaceability, easy reproduction and other characteristics. However, in the era of massive data, the traditional mathematical physical model does not have the ability to extract deep features from massive data, and ordinary shallow models are difficult to achieve ideal results in the face of complex and variable industrial data. In recent years, data-driven deep learning models have been widely developed, and have achieved remarkable results in image classification, target detection and natural language processing, and have also provided some solutions for fault diagnosis. However, most researchers in the field of fault diagnosis have studied based on time domain or frequency domain of signals, and the relative position information between frequencies hidden in the time domain of vibration signals is often ignored. For some small sample data that is not easy to obtain, some deep features are undoubtedly lost, which brings a high learning threshold. Therefore, how to obtain more important features of the relative position of frequency occurrence hidden in the vibration signal has important significance for accurate classification of rolling bearing data of rotating machinery. SUMMARY
[0003] The application provides an improved MHSA double-path feature fusion small sample fault diagnosis method, which solves the problem that intelligent fault diagnosis in the prior art cannot extract the relative position information between frequencies, resulting in insufficient deep feature mining and low precision.
[0004] The application is implemented through the following technical scheme: an improved MHSA double-path feature fusion small sample fault diagnosis method, and the steps are as follows:
[0005] 1) Signal acquisition: collect the vibration signal of the bearing by using a sensor, and select the bearing data with a sampling frequency of 5000Hz.
[0006] 2) Data processing: perform continuous wavelet transform (CWT) on the original one-dimensional vibration data, and convert the one-dimensional vibration signal into a two-dimensional time-frequency image with time domain and frequency domain information. The specific process of CWT can be represented by formula (1):
[0007]
[0008] Wherein f(x) represents the original signal to be processed, represents a wavelet base function, wherein * represents a complex conjugate symbol, a represents a scale factor, and b represents a translation parameter.
[0009] 3) Feature learning:
[0010] A rotating machinery fault diagnosis model structure composed of continuous wavelet transform (CWT), improved MHSA and double-path feature fusion mechanism is proposed for deep feature learning.
[0011] 4) Fault classification:
[0012] 4.1) Import the original one-dimensional vibration signals collected by the sensor into the model: Due to the scarcity of sample quantity in the small sample problem, we collected a total of 10 categories of data, one category of normal data and nine categories of fault data, with only 80 samples collected for each category, and a total of 800 samples for the ten categories of data;
[0013] 4.2) Process the one-dimensional vibration data as shown in step 2);
[0014] 4.3) Use the two-dimensional time-frequency graph obtained in step 4.2) to make the training data set and test data set for fault diagnosis: As described in step 4.1), 80 original one-dimensional vibration signals are collected for each category of signal, and after step 4.2), 80 two-dimensional time-frequency graph data are obtained for each category of signal. Then 40% of each time-frequency graph data is used as the training set and 60% as the test set;
[0015] 4.4) Construct an improved MHSA double-path feature fusion small sample fault diagnosis method composed of continuous wavelet transform (CWT), improved MHSA and double-path feature fusion mechanism;
[0016] The specific method is as follows:
[0017] Improved MHSA: Double position encoding is based on wavelet transform, and the time domain information of the vibration signal is extracted again. In order to balance the content superposition of the two times of time domain information, we also use double content encoding to strengthen the frequency domain information of the vibration signal. The specific process is shown in formula (2):
[0018]
[0019] Where X represents the feature map, W q , W k , W v are all learnable parameter arrays, and Q, K, V represent the query matrix, key matrix and value matrix respectively.
[0020] As for the query matrix Q1, we calculate its position encoding in the horizontal direction and the position encoding in the vertical direction where is a column vector, is a row vector, and S h(·), S w (·) respectively represent the column vector and the row vector into a matrix, and then they are merged into a position matrix As shown in equation (3):
[0021]
[0022] Similarly, the position encoding of the merged query matrix Q2 can be obtained, as shown in equation (4):
[0023]
[0024] Therefore, the improved dual position and dual content attention can be represented by equation (5) as follows:
[0025]
[0026] where V d represents the dimension of Q and K, Q T represents the transpose matrix of the Q matrix. Therefore, the four components of the final attention feature map (IDMSA) are shown in equation (6) as follows:
[0027]
[0028] Finally, the output Y of the IDMSA layer is an attention weight, multiplied by the value matrix V, which can be represented by equation (7) as follows:
[0029] Y = V0 IDMSA (21)
[0030] Dual-path feature fusion mechanism: The dual-path feature fusion mechanism contains two paths, one path with improved MHSA is responsible for the global information of the original signal, including the position information and frequency information of the signal, and the other path is mainly composed of convolution blocks, which are used to deepen the neural network layers and save the local features of the input data. The combination of the two allows the final output of the model to have both global information and not lose local information. In order to prevent overfitting, a global average pooling (GAP) method with compressed input channel feature matrix dimension is adopted, and the specific process can be represented by equation (8) as follows:
[0031]
[0032] where c represents the cth channel of the sample, x c is the cth channel of the input sample, d is the sample dimension, max(·) is the maximum value function, and j is the maximum value.
[0033] Convolution is an important operation for extracting deep features of data and plays an indispensable role in network models. The specific process is shown in equation (9) as follows:
[0034]
[0035] where x represents input data, w ij represents weight matrix, b represents bias matrix. C represents the number of channels, f conv3*3 (x) represents convolution operation with kernel size 3, and f conv1*1 (x) represents convolution operation with kernel size 1.
[0036] First, the data will be sent into the left and right two branches, for the left branch, the left branch specific process is, first the sample will be sent into the convolution layer for convolution, and then through the activation function, so that the data has nonlinear, the specific process is shown in equation (10):
[0037] O conv3*3 left = σ((f conv3*3 (x)) (24)
[0038] where x represents input data, f conv3*3 (x) represents convolution operation with kernel size 3*3, and σ is ReLU activation function.
[0039] The data after ReLU activation function is sent into the improved MHSA (IDMSA), and after global flat pooling and 1*1 convolution kernel dimension reduction operation, the specific process is shown in equation (11):
[0040] O atte-l left = f conv1*1 (GAP(IDMSA(O conv3*3 left)) (25)
[0041] where IDMSA is shown in equation (6), f conv1*1 (x) represents convolution operation with kernel size 1*1, and GAP represents global average pooling.
[0042] Then O atte-l left and the convolution kernel size of 3*3 is added to the convolution kernel, and the specific process is shown in equation (12):
[0043] O L left = O atte-l left + f conv3*3 (x) (26)
[0044] Similarly, the final result of the right branch is O R right, the only difference between the right branch and the left branch is that the improved IDMSA is replaced by 3*3 convolution kernel to obtain more local features, and the other processes are the same as the left branch, that is, only IDMSA in equation (11) is replaced by f conv3*3(·), shown by formula (13):
[0045] O atte-r = f(GPA(f conv3*3 ((O conv3*3 )))) (27)
[0046] Therefore, the result of the final fusion feature is shown by formula (14):
[0047] O F = O L + O R (28)
[0048] 4.5) input the time-frequency chart training set data into the classification model in step 4.4, and train it;
[0049] 4.6) input the time-frequency chart test set data into the model trained in step 4.5), and verify the model effect of step 4.5 by an evaluation index, if the effect can reach the expectation, step 4.7) is performed, otherwise the model is retrained by step 4.5) after increasing the iteration number;
[0050] 4.7) input the actually obtained noise data into the fault diagnosis model trained in step 4.5, and perform fault classification.
[0051] The beneficial effects of the present application are:
[0052] The present application adopts the above scheme, and converts a one-dimensional vibration signal into a time-frequency chart having time domain and frequency domain information by CWT, extracts the frequency relative position features of the vibration signal by using the improved MHSA with double position and double content, and uses double content coding to strengthen the frequency domain information of the vibration signal once in order to balance the time domain position information and the frequency domain information in the extracted features. Finally, a global and local information feature fusion mechanism is introduced, since one branch with the improved MHSA has more global information, in order not to lose the local information of the vibration signal, the other branch is replaced by a deep convolution operation to extract the local information of the vibration signal. The features with rich local information and global information can improve the classification precision. The present application performs intelligent fault diagnosis on a small sample data set of a rotating machinery rolling bearing. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 is a fault diagnosis flowchart of the model;
[0054] Figure 2 is an improved MHSA diagram;
[0055] Figure 3 is a double-path feature fusion diagram;
[0056] Figure 4 is a model loss function graph;
[0057] Figure 5 is a model diagnosis accuracy graph. DETAILED DESCRIPTION
[0058] An improved MHSA double-path feature fusion small sample fault diagnosis method, the steps are:
[0059] 1) Signal collection: collect the vibration signal of the bearing by using the sensor, and select the sampling frequency of the digital signal as 5000Hz bearing data.
[0060] The one-dimensional original vibration signal generated by the laboratory rotating machinery rolling bearing test bench PT300 is used as the data set, a total of ten categories of vibration data, one normal data, and fault data is divided into three categories, bearing inner ring fault, outer ring fault and rolling element fault, each category is divided into three types, therefore, a total of nine categories of fault data and one category of normal data.
[0061] 2) Data processing: CWT is a kind of wavelet transform, continuous wavelet transform CWT uses a time-frequency window that changes with frequency to overcome the short-time Fourier transform that does not change with frequency or time, which cannot accurately correspond to the relationship between frequency and time, and is more suitable for processing signals with transient mutations. The specific process of CWT is shown in formula (1):
[0062]
[0063] Where f(x) represents the original signal to be processed, represents the wavelet basis function, where * represents the complex conjugate symbol, a represents the scale factor, and b represents the translation parameter. When a is large, it is suitable for extracting low-frequency parts of the signal, and vice versa, which is suitable for extracting high-frequency features. The key to wavelet transform is the selection of wavelet basis function, which determines the effectiveness and efficiency of wavelet transform. Commonly used wavelet basis functions include Haar wavelet, Coiflet wavelet, Morlet wavelet and cmor wavelet. The cmor wavelet is a complex form of the Morlet wavelet, which has better generalization ability and adaptability. Therefore, the cmor wavelet is selected as the wavelet basis function of CWT, and the obtained one-dimensional vibration signal is processed to obtain a two-dimensional low-frequency image containing fault information.
[0064] 3) Feature learning:
[0065] A rotating machinery fault diagnosis model composed of continuous wavelet transform CWT, improved MHSA and double-path feature fusion mechanism is proposed to learn deep features of vibration signals.
[0066] 4) Bearing fault diagnosis:
[0067] 4.1) Import the original one-dimensional vibration signal collected by the sensor into the model;
[0068] 4.2) Process the one-dimensional vibration data as shown in step 2);
[0069] 4.3) Use the two-dimensional time-frequency graph obtained in step 4.2) to create a training data set and a test data set for fault diagnosis;
[0070] 4.4) Construct an improved MHSA dual-path feature fusion small sample fault diagnosis method composed of continuous wavelet transform CWT, improved MHSA and dual-path feature fusion mechanism;
[0071] 4.5) Input the time-frequency graph training set data into the classification model in step 4.4) for training;
[0072] 4.6) Input the time-frequency graph test set data into the trained model in step 4.5), and use evaluation indexes to verify the effect of step 4.5 model. If the effect can meet the expectation, proceed to step 4.7), otherwise increase the number of iterations and retrain the model through step 4.5);
[0073] 4.7) Input the actual noise data into the trained classification model in step 4.5) for fault classification.
[0074] In step 4.4), the specific method is as follows:
[0075] Improved MHSA: Double position encoding is based on wavelet transform, and the time domain information of the vibration signal is extracted again. In order to balance the content superposition of the two times of time domain information, we also use double content encoding to strengthen the frequency domain information of the vibration signal. The specific process is as formula (2):
[0076]
[0077] Where X represents the feature map, W q , W k , W v are all learnable parameter arrays, and Q, K, V represent query matrix, key matrix and value matrix respectively.
[0078] As for the query matrix Q1, we calculate its position encoding in the horizontal direction and the vertical direction respectively. Where is a column vector, h is a row vector, and S w (·), S (·) respectively represent that the column vector and the row vector are combined into a matrix, and then they are combined into a position matrix As shown in formula (3):
[0079]
[0080] Similarly, the position encoding of the combined query matrix Q2 can be obtained, as shown in formula (4):
[0081]
[0082] Therefore, the improved dual position and dual content attention can be represented by formula (5):
[0083]
[0084] where V d represents the dimensions of Q and K, Q T represents the transpose matrix of the Q matrix. Therefore, the four components of the final attention feature map (IDMSA) are shown in formula (6):
[0085]
[0086] Finally, the output Y of the IDMSA layer is an attention weight, multiplied by the value matrix V, which can be represented by formula (7):
[0087] Y = V0 IDMSA (35)
[0088] Dual-path feature fusion mechanism: The dual-path feature fusion mechanism contains two paths. The path with improved MHSA is responsible for the global information of the original signal, including the position information and frequency information of the signal, while the other path is mainly composed of convolution blocks to deepen the neural network layers and save the local features of the input data. The combination of the two allows the final output of the model to have both global information and not lose local information. To prevent overfitting, the global average pooling (GAP) method is used, which compresses the dimensions of the feature matrix in the input channel. The specific process is shown in formula (8):
[0089]
[0090] where c represents the cth channel of the sample, x c is the cth channel of the input sample, d is the sample dimension, max(·) is the maximum value function, and j is the maximum value.
[0091] Convolution is an important operation for extracting deep features of data and plays an indispensable role in network models. The specific process is shown in formula (9):
[0092]
[0093] where x represents the input data, wij represents a weight matrix, b represents a bias matrix. C represents the number of channels, f conv3*3 (x) represents a convolution operation with a kernel size of 3, and f conv1*1 (x) represents a convolution operation with a kernel size of 1.
[0094] First, the data is sent to the left and right branches respectively. For the left branch, the specific process is that the sample is first sent to the convolution layer for convolution, and then the data is made nonlinear through the activation function. The specific process is shown in equation (10):
[0095] O conv3*3 = σ ((f conv3*3 (x)) (38)
[0096] Where x represents the input data, f conv3*3 (·) represents a convolution operation with a kernel size of 3*3, and σ is the ReLU activation function.
[0097] The data after the ReLU activation function is sent to the improved MHSA (IDMSA). After global average pooling and 1*1 convolution kernel dimensionality reduction operation, the specific process is shown in equation (11):
[0098] O atte-l = f conv1*1 (GAP(IDMSA(O conv3*3 ))) (39)
[0099] Where IDMSA is shown in equation (6), f conv1*1 (·) represents a convolution operation with a kernel size of 1*1, and GAP represents global average pooling.
[0100] Then O atte-l and the convolution kernel size of 3*3 is added to the convolution kernel, and the specific process is shown in equation (12):
[0101] O L = O atte-l +f conv3*3 (x) (40)
[0102] Similarly, the final result of the right branch is O R The only difference between the right branch and the left branch is that the improved IDMSA is replaced by a 3*3 convolution kernel to obtain more local features. The other processes are the same as the left branch, that is, the IDMSA in equation (11) is replaced by f conv3*3 (·), as shown in equation (13):
[0103] O atte-r = f(GPA(fconv3*3 ((O conv3*3 )))) (41)
[0104] Therefore, the result of the final fusion feature is shown by formula (14):
[0105] O F =O L +O R (42)
[0106] Embodiment 1:
[0107] I. The theoretical basis of the present application:
[0108] 1. Continuous wavelet transform CWT
[0109] The original one-dimensional vibration data is subjected to continuous wavelet transform CWT, and the one-dimensional vibration signal is converted into a two-dimensional time-frequency image having time domain information and frequency domain information at the same time. The specific process of CWT is shown by formula (1):
[0110]
[0111] wherein f(x) represents the original signal to be processed, represents the wavelet basis function, wherein * represents the complex conjugate symbol, a represents the scale factor, and b represents the translation parameter.
[0112] 2. Improved multi-head attention MHSA
[0113] Double position encoding is based on wavelet transform, and the time domain information of the vibration signal is extracted again. In order to balance the content superposition of the two times of time domain information, we also use double content encoding to strengthen the frequency domain information of the vibration signal, which is shown by formula (2):
[0114]
[0115] wherein X represents the feature map, W q , W k , W v are all learnable parameter arrays, and Q, K, V represent query matrix, key matrix and value matrix respectively. As for the query matrix Q1, we calculate its position encoding in the horizontal direction and the vertical direction wherein is a column vector, is a row vector, S h (·), S w (·) respectively represent that the column vector or the row vector is complex into a matrix, and then they are combined into a position matrix as shown by formula (3):
[0116]
[0117] Similarly, the position encoding of the merged query matrix Q2 is shown in equation (4):
[0118]
[0119] Therefore, the improved dual position and dual content attention is represented by equation (5) as follows:
[0120]
[0121] where V d represents the dimensions of Q and K, Q T represents the transpose matrix of the Q matrix. Then, the four components of the final IDMSA attention feature map are shown in equation (6):
[0122]
[0123] Finally, the output Y of the IDMSA layer is an attention weight, multiplied by the value matrix V, which can be represented by equation (7):
[0124] Y = V0 IDMSA (7)
[0125] 3. Dual-path feature fusion mechanism
[0126] Dual-path feature fusion mechanism: The dual-path feature fusion mechanism contains two paths. The path with improved MHSA is responsible for the global information of the original signal, including the position information and frequency information of the signal, while the other path is mainly composed of convolution blocks to deepen the neural network layers and save the local features of the input data. The combination of the two allows the final output of the model to have both global information and not lose local information. In order to prevent overfitting, the global average pooling (GAP) method with compression of the input channel dimension of the feature matrix is adopted, and the specific process is shown in equation (8):
[0127]
[0128] where c represents the cth channel of the sample, x c is the cth channel of the input sample, d is the dimension of the sample, max(·) is the maximum value function, and j is the position of the maximum value.
[0129] Convolution is an important operation for extracting deep features of data and plays an indispensable role in network models. The specific process is shown in equation (9):
[0130]
[0131] where x represents input data, w ij represents weight matrix, b represents bias matrix. C represents channel number, f conv3*3 (x) represents convolution operation with kernel size 3, and f conv1*1 (x) represents convolution operation with kernel size 1.
[0132] First, the data will be sent into the left and right two branches, for the left branch, the left branch specific process is, first, the sample will be sent into the convolution layer for convolution, and then through the activation function, so that the data has nonlinear, the specific process is shown in equation (10):
[0133] O conv3*3 = σ((f conv3*3 (x)) (10)
[0134] where x represents input data, f conv3*3 (·) represents convolution operation with kernel size 3*3, and σ is ReLU activation function.
[0135] The data after ReLU activation function is sent into the improved MHSA (IDMSA), and after global flat pooling and 1*1 convolution kernel dimension reduction operation, the specific process is shown in equation (11):
[0136] O atte-l = f conv1*1 (GAP(IDMSA(O conv3*3 ))) (11)
[0137] where IDMSA is shown in equation (6), f conv1*1 (·) represents convolution operation with kernel size 1*1, and GAP represents global average pooling.
[0138] Then O atte-l and the convolution kernel size of 3*3 is added to the convolution kernel, and the specific process is shown in equation (12):
[0139] O L = O atte-l +f conv3*3 (x) (12)
[0140] Similarly, the final result of the right branch is O R , the only difference between the right branch and the left branch is that the improved IDMSA is replaced by 3*3 convolution kernel to obtain more local features, and the other processes are the same as the left branch, that is, only IDMSA in equation (11) is replaced by f conv3*3 (·), which is shown in equation (13):
[0141] Oatte-r = f(GPA(f conv3*3 ((O conv3*3 )))) (13)
[0142] Therefore, the result of the final fusion feature can be represented by formula (14) as follows:
[0143] O F = O L + O R (14)
[0144] Second, the implementation process of the technical scheme of the application:
[0145] 1. Signal acquisition: collect the vibration signal of the bearing by using the sensor, and select the bearing data with a sampling frequency of 5000Hz of the digital signal.
[0146] 2. Data processing: perform continuous wavelet transform CWT on the original one-dimensional vibration data, and convert the one-dimensional vibration signal into a two-dimensional time-frequency image with time domain information and frequency domain information. The specific process of CWT can be represented by formula (1) as follows:
[0147]
[0148] Wherein f(x) represents the original signal to be processed, represents the wavelet base function, wherein * represents the complex conjugate symbol, a represents the scale factor, and b represents the translation parameter.
[0149] 3. Feature learning:
[0150] A rotating machinery fault diagnosis model composed of continuous wavelet transform CWT, improved MHSA and double-channel feature fusion mechanism is proposed for deep feature learning of vibration signals.
[0151] 4. Fault diagnosis: first, collect the vibration signal of the bearing by using the sensor, select the bearing data with a sampling frequency of 5000Hz of the digital signal, input the collected one-dimensional vibration data into the continuous wavelet transform CWT, obtain a two-dimensional time-frequency image with time domain information and frequency domain information, input the two-dimensional time-frequency image after maximum and minimum normalization processing into the improved MHSA to obtain the relative position information of each frequency in the time domain of the vibration signal and the frequency information of the vibration signal, obtain the global information and local information of the vibration signal through the double-channel feature fusion mechanism, then add the local information and the global information to obtain high-level features with global information and local information, and finally the fault diagnosis model obtains the fault classification result.
[0152] 5. An improved MHSA dual-path feature fusion small sample fault diagnosis method uses one-dimensional raw data generated by a laboratory rotating machinery rolling bearing PT300 test bed as a data set for comparative experiments. A total of ten categories of vibration data, one normal data, fault data is divided into three categories, respectively, bearing inner ring fault, outer ring fault and rolling element fault, each category of fault is divided into three types, therefore, a total of nine categories of fault data and one category of normal data, each category of data has 80 samples, a total of 800 samples.
[0153] To evaluate the model fault diagnosis effect, we added different signal-to-noise ratio (SNR) Gaussian white noise to the original one-dimensional vibration signal to simulate the working environment of rolling bearings in actual industrial production. Each model experiment was performed five times, and the mean value was taken as the final fault diagnosis effect. The results are shown in Table 1, where each model was repeated five times, and the mean value was taken as the result. To test the stability of the model, we performed stability evaluation experiments under different loads (HP). Each model was executed five times, and the mean value was taken as the stability evaluation result. The results are shown in Table 2, where each model was repeated five times, and the mean value was taken as the result.
[0154] Table 1: Accuracy of the model under different SNR
[0155]
[0156] Table 2: Accuracy of each model under different HP
[0157]
[0158] From Table 1, the proposed fault diagnosis model achieved the highest accuracy under different signal-to-noise ratios, which were 99.8, 100, 100, 100, and 100, respectively. This proves that our model has stronger noise resistance than other models and can accurately identify the deep features of vibration signals in a noisy environment. From Table 2, our model achieved the best results under different loads of mechanical rotation and did not cause differences in diagnosis results due to different loads of the machine. This proves that the model has strong stability.
[0159] The application elaborates the proposed fault diagnosis model and rolling bearing data of rotating machinery in detail, and the model comprises continuous wavelet transform (CWT), improved multi-head attention (MHSA) and double-path feature fusion mechanism. The continuous wavelet transform converts one-dimensional vibration signals into two-dimensional time-frequency diagrams which have both time domain information and frequency domain information, and the time-frequency diagrams are input into the improved method to greatly improve the prediction accuracy. The improved MHSA has improved double-position double-content coding, and can extract information on the time domain of the signal again on the basis of wavelet transform. In order to balance the two times of time domain information extraction, the double-content coding is adopted to strengthen the extraction of frequency domain information. Then the double-path feature fusion mechanism can extract global information and local information from the data at the same time, so as to obtain deeper features of the data. Finally, the data are input into the classifier to obtain the classification result. The proposed method provides a high-precision and high-stability classification method for fault recognition of rotating machinery fault diagnosis, and provides a new idea and a more intelligent fault diagnosis method for fault diagnosis.
Claims
1. An improved small sample fault diagnosis method of MHSA double-path feature fusion, characterized in that, The steps are as follows: 1) Signal acquisition: collect the original one-dimensional vibration signal of the rolling bearing by using the sensor, and select the sampling frequency of the digital signal as 5000Hz bearing data; 2) Data processing: the original one-dimensional vibration signal is subjected to continuous wavelet transform CWT, and the one-dimensional vibration signal is converted into a two-dimensional time-frequency image; the specific process of CWT is represented by formula (1): (1) wherein represents the original one-dimensional vibration signal to be processed, represents a wavelet base function, represents a complex conjugate symbol, denotes a scale factor, denotes a translation parameter; 3) Feature learning: deep feature learning is performed by a rotating machinery fault diagnosis model composed of continuous wavelet transform CWT, improved MHSA, and double-path feature fusion mechanism; 4) Bearing fault diagnosis: 4.1) Import the original one-dimensional vibration signal collected by the sensor into the model; 4.2) The one-dimensional vibration data is subjected to continuous wavelet transform CWT processing in step 2), and a two-dimensional time-frequency image is obtained; 4.3) Use the two-dimensional time-frequency image obtained in step 4.2) to make a training data set and a test data set for fault diagnosis; 4.4) Construct an improved MHSA double-path feature fusion small sample fault diagnosis method composed of continuous wavelet transform CWT, improved MHSA and double-path feature fusion mechanism; 4.5) Input the time-frequency image training set data into the fault diagnosis model in step 4.4) for training; 4.6) Input the time-frequency image test set data into the trained model in step 4.5), and use the evaluation index to verify the effect of the model in step 4.5); if the effect can meet the expectation, proceed to step 4.7), otherwise increase the number of iterations and retrain the model through step 4.5); 4.7) Input the actual noise data into the trained fault diagnosis model in step 4.5) for fault diagnosis.
2. The improved MHSA dual-path feature fusion small sample fault diagnosis method according to claim 1, characterized in that: In step 4.4), the specific method is as follows: Improved MHSA: double-position coding is based on wavelet transform, and the time-domain information of the vibration signal is extracted again, and double-content coding is used to strengthen the frequency-domain information of the vibration signal, and the specific process is as formula (2) , , , , (2) wherein denotes a feature map, , , are all learnable parameter arrays, denote query matrix, key matrix and value matrix, respectively; Query matrix , respectively, the position encoding in the horizontal direction and the position encoding in the vertical direction , where is a column vector, is a row vector, , respectively represent the column vector and the row vector are combined into a matrix, and they are combined into a position matrix , as shown in equation (3): (3) Query matrix The combined position encoding is given by equation (4): (4) Therefore, the improved double-position and double-content attention is represented by formula (5): , , , (5) wherein denotes and dimension of, denotes the transpose of the matrix; thus, the final attention feature map O IDMSA the four components of as shown in equation (6): (6) Finally, the output of the layer is an attention weight, multiplied by a value matrix V, to be expressed by equation (7): (7) Dual-path feature fusion mechanism: the dual-path feature fusion mechanism contains two paths, with improved The path responsible for the global information of the original signal, including the position information and frequency information of the signal, and the other path composed of convolution blocks is used to deepen the neural network layer and save the local features of the input data. The global average pooling (GAP) method with compressed input channel feature matrix dimension is adopted, and the specific process is shown in equation (8): (8) wherein, represents the first channel of the sample, is the first channel of the input sample, is the sample dimension, is the max function, is the location of the maximum. Convolution is an important operation for extracting deep features of data, and the specific process is shown in formula (9): (9) wherein, represents input data, represents a weight matrix, represents a bias matrix; represents the number of channels, represents a convolution operation with a kernel size of 3, and represents a convolution operation with a kernel size of 1. The data is sent to the left and right two branches respectively, and the specific process of the left branch is: the sample is sent to the convolution layer for convolution, and then passes through the activation function to make the data have nonlinearity, and the specific process is shown in formula (10): (10) wherein, represents input data, represents a convolution kernel size of 3 3 convolution operations, is activation function; The data after the ReLU activation function is sent into the improved MHSA, which is reduced in dimension by global average pooling and a 1 1 convolution kernel, and the specific process is shown in equation (11): (11) wherein the IDMSA is represented by formula (6), representing a convolution kernel size of 1 1convolution operation, GAP represents global average pooling; Then the and the convolution kernel size is 3 3 convolution kernel addition operation, the specific process is shown in equation (12): (12) By the method, the final result of the right branch is The only difference between the right branch and the left branch is that the IDMSA is replaced by 3 The convolution kernel of 3 is used to obtain more local features, and other processes are the same as the left branch, that is, the IDMSA in equation (11) is replaced by As shown in equation (13): (13) Therefore, the final fusion feature result is shown in formula (14); (14)。
Citation Information
Patent Citations
Bearing fault classification method based on wavelet signal processing and deep learning
CN115597868A
Small sample rolling bearing fault diagnosis method based on convolutional transformer generative adversarial network
CN115859142A