# Automated Fillet Weld Inspection Based on Deep Learning from 2D Images
## 2 Materials and Methods
### Methodology
#### 2.4.5 Hyper-Parameters Selection (HS)  
In the context of a YOLO system, a series of hyperparameters are configurable in accordance with the training to be performed. Table 1 lists the hyperparameters that have been used in each of the three experiments performed in this research.  
In order to select the hyperparameters for each experiment, it has been taken into account that they are as homogeneous as possible so that a comparison and discussion of the results can be made as fair as possible later. Thus, only the number of epochs has been altered between one experiment and another, due to the complexity of the detection and the characteristics of the classes to be detected, which have led to a slower convergence of the model. In any case, the lowest possible number of epochs has been applied to avoid possible overfitting, taking into account that we have a limited dataset.  
During the training process, a batch size of 16 was utilized, indicating that the data were updated following the concurrent processing of 16 images. The selection of this parameter was informed by the available resources. An increased batch size could enhance the efficiency of the training process; however, it may necessitate additional memory resources.  
The learning rate was set to 0.01. This parameter controls the tuning of the model weights during each training iteration. Care must be taken in choosing it, as a higher learning rate might result in faster convergence, but at the same time it could lead to oscillations or exceeding the optimal weights.  
\begin{table}
\begin{tabular}{l c c c} \hline \hline
**Parameter** & **Experiment 1** & **Experiment 2** & **Experiment 3** \\ \hline _epochs_ & 105 & 300 & 300 \\ \hline _batch size_ & 16 & 16 & 16 \\ \hline _Learning rate_ & 0.01 & 0.01 & 0.01 \\ \hline _Optimizer_ & SGD & SGD & SGD \\ \hline _Input image size_ & \(320\times 320\) & \(320\times 320\) & \(320\times 320\) \\ \hline _Confidence Threshold_ & 0.75 & 0.75 & 0.75 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Hyperparameters used in each of the experiments performed.  
The stochastic gradient descent (SGD) optimizer was employed. The SGD is a classic optimization algorithm that iteratively updates the model's weights based on the gradient of the loss function.  
The input images were resized to \(320\times 320\) pixels, which is a lower resolution than the one commonly used for YOLO models. Due to the characteristics of the image to be detected, it was considered convenient not to invest in a larger image size in order to guarantee a consistent input size for the model and efficiency in terms of training time and memory allocated.  
The confidence threshold is represented as the inverse of the significance threshold and is also often expressed as a percentage. Confidence determines how confident the model is that a prediction matches the true value of a class. The threshold determines the value to label a class as that class. Therefore, it can be posited that, in the event the confidence threshold is established at 0.6, the model will be required to attain a minimum confidence level of 60% in order to proceed with the classification of the object in question. In our case, we have required a confidence of 0.75, so we will have to ensure that the predictions are at least 75% certain. This value is interesting to use when we are sure that the model converges well with a high percentage of success.  
Additionally, note that the MS COCO [44] weights have been used, which were passed as input parameters to the YOLO algorithm.