# Research on Fault Diagnosis of Rotating Parts Based on Transformer Deep Learning Model
## 3 Results and Discussion
### Experimental Results and Analysis of CWRU Dataset
#### 3.5.1 Analysis of Experimental Results  
For the CWRU dataset, the experimental results of different models are shown in Table 3 (four indicators take the maximum value during the model training process). It can be observed that the proposed model achieves higher performance in all four fault recognition metrics compared to other methods. The accuracy of the proposed model is 0.97947, surpassing WDCNN, DRCNN, DilatedNN, and Vision Transformer by 0.07926, 0.01939, 0.03304, and 0.10972, respectively.  
In order to further intuitively show the stability of model training, the boxplot is introduced to visualize the distribution of model indicators. Figure 9 shows the accuracy box diagram of the last 50 epochs of the five model trainings (a total of 100 epochs were trained). The higher the height of the box, the greater the fluctuation of the model performance. The figure shows that the training performance of the Vision Transformer model is the most unstable, and there are two relatively low accuracy values. The MultiDilatedFormer, WDCNN, and DilatedNN models have smaller box heights, indicating more stable performance. Among them, MultiDilatedFormer has the highest overall accuracy.  
As shown in Figure 10, the normalized confusion matrix of the test set, it can be clearly seen from the color weight distribution that the proposed model MultiDilatedFormer has the highest recognition rate. The diagnosis effect of Vision Transformer is the worst. Among them, the recognition rate of label 1 is relatively low in several models. The lowest recognition rate of Vision Transformer is only about 61%, while the recognition rate of MultiDilatedFormer model reaches 97%. The other fault recognition rate of this model is also the best among all models, which further verifies the effectiveness and superiority of the proposed model.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Accuracy** & **Precision** & **Recall** & **F1 Score** \\ \hline WDCNN & 0.90021 & 0.90142 & 0.90122 & 0.90052 \\ DRCNN & 0.96008 & 0.96212 & 0.96081 & 0.96079 \\ DilatedNN & 0.94643 & 0.94688 & 0.94734 & 0.94664 \\ Vision Transformer & 0.86975 & 0.87355 & 0.88816 & 0.86957 \\ MultiDilatedFormer & 0.97947 & 0.97734 & 0.97807 & 0.97738 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Indicators comparison of CWRU dataset.  
Figure 11 shows the t-SNE clustering diagram of the test set (100 epochs are trained), and different colors represent different types of samples. It can be seen from the figure that the data dimension reduction distribution boundary of MultiDilatedFormer is the most distinct and the discrimination is the highest. The other four models can also basically distinguish 10 fault types, but there are more serious data sample overlaps between different types. MultiDilatedFormer shows a clear separation between samples of the same type, with only a few scattered points. This indicates that the proposed model has an advantage over the comparative models in the recognition of faults in shorter window sizes.  
Figure 10: Normalized confusion matrix of CWRU dataset: (**a**) WDCNN; (**b**) DRCNN; (**c**) DialetedNN; (**d**) Vision Transformer; (**e**) MultiDilatedFormer.  
Figure 9: Accuracy boxplot of the CWRU dataset.