## 3 Results And Discussion
### Training and Inference Times  
Thermographic videos and raw frames were processed by computational unit hardware Intel(R) Xenon(R) CPU E5-1620 [EMAIL_ADDRESS] GHz with 16 GB RAM for the feature extraction process, training of ML classifiers, and parameters tuning, while DL architectures were trained on graphic card NVIDIA Quadro P4000, using Tensorflow and Sklearn Python 3.10 packages. In addition, the same hardware was used for test of trained networks. Reported results in Tables 4 and 5 account for all classifiers and workflows combinations, whose performances were analyzed in Section 3. In the following table, training time refers to average time and standard deviation, measured in milliseconds, taken by classifiers to shape decision function in five-fold learning sets.  
Table 4 shows that the DL architecture requires, on average, less than 5 min for learning phase, while ML algorithms take less than half of a minute. Feature reduction and feature selection have light-weighted model representation with an improved training convergence speed with respect to workflow I. The highlighted trend does not cover SVM; in fact, training time required reaches maximum value in workflow III. This is attributable to the high regularization, through setting C parameter, that constrained to converge to simple decision function, maintaining generalization ability on defective class. DT and KNN show monotonic decrease of the training duration as dimensionality is reduced, accompanied, for DT, by continuous increasing in precision, recall, and f1 score while KNN reaches best precision in workflow III with lowest learning time, with stable and slightly decreasing recall and f1 score, respectively. The SVM shows better performances regarding all three metrics from workflow I to workflow II, accompanied by five-times-reduced training time; however, SVM does not benefit from feature selection with increased learning time and reduced performances.  
The DL classifiers require greater execution time than ML ones due to higher number of parameters; CNN-C is built on eLu and sigmoid activation functions that, combined with focal loss, yield to the fastest learning among CNNs.  
\begin{table}
\begin{tabular}{c r r r} \hline \hline \multirow{2}{*}{**Architecture**} & \multicolumn{3}{c}{**Training Time [ms]**} \\ \cline{2-4}  & **Workflow I** & **Workflow II** & **Workflow III** \\ \hline DT & 462.01 \(\pm\) 50.12 & 62.3 \(\pm\) 6.10 & 21.60 \(\pm\) 1.60 \\ KNN & 31.00 \(\pm\) 0.44 & 6.41 \(\pm\) 0.13 & 3.08 \(\pm\) 0.42 \\ SVM & 15,133.05 \(\pm\) 3535.01 & 304.33 \(\pm\) 13.42 & 751.71 \(\pm\) 270.14 \\ CNN-C & 60,490.02 \(\pm\) 4856.31 & - & - \\ CNN-W & 271,991.80 \(\pm\) 4456.70 & - & - \\ CNN-EW & 263,880.00 \(\pm\) 4099.30 & - & - \\ \hline \hline \end{tabular}
\end{table}
Table 4: Average and standard deviation training time measured in milliseconds taken by classifiers and respective workflows to shape decision function in five-fold learning sets.  
Inference time reported in Table 5 refers to the average and standard deviation, measured in milliseconds, of time required to classify a single sample as 'defective' or 'non-defective' weld. ML classifiers, except DT, show a monotonic decreasing in inference time required, along with feature reduction and selection, that can be attributable to simple representation and mapping of samples. In addition, DL classifiers need less than a few hundred milliseconds with a minimal standard deviation. In absolute term, the elected method identified in CNN-C performs prediction in roughly 0.1 s.  
Moreover, time required for feature extraction pipeline was measured and accounted for average value of 325.40 ms \(\pm\) 26.71 ms; considering having trained the model, the whole time required from acquisition to classification step is roughly equal to 425.40 ms \(\pm\) 30.00 ms, rounded to 0.5 s.  
All implemented methods have inference time on a single data sample coherent with the industrial real-time requirements of fast anomaly detection without need to interrupt assembly lines.