Elamur Research

Benchmarking Bayesian Deep Learning on Diabetic Retinopathy Detection Tasks

Paper · 2022 · Neil Band, Tim G. J. Rudner, Qixuan Feng et al.

Summary

A system that screens retinal photographs for diabetic retinopathy has to make a judgment about the disease and, potentially, a judgment about its own ability to read the image. A confident mistake can leave a sight-threatening case without further review. An uncertainty estimate offers a way to route difficult scans to a specialist, provided that the system actually assigns high uncertainty to cases it is likely to get wrong. The authors introduce RETINA to test that property. Their benchmark asks which images a classifier would send for review and how well it would handle the images left behind.

The authors use retinal photographs from EyePACS and APTOS. They treat moderate diabetic retinopathy or worse as a positive screening result. In the Severity Shift task, the classifiers learn from EyePACS photographs with grades up to moderate disease and face severe or proliferative cases at evaluation. In the Country Shift task, they learn from US EyePACS images and face photographs from India’s APTOS dataset, where the patient population and imaging equipment differ. The comparison includes a deterministic baseline, Bayesian approximations that generate a range of predictions for each image, and ensembles of independently trained networks. Each method is evaluated for ordinary diagnostic performance and for performance as its most uncertain predictions are set aside.

The referral strategy worked better for the severity change. On the severe and proliferative EyePACS subset, the accuracy of the retained predictions rose with referral, and Monte Carlo dropout reached 100% accuracy near a 50% referral rate. That accuracy describes the severe cases left for automated classification at that operating point. The transfer to APTOS exposed a different pattern. Diagnostic ROC area, a measure of disease ranking, was higher on APTOS than on the corresponding EyePACS test set, yet for most methods the ROC area of the retained cases fell as more uncertain images were referred. An apparently favorable result for diagnostic discrimination therefore coexisted with a poor choice of which images to review.

The paper also tests whether the result changes when developers can use a small sample of shifted images during tuning. Selecting settings on an uncertainty-aware validation measure improved the APTOS accuracy referral curves for several methods, while the training data remained EyePACS. Image preprocessing also changed the results, particularly on shifted data. The authors release the tasks, baseline implementations, and trained checkpoints through Uncertainty Baselines. The benchmark’s main contribution is a way to distinguish a classifier that ranks disease well from one whose uncertainty helps direct scarce expert attention.

Deep dive: Benchmarking Bayesian Deep Learning on Diabetic Retinopathy Detection Tasks

The RETINA benchmark tests whether diabetic retinopathy classifiers can identify the scans they should send for expert review when the data change. · about 36 minutes to read

The problem and its context

A useful screening decision has two parts

Diabetic retinopathy can damage vision and lead to blindness. The paper studies a screening decision made from a retinal photograph. An image is positive if its clinical grade reaches the level at which the eye-care guidelines cited by the authors call for referral to an ophthalmologist. The grading scale distinguishes eyes with no visible diabetic retinopathy from those with mild, moderate, severe, or proliferative disease. For screening, the authors group those grades around the moderate threshold. This preserves the decision of whether the photograph shows sight-threatening disease while allowing the researchers to recover the original grades for analysis.

Referral appears in a second sense in the paper. A positive disease classification indicates a clinical reason to send the patient to an ophthalmologist. An uncertainty-based referral sends a photograph to a human reader because the automated prediction is doubtful. A photograph provisionally classified as negative can still be sent for review on that basis. A photograph provisionally classified as positive can also be flagged if the classifier is unsure. The disease probability controls the screening classification. The uncertainty score controls which classifications the system has to make by itself.

This distinction gives uncertainty a concrete job. A retinal photograph might contain an artifact, show features absent from the training material, or come from a camera that produces images unlike those previously seen. In any of these cases, the automated prediction can be wrong. The value of the uncertainty estimate depends on where that image falls relative to other images awaiting review. A score that rises for likely errors can help a specialist see the cases where review makes the greatest difference. A large score on a case that is neither especially difficult nor likely to be misclassified consumes some of the same review capacity.

A screening service could approach the decision from either direction. It might have a fixed amount of clinician time and want to know the quality of the predictions it can safely leave to the classifier at that workload. Or it might have a performance target and want to estimate how many images would need human attention to reach it. Both questions require an evaluation of the retained cases across a range of referral budgets. A single discrimination score computed before any image is referred answers a different question.

Changes that a screening system may encounter

The first situation the authors consider arises from the mix of disease grades available for training. Images showing little or no retinopathy are easier to collect than images of advanced disease. A classifier can consequently learn the screening boundary from examples that include moderate retinopathy yet have little exposure to the severe end of the clinical scale. Features visible in moderate disease may also be present in more advanced cases, sometimes in a more pronounced form. Some findings, such as bleeding into the vitreous, can be unfamiliar to a classifier trained within the narrower range. The benchmark makes this scenario explicit by withholding the severe and proliferative grades from training in the Severity Shift task.

The other situation arises when screening expands to a setting where fewer local photographs are available. A service could begin with a classifier trained on images collected elsewhere. In the paper’s Country Shift task, the move from EyePACS to APTOS changes several aspects of the data together. The patient population differs, the photographs come from different equipment, and the authors identify more visible artifacts in APTOS. The task asks how a classifier trained on the source images handles the resulting change in the distribution of test images.

The severity comparison identifies the shift through the original grading labels. The country comparison identifies it through the source of the images. The first therefore offers a specific way to ask what happens when the clinical range expands. The second represents a bundled change of the sort a deployment might encounter. In both settings, a binary diagnosis still has the same meaning. The crucial change is what the classifier sees when it has to make that diagnosis.

What the authors build on

The paper situates RETINA after earlier work by Leibig and colleagues on using uncertainty for diabetic retinopathy detection. It adopts their binary screening target and extends the evaluation with new shift tasks, more uncertainty estimation methods, and a common implementation. The authors also describe RETINA as a direct extension of an earlier comparison by Filos and colleagues. That study covered a smaller set of evaluation procedures, used a smaller neural architecture, and compared a narrower set of variational approaches. Withholding the most severe grades is an addition in RETINA.

