Development of a localization‐based algorithm for the prediction of leg ulcer etiology

Diagnostic work‐up of leg ulcers is time‐ and cost‐intensive. This study aimed at evaluating ulcer location as a diagnostic criterium and providing a diagnostic algorithm to facilitate differential diagnosis.


INTRODUCTION
Ulcers of the lower leg are one of the most common medical problems encountered, accounting for up to 3% of healthcare budgets in developed countries. 1,24][5] The estimated prevalence of 0.18-2% in the overall population increases to 5% in patients over This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.© 2023 The Authors.Journal der Deutschen Dermatologischen Gesellschaft published by John Wiley & Sons Ltd on behalf of Deutsche Dermatologische Gesellschaft.65 years of age. 6Moreover, the incidence of leg ulcers has been rising as a result of an aging population and increased risk factors such as diabetes, obesity, and smoking. 7][10] Risk factors for healing failure include a larger wound area, longer wound duration, and wound infection. 11Moreover, the risk of recurrence is high, particularly in enlarged, deep and therapy-resistant ulcers. 12Hence, the correct therapeutic management is required to prevent recurrences. 13To be able to provide adequate treatment and consequently avoid unnecessary pain and suffering, accurate and rapid diagnostic work-up is crucial. 14,15However, despite the high prevalence of lower leg ulcers, misdiagnosis or delayed diagnosis are common. 16,17ifferential diagnosis includes more than 70 entities. 14ascular etiologies represent the leading cause accounting for approximately 75% of leg ulcers.The majority of these ulcers can be attributed to chronic venous insufficiency, followed by arterial diseases. 7,18,19A mixed ulcer attributed to arterial and venous disease can be found in approximately 20% of patients. 141][22] Further causes include vasculitis, exogenous factors, infections, pyoderma gangrenosum, neoplasia, and drugs. 23iagnostic work-up is time-consuming and costintensive, including duplex ultrasound, arterial measurements, and often biopsy taking. 21,24A tool supporting intial clinical differential diagnosis to enable targeted diagnostic measures and avoid unnecessary investigations could accelerate and facilitate the diagnostic process.We therefore developed a 2D approach for localization mapping of lower leg ulcers. 25Based on this model, we aimed at providing a comprehensive analysis of predilection sites of various types of lower leg ulcers and evaluated ulcer location as the main diagnostic criterium embedded into a multivariate algorithm.Additionally, convolutional neural network analysis was performed based on the photographs of ulcers of different etiologies.

MATERIALS AND METHODS
The study was conducted in compliance with Good Clinical Practices and the Declaration of Helsinki. 26The study protocol was approved by the ethics committee of the Medical University of Vienna (No. 2216-2019).

Patient recruitment
Patients with ulcers of the leg including the foot who presented to the Department of Dermatology at the Medical University of Vienna between January 1998 and October 2019, aged 18 years or older at the time of presentation, with sufficient photographic or clinical documentation were included in the study.Patients suffering from arterial leg ulcers were recruited at the Department of Angiology at the Medical University of Vienna.
Venous leg ulcer was diagnosed, if there was clinically relevant reflux in the ipsilateral leg determined by duplex sonography, which represents the diagnostic gold standard. 24Hemodynamically relevant PAOD was excluded by ABI measurement.Arterial ulcer was diagnosed if hemodynamically relevant PAOD was present.Ultrasound of the arteries or digital subtraction angiography was available in all patients.Clinically relevant venous insufficiency was excluded by duplex ultrasonography.The diagnosis of mixed arterial and venous ulcer was made if there was both clinically relevant reflux of the venous system as determined by duplex sonography and clinically relevant PAOD, verified by duplex sonography of the arteries or digital subtraction angiography, of the ipsilateral leg.The diagnosis of arteriolosclerotic ulcer was made histologically. 21ll patients had long-standing, severe arterial hypertension.Hemodynamically relevant venous insufficiency and PAOD were excluded using duplex sonography and ABI measurement.The diagnosis of vasculitis was also made histologically.

Computational surface rendering
A standardized 2D lower leg model was used for visualization of ulcer localization using the photographic documentation of all patients.The model displayed the entire surface of a lower leg and was divided into twelve sections (Ventral Lateral [VL] 1, VL2, VL3, Dorsal Lateral [DL] 1, DL2, DL3, Ventral Medial [VM] 1, VM2, VM3, Dorsal Medial [DM] 1, DM2, DM3) based on the proportions of the lower leg.Using a computational surface rendering approach, photographically documented ulcerations were integrated into this standardized 2D surface model (Figure 1).

