# Neural Network-Enhanced Fault Diagnosis of Robot Joints
## 4 Computational Experiments
### Mixed Diagnostics for Multi-Size Faults  
In the practical application of different requirements for the accuracy of the robotic arm task, a single size of the injected faults can not meet the demand if the trajectories generated by different sizes of the injected faults are put into the same network, i.e., in addition to a fault-free trajectory, there are 18 different joints with different fault sizes, and a total of 19 trajectories corresponding to the accuracy of the 19 classifications in the experiments using dual-featured data training network were found. The result is average, and the accuracy is only about 80%, but if the sampling number of a single trajectory is set to 5000, a total of 95,000 sets of data are fed into the network for training, validation and testing, the result is more satisfactory, and the accuracy can reach 96.1%. The structure of the network is basically the same as the above experiments, the only modification is that there are 19 neurons in the output layer. The corresponding confusion matrix is shown in Figure 12.  
It can be seen that for most of the trajectories, the neural network is able to classify them well, this classification means that it can be precise as to which joints have what fault error, it is worth noting that the fifteenth classification has a lower accuracy rate, calculated as per the above methodology is only 21%, and the precision rate is only 33%, as can be seen from the data, for every 1000 sets of data corresponding to a label of 15 there are 322 were able to be correctly classified, with a large proportion predicted to be labelled 16. this means that a large proportion of third joint faults are classified as fourth joint faults when the injected fault is 0.1 degrees. A possible reason for this is that the third and fourth joint faults correspond to the same actuator orientation, since the third joint only controls the extension and retraction of the robot arm, and there is very little difference in the position of the actuators at an error of 0.1 degrees; In other words, the two trajectories are highly coincident. The neural network is able to distinguish and classify these two well even for 0.1 degree faults during the previous single-size injection faults. A possible reason for this is that with so many classification labels, it is difficult for the network to find the difference between the two labels so it is also difficult to distinguish these two labels accurately. The performance of the neural network in classifying the 19 labels can be evaluated more comprehensively with the help of ROC curves, the corresponding ROC curves are shown in Figure 13.  
The percentages in the bottom row of the figure can be used to measure the performance of the model on negative categories, such as the false alarm rate, which is non-zero in columns 5,10,12,15,16, and 18 of the row, which are 0.1%, 1.4%, 0.4%, 67.8%, 2.1%, and 1.9%, respectively, e.g., the 0.1% in the fifth column indicates that for the data corresponding to the label (4) there is a 0.1% probability that the the misclassified. The percentages in this rightmost column can be used to measure the performance of the model on positive classes, such as Recall, which is 99.9%, 98.1%, 96.1%, 94.2%, 59.9%, and 99.9% for rows 4, 9, 14, 15, 16, and 18, respectively, meaning that there is a corresponding probability of classifying the data correctly, and that the data in the other rows is 100%, which means that it will do the classification completely correctly. From the figure, it can be seen that the AUC values of all curves are above 0.99, and most of the classified labels correspond to an AUC of 1, while the labels starting from 14 and onwards have an AUC of less than one, which corresponds to the fault trajectory of each joint when the injected faults are 0.1 degrees. Label 15, on the other hand, corresponds to an AUC of 0.999, while the accuracy of the predictions made for it is only 21%.