Source-linked AI summary

Does Your Dermatology Classifier Know What It Doesn't Know? Detecting the Long-Tail of Unseen Conditions

Abhijit Guha Roy, Jie Ren, Shekoofeh Azizi, Aaron Loh, Vivek Natarajan, Basil Mustafa, Nick Pawlowski, Jan Freyberg, Yuan Liu, Zach Beaver, Nam Vo, Peggy Bui, Samantha Winter, Patricia MacWilliams, Greg S. Corrado, Umesh Telang, Yun Liu, Taylan Cemgil, Alan Karthikesalingam, Balaji Lakshminarayanan, Jim Winkens

arXiv:2104.03829v1cs.CVcs.LG

TL;DR

Rare dermatological conditions are too infrequent for practical per-condition supervised training, and detecting unseen conditions is a challenging near-OOD problem. The paper proposes hierarchical outlier detection and evaluates it with modern representations and ensembles, reporting gains over baselines and vanilla ensembles.

  • Problem

    Hundreds of rare dermatological conditions make per-condition supervised training prohibitively challenging, while detecting unseen conditions is a harder near-OOD task than dataset shift detection.

    Source: §1 · pp. 1–2
  • Method

    Hierarchical outlier detection assigns multiple abstention classes for training outlier classes and combines fine-grained classification with a coarse inlier-versus-outlier loss.

    Source: §7 · p. 16
  • Results

    HOD adds performance gains over baselines, stronger representations improve OOD detection, and diverse ensembles outperform vanilla ensembles on OOD performance and inlier accuracy.

    Source: §7 · p. 16
  • Takeaways & Limitations

    Reported gains extend across different representation-learning approaches, while diverse ensemble selection improves both OOD performance and inlier accuracy over vanilla ensembles.

    Source: §7 · p. 16

    Because test outlier conditions are mutually exclusive from training outlier conditions, this benchmark may underestimate performance when deployment includes previously seen outlier classes.

    Source: §3.2 · p. 5

Abstract

from arXiv · show

We develop and rigorously evaluate a deep learning based system that can accurately classify skin conditions while detecting rare conditions for which there is not enough data available for training a confident classifier. We frame this task as an out-of-distribution (OOD) detection problem. Our novel approach, hierarchical outlier detection (HOD) assigns multiple abstention classes for each training outlier class and jointly performs a coarse classification of inliers vs. outliers, along with fine-grained classification of the individual classes. We demonstrate the effectiveness of the HOD loss in conjunction with modern representation learning approaches (BiT, SimCLR, MICLe) and explore different ensembling strategies for further improving the results. We perform an extensive subgroup analysis over conditions of varying risk levels and different skin types to investigate how the OOD detection performance changes over each subgroup and demonstrate the gains of our framework in comparison to baselines. Finally, we introduce a cost metric to approximate downstream clinical impact. We use this cost metric to compare the proposed method against a baseline system, thereby making a stronger case for the overall system effectiveness in a real-world deployment scenario.

1. Introduction

Clinical dermatology classifiers face a long tail: common conditions support supervised classification, while many rare conditions are too infrequent for it. This paper frames detection of unseen rare conditions as near-OOD detection and proposes HOD and related evaluation methods.

1. Introduction

  • The dataset’s long tail contains 26 common conditions representing around 80% of cases and hundreds of rarer conditions that are prohibitively difficult to train per condition.The rare conditions account for the remaining 20% of cases.Source: §1 · pp. 1–2
  • The task uses known outlier samples during training to help detect unknown outliers at test time, a challenging near-OOD shift between conditions.Semantic shifts between conditions are more subtle and harder to detect than dataset distribution shifts.Source: §1 · p. 2
  • HOD outperforms existing outlier-exposure techniques for detecting OOD inputs.It assigns multiple abstention classes for training outlier classes and combines fine-grained classification with a coarse inlier-versus-outlier loss.Source: §1 · p. 3
  • The paper introduces a near-OOD benchmarking framework and design choices for proper validation of OOD detection algorithms.Source: §1 · p. 3
  • The authors evaluate HOD with SimCLR, MICLe, and large-scale benchmarks including ImageNet and BiT pre-trained on JFT.They report OOD detection performance gains on those benchmarks.Source: §1 · p. 3
  • The proposed diverse ensemble varies representation learning and objectives, outperforming vanilla ensembles for OOD detection.The authors also analyze how diversity relates to OOD performance.Source: §1 · p. 3
  • A cost-weighted evaluation metric incorporates downstream clinical implications to assess model trust and approximate real-world impact.Source: §1 · p. 3

