# Intelligent Diagnosis of Bearing Failures Based on Recurrence Quantification and Energy Difference
## 3 Experimental Implementation
### Analysis of the Results of Data Recurrence Features  
Incorporating the recurrence rate as a feature can provide the model with additional dynamic information, making it a highly effective analytical tool.  
Construction of a Convolutional Neural Network Model  
The structural parameters of the convolutional neural network model, based on data recurrence features, are delineated in Table 4.  
With the input to the convolutional neural network, the loss, accuracy, and confusion matrices obtained after 100 epochs of testing are depicted in Figures 24 and 25. In Figure 24a, the blue line represents the loss curve during training, and the orange line represents the loss curve during testing. As the number of iterations increased, the loss value decreased sharply. By the time the number of epochs reached 20, the loss value stabilized at approximately 1%.  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Layer Name** & **Type** & **Input Size** & **Kernel Size** & **Stride** & **Padding** & **Output** & **Output Size** & **Activation Function** \\ \hline input & Input & \(8\times 11\times 1\) & - & - & - & - & \(8\times 11\times 1\) & - \\ conv1 & Convolutional & \(8\times 11\times 1\) & \(3\times 3\) & 1 & 1 & 6 & \(6\times 9\times 10\) & ReLU \\ pool1 & Pooling & \(6\times 9\times 10\) & \(2\times 2\) & 2 & 0 & - & \(3\times 5\times 6\) & - \\ conv2 & Convolutional & \(3\times 5\times 6\) & \(3\times 3\) & 1 & 1 & 12 & \(3\times 3\times 12\) & ReLU \\ pool2 & Pooling & \(3\times 3\times 12\) & \(2\times 2\) & 2 & 0 & - & \(1\times 2\times 12\) & - \\ conv3 & Convolutional & \(1\times 2\times 12\) & \(3\times 3\) & 1 & 1 & 24 & \(1\times 1\times 24\) & ReLU \\ flatten & Flatten & \(1\times 1\times 24\) & - & - & - & - & 96 & - \\ fc1 & Fully Connected & 96 & - & - & - & 4 & 4 & Softmax \\ \hline \hline \end{tabular}
\end{table}
Table 4: Structure parameters of the convolutional neural network model based on data recurrence features.  
Figure 23: Confusion matrices of Data Energy Features generated for the new test set. (**a**) New confusion matrix 1; (**b**) new confusion matrix 2.  
The close alignment of the loss curves for the training and testing indicates the high accuracy of the proposed methods and procedures in diagnosing bearing faults. In Figure 24b, the accuracy curve over the course of iterations is illustrated. At 25 epochs, the accuracy stood at 90%, rising to 95% by 30 epochs. An accuracy nearing 100% was achieved by 60 epochs. The significance of the proposed methods and procedures for bearing fault diagnosis are proven and and can be clearly observed.  
The confusion matrix obtained from a new test set is depicted in Figure 26. In the confusion matrices shown in Figures 25 and 26, the horizontal axis represents the predicted value, and the vertical axis represents the true value. The labels 0, 1, 2, and 3 respectively represent four fault types: normal, inner race fault, outer race fault, and rolling element fault. If the obtained results are mainly distributed on the diagonal, the model can effectively classify the faults. As shown in Figure 26a, the total number of test sets was 180, of which 176 were correctly predicted, and the accuracy reached 97.778%. As shown in Figure 26b, the total number of test sets was 120, of which 117 were correctly predicted, and the accuracy reached 97.500 %.  
Figure 24: Curves of loss and accuracy. (**a**) Curves of loss, (**b**) Curve of accuracy.  
Figure 25: Confusion matrix of Recurrence Features.