Next Article in Journal
Can a Chatbot Help Heal a Wound? Context-Aware Prompts for Boosting Adherence in Diabetic Foot Ulcers
Previous Article in Journal
A Pragmatic Cluster-Randomized Trial of Insulin Therapy for Dexamethasone-Induced Hyperglycemia Amongst Diabetes Patients with COVID-19
Previous Article in Special Issue
From Plaster to Pixels: The Evolution of Offloading in the Diabetic Foot
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Monitoring Diabetic Foot Using Images and Generative AI

Institute for Systems and Robotics, Instituto Superior Técnico, 1049-001 Lisbon, Portugal
*
Author to whom correspondence should be addressed.
Diabetology 2026, 7(5), 95; https://doi.org/10.3390/diabetology7050095
Submission received: 2 March 2026 / Revised: 8 May 2026 / Accepted: 8 May 2026 / Published: 12 May 2026

Abstract

Background: Diabetic Foot Ulcers (DFU) are a common complication of diabetes, often leading to infections, amputations and even death if left untreated. Effective management of the Diabetic Foot (DF) requires timely detection and frequent monitoring. Current DF assessment methods, by healthcare professionals, are largely based on visual inspection of feet, together with touch, temperature, and vibration sensitivity, and pedal pulse. Methods: The paper describes a machine-learning approach for the assessment of DF from feet images, combining pre-trained convolutional neural networks (CNN) with Generative AI for dataset annotation. Specifically, the GPT-4o-mini model was used to assign risk labels (Low, Medium or High Risk) to individual foot images, following a structured designed prompt for this task. The labeled dataset was used to train and evaluate two pre-trained CNN architectures, namely, ResNet50 and VGG16. Output predictions are obtained by aggregating the prediction for each of the images of a patient. Results: The results obtained show that both ResNet50 and VGG16 achieved good overall performance, with ResNet50 showing superior results. The High Risk class achieved the highest performance. The Low and Medium Risk classes also showed good performance but were prone to confusion due to the similar features of the images belonging to those classes. Conclusions: The technical contribution of the paper is a Streamlit App, available online for public use, showcases the work. The primary scientific contribution is the demonstration of how Generative AI can be used to train common CNN and automate a highly relevant healthcare process.

1. Introduction

Diabetes mellitus, a chronic condition caused by uncontrolled blood sugar levels, represents a major public health concern with a rapidly increasing prevalence over the past decades, often leading to complications such as foot ulcers (approximately one-third of diabetic patients are likely to develop diabetic foot ulcers). The International Diabetes Federation (IDF) reports a continued global increase in diabetes prevalence and estimates that affects 589 million adults (20–79 years) worldwide [1]. This estimate is expected to reach 853 million by 2050. Research shows that people with diabetes have an approximately 34% lifetime risk of acquiring diabetic foot ulcer (DFU) [2], which leads to a risk of lower limb amputations up to 85%, mainly caused by poor diagnosis and treatment. Approximately 90% of annual amputations in the United Kingdom and 67% in the USA are estimated to be associated with diabetes [3]. High-risk patients require regular medical evaluation, resulting in a strong economic impact, especially in developing countries [4].
DFU, resulting from diabetes, is defined as an open wound commonly located on the bottom of the foot or around the toes [5]. Ulcers are formed as a result of skin tissue breaking down and exposing the layers underneath. If left untreated, infection can progress continuously to severe stages and involve the deeper soft tissues and ultimately the bone, potentially leading to amputations of the lower limb [6] and prolonged hospitalization [7]. Globally, a diabetes-related amputation occurs every 20 seconds, highlighting the severe implications of this condition [8]. Furthermore, amputations have a significant impact on mortality rates. While the 5-year survival rate for patients with DFU is 70%, this percentage drops significantly to 43% following a major amputation [9]. Individuals with DFU are estimated to face a 5-year mortality risk 2.5 times higher than diabetic patients without DFUs [10]. Early detection, together with accurate screening and appropriate management strategies, plays a crucial role in the treatment and prevention of further serious complications. Risk indicators include neuropathy, poor circulation, foot deformity, using inappropriate shoes, and uncontrolled blood sugar [5]. These may lead to foot ulcers, with risk factors including neuropathy, peripheral artery disease, foot deformities, diabetes complications and obesity [11].
Traditional detection methods rely mainly on visual inspections performed by specialists, and so there are some limitations to take into account. The first one is accessibility, as the availability of specialists may be limited, namely, in rural areas and remote regions. People with diabetes living in rural areas are more likely to develop complications of the disease compared to people who live in the suburbs and cities due to a lack of access to medical care [12]. The second limitation is subjectivity, as visual assessment made by medical specialists depends on the opinion and experience of the specialists, which varies among professionals.
Furthermore, in-person assessment may be expensive, time-consuming, resource and labor-intensive, and require specialized expertise [4,13]. By using technology and computer-aided diagnosis methods, it is possible to automate the process of detection and prevention while minimizing costs and the amount of time spent on traditional methods. This is where the integration of machine learning and deep learning becomes useful as a method to prevent, detect and evaluate the progression of diabetic foot ulcers, offering a faster and more cost-effective approach, and so the advancements in artificial intelligence and generative AI help to address these challenges [13]. Image-based diagnostic systems are non-invasive and can be used in remote or resource-constrained settings, empowering healthcare professionals and patients with accessible tools for early detection and improved treatment. The continuous monitoring of diabetic foot patients is crucial to monitor their healing process and provide adequate medication to prevent complications [14], along with economic benefits.
This paper presents a diabetic foot risk assessment system that predicts the risk of ulcer progression and development from foot images of diabetic patients. Current diagnostic methods based on visual inspections tend to have a subjective degree, often depending on the level of experience of the healthcare professional. Automated methods have the potential to overcome these limitations by analyzing a large number of images, and generating a combined assessment, thus reducing the burden on healthcare professionals. Unlike traditional methods, which are limited by the availability of healthcare professionals, automated systems can operate continuously, reducing delays in care and enabling timely interventions.
In this work, foot images are individually labeled using a Generative AI model (GPT-4o-mini) to assign a risk label (Low Risk, Medium Risk or High Risk) based on features in the images, such as ulcers, dryness, discoloration, and others. These labels are then used to train and evaluate two pre-trained ResNet50 and VGG16 models. Multiple images of the same foot are used, and the system reports a risk prediction for each, combining them all through meaningful criteria. The results show the practical viability of using Generative AI to train common CNNs and contribute to automating, and potentially massify, DF analysis. The structure of this paper is as follows; Section 2 reviews related work, followed by Section 3 with the details on the methods, Section 4 on results, Section 5 on the Streamlit App developed, and Section 6 with the conclusions.

