## 4 Results and Discussion  
As mentioned in Section 3.3, the performances of the warping deformation prediction in the two cases were compared and analyzed through various classification evaluation metrics. The performance results of the DTW-based KNN model are shown in Figure 5. The model was trained with 40 training data (25 warped data and 15 unwarped data) and tested with 10 testing data (5 warped data and 5 unwarped data) for warping prediction according to the K value. K is one of the major hyperparameters of the KNN algorithm. The results showed the lowest error rate of 10% and the highest accuracy of 90% when the K value was 26. Based on Figure 5 and Equations (6) and (7), the error rate and accuracy have an inverse relationship. The performance of classifying the time series patterns rapidly dropped with a K value greater than the highest performing K value. Once the K value exceeded 30, the DTW-based KNN model completely lost its classification capabilities. Figure 5: Performance change plot of the (**a**) error rate and (**b**) accuracy according to the hyperparameter K.  
The confusion matrix and receiver operating characteristic (ROC) curve evaluating the testing data using the highest performing K value are shown in Figure 6. As depicted in Figure 6a, all five unwarped samples were correctly classified, while one warped sample was classified as an unwarped sample. The classification performance was as follows when evaluated based on the confusion matrix in the case of the warped data. The precision was 0.83, recall was 1.0, and f1-score was 0.91. However, in the case of the unwarped data, the precision was 1.0, recall was 0.8, and f-1 score was 0.89. The graph in Figure 6b shows the performance of the classification model at all the thresholds, where the area below the curve is called the area under the curve (AUC). A high AUC value signifies a high model performance. The AUC in this experiment was found to be 0.9, which is consistent with the accuracy. K-fold cross-validation (CV) was performed to avoid any bias in the prediction performance for specific test samples due to the limited data and to generalize the performance. The k values of 5 and 10 were used along with 20% and 10% of the testing data, respectively. Figure 7 shows the obtained mean accuracy results according to the K values in each CV. At a K value of 3, 82% accuracy for the 5-fold CV and 84% accuracy for the 10-fold CV were obtained. Like the results obtained using a single testing set, the classification performance of the prediction model was drastically reduced as the K value exceeded a specific value (31 for the 5-fold CV and 36 for the 10-fold CV). Although the highest performance of the two CVs did not differ significantly, the k value with the lowest performance was smaller for the 5-fold CV. The KNN model was also trained using the partial time series data rather than the entire data with the purpose of early detection of the warping deformation. The length of the partial time series data was adjusted by splitting the entire data into five equal sections. The early detection results using  
Figure 6: (**a**) Confusion matrix and (**b**) receiver operating characteristic (ROC) curve based on the test data. Figure 7: (**a**) 5-Fold Cross Validation and (**b**) 10-Fold Cross Validation curve based on the test data. the partial time series according to the highest performing K values are listed in Table 3. The predictive model did not differ much in performance between the CVs, but it showed a difference depending on the length of the time-series data. For both the 5-fold and 10-fold CV, the overall performance of the model was lowest when only 20% of the data were fed, and it was highest when 40% of the data were fed. The experimental results have shown that warping deformation can be early detected with at least 80% accuracy even when using a small length of thermal time series data. The possibility of detecting the warping deformation using as little as 20 percent of the printing process implies two possible conclusions.