## 2 Materials and Methods
### Methodological Framework
#### 2.2.3 Convolutional Neural Network Training  
Using the preprocessed foot images, a convolutional neural network (CNN) was trained to classify the images into two main categories: non-healthy patients (those diagnosed with diabetic neuropathy, peripheral arterial disease, or both conditions) and healthy patients (those without these conditions). Convolutional neural networks are widely used in classification tasks, such as the one proposed in this study, due to their ability to extract and process high-level features from input images [14]. Additionally, CNNs can leverage transfer learning mechanisms, enabling the development of high-performance models by utilizing data from different domains [15]. This approach is particularly useful in scenarios where the dataset size is limited, as it reduces training time and enhances the model's generalization capability. Our convolutional neural network (CNN) utilized transfer learning by leveraging several base models, including ResNet-50 [16], MobileNet V1 [17], and EfficientNet V2 B0 [18]. The convolutional neural network (CNN) model was developed to process input images with the dimensions \(224\times 224\times 3\), corresponding to standard RGB images with three color channels. This dimensionality was chosen to align with the input requirements of the selected base architectures. To enhance the generalization capability of the model and to mitigate potential overfitting--particularly in the presence of class imbalance--data augmentation techniques were selectively applied. Specifically, random rotations and horizontal/vertical flips were introduced exclusively to samples of the underrepresented class (i.e., healthy cases) within the training dataset, ensuring that augmentation would not bias the already dominant class and would improve model robustness to spatial variability. Table 3 summarizes the structure of the dataset, showing how it was divided into training, validation, and test sets before and after data augmentation, providing the number of images per class in each subset: \begin{table}
\begin{tabular}{l l l} \hline \hline
**Pathology** & **Number of Patients** & **\%** \\ \hline Healthy & 56 & 29.17 \\ Not Healthy & 136 & 70.83 \\ Total & 192 & 100 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Patient distribution in the final balanced dataset. \begin{table}
\begin{tabular}{l l} \hline \hline
**Before Data Augmentation** & \\ \hline Dataset & Number of Images \\ \hline Training Healthy & 16 \\ Training Not Healthy & 92 \\ Validation Healthy & 20 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Training, validation, and test sets division (before and after data augmentation). The architecture employed transfer learning by utilizing one of three state-of-the-art convolutional backbones: ResNet-50, MobileNet V1, or EfficientNetV2-B0. These models were initialized with pretrained weights from the ImageNet dataset, enabling the network to benefit from a rich hierarchy of visual features learned on a large and diverse corpus of natural images. The top classification layers of the pretrained models were removed, and a custom classification head was appended. This included a global average pooling layer to condense the spatial dimensions of the feature maps into a compact vector representation, effectively summarizing global contextual information. This was followed by a dropout layer (with a dropout rate of 0.3) to introduce regularization and reduce the risk of overfitting during training. Finally, a single dense layer with sigmoid activation was added to perform binary classification between the target classes (see Figure 3). The training process was carried out in two main phases. During the initial training phase, a partial fine-tuning strategy was adopted: approximately 75% of the base model  
Figure 3: CNN network architecture.