2. Related Work

The section reviews OOD detection methods and their use in medical imaging, highlighting gaps in evaluating near-OOD dermatology and leveraging known outliers.

2.1. OOD Detection for Deep Learning

  • MSP scores OOD inputs by maximum class probability; outlier exposure adds a training objective to lower that confidence, while abstention-class methods assign OOD data a separate class.Deep ensembles average predictive probabilities across models; combining different hyperparameters or architectures has improved inlier accuracy, but its effect on OOD detection had not been explored.Source: §2.1 · p. 3
  • SimCLR contrastive pre-training has improved near-OOD detection in prior work, with learned representations thought to encourage robust, invariant features.The method draws together embeddings of transformed views of the same image and separates views from different images.Source: §2.1 · p. 3
  • Mahalanobis scoring fits class-conditional Gaussians to inlier activations, while generative methods score test inputs by likelihood and may require substantial training changes and tuning.The section also notes that generic OOD methods are often tested on standard benchmarks, may require extensive inlier data, and need application-specific evaluation; most do not train on outliers.Source: §2.1 · pp. 3–4

2.2. OOD Detection in Medical Imaging

  • Dermatology OOD studies often use dermatoscopic lesion datasets, limiting broader clinical utility and coverage of the many other skin conditions encountered in practice.Those datasets also tend to contain well-lit, magnified images with little background variability.Source: §2.2 · p. 4
  • Detecting previously unseen dermatological conditions is a near-OOD task that remains relatively unexplored, unlike the more commonly studied far-OOD cases.Some existing approaches also require extensive model modifications and careful hyperparameter tuning.Source: §2.2 · p. 4

3. Benchmark Setup and Problem Formulation

The benchmark uses a long-tailed dermatology dataset, separates common inlier conditions from rare outliers, and defines splits that test detection of unseen outlier conditions.

3.1. Dataset Description

  • The development dataset contains 14,427 cases from 17 sites, with up to six consumer-camera RGB images per case and diagnoses aggregated from multiple board-certified dermatologists.Cases with multiple conditions or multiple primary diagnoses were removed.Source: §3.1 · p. 4
  • Contrastive representation learning also uses 271,433 unlabeled images from 114,849 cases and 46,728 patients, collected across 35 sites in Australia and New Zealand.The images primarily come from skin cancer clinics, are skewed toward cancerous conditions, and have no labels.Source: §3.1 · p. 4

3.2. Data Splitting Strategy

  • The benchmark treats the 26 conditions with at least 100 cases as inliers and the remaining 199 conditions as outliers.Inlier and outlier conditions are mutually exclusive.Source: §3.2 · p. 4
  • Inlier samples are split approximately 80/10/10 across training, validation, and test, while outlier conditions are assigned to mutually exclusive splits.Patients do not overlap between the splits, and outlier sample counts, condition counts, and condition heterogeneity are kept similar.Source: §3.2 · p. 5
  • The splits preserve similar distributions of outlier risk categories and Fitzpatrick skin types for subgroup analysis.Risk categories reflect worst-case clinical complications if conditions are left untreated.Source: §3.2 · p. 5
  • The benchmark’s mutually exclusive outlier-condition splits may underestimate real-world OOD performance, where test outlier classes may have appeared during training.The split requirements are presented as generalizable to long-tailed class datasets.Source: §3.2 · p. 5

3.3. Problem Formulation

  • A condition is an inlier when its dataset count reaches the fixed minimum of 100; conditions below that threshold form the outlier set.This partitions both labels and samples into inlier and outlier sets.Source: §3.3 · p. 5
  • The model is trained on inlier and training-outlier data, with hyperparameters selected on validation data, to distinguish test inliers from test outliers.Outlier conditions assigned across the splits are mutually exclusive.Source: §3.3 · p. 5

4. Methods

The methods combine a shared multi-instance image encoder with hierarchical outlier detection, representation learning, and ensemble strategies to classify inlier conditions while detecting outliers. HOD uses fine-grained class predictions alongside coarse inlier-versus-outlier predictions.