The paper also describes uncertainty studies that relied on curated image datasets such as CIFAR-10 or FashionMNIST. Controlled datasets make methods easier to compare. The authors wanted a benchmark in which image size, noisy labels, class imbalance, and changes in data collection all matter to the downstream task. They identify complementary strands of prior work in object detection and medical imaging. The object-detection study they discuss used real data but had a narrower comparison and left distributional shift outside its study design. Other work examined shifted data and different sources of uncertainty, using measures focused on prediction. The authors’ criterion for RETINA is whether an estimate helps decide which specific predictions should be reviewed.

The related work also includes WILDS, which studies shifts in real datasets. As characterized in the paper, that comparison assumes access to training distributions with domain labels and focuses on adaptation. RETINA frames its central evaluation around source-trained classifiers and the ordering of their uncertainty under shift. It also makes access to shifted validation images an explicit experimental condition. WILDS

The technical approaches in RETINA likewise come from earlier research. The paper draws on Bayesian treatments of uncertain network weights, work on predictive uncertainty in computer vision, dropout-based approximations, and independently trained ensembles. Its main novelty lies in putting those approaches through the same screening tasks and observing how the estimates behave when used to make a referral decision. The benchmark is designed so that the same data handling and evaluation can be applied to another uncertainty method without having to reconstruct the clinical setup.

The method, step by step

Prepare images and preserve the clinical grades

The starting material is a set of color photographs of human retinas, each assigned a clinical severity grade. The original grade is 0 for no diabetic retinopathy, 1 for mild disease, 2 for moderate disease, 3 for severe disease, and 4 for proliferative disease. For training and binary evaluation, grades 0 and 1 become negative labels, and grades 2, 3, and 4 become positive labels. The original grade remains available for constructing the Severity Shift and for asking later whether uncertainty behaves differently across levels of disease.

The authors apply the same basic preprocessing to photographs from both sources. They resize the images to bring the retinal radius to 300 pixels. The procedure estimates local average color with Gaussian blur and subtracts that average from the image. It then clips the image to 90% of its size to reduce edge effects. The recipe comes from the winning entry in the EyePACS Kaggle challenge. The country comparison retains differences in imaging after this processing. In the APTOS examples, the paper points to blur, low background illumination, and effects near the retinal boundary.

The width of the Gaussian kernel controls the neighborhood used to estimate average color. The authors express this setting as follows.

σ = target_radius / blur_constant

Here σ is the standard deviation of the Gaussian kernel, target_radius is the normalized retinal radius in pixels, and blur_constant is the divisor controlling the kernel width. The defaults are target_radius = 300 and blur_constant = 30. Lowering the divisor widens the averaging neighborhood. Because the estimated average is then subtracted, the effect on the finished photograph depends on what the larger neighborhood captures. The authors describe lower settings as retaining more visible signal and noise.

Decide what information is available before evaluation

For Severity Shift, the EyePACS training material is restricted to clinical grades 0, 1, and 2. The resulting training set has 33,545 images. The in-domain evaluation set has 40,727 images from the same clinical range, and the shifted evaluation set has 3,524 images with grades 3 and 4. In-domain means that the evaluation images come from the range represented in training. The shifted set contains only binary positives. The training set already has positive examples in the form of moderate cases, so the task tests transfer to higher grades of a known screening category.

For Country Shift, the authors use the full EyePACS training split of 35,126 images and its 42,670-image test split for in-domain evaluation. The shifted test set is drawn from APTOS, with 80% of its images, or 2,929 photographs, assigned to test. The other 20%, or 733 photographs, form a separate shifted validation set. Both test sets for this task contain positive and negative cases. The study can therefore ask about disease discrimination and accuracy separately on each source.

In both tasks the training images come from EyePACS. In the main protocol, the authors choose hyper-parameters using an in-domain validation measure. This represents a developer who has source data and lacks examples from the eventual shift. The alternative protocol uses shifted examples in validation to represent a developer who can inspect a sample of the target setting before settling on a configuration. Those examples affect which configuration is chosen. The training split continues to define what images the network learns from through its objective.

From retinal photographs to a referral curve

The steps in order.

From retinal photographs to a referral curveStep 1: Standardize the retinal images1. Standardize the retinal imagesStep 2: Group clinical grades around the screening threshold2. Group clinical grades around the screening thresholdStep 3: Train candidate classifiers on EyePACS3. Train candidate classifiers on EyePACSStep 4: Select settings on the designated validation data4. Select settings on the designated validation dataStep 5: Average each image’s predictive probabilities5. Average each image’s predictive probabilitiesStep 6: Rank evaluation images by predictive entropy6. Rank evaluation images by predictive entropyStep 7: Refer the most uncertain scans first7. Refer the most uncertain scans firstStep 8: Score the predictions that remain8. Score the predictions that remain

Train a common image classifier

All the central comparisons use ResNet-50. Holding the architecture fixed makes the experiment a comparison of uncertainty estimation and prediction procedures within a common image classifier. The last linear layer produces a numerical score, called a logit. A sigmoid transformation turns it into a probability for the positive class. Its complement is the probability for the negative class. The architecture comes from the work on deep residual learning. Deep Residual Learning for Image Recognition

An additional training choice concerns class imbalance. For instance, only 19.6% of the EyePACS training split carries a positive binary label. Without adjustment, the more common class contributes more examples to the training objective. The authors compensate by giving greater weight to the less frequent class in each mini-batch, the group of examples processed together in an update. The weighting applies to the cross-entropy part of the objective. Using a log probability for the labeled outcome inside the sum, the rule is

L = −(1 / (K M)) Σᵢ ℓᵢ / pₘᵢₙᵢ₋ᵦₐₜ꜀ₕ(kᵢ)