Statistical analysis
Descriptive analysis of the study groups was performed.Results are displayed as mean ± standard deviation, median (interquartile range), or percent (absolute numbers).
To determine the diagnosis based on abundance, location and size of the ulcers a multinomial logistic regression model was fitted.Diagnosis was defined as the dependent variable and age, sex, total number of ulcers, bilateral involvement, occurrence of ulcers in each of the twelve respective areas and the average size of all ulcers were defined as explanatory variables.Estimates were computed using a bias-reducing penalized maximum likelihood approach, 27 since the variables would allow almost perfect F I G U R E 1 Computational surface rendering.(a) A standardized 2D lower leg model was developed.(b) Photographic documentation was used to map the ulcer location on the 2D lower leg model.Abbr.: Mx, medial; Lx, lateral; vM, ventromedial; dM, dorsomedial; vL, ventrolateral; dL, dorsolateral separation between subclasses.Using this model, backwards regression to identify the most important variables was performed.AIC was specified as the information criterion.Venous leg ulcer was always chosen as the reference group when reporting odds ratios.To evaluate how the obtained model performs on unseen data, 5-fold cross validation of the model selection procedure was performed.In each step the same backwards regression algorithm as above was performed on 4/5 of the data and the predictions of the resulting model on the remaining cases were compared to their respective ground truths to obtain overall accuracy and Cohen's Kappa on the validation sets when choosing the most probable diagnosis according to the model.To make sure that each diagnosis is well represented in each of the split, the samples were drawn stratified with regards to diagnosis.Using this cross-validation approach we expected to obtain an unbiased estimator of how the final model will perform on unseen data.Statistical analy-sis was performed using R, version 3.6.1 or higher.Graphics were compiled using GraphPad Prism Version 9.5.1.

Neural network image analysis
To estimate a baseline accuracy of visual analysis of the ulcer alone, a tiny Swin Vision Transformer Model (microsoft/swin-tiny-patch4-window7-224 28 weights from huggingface.co 29) was trained to distinguish between five different diseases based on a single RGB input image.Training was conducted with pytorch (v1.12.0) and huggingface transformers (4.26.1) on a single workstation with four NVIDIA GeForce 1080Ti GPUs.The model was trained for a maximum of 60 epochs, with a learning rate of 5e-5, a linear learning rate scheduler and a warmup-ratio of 0.1, a batch size of 32 and gradient accumulation for four steps.The training was stopped early if the F1 score on the validation set did not improve for ten epochs.Random crops and horizontal flips were used as image augmentations.AdamW was used as an optimizer, and cross entropy, weighted by the inverse class frequencies, as a loss function.Input images were cropped manually to contain only the ulcer and immediate surrounding skin, to avoid shortcut learning by non-ulcer image features.The test-set was split off initially in a random diagnosis-stratified fashion, ensuring none of the patients included in the test-set were present in the training or validation data.The validation data was a further split from the remaining data in the same fashion.Resulting image counts used for the neural network training and evaluation are shown in Supplementary Table S1.

Peripheral arterial occlusive disease
Peripheral arterial occlusive disease was the underlying disease in 56 patients presenting with 199 ulcers.The median age was 74 (13.5) years.The mean number of ulcerations was 3.6.Ulcers occurred bilaterally in 26.8% (15).The most frequent localizations appeared to be on the distal end of the lower extremities.The leading area was VL3 with 21.6% (43) of ulcers reaching into this segment, followed by DM3 with 18.1% (36), DL2 and DL3 with 15.6% (31) of ulcers respectively.The mean size of ulcers was 3.7 cm 2 , (Figure 2b-d).

Mixed arterial and venous ulcer
Mixed arterial and venous etiology could be found in 27 patients presenting with 71 ulcers.The median age was 79 (15) years.The mean number of ulcers amounted to 2.6.Bilateral involvement was found in 37.0% (10) of patients.The most frequent location was VL1 with 45.0% (32) of ulcers reaching into this segment, followed by DL1 with 32.4% (23).The mean size of ulcerations was 6.5 cm 2 , (Figure 2b-d).

