I. Introduction
Diabetic foot ulcer (DFU) is a complex and severe complication of uncontrolled diabetes, often beginning as a minor wound or ulcer on the lower extremities. The early stages of DFU frequently present without obvious symptoms, allowing the condition to progress unchecked into chronic, non-healing wounds. If not properly managed, DFU can result in severe infections, hospitalizations, amputations, and elevated mortality rates [
1]. Continuous monitoring is required to assess whether the wound is healing or deteriorating. However, in many developing countries—particularly in South Asia and India, where the burden of diabetes and its complications is rising rapidly—regular monitoring by healthcare professionals is often neither economically feasible nor logistically practical [
2].
In India, estimates indicate that 25% of individuals with diabetes develop DFU, 50% of these cases require hospitalization, and 20% of hospitalized cases ultimately lead to amputation [
3]. The financial impact on patients is considerable, with treatment costs exceeding several years of income for many families [
2]. These challenges emphasize the urgent need for scalable, cost-effective strategies that enable early screening, self-monitoring, and continuity of care at the primary care level.
Artificial intelligence (AI) provides a promising approach to overcoming these challenges [
4,
5]. By integrating AI-enabled tools into patient care, individuals with DFU can monitor their wounds at home. Such tools can detect and grade ulcers according to severity, delivering real-time insights to guide decision-making. For instance, an AI-powered application could flag worsening conditions and recommend timely medical attention, thereby preventing severe outcomes such as amputations [
6]. Furthermore, these tools can help reduce the strain on already overburdened healthcare systems in resource-constrained regions.
The aim of this study is to develop and validate a deep learning algorithm capable of accurately detecting and grading diabetic foot ulcers. This initiative seeks to establish the foundation for a user-focused application that will enable patients to self-monitor their ulcers and maintain continuity of care at the primary level. By equipping patients and caregivers with accessible technology, this approach aims to bridge the gap between healthcare providers and patients, thereby improving DFU outcomes in resource-limited settings.
II. Methods
1. Datasets
The data for this study were acquired in two phases: Phase 1 (open-source data obtained from public repositories such as Kaggle), and Phase 2 (anonymized images of diabetic foot ulcers collected from two clinics in South India) [
7].
All images were in .jpeg format. In Phase 1, a Kaggle dataset of 434 images was downloaded and examined. This dataset originated from a Kaggle competition designed to train AI models to classify ulcers versus non-ulcers based on clinical foot images. Author (S.S.) screened each image and labeled tissue surfaces according to the International Working Group on the Diabetic Foot (IWGDF) 2019 classification [
8]: grade 1—small, shallow ulcer(s) on the distal leg or foot with no exposed bone; grade 2—deeper ulcer with exposed bone, joint, or tendon; grade 3—extensive, deep ulcer involving the forefoot and/or midfoot, or full-thickness heel ulcer; grade 0—apparently healthy (no ulcer). From this dataset, 347 images were manually labeled across grades 0–3 (
Figure 1). The labeled images were split into a 70:30 ratio, with 70% used for training and 30% reserved for validating the initial training performance of the algorithm.
Phase 2 comprised 60 anonymized images obtained from two clinics in South India. These images were pre-labeled by practitioners, and the labels were subsequently verified by author (S.S.). These 60 images were used to validate the developed algorithm. In total, 407 images were obtained and processed for this study, with 70% allocated for training, 15% for validation, and 15% for testing.
2. Data Augmentation Process
Because the study dataset contained only 407 clinical images, geometric transformations were applied to expand it. These included random horizontal flips, random resized crops, random rotations (up to 20°), and random color jitter. The Torchvision module in Python was used to implement these augmentations [
9]. The augmented images were labeled consistently with the originals and combined into a balanced dataset with their corresponding labels.
After augmentation, the dataset comprised 612 images. These were divided into 428 (70%) for training, 93 (15%) for testing, and 91 (15%) for validation. The data were split using random assignment, and a data loader was developed to handle batching, shuffling, and parallel loading during model training. The final dataset contained 612 images stratified across the four DFU grades defined by the IWGDF 2019 classification: grade 0 (healthy) 142 images; grade 1 (mild) 156 images; grade 2 (moderate) 158 images; and grade 3 (severe) 156 images. This balanced distribution was achieved by stratified augmentation of the original 407-image dataset, which included 347 Kaggle images and 60 clinical images with an initially imbalanced grade distribution. Augmentation was performed before data splitting. Although this ensured balance across all DFU grades, it may have introduced augmented variants into the validation and test sets.
The original dataset of 407 images showed moderate class imbalance, with grade 3 (severe) cases comprising approximately 32% of the data and grade 1 (mild) cases only 21%. To correct this, stratified data augmentation was applied, with underrepresented grades, particularly grade 1, augmented more intensively using geometric and color-based transformations. This yielded a balanced dataset of 612 images with an approximately equal distribution across all grades. Consequently, additional rebalancing methods such as class weighting or resampling were not required.
3. Model Training
Model training was conducted using the balanced dataset. Several architectures were evaluated, including EfficientNetb0, DenseNet121, ResNet_50, MobileNet_V2, VGG16, and ViT_b_16 [
10–
15]. Among these, MobileNet_V2 produced the best performance. Models were trained to classify DFU images into four categories according to the IWGDF guidelines: grade 0 (healthy skin), grade 1 (mild risk), grade 2 (moderate risk), and grade 3 (high risk). Precision, recall, and F1-scores were calculated for all grades. Results were reported as overall training, validation, and testing accuracy, as well as grade-specific accuracy for classification from grade 0 to grade 3.
III. Results
For Phase 1, we evaluated five convolutional neural network (CNN)-based models (VGG16, ResNet_50, MobileNet_V2, DenseNet121, and EfficientNet-b0), one Transformer-based model (ViT_b_16), and a TensorFlow-based Sequential Mobile model as the baseline [
16]. Among the seven models trained and validated, MobileNet_V2 achieved the highest validation accuracy of 82%, followed by DenseNet121 at 79% and ResNet_50 at 70%.
Table 1 provides detailed results on the training and validation accuracy of all seven models.
The top three models were further tested on the independent test dataset. MobileNet_V2 achieved a testing accuracy of 0.80 with an F1-score of 0.79, DenseNet121 yielded 0.72 (F1-score 0.73), and ResNet_50 achieved 0.69 (F1-score 0.70). Based on these results, MobileNet_V2 was selected as the best-performing model for the algorithm.
Table 2 summarizes the precision, recall, and F1-scores for each of the four classification grades.
The training and validation metrics over multiple epochs are illustrated in
Figure 2. The loss curves demonstrated a steady decrease in both training and validation losses, reflecting effective learning and improved predictive capability. The training loss declined more rapidly than the validation loss, which was expected since the model was optimized directly on the training data. The relatively small gap between training and validation losses suggests minimal overfitting and good generalization to unseen validation data.
Similarly, the accuracy curves showed consistent improvement across epochs for both training and validation sets. While training accuracy remained slightly higher than validation accuracy, the difference was within acceptable limits, further supporting the model’s ability to generalize effectively. The close alignment of the two curves indicates robust learning and stable performance suitable for deployment on unseen data.
The MobileNet_V2 algorithm was evaluated using confusion matrices (
Figure 3) for the training, validation, and testing datasets, providing insight into classification performance across the four categories: grade 1, grade 2, grade 3, and healthy. Training results demonstrated near-perfect accuracy, with the diagonal dominance of the confusion matrix confirming strong learning of intra-class patterns. However, this very high training accuracy raises the possibility of overfitting.
In the validation set, performance declined moderately, particularly for adjacent ulcer severity grades. Of the grade 2 images, seven were misclassified as grade 1 and five as grade 3, while five grade 3 images were misclassified as grade 2. For grade 1, three samples were predicted as grade 2. These errors highlight the model’s difficulty in distinguishing borderline cases with overlapping clinical features.
The test set revealed similar trends. Among grade 2 cases, five were predicted as grade 1 and three as grade 3. For grade 3, five cases were misclassified as grade 2. Additionally, three grade 1 cases were labeled as grade 2. By contrast, the model achieved high precision for healthy (grade 0) images, correctly classifying 22 of 23 cases in the test set.
The confusion matrices for the validation and test sets revealed that while the model maintained high accuracy for grade 0 (healthy) classification (e.g., 22/23 correct in the test set), performance for adjacent ulcer severity grades was comparatively lower. In the validation set, out of 24 grade 2 cases, seven were misclassified as grade 1 and five as grade 3. Additionally, five grade 3 images were misclassified as grade 2, and three grade 1 images were labeled as grade 2. In the test set, five grade 2 cases were misclassified as grade 1 and three as grade 3, while five grade 3 cases were misclassified as grade 2. These quantitative details reflect the model’s challenge in distinguishing borderline grades where clinical features often overlap. This highlights the model’s difficulty in distinguishing borderline cases, which may be attributed to similarities in feature representation across these classes. However, the model consistently identified the “Healthy” class with high accuracy, demonstrating its ability to effectively recognize distinct patterns for this category
The testing results further evaluated the model’s generalization to unseen data. While the model maintained strong performance for the “Healthy” class, the confusion matrix revealed increased misclassifications among the grades, particularly between grade 1 and grade 2, and grade 3 and grade 2. These findings suggest that the model generalizes reasonably well but faces challenges in differentiating closely related grades. Overall, the results indicate that MobileNet_ V2 provides robust performance for distinct classes but requires further optimization, such as feature engineering or data augmentation, to improve its classification accuracy for borderline cases in a multi-class setting.
IV. Discussion
Global research efforts have focused on developing machine learning algorithms for detecting DFU, with notable progress achieved using datasets such as the DFUC2020 dataset [
17]. This dataset has provided a foundation for understanding DFU morphology and translating clinical features into machine-readable data points. Similarly, the IEEE Data Port Diabetic Foot dataset has made clinical images accessible, facilitating further advancements. Building on these resources, researchers have achieved strong results in ulcer detection. For example, Biswas et al. [
18] reported an F1-score of 99.08% using the FusionNet model, while Thotad et al. [
19] achieved 98% with EfficientNet applied to 844 DFU images. More recently, Sarmun et al. [
20] employed a combination of YOLOv8m and FRCNN-ResNet101 models, achieving an F1-score of 81.1%. Collectively, these studies underscore the potential of machine learning in DFU detection and classification [
18–
23].
A key limitation of the present study is the relatively small dataset, consisting of 407 original images expanded to 612 after augmentation. Deep learning models, particularly in multi-class classification tasks, generally require larger datasets to achieve robust feature learning and generalization. For instance, Biswas et al. [
18] trained on over 1,200 labeled DFU images, reporting improved performance due to richer feature representation and clearer class separation. Similarly, Sarmun et al. [
20] used more than 1,000 annotated images with YOLOv8m and FRCNN-ResNet101, demonstrating the benefits of data diversity and scale.
Although our dataset was balanced through augmentation, its limited size may have constrained the model’s ability to distinguish closely related DFU grades. This limitation likely contributed to misclassifications between grades 1 and 2 or grades 2 and 3. To address this, future research should emphasize multi-center image collection and explore synthetic data generation approaches such as generative adversarial networks (GANs) or diffusion models to enrich underrepresented classes. Integrating clinical metadata (e.g., duration of diabetes, comorbidities) could also improve context-aware classification.
Unlike prior work that primarily distinguished ulcer versus non-ulcer, this study targeted ulcer grading across four severity levels. While achieving a comparable F1-score of 79% with MobileNet_V2, the novelty lies in grading rather than binary classification, thereby addressing an unmet need in diabetic foot care. Grading provides a more nuanced understanding of ulcer progression, enhancing self-assessment and clinical decision-making. This distinction represents an important step toward supporting patient self-monitoring and equipping frontline healthcare workers to provide timely, evidence-based care for patients with DFU.
Within the scope of this study, no optimization techniques beyond baseline training were implemented. Standard measures such as data augmentation, dropout, batch normalization, and early stopping were applied, but more advanced approaches, including feature engineering, metadata integration, and ensemble methods, were not explored. A methodological limitation is that augmentation was performed before data splitting, potentially introducing similar transformed variants into both training and validation/test sets, which may have slightly inflated performance metrics.
A critical concern in automated ulcer grading is the risk of underestimating ulcer severity. Misclassifying a higher-grade ulcer as a milder grade could delay appropriate intervention, increasing the risk of infection progression, hospitalization, or amputation. In our study, some grade 2 and 3 ulcers were misclassified as lower grades, highlighting this risk. Future models could address this issue by implementing threshold-tuning strategies that penalize false negatives more heavily during training. In addition, incorporating clinical metadata (e.g., history of recurrence, diabetes duration) and applying uncertainty estimation techniques such as Monte Carlo dropout may help flag ambiguous cases for human review, enhancing clinical safety.
Future work will aim to improve classification accuracy for borderline grades by leveraging clinical metadata (e.g., diabetes duration, wound chronicity), developing uncertainty-aware models, and applying advanced augmentation methods, including GAN-based image synthesis. Ensemble learning and attention-based architectures may also provide improvements in distinguishing subtle inter-grade differences.
Despite its preliminary nature, this study presents a tool with substantial potential for real-world application. It offers frontline healthcare workers a means of assessing ulcer severity, prioritizing patients who require immediate intervention, and facilitating timely referrals for deteriorating conditions. This capability could accelerate clinical decision-making and improve outcomes for recurrent or advanced DFU cases. Cassidy et al. [
17] have highlighted the value of integrating such models into user-centric applications, paving the way for further development in this domain. While Biswas et al. [
18] and Thotad et al. [
19] reported exceptionally high F1-scores of 99.08% and 98%, respectively, their work focused primarily on binary classification tasks (ulcer vs. non-ulcer). In contrast, this study addressed a more complex and clinically nuanced challenge: grading DFUs across four severity levels using the IWGDF classification. Given the increased difficulty of multi-class grading and the limited availability of annotated datasets, our F1-score of 79% is contextually strong, demonstrating the model’s ability to generalize across diverse image sources and ulcer presentations.
In summary, this study developed a machine learning algorithm capable of detecting and classifying diabetic foot images according to ulcer type, depth, and spread. This contribution represents a promising advance toward empowering primary healthcare workers and promoting self-care among individuals at risk of DFU. Future research should refine the model, expand its scope, and integrate it into accessible applications to strengthen diabetic foot care management.