Here L is the weighted loss, K counts the classes, and M is the number of images in the current mini-batch. The sum Σᵢ runs over its images. The log probability assigned to the recorded label of image i is ℓᵢ, its class is kᵢ, and pₘᵢₙᵢ₋ᵦₐₜ꜀ₕ(kᵢ) is the frequency of that class within the batch. The minus sign turns the log probabilities into losses. Dividing by the class frequency increases the contribution of an example belonging to a class that is scarce in that batch. This is a training adjustment. The authors keep the evaluation splits in their original proportions except in comparisons that explicitly rebalance the data.

Obtain a distribution of predictions for each image

A deterministic network gives the same class probabilities each time it sees a fixed photograph. Its probabilities can express ambiguity, for example when the predicted mass is spread across the possible labels. To represent another source of uncertainty, the paper considers methods under which several plausible predictive functions can be applied to the same image. Different functions can be obtained by sampling network parameters, sampling dropout masks, or using independently trained networks. For any given image, these functions may produce similar probabilities or substantially different ones.

The authors use aleatoric uncertainty for the uncertainty expressed within those individual predictive distributions, as can happen with noisy images or noisy targets. They use epistemic uncertainty for the disagreement associated with uncertainty about the predictive function. An image could produce ambiguous probabilities under nearly every sampled function. Another could receive individually confident predictions that point in different directions. Both circumstances warrant a high total uncertainty score for referral because either can lead to a mistake. The distinction between these sources has a precedent in work on Bayesian computer vision. What Uncertainties Do We Need in Bayesian Deep Learning for Computer Vision?

The measure used for referral is predictive entropy. Entropy is high when the predictive probabilities are spread across the class labels and low when the probability is concentrated on a label. The authors first average the predicted probabilities over the distribution of possible weights and then calculate entropy. At a fixed test input, their decomposition is

H(E[p(y∗ | f(x∗; θ))]) = E[H(p(y∗ | f(x∗; θ)))] + I(y∗; Θ)

Here x∗ is the retinal image being evaluated, and y∗ is its unknown binary outcome. Θ denotes the random network parameters, and θ is a particular realization of those parameters. The function f returns the logits for x∗ at θ, and p is the class distribution conditional on those logits, with | indicating conditioning. E is expectation over the weights, and H is entropy. The quantity on the left is total predictive uncertainty. The expected entropy on the right is the aleatoric term. I is mutual information between the prediction and the parameters at the fixed image, which measures the epistemic contribution. In their practical estimator, the authors obtain that contribution as total entropy minus the average entropy of the individual distributions.

For the binary screening decision, total uncertainty takes the following form.

H(E[p(y∗ | f(x∗; θ))]) = −Σ꜀∈{0,1} E[p(y∗ = c | f(x∗; θ))] log E[p(y∗ = c | f(x∗; θ))]

The summation Σ covers class c in the set {0, 1}, where 0 is negative and 1 is positive. The expression E[p(y∗ = c | f(x∗; θ))] is the averaged probability assigned to class c for input x∗. As before, y∗ is the outcome, f gives the logits at parameter setting θ, p gives the conditional class probabilities, E averages over the weight distribution, and H is entropy. The function log is the logarithm. The negative sign gives positive entropy when the averaged distribution has probability spread over the classes.

Computing the exact average over the weight distribution is generally impractical. The evaluation approximates the average with a finite number of predictions.

E[p(y∗ | f(x∗; θ))] ≈ (1 / S) Σᵢ₌₁ˢ p(y∗ | f(x∗; θ⁽ⁱ⁾))

Here S is the number of sampled predictions, i indexes those predictions, and θ⁽ⁱ⁾ is the set of weights used for draw i. The sum covers all S draws. As above, x∗ is the input, y∗ is the outcome, f supplies logits, p is the conditional predictive distribution, and E denotes the exact average being approximated. The right side is the Monte Carlo estimate, formed by averaging the probabilities from the sampled predictors. The authors use five samples per stochastic network at evaluation. Their example of an MC dropout ensemble with K = 3 members uses S = 15 samples in total. Here K counts trained ensemble members, whereas S counts sampled predictions.

Compare different sources of predictive variation

The deterministic baseline uses maximum a posteriori estimation, abbreviated MAP. It chooses one weight setting at the mode of the posterior, the distribution over weights conditioned on the training observations. Under the prior described by the authors, the optimization is equivalent to fitting with weight decay.

arg minθ {−log p(yᴰ | f(Xᴰ; θ)) + λ‖θ‖₂²}

Here arg min asks for the parameter value θ that minimizes the expression. Xᴰ contains the training images and yᴰ their labels. The function f gives the logits, and p is the probability of the labels under the corresponding predictive distributions. The logarithm turns the probability term into a log likelihood, with the minus sign giving a loss to minimize. The coefficient λ controls the squared Euclidean norm ‖θ‖₂², which penalizes large weights. Prediction from this solution uses the fitted parameters. Its entropy can reflect distributed class probabilities, and its epistemic term is absent because the predictor has a single parameter setting.

Bayesian approaches seek a distribution over the weights. The prior describes assumptions about the weights before the training data are used, and the likelihood describes how well a weight setting explains the observed labels. The exact posterior is intractable for the networks in this study. Variational inference replaces it with a tractable distribution chosen from a specified family and fits the approximation by optimization. The paper writes the general objective as

arg maxq∈Q {E_q[log p(yᴰ | f(Xᴰ; θ))] − D_KL(q ‖ p)}

Here arg max selects the distribution q in the allowed family Q that maximizes the objective, and ∈ denotes membership in that family. E_q averages the log likelihood over θ drawn from q. The training images are Xᴰ, their labels are yᴰ, and f produces logits from the images and parameters. Within the likelihood term, p gives the probability of those labels. Within D_KL, p denotes the prior distribution, and the ordered pair q ‖ p gives the direction of the Kullback–Leibler divergence. This divergence penalizes departure from the prior in the specified space. The overall objective trades off explaining the training labels against that penalty. The paper cites earlier work on learning distributions over network weights. Weight Uncertainty in Neural Networks

In Gaussian mean-field variational inference, or MFVI, the weight distribution is built from independent Gaussian factors. Each factor has a learned center and scale. The variational objective can then be optimized with stochastic gradients by expressing a weight sample as a transformation of standard noise.