4.1. Architectural Details

  • A shared wide ResNet-101 × 3 encoder processes each case’s 1–6 images, averages their features, and sends the result through a 512-dimensional hidden layer to the classification head.ImageNet, BiT, SimCLR, and MICLe are used as encoder pre-training approaches.Source: §4.1 · pp. 5–6, Figure 2 · p. 6

4.2. Hierarchical Outlier Detection Loss

  • HOD sums fine-grained inlier and training-outlier probabilities into coarse predictions, combines fine-grained and coarse-grained losses, and uses the aggregate outlier probability as the test-time OOD score.The individual training-outlier class probabilities are not used at test time.Source: §4.2 · p. 7
  • The HOD loss is argued to reduce outlier heterogeneity within abstention classes and use coarse-grained loss as dynamic label smoothing to improve generalization to unseen outliers.The authors describe its hierarchical loss for OOD detection as, to their knowledge, a first.Source: §4.2 · p. 7

4.3. Representation Learning

  • The representation-learning experiments examine ImageNet pre-training, supervised BiT-L pre-training on JFT, and domain-specific self-supervised contrastive pre-training.The authors investigate whether generic features from these approaches help downstream OOD detection.Source: §4.3 · p. 7, §4.3.1 · p. 8

4.3.1. Big Transfer (BiT) using JFT

  • BiT-L uses a wide ResNet-101 × 3 pre-trained on JFT to test whether substantially more natural-image data improves OOD detection over the ImageNet baseline.Source: §4.3.1 · p. 8

4.3.2. Contrastive Training

  • SimCLR pre-trains on unlabeled dermatology images, while MICLe brings augmented images from the same case closer in feature space for the multi-instance task.Both use the same unlabeled dermatology dataset.Source: §4.3.2 · p. 8

4.4. Representational Diversity in Ensembles

  • The diverse ensemble greedily selects models across representation-learning approaches and objectives, aiming to add diversity beyond randomizing only the final layer of pre-trained models.The selected models are chosen for improved OOD performance on the validation dataset.Source: §4.4 · p. 8

5. Experimental Results

The section evaluates HOD against existing OOD methods, tests representation-learning and loss choices, and compares ensemble strategies for dermatological classification.

5.1. Experimental Settings and Evaluation Metrics

  • Checkpoint selection used validation OOD AUROC; test evaluation reported AUROC, FPR @ 95% TPR, AUPR-in, and inlier accuracy.Higher AUROC and AUPR-in are better; lower FPR @ 95% TPR is better.Source: §5.1 · p. 9

5.2. Comparison of HOD Loss with Existing Methods

  • Reject bucket had the best OOD detection among existing methods, outperforming outlier exposure and methods that trained without outliers.MSP outperformed Mahalanobis by 4 AUROC points; outlier exposure with MSP gained 0.8 points over MSP, and reject bucket gained 2.7 points over outlier exposure.Source: §5.2 · p. 9
  • Multiple abstention classes add 3 AUROC and inlier-accuracy points over reject bucket; λ=0.1 adds 1 AUROC point and cuts FPR @ 95% TPR by 7 points, with inlier accuracy down 1.6 points.The coarse-loss comparison is against multiple abstention classes with λ=0.Source: §5.2 · pp. 9–10
  • Higher λ values degrade both inlier accuracy and OOD detection, so the authors fix λ=0.1 for subsequent experiments.For BiT-L with reject bucket, p(out|x) scored 77% validation AUROC versus 70% for Mahalanobis; the authors attribute the drop to Gaussian under-fitting amid class imbalance.Source: §5.2 · p. 10

5.3. Effect of Different Representation Learning Methods

  • HOD raises AUROC over reject bucket by 2.3 (ImageNet), 3.8 (BiT-L), 1.1 (SimCLR), and 2.1 (MICLe) points, but inlier accuracy falls for all except BiT-L.BiT-L inlier accuracy rises 1.2 points; ImageNet, SimCLR, and MICLe inlier accuracy falls 2.3, 5.3, and 3.7 points, respectively.Source: §5.3 · p. 10
  • BiT-L outperforms ImageNet on inlier accuracy and OOD performance; MICLe has better OOD performance than SimCLR despite similar inlier accuracy.For reject-bucket models, contrastive methods have higher inlier accuracy than natural-image methods, which the authors associate with additional unlabeled dermatology images.Source: §5.3 · pp. 10–11

