# An Automatic Fault Diagnosis Method for the Reciprocating Compressor Based on HMT and ANN
## 4 Results and Discussion
### The Results of the Proposed Method  
To exhibit the feature space intuitively, the distribution of the first two extracted features, \(\beta_{c}\) and \(\beta_{c}\), were plotted in Figure 8. The figure showed that most of the cases can be distinguished from each other with the first two features, except Fault 3 and the faultless cases. About 60% of the feature space of samples in the case of Fault 3 overlapped the feature space of the faultless case. This can also be explained by Figure 7c. Since the two \(p\)-\(V\) diagrams almost overlapped with each other in Figure 7c, the extracted feature should also be similar. In general, however, with the help of the first two image features, the differences between different conditions already become more clear and distinguishable.  
The loss curves of the model during training, validation and testing were shown in Figure 9. Figure 9 implies that the loss of the training process decreased steadily first and tend to be stable after the 40 th iteration and the loss is smaller than 0.01. This suggests that the ANN model is well trained. Besides, the loss during training is similar with that during validation, which implies that the model has excellent generalization. The loss curve of the testing also proves that.  
Figure 7: Comparison of faulted and faultless diagrams: (**a**) Fault 1 and Faultless; (**b**) Fault 2 and Faultless; (**c**) Fault 3 and Faultless; (**d**) Fault 4 and Faultless; (**e**) Fault 5 and Faultless; (**f**) Fault 6 and Faultless; (**g**) Fault 7 and Faultless.  
Then, the classification performance of the ANN was indicated as the confusion matrix of all samples shown in Figure 10. In Figure 10, each column represents the target class, and each row represents the predicted class. When the predicted class is consistent with the target class, the block is green; otherwise, the block is pink. Additionally, the main misclassifications were marked red in Figure 10. We can see that seven samples (7.3%) in the Fault 3 class were mistaken for the faultless class, and eight samples (8.3%) in the faultless class were mistaken for the Fault 3 class. It benefits from the vertical projection features in the input vector that the percentage of misclassification of the classes 3 and 8 not being as high as that of the feature space showed (Figure 7). This confirms that it is necessary to extract the vertical projection features from the discharge curve. In general, the entire classification accuracy of the ANN model achieved 97.9% based on the eight extracted features, even if the incipient defect cases were included, which is accurate enough in engineering applications.  
To demonstrate the advantages of this method, several common machine learning algorithms were compared in this paper. The same sample set extracted by methods mentioned above was used to trained the ANN, SVM (support vector machine), and RF (random forest) models. The features extracted from raw data are mutually independent, however, CNNs are widely adopted for solving problems in which the data are related, so the raw data set was used to train the 1D CNN (convolutional neural network) model. The results were classification performance of four algorithms on validation sets by means of 5-fold cross validation, which were shown in Figure 11. The sixth results are the average of the results of the 5-fold cross validation. From Figure 11, we can see the performance of 1D CNN model based on raw data is the worst, since the dimension of the input vector  
Figure 8: Features of samples.  
Figure 9: Loss curves during training, validation and testing.  
for it is too high, and there were not enough samples to train a good 1D CNN model. Additionally, we can see the classification accuracy of ANN model is the best, which is over 90%. However, the classification accuracies of SVM and RF are about 83% and 60%, respectively, which proves that the superiority of the ANN algorithm is considerable.  
Figure 11: Comparison of ANN, SVM, RF and 1D CNN models.  
Figure 10: Confusion matrix of all samples.