## 3 Fault Diagnosis Experiment and Analysis
### Model Training  
The experiments described in the paper were implemented by using the TensorFlow 2.0 deep learning framework. TensorFlow 2.0 is a machine learning and deep learning framework developed by Google (Mountain View, CA, USA). It makes the development and deployment of machine learning models easier, more efficient, and more intuitive [39]. The data processing process in this paper was carried out on the Intel Core i7-12700H processor (manufactured by Intel Corporation in Santa Clara, CA, USA), and the model training process was carried out on the RTX3060 graphics card (manufactured by NVIDIA Corporation in Santa Clara, CA, USA). The Python version used was 3.8. In the experiment, firstly, data with motor loads of 1-3 HP were selected, and IFIs were generated form these three one-dimensional datasets by using the aforementioned method; then, three different two-dimensional image datasets, A, B, and C were obtained, each dataset containing 1600 samples with an equal number of samples for each fault category. The dataset was randomly partitioned into training, validation, and testing sets in a 6:2:2 ratios. To ensure the reproducibility of the partitioning results, a random seed was used to record the random partitioning process. The ViT model based on transfer learning (TLViT) was then fine-tuned and tested on the partitioned datasets separately. To avoid the influence of randomness in the experimental results, the experiment was repeated five times. Each time, a different random seed was used. The average accuracy on the testing set over the five repetitions was  
Figure 4: Fault diagnosis process of the TLViT + IFI. Figure 3: The process of converting time series data to IFI. taken as the final result. To validate the performance of the TLViT model, a performance comparison experiment was conducted between different models. ResNet50 and ViT were used as the benchmark models, and they were trained and tested by using IFIs. In order to validate the effectiveness of the image fusion methods used, TLViT + CWT, TLViT + GASF, and TLViT + GADF were used as control experiments. In this study, all experiments were performed more than five times, and the average of the test results was taken as the final result. Based on previous experience, the training process of the ViT model typically stabilized after around 15 epochs. To balance the time cost of experiments and the stability of final training results, all experiments in this paper were set to run for 30 epochs with a batch size of 4. The stochastic gradient descent (SGD) optimization algorithm was selected [40], and during the training process, the weights of the model were recorded as the best weights when the validation loss is the lowest. These best weights were then used for testing on the testing set. To observe the training process of each model more clearly, taking one training process of a model on dataset A as an example, the variation of the model's loss and accuracy during training is shown in Figure 5. Figure 5h shows the comparison curve of the change of diagnosis accuracy of each model on the verification set during this training process, and the performance of each model can be preliminarily seen from the figure. To accurately evaluate the performance of each method, Table 2 provides the average accuracy on the testing set after five rounds of training and testing for each method on datasets A, B, and C. In the model performance comparison experiment, the ViT + IFI method achieved an accuracy of only 99.12% on the testing set. The performance of ResNet50 + IFI surpasses that of ViT + IFI, with an accuracy of 99.72% on testing set. This indicates that the performance of the ViT model cannot be fully utilized without pre-training on large datasets. As shown in Figure 5c,d, the TLRsenet50 + IFI and TLViT + IFI models have high diagnosis accuracy at the beginning of training, indicating that the pre-trained models already have a certain fault diagnosis capability.