5.4. Comparison of Ensembling Strategies

  • Ensembling five independently trained models improves both inlier accuracy and OOD detection over the corresponding single-model methods.The models differed by random final-layer initialization and data shuffling.Source: §5.4 · p. 11
  • 83% AUROC, 85.8% AUPR, 76.3% inlier accuracy, and 61.4% FPR @ 95% TPR were achieved by the selected diverse ensemble.It combined three BiT-L + HOD models and two MICLe + HOD models.Source: §5.4 · p. 11

6. Discussion

The discussion examines factors for further improvement and analyzes subgroup performance and clinical implications.

6. Discussion

  • The discussion covers performance by risk level and skin type, alongside a trust analysis of total clinical implications.It also considers factors that may guide further model improvement.Source: §6 · p. 11
  • The authors identify subgroup performance and trust analysis as parts of their downstream assessment of the final model.Source: §6 · p. 11

6.1. Available Training Outlier Data

This section tests how training outlier data quantity and class heterogeneity relate to OOD detection with BiT-L and HOD.

6.1. Available Training Outlier Data

  • The experiment uses BiT-L with HOD, five models per setting, and a shared validation set for selection and shared test set for reporting.The authors vary training-outlier proportions and report mean and standard deviation of AUROC.Source: §6.1 · p. 11
  • OOD detection performance increases consistently as training outlier heterogeneity and quantity increase, with no observed plateau.The authors note that additional outlier classes and samples may potentially improve performance further.Source: §6.1 · p. 11

6.2. Diversity in ensembles

The section analyzes how representation, objective, and initialization diversity relate to ensemble selection and OOD performance.

6.2. Diversity in ensembles

  • Representation type forms the highest-level clustering split, loss function the next, and random initialization and shuffling the lowest.The five models sharing a representation method and loss cluster together with minimum diversity.Source: §6.2 · p. 12
  • Figure 3 maps pairwise diversity by color and plots OOD AUROC against ensemble size across model pools.Darker blue denotes greater diversity; pools vary by representation method and loss.Source: Figure 3 · p. 13
  • The natural-image pool outperforms the contrastive pool at every ensemble size; the reject-bucket pool underperforms the other pools.The selected ensembles from the all-model and HOD-only pools were identical and performed best.Source: §6.2 · p. 13
  • The selected models alternate between BiT-L + HOD and MICLe + HOD, suggesting greedy selection balances representational diversity at each step.The authors suggest additional representation-learning strategies and loss functions could enrich pool diversity and potentially improve OOD performance.Source: §6.2 · p. 13

6.3. Subgroup Analysis of OOD Detection Performance

The analysis compares the diverse ensemble with a vanilla ensemble across outlier risk levels and Fitzpatrick skin-type subgroups. The diverse ensemble has higher OOD AUROC in each reported subgroup, with the strongest reported gains for high-risk and low-risk conditions and a 17-point margin for Types 5&6.

6.3. Subgroup Analysis of OOD Detection Performance

  • The comparison used a diverse ensemble of 3 BiT-L + HOD and 2 MICLe + HOD models against a five-model ImageNet ensemble with a reject bucket.The subgroup AUROC values compare inliers and outliers within each subgroup.Source: §6.3 · p. 13, Table 6 · p. 14

6.3.1. Analysis Over Risk Subgroups

  • The diverse ensemble’s AUROC exceeded the baseline by 7.6 points for high-risk, 2.5 for medium-risk, and 8.2 for low-risk outliers.Risk labels were assigned by dermatologists based on the worst-case outcome if a condition was left untreated.Source: §6.3.1 · p. 14

6.3.2. Analysis Over Skin Type Subgroups

  • The diverse ensemble had higher AUROC in all four skin-type subgroups, with a 17-point margin for Types 5&6.Ground-truth skin types were available for 1,543 of 2,129 test samples; the smaller sample size makes confident conclusions difficult.Source: §6.3.2 · p. 14

6.4. Qualitative Analysis and Failure Cases

The qualitative analysis compares test-sample OOD scores from the diverse ensemble and baseline, illustrating both shared failures and cases where either model performs better. The marginal score distributions show more overlap for the baseline than for the diverse ensemble.

