| In recent years,In recent years,with the increase in industrial demand for output and production scale,the structure of machinery and equipment has become more complex,and the degree of automation has gradually increased.It is important to ensure the normal operation of the equipment to accurately feedback the status information of the equipment in real time through the automatic mechanical fault diagnosis system.The traditional fault diagnosis method mainly judges its health status through manual observation or through the parameters of the equipment,and its accuracy and real-time performance are low.With the in-depth study of machine learning algorithms,the accuracy,robustness and real-time performance of fault diagnosis methods for mechanical equipment have been significantly improved.However,if the accuracy of fault diagnosis models is reduced due to noise interference,moreover,when the known fault sample data is insufficient,the unknown fault state cannot be detected in time.Therefore,this paper proposes an end-to-end adaptive mechanical fault diagnosis algorithm MHA-CNN based on the multi-head attention mechanism(MAH)and convolutional neural network(CNN),aiming at the problem that the existing fault diagnosis models are susceptible to noise interference.The MHA-CNN network is mainly composed of three parts:data preprocessing,multihead attention mechanism network and convolutional neural network.First,the data preprocessing module decomposes the input data into the wavelet packet coefficients of each node in the fifth layer through the wavelet packet reconstruction to obtain the feature matrix.Then,the multi-head attention network is used to further extract high-dimensional feature data.Finally,the extracted high-dimensional feature data and the feature matrix obtained by wavelet packet decomposition are input to the convolutional neural network for fault classification after residual connection with weight matrix.The advantages of the MHA-CNN algorithm are as follows:(1)It can adaptively select the frequency data features with higher correlation with the fault type to train the network model.The application of the multi-head attention mechanism increases the diversity of extracted features,and the cooperation between the multiple heads helps the network to learn more deeply data features;(2)The residual connection with weight matrix can make the network more stable and more robust,and combined with the convolutional neural network,the fault classification accuracy of the network is improved;(3)Multi-head parallel processing can improve the training speed of the network and enable the network to meet higher real-time requirements.In order to verify the effectiveness of the MHA-CNN network,multiple sets of comparative experiments are designed in this paper.First,5 sets of comparative experiments on the CWRU data set and 4 sets of comparative experiments on the PU data set verify that the MHA-CNN network has higher accuracy than other mainstream algorithms after convergence,and the convergence speed is also faster.Then,combined with the t-SNE dimensionality reduction technology,it is verified that the data features are easier to distinguish with the increase of the number of model trainings.Through the confusion matrix analysis method,it is concluded that the wrong data predicted by the model mainly occurs in the inner race and the outer race,and almost no misprediction occurs in the data of the health status and the roller fault.Finally,the robustness comparison experiment verifies that the MHA-CNN network has strong robustness in the noise interference environment. |