Θ = μ + σ ⊙ ε,   ε ∼ N(0, I)

Here Θ is a random weight vector, μ gives its Gaussian centers, and σ gives its scales. The operator ⊙ multiplies corresponding entries, and ε is a vector drawn from N, the Gaussian distribution whose mean is 0 and whose covariance is the identity matrix I. The symbol ∼ means “is distributed as.” This is a different use of σ from the image-preprocessing formula. Here it controls spread in weights rather than the width of an image filter. Expressing the draw this way lets the training procedure differentiate through its dependence on μ and σ.

To lower the variance of the gradients, the implementation applies Flipout in both the convolutional layers and the last dense layer. It also adjusts the strength of the divergence penalty during training on a cyclical schedule. For Gaussian MFVI and its radial variant, the authors tie the prior mean to the current variational mean. That choice leaves the divergence term penalizing the scale of the weight posterior. These implementation choices matter to what the benchmark measures. A result for MFVI here belongs to the trained approximation with this architecture, objective, and optimization procedure.

Radial MFVI keeps the variational objective and changes the sampling construction to improve the signal relative to noise in the gradient estimate. It uses a normalized direction and a separately sampled radius.

Θ = μ + σ ⊙ (ε / ‖ε‖₂) · |r|,   ε ∼ N(0, I),   r ∼ N(0, 1)

Here Θ, μ, and σ again refer to the random weights, their centers, and their scales. The operator ⊙ applies the scale entrywise. The Gaussian vector ε has mean 0 and identity covariance I, and ‖ε‖₂ is its Euclidean length. The quotient gives the direction, while multiplication by |r| gives the absolute value of a scalar Gaussian draw with mean 0 and variance 1 as its radius. N denotes the Gaussian family, and ∼ denotes sampling from the indicated distribution. The authors set the default radial prior scale using the He initializer’s standard deviation.

σprior = √(2 / fan_in)

In this expression σprior is the prior standard deviation and fan_in is the number of inputs feeding the corresponding unit in the initialization rule. The square root √ converts the quantity inside it into the standard deviation. This setting concerns the prior scale used by the radial implementation.

Function-space variational inference, or FSVI, measures the divergence between distributions of network outputs at selected inputs. The authors describe evaluating the functions at the training inputs together with inducing inputs, which are additional inputs at which the function distributions are compared. A linear approximation to the network mapping makes that comparison tractable. In RETINA the Gaussian mean-field distribution is placed on the final layer, with samples obtained by the Gaussian transformation above. This changes where the variational penalty acts while retaining the common ResNet-50 image architecture.

Monte Carlo dropout trains a network with dropout and weight decay, then keeps dropout active during evaluation. Each mask changes which parts of the network participate in the prediction, so repeated passes give a set of probability estimates for the same image. The training objective has the following form.

arg minθ {−E_q[log p(yᴰ | f(X; θ))] + λ‖θ‖₂²}

Here arg min selects the fitted network weights θ and E_q averages over the parameter perturbations induced by dropout. The inputs are X and the associated labels are yᴰ. The function f supplies logits under the dropout draw, and p is the predictive likelihood. The minus sign converts the expected log likelihood into a loss. The coefficient λ multiplies the squared Euclidean weight norm ‖θ‖₂². Training estimates the expectation with a single mask draw for the update. At evaluation, multiple draws form the approximate predictive distribution. The underlying regularizer comes from the earlier work on dropout. Dropout

The rank-1 method uses a different way to restrict where the weights can vary. Each weight matrix has a deterministic component, and the stochastic factors are vectors whose outer product modulates that matrix.

W′ₖ = Wₖ ⊙ (rₖ sₖᵀ)

Here k indexes the layer, Wₖ is its deterministic weight matrix, and W′ₖ is the corresponding stochastic matrix. The vectors rₖ and sₖ are random, ᵀ transposes sₖ, and their outer product forms a rank-1 matrix. The operator ⊙ applies its entries as multipliers to the corresponding entries of Wₖ. The variational procedure fits distributions over the vectors and a point value for the deterministic matrix. This supplies stochastic variation without fitting a separate random factor to every entry of the matrix.

The ensemble variants combine independently trained predictors. A deep ensemble combines MAP networks trained with different random seeds. Each member contributes a deterministic predictive distribution, and differences among the members contribute to the ensemble’s epistemic uncertainty. An ensemble of Bayesian networks also combines independently trained members, each of which can itself produce several predictions through sampling. The motivation is that a single variational fit can offer a poor approximation, and averaging several fits can capture differences it misses. RETINA evaluates both individual classifiers and ensemble versions, so the comparison can show whether a gain accompanies the uncertainty method, the combination of independently trained members, or both. Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles

Select settings and turn uncertainty into referrals

The authors use quasi-random hyper-parameter searches covering learning rate, momentum, weight regularization, and method-specific settings such as dropout rate and variational initialization. They run at least 32 trials per method, task, and tuning assumption. The main experiments select the configuration by in-domain validation ROC area. The alternative selects it by the area under an accuracy referral curve on a mixture of in-domain and shifted validation images. The shifted validation set is upsampled to match the size of the in-domain validation set, giving the smaller source comparable representation in the selection criterion.

The work required a compromise between the number of weight samples per training update and the number of images in a batch. Multiple draws used enough memory to constrain the batch size for the more expensive variational methods. Using a single draw at training time let the researchers fit batches of at least 64 images. They report improved convergence and validation performance with this setup and attribute it to the larger batches and variance reduction. At evaluation, they return to multiple draws to estimate the mean probabilities.

After selecting a configuration, they retrain it with 6 random seeds. For single classifiers, the reported performance averages over those runs. For ensembles, they sample groups of 3 members without replacement from the 6 trained networks and average over 6 ensemble constructions. The use of separate constructions reveals some of the variation associated with which training runs happen to be combined.

Evaluation on a given split starts by sorting its photographs from highest to lowest predictive entropy. At any chosen referral rate, the top part of the list goes to simulated review. The classifier is scored on the other photographs. The paper expresses the retained share as

