## 3 Fault Diagnosis Experiment and Analysis
### Experimental Analysis of Small Samples  
In practical working conditions, acquiring a substantial amount of fault data often poses challenges. Hence, it is imperative to ensure that fault diagnosis methods proposed under limited training data can uphold a commendable level of diagnostic accuracy. In this experiment, only the data with a motor load of 1 HP were utilized to train the model by using four datasets comprising varying numbers of training samples. The dataset sizes were 1000, 500, 300, and 100, respectively, while each dataset consisted of 1152 test data \begin{table}
\begin{tabular}{c c} \hline \hline
**Fault Diagnosis Method** & **Average Accuracy on the Test Set** \\ \hline Resnet50 + IFI & 99.72\% \\ TLResnet50 + IFI & 100\% \\ ViT + IFI & 99.12\% \\ TLViT + IFI & 100\% \\ TLViT + CWT & 100\% \\ TLViT + GADF & 99.30\% \\ TLViT + GASF & 98.70\% \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Average accuracy on test set. Figure 5: Accuracy and loss of training set and validation set during training. (**a**) ViT + IFI, (**b**) Resnet50 + IFI, (**c**) TLViT + IFI, (**d**) TLResnet50 + IFI, (**e**) TLViT + CWT, (**f**) TLViT + GADF, (**g**) TLViT + GASF, and (**h**). Comparison of accuracy changes of each model on validation set. samples. It is noteworthy that an equal number of training and test samples were allocated for each fault class within every dataset. In the model performance comparison experiment, As shown in Figure 6, when the training sample is 1000, each method can achieve higher accuracy. With the decrease of training sample size, the fault diagnosis accuracy of all methods decreased, among which ViT + IFI model is the most affected, only 86.54% when the training sample size is 100, and the fault diagnosis ability decreased significantly. With the same number of training samples, the fault diagnosis accuracy of the Resnet50 + IFI model is slightly higher than that of the ViT + IFI model, and the diagnosis accuracy reaches 88.80% when the training sample size is 100, indicating that the ViT model without pre-training of large data sets has no advantage in diagnosis accuracy compared with the Resnet50 model. The TLViT model based on transfer learning solves this problem. As shown in Figure 6, when the number of training samples in the target domain is 1000, 500, and 300, the diagnosis accuracy of TLViT model on the test set is slightly higher than that of TLResnet50 model, but there is no obvious difference between them. When there are 100 training samples in the target domain, TLViT can achieve 97.34% fault diagnosis accuracy on test set, while TLResnet50 + IFI diagnosis accuracy is only 92.76%, indicating that after pre-training on the same large data set, the fault diagnosis accuracy of TLresnet50 + IFI is only 92.76%. The performance of ViT model in this bearing fault diagnosis task exceeds that of Resnet50, which is more suitable for the case of less fault samples in the target domain. In the experiment to test the impact of image data generation on fault diagnosis methods, the fault diagnosis accuracy of each model gradually decreases with the reduction of the training sample size. Among them, TLViT + GADF and TLViT + GASF are most affected by the reduction of training sample size. When there are only 100 training data, the diagnosis accuracy on test set is only 75.87% and 75.61%. When the original data are small, it is not effective to convert one-dimensional vibration data into GAF images to train the model. Compared with TLViT + GADF and TLViT + GASF, TLViT + CWT has obvious advantages. When the amount of training data are only 100, the fault diagnosis accuracy on test set can reach 95.63%, but it is still lower than the 97.34% of TLViT + IFI. It shows that the IFI proposed in this paper can reduce the requirement of training data. It can be seen that TLViT + IFI model has strong diagnosis ability in the case of small samples.