## 3 Materials and Methods
### Deep Learning Pipeline
#### 3.3.3 CNN Approach  
Concerning the CNN model utilized, the ResNet-34 architecture was employed in both the 2D and 3D experiments. The ResNet architecture is composed of residual blocks, each featuring shortcut connections that were designed to prevent the vanishing gradient problem, and therefore facilitating the training process of the networks [46].  
For the 2D approach, the implementation available in the _Torchvision_ package from _PyTorch_[47] was utilized, which is based on the architecture proposed in [46], and certain modifications were necessary in the original implementation. Firstly, the number of channels in the initial convolutional layer was adjusted from three to one, considering that the CT images are represented in greyscale. Furthermore, a dropout layer was introduced before the fully connected (FC) layer, which consists of a single neuron with a sigmoid activation function, at the final stage of the network.  
For the 3D experiments, the ResNet-34 architecture sourced from MedicalNet [48] was employed, given that the architecture was designed for applications involving medical images and has demonstrated its potential in lung classification tasks [29; 48]. The MedicalNet networks were devised for segmentation tasks, necessitating certain adjustments in the architecture, analogous to what was performed in the 2D approach. A global average pooling (GAP) layer was entered after the last convolutional layer of the ResNet encoder module, as proposed by [29]. Subsequently, a dropout layer was inserted and then, to accomplish the binary classification task, an FC layer with one output neuron and sigmoid activation function was added into the architecture. A representation of the deep learning experimental pipeline, with details of the modifications employed to the ResNet-34 models, can be found in Figure 6.  
Regarding the training process, the loss function utilized was the binary cross entropy (BCE), along with adaptive moment estimation (Adam) as the optimizer. To optimize the model's performance, numerous combinations of hyperparameters were tuned, including dropout rate, learning rate, momentum and weight decay. The range of values explored for each parameter is presented in Table 5.  
The criteria for stopping the training process were established by monitoring the progression of the AUC in both the training and validation sets throughout training. Specifically, training would cease under two conditions: if the validation AUC showed no improvement over a span of 10 epochs, or if the training AUC reached the value of 1.0.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Transformations** & **Range** \\ \hline Flips & - \\ Rotation & \([-20,\,20]^{\circ}\) \\ Shift & \([-15,\,15]\)\% \\ Shear & \([-20,\,20]\)\% \\ \hline \hline \end{tabular}
\end{table}
Table 4: Range of values defined for the parameters of the data augmentation transformations.  
Figure 5: Samples resulting from data augmentation transformations applied in the deep learning approach, respectively: (**a**) original image, (**b**) vertical flip, (**c**) horizontal flip, (**d**) rotation of \(10^{\circ}\), (**e**) shift of \(10\%\), and (**f**) shear of \(10\%\).  
Upon completion of the training, the selected model was the one that achieved the highest validation AUC value, with the corresponding epoch being selected for subsequent testing.