retained proportion = 1 − τ,   τ ∈ [0, 1]

Here τ is the fraction marked for expert review, and ∈ [0, 1] gives its range from no referral to full referral. The retained proportion is the share left for automated prediction. The subtraction is from the whole evaluation set. When a retained set cannot support the chosen metric, as happens for ROC area on a set with only positives, that metric is unavailable.

Sweeping the referral rate gives a curve. A rising accuracy curve means that, as the most uncertain images leave, the share of correct predictions increases among those kept. An AUC referral curve instead asks how disease ranking changes among the retained images. Each point describes the result of applying the same ranking policy at a different workload. The authors also inspect uncertainty distributions grouped by original clinical grade and by whether the binary classification was correct. That diagnostic helps explain which kinds of images contribute to the shape of the referral curve.

The authors package data adapters, evaluation measures, baseline training pipelines, and checkpoints in Uncertainty Baselines. The data adapters support the same split and preprocessing choices across implementations, while individual methods can have separate experiment pipelines. The paper describes FSVI in JAX and the benchmark’s MC dropout runs in TensorFlow, alongside a PyTorch variant of dropout. It also describes an extension by Tran and colleagues that adds pretrained Vision Transformers, illustrating how the benchmark pipelines can accommodate a different architecture. Transformer and attention

Experiments and results

Read each metric in the setting where it applies

The headline comparison evaluates the trained classifiers on in-domain images, shifted images, and combinations of the two. On Country Shift, EyePACS serves as the in-domain test source and APTOS as the shifted test source. On Severity Shift, the in-domain test set contains EyePACS grades up through moderate disease, and the shifted set contains the severe and proliferative grades. Joint results answer what happens when the referral queue contains cases from both distributions. The appendix also reports a balanced joint evaluation, where the distributional sources are given more even representation than in their simple union.

The receiver operating characteristic, or ROC, traces how the disease classifier’s sensitivity and false-positive rate move as its disease-probability threshold changes. Sensitivity is the fraction of true positives the classifier catches. Specificity is the fraction of true negatives it correctly clears, so the false-positive rate is the complement of specificity. The ROC area, which the paper frequently abbreviates as AUC, summarizes how well the disease score orders positive and negative examples across thresholds. The paper gives 0.5 as chance-level ROC area and 1.0 as perfect discrimination. The plots also mark the NHS reference point cited in the paper, with 85% sensitivity and 80% specificity.

Accuracy measures the fraction of predicted labels that agree with recorded labels. The EyePACS test split has 19.2% positive labels, so accuracy and sensitivity can convey different aspects of performance. The paper therefore follows accuracy and ROC area separately as cases are referred. The appendix adds area under the precision–recall curve, negative log likelihood, and expected calibration error. Precision describes how frequently a positive call is correct, and recall describes how many positives are found. Negative log likelihood measures the penalty assigned to the probabilities of the recorded labels. Expected calibration error summarizes disagreement between reported confidence and observed correctness across confidence ranges.

The paper also uses ROC area for a separate diagnostic in which the target is membership in the shifted set and the score is predictive entropy. In that analysis a high score means the uncertainty ranking is effective for detecting a source change. In the disease ROC analysis, a high score means the predicted disease probabilities separate positive from negative images. The referral analysis introduces a further distinction. It uses entropy to choose the cases that remain, then measures disease performance on those cases. These evaluations test different properties of the same predictive distributions.

Severity Shift rewards selective referral

Moving from the in-domain Severity Shift evaluation to a joint set that includes the advanced grades improved diagnostic ROC area for the methods the authors study. For the deterministic MAP baseline, the appendix reports 82.0% ROC area on the in-domain evaluation set and 86.3% on the joint set. The MC dropout ensemble obtains 90.6% and 93.1% on the same respective splits. Adding advanced positive cases can help a classifier demonstrate discrimination when their visible disease features receive high scores. The comparison uses a joint set because the severe-only split has no negatives from which to build a disease ROC curve.

The severe-only split supplies a different test. Every error there is a severe or proliferative photograph classified as negative. At no referral, the single MAP network records 74.4% accuracy on those EyePACS images. Single MC dropout records 86.4%, and its ensemble records 87.4%. A classifier that always gives a positive label would score well on this particular split by construction, so the severe-only accuracy describes how well these fitted classifiers catch advanced positives. Their ability to handle negatives must be checked on the other evaluation splits.

The chart compares accuracy on the severe-only evaluation set when the methods send 50% of its most uncertain cases for review. All systems in this comparison are tuned on in-domain validation AUC. The reported values are the mean accuracies on the retained portion of the split.

Retained accuracy on severe and proliferative EyePACS cases at 50% referral

Single MC dropout slightly leads its ensemble and retains more correct predictions than the other methods shown.

Retained accuracy on severe and proliferative EyePACS cases at 50% referralMAP: 93.2MAP93.2Deep ensemble: 89.8Deep ensemble89.8Function-space variational inference: 88.5Function-space variational inference88.5Gaussian mean-field variational inference: 86.7Gaussian mean-field variationalinference86.7MC dropout ensemble: 99.4MC dropout ensemble99.4MC dropout (this paper): 99.5MC dropout (this paper)99.5
The numbers
System or settingaccuracy %
MAP93.2
Deep ensemble89.8
Function-space variational inference88.5
Gaussian mean-field variational inference86.7
MC dropout ensemble99.4
MC dropout (this paper)99.5

The single MC dropout result at this point is 99.5 ±0.2, and the deterministic baseline is 93.2 ±3.3 in the same table. At 70% referral, both dropout variants reach 100.0% retained accuracy on the shifted split, and MAP reaches 98.6%. The curves near those operating points support the authors’ observation that dropout reaches perfect or nearly perfect accuracy among the retained advanced cases with less referral than MAP. The estimates describe the benchmark’s severe photographs and a policy that ranks cases within that evaluation set.

