## 2 Materials and Methods
### Methods
#### 2.3.1 Data Preparation and Pre-Processing  
Data preparation and pre-processing are crucial stages in any deep learning pipeline, directly influencing the model's performance and ability to generalise. In this stage the ITA skin tones were estimated for each image. The dataset of diabetic foot ulcer images was then partitioned into training and validation sets using a stratified random split, preserving the original class distribution. A split of 80% for the training set and 20% for the validation set was chosen, using a fixed random seed to ensure reproducibility. This choice was made to ensure that the model had a substantial set of data to learn from, while still allowing an effective assessment of the model's performance through the validation set. The use of callbacks such as early stopping and model checkpointing helped prevent overfitting and ensured robust model selection.  
Figure 5: VGG16 and VGG19 network architectures.  
Figure 6: MobileNetV2 network architecture and related Bottleneck Residual Block.  
Additionally, to ensure that the models could effectively handle the visual diversity of the images, a set of pre-processing operations were performed. Specifically, images were first converted to grayscale and were normalised to the range 0-1, helping to stabilize the gradients during training, making the optimisation process smoother, faster and more likely to converge to a good solution.  
Data augmentation techniques were also applied to increase dataset variability and improve generalisation. Data augmentation focused on transformations that preserve the general visual characteristics of the ulcers while generating feasible variations. Since skin tones were considered, colour variations were carefully used, as described below:  
* Geometric Transformations
* Image rotation or Flipping: varying rotation angles by up to 30\({}^{\circ}\) or applying a vertical or horizontal flip, which helps the model recognise ulcers regardless of image orientation.
* Translation: small positional variations of up to 20% of the image dimensions were applied to simulate different ulcer locations and improve the model's robustness to spatial displacement.
* Scaling/Zoom: applied with a range of up to 50%, allowing the model to focus on both smaller details and broader aspects of the images.
* Shear: introducing small geometric distortions, which forces the model to learn more complex variations in ulcer shapes.
* Colour and Photometric Transformations
* Brightness Adjustment: The brightness of the images has been adjusted in a range of 20% up or down, which simulates different lighting conditions and makes the model more robust to these variations. The operation alters luminance but does not significantly shift colour balance (chrominance).
* Gamma adjustment: Very small adjustments to mid-tone brightness can be useful to mimic different camera sensors. It keeps relative colour ratios mostly intact.  
The transformations were not cummulatory to better control the potential disturbance during the process. As represented in Figure 7, for each original image of the dataset, another 8 augmented images were created.