# An Intelligent Diagnosis Method for Machine Fault Based on Federated Learning
## 3 Case Study
### Case 1: Bearing Fault Data of Machinery Fault Database  
In this section, the bearing fault data from the Machinery Fault Database [30] are used. The data are obtained on the quasi-balance vibration trainer in Spectra Quest's mechanical failure simulator. During the operation of the test rig with rotating frequency of 30 Hz and no load, the acceleration data of the bearing between the rotor and the motor are collected at the sampling frequency of 51.2 kHz, and the sampling time is 5 s. The sample data are collected under four working conditions, i.e., normal, inner fault, outer fault, and ball fault. There are 400 samples for each bearing working condition. The samples are divided into training set and testing set according to the ratio of 9:1. For the four working conditions of the bearing, four local fault diagnosis models based on deep convolution neural network are constructed according to the parameters in Tables 1 and 2, i.e., the models \(\mathrm{M_{n}}\), \(\mathrm{M_{b}}\), \(\mathrm{M_{i}}\), and \(\mathrm{M_{o}}\). Then, the four models are fused by FL. After the fusing, the local models are update as a global model. Figure 4 shows the loss curve and accuracy curve after the training and testing. The loss of the testing set gradually converges to 0, and almost overlaps with that of the training set in the entire model. The accuracy of the training set and the testing set all reach 100%. So, the federated fault diagnosis model can recognize all fault types. In order to better explain the federated fault diagnosis model, the weights of each convolution layer are visualized, as shown in Figure 5. Comparing the distribution of initialized weights in Figure 5, the distribution of weights after training changes in Figure 5. The result reflects the change process of the model parameters before and after the training. The feature extraction ability of the federated fault diagnosis model can be shown by the hidden features of the convolution layer. However, since the output of the convolution layer is a high-dimensional vector, it is not easy to display. Therefore, it is necessary to reduce the dimension of output of the convolution layer. Here, the non-linear dimensionality reduction algorithm t-SNE is employed. After dimension reduction, the scatter diagrams of hidden features from each convolution layer are shown in Figure 6. From Figure 6, it can be seen that the features of faults with different types are gradually separated, and the features of the same fault types are gradually gathered. So, the federated fault diagnosis model can recognize different conditions of the bearing. In order to demonstrate the advantages of the proposed model, the comparison with the local fault diagnosis model is conducted. Firstly, the four local models \(\mathrm{M_{n}}\), \(\mathrm{M_{b}}\), \(\mathrm{M_{i}}\), and \(\mathrm{M_{o}}\) are used to analyze the single working condition corresponding to the model, and the results are shown in Figure 7. From Figure 7, the loss curves of the training set and testing set of each model all decrease to zero, and the accuracy curves all reach 100%. At the same time, the curves of the training set and the testing set almost overlap, which indicates  
Figure 4: Loss and accuracy curve of federated fault diagnosis model. that the overfitting or underfitting has not arisen in the model. Therefore, the local fault diagnosis models are well trained and used to recognize the single fault type. Then, we constructed a hybrid testing set to test the local fault diagnosis model and the federated fault diagnosis model. The hybrid set is composed of the data under four working conditions according to the ratio of 1:1:1:1. The testing result of the models is as shown in Table 3. By observing Table 3, it can be found that the loss is 0 and the accuracy is 100% when the local fault diagnosis models are tested by their corresponding fault types. However, when the local fault diagnosis models are tested by the hybrid testing set, the loss increases and the accuracy decreases.