The comparison also shows that representing uncertainty over weights is an insufficient condition for effective referral. Gaussian mean-field variational inference records 71.5% severe-only accuracy before referral and 86.7% at 50% referral. Some of the radial variants show a much smaller improvement over a larger portion of the curve. The implementation of the Bayesian approximation affects both the original class predictions and the ordering used to remove cases, so the benchmark result belongs to their combination.

The rise in accuracy on the in-domain Severity Shift test split is also relevant. Under the deterministic baseline, the paper reports 87.9% accuracy without referral and 95.2% when 50% of the cases are referred. For single MC dropout the corresponding entries are 90.5% and 97.2%. On that split the retained set can include both classes, so improvement can reflect the removal of likely errors among negatives as well as positives. A referral policy would have to handle that mixed stream in a screening setting where advanced disease is uncommon.

Country Shift exposes a disconnect between discrimination and referral

The Country Shift plots show stronger disease discrimination on APTOS than on the EyePACS test split. At no referral, the deterministic baseline’s ROC area is 87.4% on EyePACS and 92.2% on APTOS. A deep ensemble scores 90.3% and 94.2%, respectively. Single MC dropout scores 91.4% and 94.0%. The authors report that on EyePACS only the MC dropout variants meet the sensitivity and specificity reference shown in the plot, while on APTOS essentially all methods exceed it. This is evidence about threshold choices for ranking disease on the respective datasets.

Accuracy at the evaluation threshold tells a more mixed story. For single MC dropout, the paper gives 90.9% on EyePACS and 86.8% on APTOS without referral. Under MAP the corresponding accuracies are 88.6% and 86.2%. ROC area can rise while accuracy at a fixed decision rule falls. The two scores describe how well probabilities order the classes and how well a particular boundary converts them into labels, respectively. Neither computation at full coverage has yet used the entropy ranking to select photographs.

Once cases are removed by uncertainty, the APTOS ROC areas reveal the failure that motivates the benchmark. At 50% referral, the retained APTOS ROC area is 80.1% for MAP, 91.2% for the deep ensemble, and 87.4% for single MC dropout. Each of those methods started with a higher ROC area on the complete shifted test split. The Gaussian mean-field approaches have a different profile at this point. Single MFVI goes from 91.4% without referral to 93.8% at 50% referral. The MFVI ensemble reaches 94.9% at that rate.

Retained disease ROC area on APTOS at 50% referral in Country Shift

The Gaussian mean-field ensemble leads at this referral rate even though other methods rank disease better before referral.

Retained disease ROC area on APTOS at 50% referral in Country ShiftMAP: 80.1MAP80.1Deep ensemble: 91.2Deep ensemble91.2Function-space variational inference: 90.6Function-space variational inference90.6MC dropout: 87.4MC dropout87.4MC dropout ensemble: 86.8MC dropout ensemble86.8Gaussian mean-field variational inference: 93.8Gaussian mean-field variationalinference93.8Gaussian mean-field ensemble (this paper): 94.9Gaussian mean-field ensemble (thispaper)94.9
The numbers
System or settingROC AUC %
MAP80.1
Deep ensemble91.2
Function-space variational inference90.6
MC dropout87.4
MC dropout ensemble86.8
Gaussian mean-field variational inference93.8
Gaussian mean-field ensemble (this paper)94.9

The single MFVI curve subsequently bends downward. At 70% referral its retained APTOS ROC area is 93.0%, while the ensemble reaches 94.2%. For the deterministic baseline, the same table reports 55.4% at 70% referral. The authors interpret the downward trends as evidence that the uncertainty ranking can send away cases whose removal is unhelpful to the desired performance on the retained set. At high referral rates, separating still-retained positives from still-retained negatives can become harder even if a number of individually correct predictions remain.

The in-domain Country Shift evaluation gives a useful comparison under the same training protocol. On the EyePACS test data, moving to 50% referral raises single MC dropout’s ROC area to 95.3% and its ensemble’s to 95.8%. Compare those values with the no-referral EyePACS results of 91.4% and 92.5%. The severe-only and country experiments therefore distinguish the behavior of the same uncertainty technique across shifts. Dropout gives strong referral results on the source data and under Severity Shift, while its uncertainty ranking on APTOS makes retained disease discrimination worse over a substantial part of the referral sweep.

The summary scores across referral rates reinforce the difference between a favorable starting point and a favorable curve. For methods tuned on source validation AUC, the Country Shift appendix gives the MC dropout ensemble an area under the AUC referral curve of 95.4 on EyePACS and 79.4 on APTOS. The MFVI ensemble scores 88.1 on EyePACS and 92.0 on APTOS on that measure. These are areas across referral rates. Their ranking differs from the ranking by diagnostic ROC area before referral. On the APTOS accuracy referral curve, the rank-1 ensemble scores 92.8 and the MFVI ensemble scores 92.4. The authors’ finding that no method consistently leads on shifted data applies across metrics as well as across referral budgets.

What the ablations show

Access to shifted validation images changes which configurations win

The authors compare the source-only tuning protocol with selection on a validation set containing source and shifted images. In source-only tuning, the winning hyper-parameter setting maximizes conventional diagnostic AUC on in-domain validation examples. For joint tuning, the authors make a combined validation set in which shifted photographs receive equal representation with in-domain photographs. They copy the smaller shifted set as many times as it will fit within the target size, then sample the remaining required examples from it without replacement. They score the area under the resulting accuracy referral curve and use that as the selection criterion.

This comparison changes the available validation examples and the objective used to choose among candidate configurations. The shift sample exposes the tuning procedure to the kinds of images that will later be evaluated. The referral-curve objective makes the ordering of uncertainty part of that choice. The experiment establishes what the combined protocol can achieve. The relative contributions to the gain remain unclear, both from the additional information about the target images and from choosing referral as the optimization objective over area under the ROC curve at full coverage.

On held-out APTOS images the authors observe accuracy referral curves that often start higher and rise faster during the early sweep after joint tuning. They call out the slope over approximately the first 50% of referrals in their comparison. For the radial MFVI ensemble, the area under the APTOS accuracy referral curve rises from 80.8 with source-only tuning to 94.6 with joint tuning. For the FSVI ensemble the corresponding scores are 90.9 and 94.3. Joint tuning also improves some measures of calibration. The radial MFVI ensemble’s expected calibration error on the shifted APTOS set is 0.10 under source-only tuning and 0.03 under the joint protocol.

