## 2 Materials and Methods
### Methodological Framework
#### 2.2.2 Dataset Balancing  
The dataset obtained from the clinical study exhibited an imbalance in the number of thermographic images of healthy patients, compared to those with pathological conditions (DPN and PAD).  
To address this issue and to ensure a balanced distribution, additional thermographic images of healthy patients were incorporated from the publicly available INAOE dataset [13]. This integration enhanced the representativeness of the healthy patient class in the analysis.  
It is important to highlight that the thermographic images of healthy subjects obtained from the INAOE public dataset were selected specifically because their acquisition protocol closely aligned with the protocol used in our clinical trial. Both datasets followed standardized practices described in prior literature, including:  
* A supine rest period for thermal acclimatization.
* Acquisition of plantar images with the patient at rest, in a thermally controlled environment.
* Application of infrared shielding methods to isolate plantar temperature from background radiation.
* Use of infrared cameras with similar technical specifications.  
Additionally, we implemented a strict preprocessing pipeline--including image merging and thermal scale alignment--in order to harmonize them with the clinical images captured in the study and to minimize potential acquisition-related biases.  
We also initiated the collection of additional thermographic images from healthy individuals under the same clinical conditions, which will be incorporated into future works to further strengthen the model and reduce domain shift risks.  
After completing the balancing process, the final dataset was obtained, consisting of a total of 192 thermal images. The additional 45 participants included from the INAOE dataset were completely healthy individuals without diabetes. While these participants did not undergo the same full clinical screening protocol described in the study, the dataset was originally collected under controlled conditions and included only subjects who were medically evaluated as free of any metabolic, vascular, or neurological disorders at the time of acquisition. Therefore, although the exact same diagnostic tests were not applied, the  
Figure 2: Examples of thermographic images processed: (**a**) original image; (**b**) processed image. The acquired images were processed to automatically segment the soles of the feet and to dynamically adjust the thermal scale based on the maximum and minimum temperature values detected in both limbs. The numbers indicate the temperature ranges and associated colors in the original image and in the processed image.  
inclusion criteria were functionally equivalent in ensuring that the individuals included from the INAOE dataset represented a healthy, non-diabetic population without signs of diabetic peripheral neuropathy (DPN) or peripheral arterial disease (PAD).  
In addition, the dataset contained 11 diabetic patients who did not present clinical signs of either PAD or DPN, serving as a secondary control subgroup. The remaining patients in the dataset were clinically diagnosed with diabetic peripheral neuropathy (DPN), peripheral arterial disease (PAD), or both, based on neurological and vascular assessments. A summary of the distribution of patients in the final dataset is presented in Table 2.