2. Literature Review

Several recent studies have explored a wide range of approaches on diabetic foot ulcer detection and classification, including convolutional neural networks (CNNs), data augmentation strategies and optimization algorithms, and the integration of additional interpretation techniques such as Grad-CAM (Gradient-weighted Class Activation Mapping, see [15]).
Additionally, deep learning-based systems have been developed to detect DFU from patient foot images, offering more reliable localization of ulcer points [16].
An automated scoring system for DFU, named ScoreDFUNet, used to evaluate their severity by identifying ulceration, infection and other features in DFU images, was proposed in [4]. The system combines deep learning with image analysis to classify ulcer images into four categories: ulcer, infection, normal and gangrene. U-Net was used for segmentation, and ResNet50 was used as the backbone network for stratification. The dataset initially included 1426 DFU images: 603 from the DFUC2020 dataset and 823 from Xiangya Hospital. To augment the dataset, 518 images from Kaggle were used. The model achieved 95.34% accuracy, along with high precision, recall and F1-scores across all categories. Grad-CAM was also used to generate visual heatmaps that highlight the regions of DFU images that contributed most to the model’s predictions. In addition, other contributions of this work include the comparison with dermatologists at different experience levels and the development of a web app to assist medical professionals, allowing them to upload patient images and receive scoring results.
A deep learning approach, DFU_MultiNet, was proposed in [17] to classify healthy and ulcer skin images using a multi-scale transfer learning approach. The method integrates three pre-trained CNN models, VGG19, DenseNet201 and NasNetMobile, to extract features from diabetic foot images. These features are then merged through a summing layer and fine-tuned with additional layers, such as dense, dropout and batch normalization. The dataset was collected from a publicly accessible dataset, which includes both healthy and ulcerated skin samples. Data augmentation techniques were used to address the limited number of samples in the dataset, increasing the size of the dataset from 1055 images to 6963. The images were divided into training (70%), validation (10%) and test sets (20%). The proposed DFU_MultiNet achieved strong performance across all metrics, including 99.1% accuracy, 100% precision, 98.2% recall and 99.1% F1-score.
Multiple convolutional neural network (CNN) architectures for the classification of diabetic foot ulcers, specifically for infection and ischemia categorization, were proposed in [6]. The DFU2020 dataset was used, containing 1459 images. Dataset imbalance was addressed through data augmentation techniques such as rotation, flipping, scaling, and others. Several pre-trained CNN models were tested, including AlexNet, VGG16, VGG19, ResNet50, ResNet101, GoogleNet, MobileNet, SqueezeNet and DenseNet. The performance of the models was evaluated using accuracy, sensitivity, specificity, precision, F1-score, AUC and MCC. Among all models, ResNet50 outperformed the other models, achieving the best overall results, reaching 99.49% accuracy for ischemia classification and 84.76% accuracy for infection classification. This study highlights that the performance for ischemia detection is higher than for infection detection, which can be explained by an imbalance, and so a larger and more representative dataset would likely improve infection classification. This work essentially demonstrates that fine-tuned deep learning models, namely, ResNet50, can achieve strong performance in the diabetic foot field. However, the authors emphasized that future work should focus on expanding the dataset to improve performance in infection classification.
A CNN and Grad-CAM-based approach to assess the evolution of ulcerations was described in [18]. The methodology employed in this thesis involves a dataset with 1000 foot images sourced from Kaggle, consisting of 500 images of ulcerated feet and 500 of normal feet. These images were preprocessed using data augmentation techniques and divided into training, validation and testing subsets to ensure rigorous evaluation of the models. Pre-trained CNN architectures, including EfficientNet-B2, ResNet50, ResNet101 and DenseNet121, were tested. In addition to this methodology, Grad-CAM was used to interpret the model’s predictions, enabling visualization of regions influencing the detection of ulcers. Besides classification, the model was also designed to monitor the progression of ulcers over time, analyzing risk factors associated with the evolution of ulcers.
The fine-tuned EfficientNet-B2 model achieved the best performance, with an Area Under the Curve (AUC) of 0.96, along with a MAP of 0.88 and an F1-score of 0.91. The system’s outputs were validated by a podiatrist specializing in diabetic foot ulcers, confirming its clinical reliability and demonstrating its ability to track the evolution of ulcers and classify their severity.
The deep learning approach in [19] used Faster R-CNN and Inception-ResNetV2 architectures on a dataset with 1775 DFU images and respective expert labels and a testing dataset with 203 images. This work targeted the evolution of ulcerations and not the risk assessment of the pre-ulceration phase. Moreover, ulcerations have distinctive visual signatures that simplify its detection by machine learning techniques. This can be easily confirmed in recent literature; see, for instance, the survey in [20], where accuracies above 90% are reported, and [21] for automatic ulcer detection from images, using CNN and LSTM, with accuracy above 94%.

3. Methodology and Methods

This study aims at developing a system that predicts the evolution of the diabetic foot in three risk categories, namely, Low Risk, Medium Risk and High Risk (this form of categorizing DF risk is commonly used in some Health Systems). The focus of this project is to estimate a risk metric for the expected evolution over time based on visual signs, such as skin condition, the severity of existing ulcers, and patches of rough and dry skin. No patient-reported information is used. The current developments in Generative AI (GenAI) define the methodology used. The methods include dataset preparation, training of pre-trained CNN models and the development of a Streamlit App that serves as a user interface, provides insight into the regions of the foot that are at risk of ulcer formation, and yields a risk label for each patient based on a set of foot images and the integration of Grad-CAM visualizations.