Several results qualify the apparent gain. On APTOS the rank-1 ensemble’s area under the accuracy referral curve is 92.8 with source-only tuning and 90.9 with joint tuning. For the deep ensemble, the corresponding entries are 91.0 and 90.7. The effect can depend on which method is being tuned and which criterion matters at evaluation. On the severe-only EyePACS split, joint tuning raises the MAP accuracy referral area from 90.4 to 94.9, while the radial MFVI ensemble remains at 60.3. The approach provides a way to use target information without fitting network weights on target images, and the magnitude of the benefit varies.

Matching the clinical grade proportions leaves the country effect in place

APTOS and EyePACS contain different mixes of the original clinical grades. The APTOS ROC curves could have been stronger simply because the evaluation set contained a different mix of easy and difficult grades within the binary classes. The authors test this by creating an APTOS-derived evaluation set with the clinical grade proportions of the in-domain EyePACS set. They sample APTOS images by grade, weighting according to the empirical EyePACS frequencies, until the rebalanced set contains 10,000 sampled images.

With that change, the APTOS ROC curves move farther towards the upper left, the region of better sensitivity and specificity. The authors also observe a slight improvement in the APTOS AUC referral curves. The ordering of the methods changes little, and performance at high referral rates remains weaker than on EyePACS. The grade mix therefore fails to account for the favorable starting ROC area and the weaker referral behavior together. Properties within grades remain plausible contributors. The authors mention differences in equipment and patient demographics as possibilities, while the reweighting study leaves them bundled within the APTOS source.

This analysis uses the original clinical grade rather than just the binary target. A dataset can contain easier or harder examples of the positive class depending on how much of that class consists of moderate disease and how much consists of advanced disease. Keeping the original grades available lets the authors examine this distinction while preserving the same screening target. This reweighting of APTOS asks a different question from balancing the sources in joint validation. The latter makes the target setting visible to the selection procedure. The former changes the clinical composition of an evaluation set to test an explanation for an observed result.

Image preprocessing can reverse a preference between settings

The preprocessing study varies blur_constant over 5, 10, 20, and 30. The comparison includes MAP, a deep ensemble, single MC dropout, and an MC dropout ensemble. The authors use in-domain validation AUC to tune the classifiers and then examine both in-domain and shifted performance. This study matters because image filtering changes what is visible to the classifier before any uncertainty estimation takes place. The resulting shift in its predictions can alter both which photographs are scored correctly and which ones are sent to the front of the referral queue.

For both tasks, the larger blur constants tend to help on the in-domain EyePACS evaluations. On the shifted severe-only set, lower constants yield higher performance for the dropout variants. The single dropout classifier, for example, records 93.5% accuracy on that split with no referral at a blur constant of 5 and 86.4% at the default of 30, in the preprocessing comparison. With 50% referral its respective accuracies are 100.0% and 99.5%. The result identifies a setting where preserving additional visible structure helps with advanced cases even though the in-domain comparisons generally favor stronger smoothing in the processed images.

On APTOS, the authors highlight the deep ensemble’s results at referral rates between 0.4 and 0.7. At τ = 0.7, the deep ensemble has retained ROC area of 82.2 ± 2.5 with a blur constant of 20 and 67.4 ± 5.6 with the default of 30. The chart shows the reported means for the deep ensemble at that referral fraction. The four rows are outcomes of the same method under different preprocessing settings.

APTOS retained ROC area for the deep ensemble at 70% referral by blur setting

An intermediate blur setting gives the strongest retained discrimination at this referral budget.

APTOS retained ROC area for the deep ensemble at 70% referral by blur settingBlur constant 5: 63.2Blur constant 563.2Blur constant 10: 51.1Blur constant 1051.1Blur constant 20 (this paper): 82.2Blur constant 20 (this paper)82.2Blur constant 30: 67.4Blur constant 3067.4
The numbers
System or settingROC AUC %
Blur constant 563.2
Blur constant 1051.1
Blur constant 20 (this paper)82.2
Blur constant 3067.4

The effect is specific enough to matter when interpreting comparisons among uncertainty methods. A fixed preprocessing recipe gives a consistent starting point across the main experiments. The sensitivity study shows that its default need not be the highest-scoring option on a shifted test set for a particular referral budget. Since this experiment covers a subset of the methods and settings, it establishes interactions in the tested conditions instead of an image-filtering prescription applicable across the benchmark.

Histograms show which errors are left in the queue

The authors supplement aggregate scores with histograms conditioned on the recorded clinical grade. For each method and grade, they plot distributions of predictive entropy separately for correct and incorrect binary classifications. The histograms are normalized, so their shapes can show where the two groups fall on the uncertainty scale. A method whose correct predictions cluster at low entropy and whose errors cluster at higher entropy has a better chance of placing those errors near the front of a review queue. Strong overlap between the distributions means there is less scope to remove errors while keeping the correctly handled cases.

For the severe and proliferative images, the paper identifies MAP, rank-1, and Gaussian MFVI as methods that put substantial mass from the incorrect group near low uncertainty. These errors are false negatives because the advanced clinical grades are positive by construction. The pattern traces a failure of referral to a concrete consequence within the task. A confident false negative can remain among the images the classifier clears without expert review. The normalized histogram describes the distribution of uncertainty conditional on an error, while the accuracy and referral metrics give information about how often errors occur.

The appendix also examines predictive entropy as a detector of the shift itself. Under Severity Shift, the radial MFVI ensemble has a shift-detection ROC area of 79.7%, while the MC dropout ensemble has 38.3%. Yet the dropout ensemble is much stronger on retained disease accuracy on the severe photographs. The targets explain why those findings can coexist. A shift detector scores well if it places examples from the shifted distribution above source examples. A referral policy scores well when the cases it removes improve the quality of the remaining diagnoses. A readily recognizable advanced case can belong to the shifted population and still be classified correctly with low uncertainty.