Arteriolosclerotic ulcer
Arteriolosclerosis was present in 23 patients with 64 ulcers.The median age was 73 (13) years.The mean number of ulcers amounted to 2.7.Ulcers appeared bilaterally in 43.4% (10) patients.The lateral aspect of the proximal third of the lower leg was the most frequent location with 56.3% (36) of ulcers reaching into DL1 and 37.5% (24) into VL1.The mean size of ulcers was 6.3 cm 2 , (Figure 2b-d).

Vasculitis
Vasculitis was the ulceration cause in 19 patients presenting with 73 ulcers.The median age was 66 (15) years.The mean number of ulcers at the time of presentation was 3.8.Ulcerations were found on both legs in 63.2% (12) of patients.The most frequent locations were DM2 with 24.7% (18) ulcers reaching into this segment, followed by DM1 with 19.2% (14) and VL1 with 17.8% (13).The mean size of ulcers was 3.8 cm 2 , (Figure 2b-d).
The distribution of the ulcer location is visualized in Figure 3 and Figure 4. Additionally, the distribution of mixed arterial and venous ulcer depending on ABI (≥ or < 0.75) is visualized in Supplementary Figure S1.

Multinomial logistic regression model
The multinomial logistic regression model predicting diagnosis was fitted using age, sex, total number of ulcers, bilateral involvement, occurrence of ulcers in each of the twelve respective areas, and the average size of ulcers as the explanatory variables.Venous leg ulcer was always chosen as the reference group when reporting odds ratios.Backwards regression identified age, ulcer count, bilateral involvement, and the locations VM2, VM3, VL1, VL3, DM3, and DL1 as relevant parameters.The results of the multinomial logistic regression model are depicted in Table 1 and Figure 5.
The presented algorithm was implemented as part of an interactive web application to aid in the initial clinical differential diagnosis as seen in Figure 6.

Estimated goodness of the model
Judging by the 5-fold cross-validation of the mode selection procedure, the final model had an estimated accuracy of 0.68 on unseen data.It is estimated that Cohen's Kappa is estimated to be 0.45 when the model is applied on unseen data.

Neural network analysis
On the hold-out test set the model achieved, macroaveraged over all classes, a precision of 0.58, a recall of 0.6, and an accuracy of 0.61.
Venous leg ulcers of the test set were assigned correctly in 53%, in 27% they were misdiagnosed as mixed arterial and venous ulcer.Photographs of arterial ulcers were assigned correctly in 93%, and only 7.1% falsely classified as vasculitis.Mixed arterial and venous ulcers were allocated correctly in 33%, in 67% misdiagnosed as vasculitis.Arteriolosclerotic ulcer of Martorell (ASUM) was diagnosed correctly in 61% and vasculitis in 60%.Scores for each diagnosis in absolute numbers and normalized for the true diagnosis are depicted in the confusion matrices in Figure 7a, b.

