# Design of an In-Process Quality Monitoring Strategy for FDM-Type 3D Printer Using Deep Learning
## 4 Results and Discussion  
The collated data was split into three parts, training, validation, and testing before running the TCN model. The TCN was run for 100 epochs and collected performance metrics such as accuracy, loss, and confusion matrix of the scheme at the end of the simulations are explained below. The proposed model is compared to the most prominently used architectures, namely, the CNN [24] and recurrent neural networks (RNN) such as long short-term memory (LSTM) [25]. These methods are known in handling time series forecasting methods [26, 27].  
In Figure 3, the performance evaluation of the proposed model illustrates its accuracy over time. In addition, Figure 4 illustrates the performance of the proposed model in terms of training and validation loss over a period of 100 epochs. Values for both stayed almost the same all through the entire process and this shows that the proposed TCN model properly familiarized the process from the collected data and overfitting was not recorded. Here the accuracy obtained was 97% The goal of most (if not all) machine learning algorithm is to reduce loss, i.e., get the loss value closer to zero as much as possible. Figure 5 shows the loss of training and validation sets to be below 0.06; hence, it can be said that the model had a very minimal loss. Then, in Figure 6, the TCN performance summary is presented in the form of a confusion matrix. The percentage of accurately categorized results (True Negative and True Positive) is roughly 97%. The remaining 3% is made up of the inaccurately categorized results (False Negative and False Positive).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**3D Printer (Type: FDM)** & **Creality CS-10** & \\ \hline Filament & Material & PLA \\  & Diameter & 1.75 mm \\ Nozzle diameter & 0.4 mm & \\ Slicing software & CreatorK & \\ X/Y/Z accuracy & 11/11/2.5 μm & \\ Speed & Feed rate & 5 mm/s \\  & Extruder travel & 40 mm/s \\ Temperature & Extruder & 210 \({}^{\circ}\)C \\  & Bed & 90 \({}^{\circ}\)C \\ Layer resolution & 0.1 mm & \\ \hline \hline \end{tabular}
\end{table}
Table 1: The 3D Printer experimental conditions.  
Lastly, the algorithm is evaluated in comparison to the current classifiers, namely, SVM, LSTM, LSTM Autoencoder, a simple CNN, and the proposed MH-ED-TCN approach. As seen in the results, the use of MH-ED-TCN trumps all the other methods. By using MH-ED-TCN, results of 97% and 95% were produced by accuracy and recall sequentially, and they are at par with that of the method that produced the best results in those areas, that is, CNN. Hence, the characteristics of the TCN model overcome the vanishing gradient problem from which the canonical RNN suffers. As for the precision and recall, using MH-ED-TCN has produced results of 99% and 96%, respectively, and the results in those areas are greater than all the other four algorithms. Overall, in every observable aspect, the use of MH-ED-TCN performed better than all other algorithms considered in this research.  
Figure 4: The comparison of the different machine learning algorithm compared to the proposed MH-ED-TCN.  
Figure 3: The graph illustrates the accuracy of the training and validation of the proposed model over a period of 100 epochs.