# Multi-Scale Rolling Bearing Fault Diagnosis Method Based on Transfer Learning
## 3 Methods
### Overview of the Proposed Model's Architecture
This enhancement aims to more effectively discern the differences between categories in multi-class classification problems. By adjusting the weights of each sample, the network pays more attention to samples that are difficult to classify, thereby enhancing the adaptability to category imbalance and complex scenarios. This integrated loss function not only effectively drives the model to learn specific category features but also improves the overall classification performance. Moreover, this improved loss function provides a more powerful tool to deal with complex and changing real-world application scenarios, further solidifying the model's robustness and generalization performance. This improvement is an effective supplement to the traditional cross-entropy loss function, making the model more reliable and robust in facing diverse challenges. ## 4 Experimental Results and Analysis

In this section, we first provide a detailed description of the experimental setup and the datasets used. Next, to validate the effectiveness of the proposed method, we conduct verification and in-depth analysis using two datasets. Finally, experimental and comparative analyses of the method proposed in this article are presented. ### Experimental Setup and Evaluation Metrics

The implementation of the model and its experimental validation are conducted on a high-performance computing system equipped with a GeForce RTX 2080 Ti GPU, utilizing PyTorch 1.11. In the model pre-training phase, the batch size is set to 256, the learning rate is \(10^{-3}\), the optimizer is Adam, and the window size is 128. The most significant difference in the new task phase is that the learning rate is reduced to \(10^{-6}\) to finely adjust the model parameters to adapt to the new tasks. In this study, accuracy is used to evaluate the performance of the model in bearing fault diagnosis. Accuracy measures the proportion of samples correctly classified by the model relative to all samples. Specifically, it can be computed utilizing the formula below:

Figure 4.1

Among them, \(N_{c}\) represents the number of correctly classified samples, and \(N\) represents the total number of samples. Moreover, we use two types of accuracy metrics: the accuracy for known classes and the accuracy for all classes, represented as _known_acc_ and _all_acc_, respectively. The _known_acc_ measures the accuracy for the classes that are known. It is calculated by dividing the number of correctly classified samples in the known categories by the total number of samples in these categories, as shown in Formula (9). The _all_acc_ measures the overall accuracy across all classes, including both known and unknown ones. It is calculated by dividing the total number of correctly classified samples (across all categories) by the total number of samples in all categories, as shown in Formula (10). Figure 4.2

Figure 4.3

Among them, \(N_{kc}\) represents the number of correctly classified samples in known classes. \(N_{k}\) represents the total number of samples in known classes. \(N_{ac}\) represents the number of samples that are correctly classified across all classes. Additionally, in the comparative experiment for the CWRU dataset tasks, we utilize UDA (Universal Domain Adaptation) [35], EVT-OSFD (Open Set Fault Diagnosis by Extreme Value Theory) [26]. In the JUN dataset task, we compare the use of OSDAFD (Open-Set Domain Adaptation in Machinery Fault Diagnostics) [36], DAN-COSFD (Dualadversarial network for cross-domain open set fault diagnosis) [16], as it achieves higher accuracy in some tasks compared to the original results presented in the reference. ### Dataset Description



The bearing dataset from Jiangnan University is specifically designed for research in bearing fault diagnosis and predictive maintenance [38]. It includes rolling bearing fault data obtained at various speeds, specifically encompassing the outer race, inner race, and rolling element fault types, as well as normal conditions.