DISCUSSION
Lower leg ulcers pose an increasingly relevant health issue associated with significant morbidity, especially if un-or mistreated. 2 To be able to provide adequate treatment and consequently avoid unnecessary pain and suffering, accurate diagnosis is crucial, 14 Evidence on predilection sites of different types of ulcerations, could change diagnostic algorithms and facilitate differential diagnosis.This study provides a comprehensive analysis on the location of various types of lower leg ulcers.The results were integrated into a multinomial logistic regression model to calculate the likelihood of a specific diagnosis depending on ulcer location, age, bilateral involvement, and ulcer count.The model showed an overall satisfactory performance with an estimated accuracy of 0.68 on unseen data.
Chronic venous insufficiency is the leading cause of lower leg ulcers, 7,18 which is also reflected in our study, represent-ing 55% of the presented cases.The localization mapping revealed that most VLUs extended to the medial aspect of the distal third of the lower leg, i.e., the medial malleolar region, which is consistent with previous literature. 30This F I G U R E 4 Quantification of ulcers reaching into segments of the standardized 2D lower leg model.Abbr.: VLU, venous leg ulcer; PAOD, peripheral arterial occlusive disease; Mixed, mixed venous and arterial ulcer; AU, arteriolosclerotic ulcer; VL1, Ventral Lateral 1; VL2, Ventral Lateral 2; VL3, Ventral Lateral 3; DL1, Dorsal Lateral 1; DL2, Dorsal Lateral 2; DL3, Dorsal Lateral 3; VM1, Ventral Medial 1; VM2, Ventral Medial 2; VM3, Ventral Medial 3; DM1, Dorsal Medial 1; DM2, Dorsal Medial 2; DM3, Dorsal Medial 3 area corresponds to the drainage area of the great saphenous vein.The lateral malleolar region representing the drainage area of the small saphenous vein is affected less frequently. 30,31The presence of skin changes typically seen in patients with advanced chronic venous insufficiency, including telangiectasias, purpura jaune d'ocre, and lipodermatosclerosis, might also be indicative for a VLU. 5,24,32mage analysis frequently allocated VLUs to the group of mixed arterial and venous ulcers, which often carry features associated with chronic venous insufficiency.
Arterial ulcers are typically affecting the dorsal aspect of the toes and the shin. 33,34This ulcer entity is often associated with necrosis, cold skin and skin color changes after leg elevation. 5,35The analysis revealed the dorsal aspect of the forefoot including the toes as the most frequent location.Only approximately one third of arterial ulcers extended to the lower leg.Image analysis assigned the majority of arterial ulcers correctly, indicating a distinctive appearance, which might be attributed to the characteristic acral location and necrotic aspects.
Reports describing typical locations of ulcers of mixed origin are limited.Results show that ulcers were mainly located on the ventrolateral aspect of the mid lower leg.
The majority of AU extended into the middle third of the lower leg, thereby exhibiting a very specific location, which has also been reported in a previous study. 25The Achilles tendon has previously also been declared a predilection site. 20However, in the present study only a small part of ulcers (approximately 10%) extended to the area above the Achilles tendon.Ulcers due to cutaneous small vessel vasculitis appeared to be randomly distributed and were markedly smaller in comparison.Consistent with previous literature, patients mostly presented with multiple ulcers and often showed bilateral involvement. 36,379][40][41] However, to our knowledge, they have not been applied to assist in the differential diagnosis of skin ulcers yet.Our results show that whilst it can provide some guidance, its performance indicates it cannot be used as an autonomous diagnostic tool.Also, its accuracy lies below that of structured analysis  of clinical parameters with a multinomial logistic regression which is arguably much easier to apply in practice.The low accuracy of image analysis might be because certain ulcer characteristics, e.g., slough and erythema, are present in any ulcer entity and thus are non-specific.
The limitations of this pilot study include its retrospective design.Moreover, the number of included diagnoses had to be limited due to an insufficient number of cases with photographic documentation regarding other differential diagnosis.Further on, patients presenting with more than one underlying disease entity were not included in the study.Also, the algorithm needs to be validated in a prospective setting.

CONCLUSIONS
This study provides a comprehensive analysis on the location of various types of lower leg ulcers.The presented algorithm including ulcer location, age, bilateral involvement, and ulcer count could serve as the basis for a tool to aid in initial differential diagnosis of leg ulcers.The application could support non-expert health care workers to narrow down potential diagnoses and initiate targeted primary diagnostic work-up.Further studies are necessary to evaluate the feasibility of an application in a clinical setting.

F U N D I N G
Institutional Funding by the Medical University of Vienna, Austrian Science Fund (FWF; P-30615), Medical Scientific Fund of the Mayor of the City of Vienna (MA-GMWF-501912-2019), Vienna Science and Technology Fund (WWTF; LS18-080).

CO N F L I C T O F I N T E R E S T
None.

F I G U R E 2
Ulcer characteristics.(a) Tukey-Box-Plot showing the ABI of legs affected by ulcers; (b) Tukey-Box-Plot showing the ulcer size referring to the largest ulcer of each patient respectively; (c) Patients with ulcers affecting both legs (in percent); (d) Tukey-Box-Plot showing the ulcer count per patient.Abbr.: VLU, venous leg ulcer; PAOD, peripheral arterial occlusive disease; Mixed, mixed venous and arterial ulcer; AU, arteriolosclerotic ulcer

F I G U R E 5
Point estimates and 95% confidence intervals of Odds ratios from the multinomial logistic regression model with VLU as the reference group.Abbr.: PAOD, Peripheral arterial occlusive disease; Mixed, Mixed venous and arterial ulcer; AU, Arteriolosclerotic ulcer

F I G U R E 6
Integration of the multinomial logistic regression model into an application supporting initial differential diagnosis.F I G U R E 7 Neural network analysis.Confusion matrices provide (a) scores for each diagnosis in absolute numbers and (b) normalized for the true diagnosis.TA B L E 1Results of the multinomial logistic regression model.VLU was always chosen as the reference group when reporting odds ratios (95% confidence interval [CI]).