3.1. Methodology

The procedure begins with the process of data collection for the creation of a dataset, followed by the dataset labeling process using GenAI, and finally the application of a methodology to predict the risk of evolution of the diabetic foot to a more severe stage, including evaluation for images and patients (by aggregating each patient’s image labels based on a criterion). This section also emphasizes the importance of data augmentation and oversampling techniques to address certain limitations and improve model generalization. The overall workflow is illustrated in Figure 1.
The process starts with the collection of clinical images of diabetic feet. The dataset used for this study consisted of images of DF patients feet. The images used in this study were obtained using a system of cameras built for the DFAA project (Diabetic Foot Automated Assessment, https://sites.google.com/view/dfaa-pex/home, accessed on 1 May 2026) at a ULS (acronym for Unidade Local de Saúde, or Local Health Unit, of the Portuguese Health System) hospital.
The original dataset was organized in subfolders, each corresponding to an individual patient, each containing images from the same foot was represented from four different views: top, bottom and both sides (see Figure 2).
At this stage, each image was individually labeled using the OpenAI API, which assigned one of three risk categories (Low, Medium or High Risk) for each image in the dataset. Based on these labels, a new organized dataset was automatically generated. Images identified as High Risk were placed into a “High Risk” folder, those identified as Medium Risk into a “Medium Risk” folder, and finally, those identified as Low Risk into a “Low Risk” folder. This process transformed a patient-based dataset into a fully structured dataset divided by risk category, ready to be used as input to our models.
Although the dataset used to train and evaluate the models is no longer composed of individual patient subfolders, each file name retains a unique patient identifier (patientX_imageX), which ensures that, even after being processed individually, the images will later be regrouped to give a single risk class for the respective patient. The dataset used for the development of this study is available upon request, with open access granted for academic purposes under CC-BY or ODC-BY licensing.
The inclusion of multiple views of the same foot is essential, as certain risk signs, such as ulcers, discoloration and swelling, might only be visible from a particular angle, while other regions of the foot can look healthy without any risk signs.

3.2. Dataset Limitations

One of the main challenges in this process was class imbalance. As is common in medical datasets, the majority of the images fell into the Low Risk and Medium Risk categories, with a few samples being classified as High Risk.
To mitigate the imbalance, the dataset was supplemented with external images in the public domain, such as the Kaggle dataset [22], which provided additional examples of severe High Risk cases, including open ulcers. This step is important to ensure that the model is exposed to the full spectrum of DF cases. Note that Kaggle images have, in general, different resolutions from the ones obtained at the hospital, requiring resizing, and lighting conditions will be different, a variety of cameras may have been used, and patient demographics may vary significantly.
Data augmentation and oversampling techniques are also applied during training to artificially increase the size and diversity of the dataset, particularly for the minority class (High Risk). The data augmentation strategy includes horizontal flipping, rotation, zoom variations, contrast adjustment, brightness modification and subtle translation. For minority classes, particularly High Risk samples, aggressive data augmentation is applied with enhanced rotation ranges and additional color jittering to increase sample diversity while preserving the essential features.
The High Risk samples were oversampled by a tenfold factor to ensure adequate representation during training. The oversampling is performed only on the training set to prevent data leakage into the validation and test sets.
Table 1 presents the number of images per risk category, comparing the dataset before and after the inclusion of additional images from Kaggle. While the Low Risk and Medium Risk categories remained unchanged, the High Risk category doubled in size, partially mitigating the imbalance highlighted earlier.
The final dataset consists of 3255 images, divided into risk classes: 1807 images for Low Risk, 1294 images for Medium Risk and 154 images for High Risk.

3.3. Patient Risk Labels and Dataset Split

The dataset splitting strategy is based on a stratified approach by patients to ensure that there is no data leakage between training, validation and test sets. For patient identification, a patient ID is present in each image filename, and all images sharing the same ID are treated as one patient sample. The patient stratification is based on a specific rule:
  • High Risk: A patient is classified as High Risk if they have at least one High Risk image.
  • Medium Risk: A patient is classified as Medium Risk if they have more Medium than Low Risk images (or equal).
  • Low Risk: A patient is classified as Low Risk if they have more Low Risk images than Medium.
Using this criterion to obtain the risk labels for each patient, we can compute the distribution of patients per risk class, taking into account the risk class of each of their images. The dataset is composed by 946 patients divided into risk classes: 428 Low Risk, 383 Medium Risk and 135 Low Risk.
Before splitting, each patient receives a single label based on this aggregation rule. Then, patients are divided into three different sets: 70% for the training set, 15% for the validation and 15% for the test set, with stratification performed by patient, which prevents the same patient’s images from appearing in multiple sets. After selecting the patient sets, all images from a given patient are assigned to that patient’s split.

3.4. Generative AI Data Labeling

The proposed methodology applies Generative AI for dataset labeling to improve the annotation process for diabetic foot images by developing a pipeline that automates this process. Automated labeling with large language models, like GPT, uses their pre-trained knowledge and their multi-modal capabilities, meaning their capacity to analyze both images and text, to interpret data and contextualize clinical features. GenAI enables the automation of the annotation process, offering a cost–benefit method and providing scalability [23], as once the prompts are established, a large number of images can be annotated without the need for manual inspection.
An essential step to make GenAI effective for dataset annotation is to formulate the right prompt for our task, a practice known as prompt engineering [24]. A well-designed prompt must provide clear and concise instructions that precisely describe the task [23] and guide the model toward consistent responses and outputs. This can be seen as an iterative process, as the request can be refined if the output is not clear or consistent with the expectations. Over time, the goal is to build a complete and polished prompt that reliably generates high-quality and consistent labels, minimizing the risk for manual correction.
Using a multimodal GenAI model, specifically GPT, we are able to annotate a dataset with labels, indicating the risk of ulcer formation or evolution to a more severe state for a specific image. The labeled dataset is then used to train the models to predict the risk of progression into more severe stages. For this labeling process, an automated pipeline was developed to automatically label each image of the dataset using the OpenAI GPT-4o-mini model.
The pipeline is designed to emulate the reasoning process of a medical assistant specializing in diabetic foot risk assessment, assigning a risk label (Low Risk, Medium Risk or High Risk) to each individual image, along with explanatory evidence and key findings. Rather than labeling entire patients directly, the system processes images individually, as the patient labels are later attributed by aggregating the individual image risk labels and predictions according to predefined criteria. Figure 3 shows samples of each risk class, assigned by GPT according to the visual features observed and described in the prompt used in this work (see Appendix A).
An important part of this task is building a prompt capable of guiding the AI model (GPT) to perform a specific task [25]. Optimizing the prompt is essential to improve the performance of the model [23,26,27], and, in general, will require multiple iterations. In the field of medical image classification, the use of large language models (LLMs), like GPT, has shown great promise [26], because of their ability to learn from textual contexts and multi-modal abilities. The AI model assigns one of three labels: Low Risk, Medium Risk or High Risk, based on visible clinical features and characteristics of the patient’s foot. The images added from the Kaggle dataset were labeled with GPT.
GPT labeling can, occasionally, present inconsistencies as when interpreting subtle features in Low Risk and Medium Risk images similarly, leading to ambiguity between the two classes. In practice, this means that Low and Medium risk images show similar visual signs, and GPT can not be entirely accurate when labeling these types of images. While such misclassifications are difficult to eliminate completely, they highlight the importance of careful interpretation of the results and the need for expert-verified annotations in future work.

3.5. Comparison with Expert Annotations

The clinical impact of errors made by automated systems can be huge, and errors are, generally, unacceptable. Indicators such as sensitivity, i.e., true positive rate, and specificity, i.e., the true negative rate, are often used to compare the performance of human and machine learning systems. These, however, can be biased by the opinions of the human experts themselves, which can be wrong. This is particularly relevant for labeling systems like the one used in this work, with only three labels and non-rigid boundaries separating them.
Still, given the variability introduced by prompt modifications, it is important to compare automated labels with those provided by medical experts. To evaluate the reliability of GPT-generated annotations, we compared them against a subset of 87 patients annotated by medical experts. This subset represents a smaller portion of the dataset but provides a valuable reference to evaluate whether GPT can assign risk labels consistently.
Figure 4 shows the comparison between GPT and human labels. It is important to note that the training of the networks was made exclusively using GPT-generated labels, i.e., all the images used for training were labeled using GPT. The distribution plot highlights that GPT produced more Medium Risk and High Risk classifications compared to medical annotations, which are more toward Low Risk. The confusion matrix shows how the GPT predictions mostly aligned with the human annotations.
Across the 87 patients that could be compared, GPT achieved an agreement rate of 80.5% with the medical labels, which corresponds to 70 patients matched, while 17 showed disagreements. These 87 patient records were defined by multiple annotators, i.e., each record was defined by a single annotator, but different records can be defined by different annotators.
A closer inspection of the disagreements shows two main types:
  • Moderate disagreements (9 cases): Occurred when GPT shifted a patient’s label by one class, for example, Low to Medium or Medium to High. Those errors can be explained by cases where visual features may be similar, like mild dryness being interpreted as either Low or Medium Risk.
  • Severe disagreements (8 cases): Involves contradictions, such as GPT labeling a patient as High Risk when experts considered Low Risk, or vice-versa. These errors are more critical and can impact the system’s performance. These cases can be linked to GPT misinterpretations of visual signs.
Despite these discrepancies, the results show that GPT can serve as a useful annotation tool, but its results have to be carefully interpreted and checked. Overall, while GPT annotations are not a replacement for human expert labeling, they provide a foundation for dataset preparation and model training, especially when medical resources are limited.

3.6. Models Structure

Two different pre-trained models, ResNet50 and VGG16, are used and trained to classify diabetic foot images into three risk categories: Low Risk, Medium Risk and High Risk. Both models are pre-trained on ImageNet and fine-tuned for the specific task of diabetic foot risk evaluation.
Pre-trained ResNet50 and VGG16 models from TensorFlow Keras, both initialized with ImageNet weights, were used. They are loaded with include_top=false, so we keep only the convolutional feature extractor and discard the original ImageNet classifier.
The original final classification layers of these pre-trained models are removed and replaced with a custom classification head designed for our task. This approach was chosen to achieve a balance between retaining the knowledge and feature detection learned from ImageNet and adapting it to specialized knowledge adapted to our dataset. The remaining backbone layers, which contain valuable feature extractors learned from ImageNet, are initially frozen to preserve their learned representations.
Training happens in two steps to carefully adapt to the medical images: Head Training (8 epochs), in which we freeze the backbone (its weights do not change) and train only the custom head. This lets the head learn our three classes quickly while preserving the useful features learned from ImageNet. Then, there is Fine-Tuning (15 epochs), in which the top 50% of the backbone layers are unfrozen, and training is continued using a smaller learning rate.
During the first stage, we froze the pre-trained backbone network (ResNet50 or VGG16) and trained only a custom head consisting of dense layers with dropout and batch normalization, allowing the model to learn task-specific representations while preserving the valuable low-level features learned on ImageNet. This initial phase enables the network to adapt its final decision making layers to the specific characteristics of our dataset without disrupting the feature extraction capabilities of the pre-trained weights [28].
Following the head training phase, a fine-tuning phase is implemented by unfreezing the top 50% of the backbone layers and continuing training with a reduced learning rate to minimize the risk of overfitting [28], which can potentially achieve improvements by adapting the pre-trained features to the new imaging data [29].
The custom head architecture uses multiple dense layers with progressively decreasing dimensions (512, 256 and 128 neurons). A Global Average Pooling is first applied, reducing each feature map down to just one value. This is followed by a stack of fully connected dense layers with batch normalization and dropout to reduce overfitting, and finished with a softmax layer with three outputs.

3.7. Training Parameters

A sparse categorical cross-entropy is used as a loss function—see, for instance, [30]. This function is designed for multi-class classification problems where we have more than two classes (in this case we have three), where each example belongs to one class, and the labels are integers (0,1,2) rather than one-hot encoded vectors. To deal with class imbalance, we computed class weights and then apply small boosts: Low × 1.1, Medium × 1.2, and High × 4.0, followed by normalization. This weighting was determined empirically with the underlying goal of ensuring that the model prioritizes High Risk detection, as it is the class with fewer samples. As the dataset imbalance is reduced, these weights can be adjusted.
The Adam optimizer is used with a learning rate of 5 × 10 4 during head training and 5 × 10 5 during fine-tuning. Validation loss is monitored with early stopping and uses ReduceLROnPlateau. The main parameters used in the development of this study are presented in the Table 2.

4. Results

The evaluation was conducted on the test set, which was not used during training or validation and therefore provides a reliable measure of the models’ performance in realistic scenarios. Both models were trained under the same conditions and evaluated for performance on predicting risk labels for images and then for patients, based on the labeling aggregation criteria:
  • Image evaluation: Each foot image is treated as an independent input.
  • Patient evaluation: Predictions from multiple images belonging to the same patient are aggregated into a single prediction, using a worst-case rule: if at least one image is classified as High Risk, the patient is labeled as High Risk. If not, but Medium Risk images are more frequent than Low Risk, the patient is labeled as Medium Risk. Otherwise, the patient is classified as Low Risk.
The results are reported for the test set, using precision, recall and F1-score per class, along with overall accuracy, macro averages and weighted averages.

4.1. Performance Comparison

Table 3 presents the results for the two models, trained with techniques to deal with class imbalance.

4.2. Discussion

As shown in Table 3, we can conclude that under the same head and training conditions, ResNet50 and VGG16 achieved similar results for both images and patient risk prediction. In the Medium and Low Risk classes, both models had their strengths and limitations but showed a similar and balanced performance. For the High Risk class, ResNet50 performed better in recall and F1-scores, and both models obtained 100% precision.
After the analysis of both models and their performance, ResNet50 was selected for deployment in the Streamlit Application, as it was superior at detecting High Risk cases.

5. A Streamlit App

To demonstrate the practical applicability of the developed model, a prototype App was built in Python 3.13 using Streamlit framework (snapshots are shown in Figure 5 and Figure 6). The App provides an easy and user-friendly interface for medical professionals or researchers to upload foot images of diabetic patients and automatically obtain a risk classification (the App is still in R&D domain and has not yet been submitted to any regulatory/certification entity).
The App classifies individual images and also aggregates label predictions across multiple images from the same patient to provide a single-patient risk prediction, applying the logic presented in the previous sections.
To improve the interpretability of the results, the App integrates Grad-CAM visualizations that highlight the regions of the images that most influenced the model’s predictions, as illustrated in Figure 6.
In this App, the user uploads images of diabetic foot patients, and it gives the risk label for each image, along with confidence scores for all the risk classes, for the user to understand how sure the model is about its predictions. Based on each individual image label, the patient is labeled, taking into account the criteria explained previously. Besides this, a Grad-CAM heatmap is shown next to the images, highlighting the areas of the image that the model primarily relied on for its decision. This addition makes it easier for the medical professionals to verify if the model is focusing on relevant areas such as ulcers and regions of dry skin. Also, it improves the trust in the model decision-making process, because we can validate the predictions and check if they make sense or not.

6. Conclusions

The results show that, despite limitations, labels generated by GPT provide a good baseline for model training, allowing an overall good performance in the predictions of the risk classes, particularly for the High Risk cases, and showing the potential of the generative AI approach. Moreover, a tool like the Streamlit App developed may work as an aid tool to challenge/tune the skills of healthcare professionals.
The presence of irrelevant or low-quality images and severe imbalance in the dataset, particularly for High Risk cases, is a consequence of the DF incidence in a real population. As the size of the dataset increases and the GenAI prompt is upgraded, re-training the models is likely to yield better results.
Automating DF risk assessment does not aim at replacing healthcare professionals. The currently employed DF tests have a degree of subjectivity, either intrinsic to each test or inherent to the human assessment (for example, the pedal pulse test using Eco Doppler sensors depends on the experience of the professional handling the sensor). As referred to in this paper, visual analysis can also be biased by subjective factors depending on the human experience. Automated systems, such as the one proposed in the paper, may play an important role as assistants to healthcare professionals or first-time diagnostic systems.

Author Contributions

Conceptualization, software, investigation, original manuscript preparation, A.N.; conceptualization, data curation, review and editing, supervision, project administration, funding acquisition, J.S.S. All authors have read and agreed to the published version of the manuscript.

Funding

This work was funded by project DFAA-2023.12465.PEX, from Fundação para a Ciência e Tecnologia, Portugal.

Institutional Review Board Statement

As shown in the referenced report, the evaluation of Diabetic Foot at local health centres of the Portuguese National Health System is part of the Portuguese National Diabetes Program (PND), which has been implemented for several years. The most recent legislation, issued by the Portuguese Health Ministry on 17 March 2025 (Despacho No. 3390/2025), clearly assigns diabetes prevention tasks to local health units (ULS). The data used in the manuscript submitted to Diabetology were acquired specifically at the Unidade Local de Saúde de Loures-Odivelas (ULSLOD) in the Lisbon area, which is actively collaborating with the DFAA project, with its physicians serving as active members of the project team. Furthermore, the acquisition of foot images to assess Diabetic Foot is consistent with the duties of public health specialists as stated, for example, in determinations 17, 18, and 27 of the aforementioned legislation. Therefore, the acquisition of images by health specialists falls entirely within their professional attributions, and neither ethical committee approval nor patient consent is required.

Informed Consent Statement

Informed consent was not necessary, as the image data was acquired at a local healthcare unit of the Portuguese Health System (SNS), by MDs working within SNS, under the National Programme for Diabetes (PND), for which the most recent national supporting legislation is “Diário da República, n° 53, 2a série, Despacho 3390/2025, de 17 de Março de 2025” (available online). Moreover, the data was anonymized at the time of acquisition.

Data Availability Statement

The dataset used is available upon reasonable request to the corresponding author.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
CNNConvolutional Neural Network.
Grad-CAMGradient-weighted Class Activation Mapping.
DFDiabetic Foot.
DFUDiabetic Foot Ulcer.
LSTMLong Short-Term Memory.
GenAIGenerative AI.

Appendix A. GPT PROMPT

  • ROLE:
    • You are an expert AI medical diagnostician specializing in podiatry and diabetology, with a focus on the early detection and risk assessment of Diabetic Foot Ulcers (DFU). Your evaluations must be systematic, clinically rigorous, and based on established medical guidelines.
  • OBJECTIVE:
    • Given a set of images of a single patient’s feet, your task is to analyze all visible features and assign a precise, evidence-based risk label (“Low Risk”, “Medium Risk”, or “High Risk”) for the likelihood of developing a diabetic foot ulcer or evolving into a more severe condition. Accompany your label with a clear, concise, structured explanation.
  • CONTEXT:
    • DFU are a serious complication of diabetes, often preceded by visible clinical signs. Early identification of these signs is critical for prevention. You are to perform a thorough visual assessment, identifying and weighing all relevant risk factors to produce a holistic risk evaluation.
  • INPUT:
    • You will receive multiple images of one patient’s feet, showing various angles (soles, tops, sides, heels, between toes). Each folder contains images for a single patient.
  • ANALYSIS FRAMEWORK (MANDATORY):
    • For each patient, follow this stepwise reasoning process:
      • Image Quality & Coverage: Briefly assess the completeness and clarity of the image set.
      • Systematic Feature Review: For each risk category below, note the presence, location, and severity (mild, moderate, severe) of findings:
        -
        Dermatological:
        • Calluses/Hyperkeratosis: Thickness, location (esp. pressure points)
        • Dryness/Anhidrosis: Cracks, flaking, dry skin
        • Erythema: Localized redness (inflammation/pressure)
        • Maceration: Soft, white skin (esp. between toes)
        • Pre-ulcerative Lesions: Blisters, hemorrhages, discoloration
        -
        Neuropathic:
        • Structural Deformities: Charcot foot, bunions, hammertoes, prominent metatarsal heads
        -
        Vascular:
        • Skin Discoloration: Pallor, rubor, cyanosis
        • Hair Loss: Shiny, thin skin, lack of hair on dorsum
        • Edema: Swelling of foot or ankle
        -
        Amputation:
        • Evidence of partial or complete toe/foot amputation (missing toes, missing part of foot, surgical scars)
  • SCORING GUIDE:
    • “Low Risk”: Healthy, intact skin; uniform color; no ulcers; no infection; no major abnormalities; almost no dryness/callus.
    • “Medium Risk”: Mild discoloration/swelling; mild dryness; superficial lesions; shallow wounds; no clear infection.
    • “High Risk”: Open ulcer; severe dryness; infection; amputation; necrosis; major swelling; major deformity.
    • Keep in mind the image quality may sometimes be blurred or show strange angles, so don’t assume perfect visibility of all features. Use your best judgement based on the visible information.
  • EXAMPLES:
    • No lesions, intact skin, uniform color, no swelling → “Low Risk”
    • Mild dryness/flaking, no ulcer, no swelling → “Low Risk”
    • Callus at pressure points, mild deformity, no ulcer → “Low Risk”
    • Thick callus, mild edema, nail dystrophy → “Medium Risk”
    • Shallow wound, dry/fissured skin, mild redness → “Medium Risk”
    • Superficial ulcer, maceration, mild exudate, early infection → “Medium Risk”
    • Large ulcer, purulent discharge, swelling, deepening wound → “High Risk”
    • Deep ulcer, necrosis, extensive erythema/edema → “High Risk”
    • Widespread necrosis/gangrene, severe deformity, multiple wounds → “High Risk”
    • Evidence of prior amputation (missing toe/foot) → “High Risk”
  • OUTPUT FORMAT:
    • Return a single-line JSON object for each patient:
      label : Low Risk | Medium Risk | High Risk , reasoning : Concise ,   structured   explanation   of   how   the   label   was   determined   for   this   patient

References

  1. International Diabetes Federation. Diabetis Facts and Figures. 2024. Available online: https://idf.org/about-diabetes/diabetes-facts-figures/ (accessed on 30 November 2024).
  2. Armstrong, D.; Boulton, A.; Bus, S. Diabetic Foot Ulcers and Their Recurrence. N. Engl. J. Med. 2017, 376, 2367–2375. [Google Scholar] [CrossRef] [Scilit]
  3. Waibel, F.; Uçkay, I.; Soldevila-Boixader, L.; Sydler, C.; Gariani, K. Current Knowledge of Morbidities and Direct Costs Related to Diabetic Foot Disorders: A Literature Review. Front. Endocrinol. 2024, 14, 1323315. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  4. Wang, Z.; Tan, X.; Xue, Y.; Xiao, C.; Yue, K.; Lin, K.; Wang, C.; Zhou, Q.; Zhang, J. Smart Diabetic Foot Ulcer Scoring System. Sci. Rep. 2024, 14, 11588. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  5. University of Michigan Health. Diabetic Foot Ulcer. 2025. Available online: https://www.uofmhealth.org/our-care/specialties-services/diabetic-foot-ulcer (accessed on 13 November 2025).
  6. Ahsan, M.; Naz, S.; Ahmad, R.; Ehsan, H.; Sikandar, A. A Deep Learning Approach for Diabetic Foot Ulcer Classification and Recognition. Information 2023, 14, 36. [Google Scholar] [CrossRef] [Scilit]
  7. Maity, S.; Leton, N.; Nayak, N.; Jha, A.; Anand, N.; Thompson, K.; Boothe, D.; Cromer, A.; Garcia, Y.; Al-Islam, A.; et al. A Systematic Review of Diabetic Foot Infections: Pathogenesis, Diagnosis, and Management Strategies. Front. Clin. Diabetes Healthc. 2024, 5, 1393309. [Google Scholar] [CrossRef] [Scilit]
  8. Zhao, W.; Xu, Z.; Wang, A. Epidemiological Characteristics of Diabetic Foot and Affecting Factors for Amputation in China. J. Diabetes Clin. Res. 2021, 3, 78–80. [Google Scholar] [CrossRef] [Scilit]
  9. Vuorlaakso, M.; Kiiski, J.; Salonen, T.; Karppelin, M.; Helminen, M.; Kaartinen, I. Major Amputation Profoundly Increases Mortality in Patients With Diabetic Foot Infection. Front. Surg. 2021, 8, 655902. [Google Scholar] [CrossRef] [Scilit]
  10. Yazdanpanah, L.; Shahbazian, H.; Hesam, S.; Ahmadi, B.; Zamani, A. Two-Year Incidence and Risk Factors of Diabetic Foot Ulcer: Second Phase Report of Ahvaz Diabetic Foot Cohort (ADFC) Study. BMC Endocr. Disord. 2024, 24, 46. [Google Scholar] [CrossRef] [Scilit]
  11. Wang, X.; Yuan, C.; Xu, B.; Yu, Z. Diabetic Foot Ulcers: Classification, Risk Factors and Management. World J. Diabetes 2022, 13, 1049–1065. [Google Scholar] [CrossRef] [Scilit]
  12. University of Maryland School of Medicine. People with Diabetes Who Live in Rural Areas More Likely to Develop Complications of the Disease. UM School of Medicine Study Finds. 2024. Available online: https://www.medschool.umaryland.edu/news/2024/people-with-diabetes-who-live-in-rural-areas-more-likely-to-develop-complications-of-the-disease-um-school-of-medicine-study-finds.html (accessed on 30 January 2025).
  13. Alkhalefah, S.; AlTuraiki, I.; Altwaijry, N. Advancing Diabetic Foot Ulcer Care: AI and Generative AI Approaches for Classification, Prediction, Segmentation, and Detection. Healthcare 2025, 13, 648. [Google Scholar] [CrossRef] [Scilit]
  14. Almufadi, N.; Alhasson, F. Classification of Diabetic Foot Ulcers from Images Using Machine Learning Approach. Diagnostics 2024, 14, 1807. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  15. Selvaraju, R.; Cogswell, M.; Das, A.; Vedantam, R.; Parikh, D.; Batra, D. Grad-CAM: Visual Explanations from Deep Networks via Gradient-based Localization. In Proceedings of the 2017 IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017. [Google Scholar]
  16. Sarmun, R.; Chowdhury, M.; Murugappan, M.; Aqel, A.; Ezzuddin, M.; Rahman, S.; Khandakar, A.; Akter, S.; Alfkey, R.; Hasan, A. Diabetic Foot Ulcer Detection: Combining Deep Learning Models for Improved Localization. Cogn. Comput. 2024, 16, 1413–1431. [Google Scholar] [CrossRef] [Scilit]
  17. Biswas, S.; Mostafiz, R.; Paul, B.K.; Mohi Uddin, K.M.; Rahman, M.M.; Shariful, F. DFU_MultiNet: A Deep Neural Network Approach for Detecting Diabetic Foot Ulcers through Multi-Scale Feature Fusion Using the DFU Dataset. Intell.-Based Med. 2023, 8, 100128. [Google Scholar] [CrossRef] [Scilit]
  18. Prieto, G. The Use of Machine Learning Techniques for Monitoring the Evolution of Diabetic Foot. Master’s Thesis, Instituto Superior Técnico, Lisbon, Portugal, 2023. [Google Scholar]
  19. Cassidy, B.; Yap, M.; Pappachan, J.; Ahmad, N.; Haycocks, S.; O’Shea, C.; Fernandez, C.; Chacko, E.; Jacob, K.; Reev, N. Artificial intelligence for automated detection of diabetic foot ulcers: A real-world proof-of-concept clinical evaluation. Diabetes Res. Clin. Pract. 2023, 205, 110951. [Google Scholar] [CrossRef] [Scilit]
  20. Lin, P.; Li, T.; Huang, T.; Hsu, Y.; Ho, W.; Xu, J.; Hsieh, C.; Jhang, Z. Machine learning for diabetic foot care: Accuracy trends and emerging directions in healthcare AI. Front. Public Health 2025, 13, 1613946. [Google Scholar] [CrossRef] [Scilit]
  21. Usha, S.G.A.; Maheswari, P.U.; Dharshini, S.; Hemaroopa, B.; Nikila, S.; Angela, M. Automated Diabetic Foot Ulcer Detection using Hybrid Short Term Memory Architecture. In Proceedings of the International Conference on Visual Analytics and Data Visualization (ICVADV-2025), Tirunelveli, India, 4–6 March 2025. [Google Scholar] [CrossRef] [Scilit]
  22. Kaggle. Kaggle Dataset—Diabetic Foot Ulcer (DFU). 2025. Available online: https://www.kaggle.com/datasets/laithjj/diabetic-foot-ulcer-dfu (accessed on 27 August 2025).
  23. Vujinović, A.; Luburić, N.; Slivka, J.; Kovačević, A. Using ChatGPT to Annotate a Dataset: A Case Study in Intelligent Tutoring Systems. Mach. Learn. Appl. 2024, 16, 100557. [Google Scholar] [CrossRef] [Scilit]
  24. OpenAI. Prompt Engineering—OpenAI API. 2025. Available online: https://platform.openai.com (accessed on 30 January 2025).
  25. Chen, R.; Xiong, T.; Wu, Y.; Liu, G.; Hu, Z.; Chen, L.; Chen, Y.; Liu, C.; Huang, H. GPT-4 Vision on Medical Image Classification—A Case Study on COVID-19 Dataset. arXiv 2023, arXiv:2310.18498. [Google Scholar] [CrossRef] [Scilit]
  26. Wang, J.; Shi, E.; Yu, S.; Wu, Z.; Ma, C.; Dai, H.; Yang, Q.; Kang, Y.; Wu, J.; Hu, H.; et al. Prompt Engineering for Healthcare: Methodologies and Applications. arXiv 2024, arXiv:2304.14670. [Google Scholar] [CrossRef] [Scilit]
  27. Sahoo, P.; Singh, A.K.; Saha, S.; Jain, V.; Mondal, S.; Chadha, A. A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applications [Preprint]. arXiv 2025, arXiv:2402.07927. [Google Scholar] [CrossRef] [Scilit]
  28. Jahanian, M.; Karimi, A.; Eraghi, N.; Zarafshan, F. MedTransCluster: Transfer Learning for Deep Medical Image Clustering. Intell.-Based Med. 2024, 9, 100139. [Google Scholar] [CrossRef] [Scilit]
  29. Team Keras. Keras Documentation: Transfer Learning & Fine-Tuning. 2025. Available online: https://keras.io/guides/transfer_learning/ (accessed on 1 June 2025).
  30. Li, C.; Liu, K.; Liu, S. A Survey of Loss Functions in Deep Learning. Mathematics 2025, 13, 2417. [Google Scholar] [CrossRef] [Scilit]
Figure 1. Workflow of the proposed methodology.
Figure 1. Workflow of the proposed methodology.
Diabetology 07 00095 g001
Figure 2. Set of images from a single foot of the same patient.
Figure 2. Set of images from a single foot of the same patient.
Diabetology 07 00095 g002
Figure 3. Samples from each risk class after labeling using GPT.
Figure 3. Samples from each risk class after labeling using GPT.
Diabetology 07 00095 g003
Figure 4. Comparison between GPT-generated labels and medical expert annotations for 87 patients.
Figure 4. Comparison between GPT-generated labels and medical expert annotations for 87 patients.
Diabetology 07 00095 g004
Figure 5. Homescreen of the Streamlit App.
Figure 5. Homescreen of the Streamlit App.
Diabetology 07 00095 g005
Figure 6. Example of a prediction in the Streamlit App.
Figure 6. Example of a prediction in the Streamlit App.
Diabetology 07 00095 g006
Table 1. Number of images per risk category before and after adding Kaggle images.
Table 1. Number of images per risk category before and after adding Kaggle images.
Risk CategoryWithout KaggleWith Kaggle
Low Risk18071807
Medium Risk12941294
High Risk77154
Total31783255
Table 2. Main parameters of the model training pipeline.
Table 2. Main parameters of the model training pipeline.
Dataset
Image size: 224 × 224 pixels
Classes: 3 (Low, Medium, High Risk)
Data split: 70% Train, 15% Validation, 15% Test
Training Setup
Batch size: 32
Head training epochs: 8
Fine-tuning epochs: 15
Learning rates: 5 × 10 4 (head), 5 × 10 5 (fine-tune)
Architecture
Base models: ResNet50, VGG16
Classification head: 512 → 256 → 128 → 3
Unfreeze ratio: 50% of top layers
Regularization
Dropout rates: 0.6, 0.4, 0.3 (progressive)
L2 regularization: λ = 0.001
Early stopping: 5 epochs patience
Class Balancing and Augmentation
Loss function: Sparse Categorical Crossentropy
Weighted loss: Loss i = w y i ( log p i , y i )
Class weights: w y i applied to emphasize minority (High Risk) samples
Oversampling: High Risk × 10
Conservative augmentation: rotation ±4.6°, zoom [0.85, 1.15]
Aggressive (High Risk): rotation ±8.6°, enhanced contrast/brightness
Table 3. Models’ performance comparison (most significant values in bold font).
Table 3. Models’ performance comparison (most significant values in bold font).
MetricResNet50VGG16
ImagesPatientsImagesPatients
Overall Performance
Accuracy75.05%72.54%75.48% 75.35%
Macro F1-Score79.35% 76.95%77.60%77.83%
Weighted F1-Score75.32%72.57%75.68% 75.55%
Low Risk Performance
Precision83.64%79.17%80.82%77.59%
Recall70.50%59.38%75.86%70.31%
F1-Score76.51%67.86%78.26%73.77%
Medium Risk Performance
Precision65.09%62.34%67.46%68.12%
Recall80.75%82.76%75.40%81.03%
F1-Score72.08%71.11%71.21%74.02%
High Risk Performance
Precision100% (All Models)
Recall80.95% 85.00% 71.43%75.00%
F1-Score89.47% 91.89% 83.33%85.71%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Nobre, A.; Sequeira, J.S. Monitoring Diabetic Foot Using Images and Generative AI. Diabetology 2026, 7, 95. https://doi.org/10.3390/diabetology7050095

AMA Style

Nobre A, Sequeira JS. Monitoring Diabetic Foot Using Images and Generative AI. Diabetology. 2026; 7(5):95. https://doi.org/10.3390/diabetology7050095

Chicago/Turabian Style

Nobre, Afonso, and João Silva Sequeira. 2026. "Monitoring Diabetic Foot Using Images and Generative AI" Diabetology 7, no. 5: 95. https://doi.org/10.3390/diabetology7050095

APA Style

Nobre, A., & Sequeira, J. S. (2026). Monitoring Diabetic Foot Using Images and Generative AI. Diabetology, 7(5), 95. https://doi.org/10.3390/diabetology7050095

Article Metrics

Back to TopTop