## 2 Materials and Methods
### Classifiers  
In this work, the authors have tested both traditional ML techniques and more recent DL approaches. The classification with classic ML algorithms was performed employing support vector machine (SVM), as presented in [PERSON] et al. [42], K-nearest neighbor (KNN), originally introduced by [PERSON] et al. in [43], and decision tree (DT) architectures, whose introduction is by [PERSON] et al. [44] in their standard implementation. Moreover, DL-based implementation has considered a CNN with a customized architecture taking conceived features as input and described in detail in the following paragraph. It is worth mentioning that three different implementations of the CNN have been tested: (1) a CNN trained for the classification task (CNN-C), (2) a CNN trained to estimate the electrical resistance by using a weighted loss function (CNN-W), (3) a CNN trained to estimate the electrical resistance by using a modified (extended) version of the weighted loss function (CNN-EW). It is important to remark that when the CNN is trained to estimate the electrical resistance, the binary classification is performed by comparing the estimated value with the threshold used to annotate the dataset (see Section 2). The Custom Convolutional Neural Networks  
CNNs are well employed in DL frameworks, being able to sharpen pattern recognition ability inside customized kernels in a similar fashion as visual cortex does. In this study, the authors propose a hybrid CNN in which the convolutional layers and dense layers are stacked together for further representation learning, starting from 2D feature matrix as an input. It is worth mentioning that the CNN classification and regression are considered by implementing one and two different loss functions, respectively; however, the basic architecture of the CNN remains the same. The rationale for using a CNN that takes as input features is double: (I) the number of image sequences related to the defective welds is small to consider more complex topologies, and (II) the logical relation between the extracted features in time and space suggests the use of CNN filters. The architecture provides, for parallel processing, two encoding paths for each feature matrix derived from cooling analysis and image analysis whose input layers can be denoted as \(x\in\mathbb{R}^{7\times 20}\) and \(\mathbb{R}^{6\times 13}\) and a fully connected network branching from principal dense layers coming from convolutions, which keeps 1D video feature vector \(\epsilon\)\(\mathbb{R}^{1\times 5}\). Each encoding path consists of the following:  
* First layer, containing three convolutional layers, each of them has four bidimensional kernels, whose size are (\(7\times 3\)) for the first branch, (\(7\times 4\)) for the second, (\(7\times 5\)) for the third, processing for cooling feature matrix, and kernels of dimensions (\(6\times 3\)), (\(6\times 4\)), (\(6\times 5\)) for the image features matrix processing. These kernels are applied along feature matrix major dimension (see Figure 3 with stride 1, extracting information related to the spatial and temporal transients from adjacent regions and frames. The output of each filter has the first dimension flatten, the second determined by number of convolutions, and the third determined by number of applied convolutional filters: \(1\times 18\times 4\), \(1\times 17\times 4\), \(1\times 16\times 4\) and \(1\times 11\times 4\), \(1\times 10\times 4\), \(1\times 9\times 4\), respectively, for cooling feature matrix and image feature matrix. The activation function follows \(eLu\) exponential linear unit for classification oriented network and \(ReLu\) for regression ones (are both nonlinear activation functions). * These outputs undergo dropout that selectively dumps number of neurons to prevent against vanishing gradient. * Reshaped into a linear vector. * Concatenate outputs in one linear vector bunching smaller ones coming from convolutional branches.