## 5 Conclusions  
This paper presented two types of warping deformation prediction methods in FDM based on a DTW-integrated KNN algorithm and multivariate thermal time series data. First, a KNN model was trained using the thermal time series data of a whole printing process to determine whether warping deformation had occurred. Second, only partial thermal time series data were fed into the predictive model to carry an early detection of the warping deformation in the specimens. To ensure stable performance results, the value of the main parameter K of the KNN algorithm was searched using the K-elbow method. The key classification performance indicators were also compared and analyzed using 5-fold and 10-fold CVs to generalize the performance of the limited number of data. The results showed 84% accuracy in the 10-fold cross-validation and 82% accuracy in the 5-fold cross-validation when the warping deformation was predicted based on the pattern of the entire thermal time series data. Moreover, the trained model showed a relatively good performance by predicting the warping deformation occurrence with an accuracy of 80% using thermal time series data corresponding to only 20% (one-fifth) of the entire printing time. The proposed methodologies not only detected the defects in a printed product but also predicted warping deformation with high accuracy. According to the obtained results, this approach can be introduced to actual manufacturing processes as a quality monitoring system to support the inspection process of defective products. This study can also be used as a stepping stone to build a feedback control system for warping prediction that can significantly reduce the unnecessary time and additional cost resulting from printing defective products. The presented study is limited due to a major element, which is data. In general, machine-learning-based prediction models show stronger performance when fed with more data. However, a limited amount of data was provided to the current model due to physical restraints. Another limitation is unbalanced data, which can lead to biased model prediction due to the data being skewed to particular target values. Although the unbalanced data problem was tackled in this study by printing a similar number of warped and unwarped samples, such a method cannot be applied in actual production processes. Hence, the authors aim to improve the prediction performance by increasing the number of samples and by trying to come up with a solution to the unbalanced data \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Timeseries** & **Precision** & **Recall** & **F1-Score** & **Accuracy** & **Best K Value** \\
**Length** & **(5-CV/10-CV)** & **(5-CV/10-CV)** & **(5-CV/10-CV)** & **(5-CV/10-CV)** & **(5-CV/10-CV)** \\ \hline
20\% & 0.783/0.833 & 0.750/0.750 & 0.743/0.743 & 0.800/0.800 & 7/8 \\
40\% & 0.883/0.916 & 0.850/0.800 & 0.852/0.813 & 0.880/0.860 & 7/6 \\
60\% & 0.833/0.866 & 0.850/0.800 & 0.831/0.796 & 0.860/0.840 & 7/10 \\
80\% & 0.833/0.866 & 0.850/0.800 & 0.831/0.796 & 0.860/0.840 & 7/8 \\
100\% & 0.820/0.866 & 0.750/0.800 & 0.776/0.796 & 0.820/0.840 & 3/3 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Warping deformation early detection performance results by the time series length. problem. The transfer of the presented results to other AM environments will also be investigated in the near future. D.S. are responsible for conceptualization, the model development and analysis of the results. A.M.C.B. contributed to conceptualization, experimental setup, data collecting, and curation. J.K. and M.B. investigate related works and methodology used in this paper. All authors contributed to writing of the manuscript. N.K. verified the model framework and results and supervised the project. All authors have read and agreed to the published version of the manuscript.