Abstract
The most serious complication of diabetes, Diabetic Foot Ulcer (DFU), can result in chronic infection, damage to tissues, and even amputation if not identified in a timely way. It is even more dangerous for disabled people. Accurate and timely diagnosis is therefore essential for improved patient outcomes. However, it is difficult to perform a manual assessment of DFU images due to variations in the textures of ulcers, light effects, and severities. Herein is presented an enhanced deep learning framework DenseNet121 with Variational Autoencoder and Contrastive Learning (DenseVAE-CL) which incorporates DenseNet121 to extract robust features and integrates a Variational Autoencoder together with Contrastive Learning to enhance representation discrimination. The model was trained and tested on 2,673 publicly available images from the Kaggle DFU dataset, which was divided into training, validation, and testing subsets in a ratio of 80:10:10, respectively. DenseVAE-CL emerged as the best performer with an accuracy of 99.6%, precision of 99.5%, recall of 99.4%, specificity of 100%, sensitivity of 98.9%, an F1-score of 99.5%, and 0.99 Area Under the Receiver Operating Characteristic Curve (AUC-ROC). Five-fold cross-validation further demonstrated stable generalization with a mean accuracy of 99.4 ± 0.2%. Moreover, calibration analysis confirmed the model’s reliability since a mean confidence of 0.9031 for abnormal cases and 0.9692 for normal cases results in an expected calibration error of 0.0457. Visualization through Grad-CAM and VAE residual heatmaps revealed sharp localization of ulcer regions, hence improving interpretability.