6.4. Qualitative Analysis and Failure Cases

  • The scatter plot’s bottom-left region contains difficult outliers that both models fail to detect, while top-left and bottom-right regions identify cases where the baseline or diverse ensemble does better.The top-right region represents cases where both models perform well and mostly corresponds to relatively easy cases.Source: §6.4 · p. 14
  • The baseline’s inlier and outlier marginal distributions overlap more than the diverse ensemble’s, while the diverse ensemble’s inlier distribution is narrower and more compact.The authors present this as qualitative evidence of better outlier detection by their model.Source: §6.4 · p. 14

6.5. Joint Evaluation for Inliers and Outliers Predictions

The joint evaluation measures inlier accuracy and outlier recall across confidence thresholds, accounting for differences in model calibration. Across outlier-recall rates, the diverse ensemble has higher accuracy than the baseline.

6.5. Joint Evaluation for Inliers and Outliers Predictions

  • Figure 5 plots accuracy against outlier recall and cost against outlier recall for the diverse and baseline ensembles.The cost curve uses the cost matrix shown in Figure 6.Source: Figure 5 · p. 15, Figure 4 · p. 15
  • For a confidence threshold τ, the model predicts when C(x) > τ and abstains when C(x) < τ; A(τ) evaluates inlier accuracy among predictions and counts outlier predictions as incorrect.The plotted accuracy and outlier-recall curves use different thresholds τ.Source: §6.5 · p. 15, Figure 5 · p. 15
  • At all outlier-recall rates, the diverse ensemble has higher accuracy than the baseline in the joint evaluation.Outlier recall is used to normalize threshold comparisons because the two ensembles differ in calibration.Source: §6.5 · p. 15, Figure 5 · p. 15

6.6. Model Trust Analysis

The model-trust analysis estimates downstream clinical implications by assigning costs to different inlier and outlier prediction errors. Across outlier-recall rates, the diverse ensemble has lower estimated cost than the baseline, with its lowest cost at recall 0.92.

6.6. Model Trust Analysis

  • The cost matrix assigns cost 1 to incorrect inlier predictions and outlier-as-inlier predictions, and 0.5 to incorrectly abstaining on an inlier.The lower abstention cost reflects that users could seek additional guidance when the model expresses uncertainty; these values are qualitative approximations verified by a dermatologist.Source: §6.6 · p. 16, Figure 6 · p. 16
  • The analysis counts incorrect inlier predictions, incorrect abstentions on inliers, and outliers incorrectly predicted as inlier classes.The assigned costs are intended to represent asymmetric clinical consequences of these mistakes.Source: §6.6 · p. 16
  • The diverse ensemble has lower overall cost than the baseline across outlier-recall rates, with its lowest cost at outlier recall 0.92.The authors interpret the consistently lower cost as better performance after accounting for different downstream clinical implications.Source: §6.6 · p. 16

7. Conclusion

The conclusion reports that hierarchical outlier detection and stronger representations improve OOD detection, while diverse ensembling, subgroup comparisons, and a cost metric support the case for clinical deployment.

7. Conclusion

  • The paper frames detection of unseen conditions as a safety concern and argues that its contributions may generalize beyond dermatology.Identifying unfamiliar inputs could support safe next steps, such as consulting a clinician.Source: §7 · p. 16
  • The authors constructed an OOD benchmark from a labeled long-tail dermatology dataset and proposed HOD, which combines multiple abstention classes with coarse inlier–outlier and fine-grained classification losses.Source: §7 · p. 16
  • Better representation learning improved OOD detection, with further gains from applying the HOD loss.The conclusion evaluates BiT, SimCLR, and MICLe alongside ImageNet-pretrained models.Source: §7 · p. 16
  • The diverse ensemble outperformed vanilla ensembles in both OOD performance and inlier accuracy.It was selected by greedy search from models with different representation learning methods and loss functions.Source: §7 · p. 16
  • The proposed method outperformed the baseline across subgroups defined by risk level and skin type.Source: §7 · p. 16
  • The proposed method outperformed the baseline on a cost matrix designed to approximate downstream clinical implications.Directly optimizing this matrix during training is left for future work.Source: §7 · p. 16
Loading 2104.03829v1…