The single and ensemble comparisons reveal a related distinction. On the EyePACS test split in Country Shift, the dropout ensemble has 92.5% ROC area before referral, compared with 91.4% for single dropout. On APTOS at 50% referral, single dropout’s retained ROC area is 87.4%, and the ensemble’s is 86.8%. Averaging independent training runs can change both the mean disease probability and the entropy ordering. The results support examining that ordering on the deployment-relevant split even when an ensemble improves the source-domain discrimination measure.

Limitations

Limits identified by the authors

The authors present RETINA as a set of benchmark tasks for uncertainty-aware screening. They explicitly recognize that a single benchmark covers only part of the challenge of evaluating reliable Bayesian deep learning. Their study offers evidence for the particular screening target, data sources, and shifts they define. The variation in the method rankings is part of that evidence. Even within retinal screening, the results depend on which test population, which performance measure, and which amount of referral are of interest.

The paper acknowledges imperfections in the underlying data. The photographs contain artifacts, the classes are imbalanced, and some labels are noisy. The analyses measure accuracy against the available grades. When a label itself is uncertain, a prediction counted as a mistake may reflect disagreement with that recorded grade. The authors also point out that advanced disease can contain features absent from the grades used for training. Their proposed role for uncertainty is to help refer the unfamiliar cases, and the histograms show where several tested methods fail to do so.

There is a limit to what the authors could estimate with the available compute. The variational training procedures were expensive enough that multiple weight samples during training made it difficult to use large batches. The chosen approach uses a single training draw and relies in part on variance reduction. The appendix also describes the Monte Carlo estimate of total entropy as biased for a finite sample and consistent as more samples are used. With five evaluation samples per stochastic network, the reported ranking is the ranking of the practical estimator used in the experiments. Retraining across seeds addresses variation between runs, while finite-sample error in the entropy for an individual image remains possible.

The authors discuss another constraint on interpreting the referral curves. At high referral rates the policy begins to remove images whose predictions are confident and correct. The composition of the small retained set can change sharply, and a late dip or rise in ROC area reflects the behavior of those remaining positive and negative examples. The practical part of the curve depends on the available review budget. The protocol that tunes from shifted validation images also assumes some access to the relevant target population, an assumption the main results deliberately vary.

Limits that follow from the experimental design

The simulated referral process scores only the cases left for the classifier. It therefore estimates a component of a screening workflow. The study leaves the performance of the expert on referred cases, turnaround time, and the resulting outcomes of the complete workflow open. In particular, retained accuracy at a given referral rate describes the reduced set after uncertain photographs have been removed. It cannot by itself establish the accuracy of the combined decision process for all patients.

Severity Shift has an especially clear limit of this kind. The shifted-only split measures how accurately the binary classifier recognizes advanced positives. The withheld grades supply no negative cases, and the authors accordingly omit their disease ROC area on that split. When advanced positives are added to the full test mixture, joint ROC area can increase even while some advanced cases receive confidently negative predictions. The all-positive analysis, the joint discrimination score, and the error-conditioned histograms each expose a different part of that behavior.

Country Shift offers evidence about transfer between the particular datasets. APTOS differs from EyePACS in geography, patient population, equipment, and visible image artifacts. The reweighting comparison tests one aspect of that bundle by matching the observed clinical grade composition. The effect of any particular camera, demographic characteristic, or acquisition procedure remains unresolved by the design. Strong APTOS ROC area consequently describes this transfer and leaves performance at other sites an empirical question.

The comparison also leaves some uncertainty about how to attribute gains to a single technical mechanism. The methods share an architecture and data procedure, but their training objectives and sampled predictive distributions differ. The shifted-validation study changes both the validation population and the selection objective. The preprocessing study changes the inputs used for training and evaluation and compares the resulting fitted systems. These choices give meaningful comparisons of complete benchmark configurations. More narrowly controlled comparisons would be needed to assign an observed improvement to one aspect of an inference procedure or to one part of the tuning change.

Finally, a retrospective referral rate is obtained by ranking a set of images whose distribution is already available to the evaluator. A live service may instead use a threshold fixed ahead of time and encounter a changing mix of images. The curve tells a reader what happened when a given fraction of the benchmark set was set aside. The stability of an absolute entropy threshold and the resulting workload in a changing clinical stream remain separate questions. Similarly, exceeding the plotted sensitivity and specificity reference establishes the existence of a favorable point on a retrospective ROC curve. The benchmark’s evidence about uncertainty-based review comes from the selective prediction results.

What came after

Bakman and colleagues’ MARS, or Meaning-Aware Response Scoring, cites RETINA. Its stated subject is the scoring of responses with attention to their meaning. That places the citation in a different prediction setting from retinal screening, where RETINA scores uncertainty to decide which images should receive expert review. The citation establishes the connection between the papers. It leaves open whether MARS adopts a RETINA metric, borrows the referral procedure, or cites the benchmark for its treatment of predictive uncertainty under shift. MARS: Meaning-Aware Response Scoring

Cite

Cite as Neil Band, Tim G. J. Rudner, Qixuan Feng, Angelos Filos, Zachary Nado, Michael W. Dusenberry, Ghassen Jerfel, Dustin Tran and Yarin Gal. 2022. Benchmarking Bayesian Deep Learning on Diabetic Retinopathy Detection Tasks. arXiv:2211.12717.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.48550/arxiv.2211.12717 · arXiv 2211.12717

@misc{band2022benchmarking,
  title = {{Benchmarking Bayesian Deep Learning on Diabetic Retinopathy Detection Tasks}},
  author = {Neil Band, Tim G. J. Rudner, Qixuan Feng, Angelos Filos, Zachary Nado, Michael W. Dusenberry, Ghassen Jerfel, Dustin Tran and Yarin Gal},
  year = {2022},
  doi = {10.48550/arxiv.2211.12717},
  eprint = {2211.12717},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.48550/arxiv.2211.12717}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/band-2022-benchmarking-bayesian-deep-learning-diabetic/