The Invisible Gorilla Effect in Out-of-distribution Detection
Organizations: Department of Engineering Science, University of Oxford, Oxford, UK
Abstract
Deep Neural Networks achieve high performance in vision tasks by learning features from regions of interest (ROI) within images, but their performance degrades when deployed on out-of-distribution (OOD) data that differs from training data. This challenge has led to OOD detection methods that aim to identify and reject unreliable predictions. Although prior work shows that OOD detection performance varies by artefact type, the underlying causes remain underexplored. To this end, we identify a previously unreported bias in OOD detection: for hard-to-detect artefacts (near-OOD), detection performance typically improves when the artefact shares visual similarity (e.g. colour) with the model's ROI and drops when it does not - a phenomenon we term the Invisible Gorilla Effect. For example, in a skin lesion classifier with red lesion ROI, we show the method Mahalanobis Score achieves a 31.5% higher AUROC when detecting OOD red ink (similar to ROI) compared to black ink (dissimilar) annotations. We annotated artefacts by colour in 11,355 images from three public datasets (e.g. ISIC) and generated colour-swapped counterfactuals to rule out dataset bias. We then evaluated 40 OOD methods across 7 benchmarks and found significant performance drops for most methods when artefacts differed from the ROI. Our findings highlight an overlooked failure mode in OOD detection and provide guidance for more robust detectors. Code and annotations are available at: https://github.com/HarryAnthony/Invisible_Gorilla_Effect.
Figures & tables
| Dataset | Training Data Desc. | # Training Images | # ID Test Images | OOD Data Desc. | # OOD Images | # OOD Type |
| CheXpert | No Support Devices | 5 213 | 1 282 | Synthetic squares | 1 282 | Synthetic Covariate |
| ISIC | Planar images with no rulers, ink or colour charts | 25 266 | 6 316 | Colour charts | 8 964 | Real Covariate |
| Ink annotations | 2 358 | Real Covariate | ||||
| MVTec | Metal nuts with no ink | 286 | 71 | Ink artefacts | 16 | Semantic (new defect) |
| MVTec | Pills with no ink | 233 | 58 | Ink artefacts | 18 | Semantic (new defect) |
| OOD Method | Ink Artefacts | Colour Chart Artefacts | |||||
| Similar | Dissimilar | Similar | Dissimilar | Synth Similar | Synth Dissimilar | (sim. - diss.) | |
| Feature-based Methods | |||||||
| CoP | 71.74 (0.02) | 65.76 (0.01) | 87.37 (0.01) | 84.35 (0.01) | 88.58 (0.01) | 83.97 (0.01) | 4.50 |
| CoRP | 71.16 (0.02) | 64.98 (0.01) | 85.75 (0.01) | 82.53 (0.01) | 84.75 (0.02) | 83.97 (0.01) | 4.70 |
| FeatureNorm | 75.12 (0.01) | 52.91 (0.02) | 62.40 (0.08) | 58.14 (0.12) | 61.47 (0.02) | 46.50 (0.05) | 13.24 |
| GRAM | 80.32 (0.03) | 72.71 (0.02) | 59.08 (0.01) | 56.79 (0.01) | 61.08 (0.04) | 57.45 (0.02) | 4.95 |
| Method | Pill | Metal Nut | |||
| Similar | Diss. | Similar | Diss. | (S-D) | |
| Feature-based Methods | |||||
| CoP | 88.27 | 81.15 | 53.07 | 39.20 | 10.50 |
| KDE | 81.35 | 73.59 | 63.52 | 43.98 | 13.65 |
| KNN | 93.33 | 86.15 | 71.02 | 36.93 | 20.64 |
| Mahal. | 71.86 | 68.72 | 69.77 | 58.30 | 7.31 |
| Method | Light aug. (ID acc -0.1 ) | Heavy aug. (ID acc -5.5 ) | ||
| Similar | Diss. | Similar | Diss. | |
| Feature-based Methods | ||||
| CoP | 77.0 (+5.3) | 70.3 (+4.6) | 79.6 (+7.8) | 69.8 (+4.1) |
| KNN | 90.1 (+4.5) | 77.3 (+7.2) | 87.9 (+2.2) | 77.6 (+7.5) |
| NAN | 76.0 (+0.4) | 58.9 (+10) | 73.6 (-2.0) | 64.4 (+16) |
| Confidence-based Methods | ||||
| Method | Method Hyperparameter(s) | Number of Settings per Model | ||
| ResNet18 | VGG16 | ViT-b32 | ||
| CoP | Dimensionality, | 3 | 3 | 3 |
| CoRP | Dimensionality, Gaussian Kernel, Number of random Fourier features, | 3 | 3 | 3 |
| FeatureNorm | Layer selection | 66 | 42 | 139 |
| GRAM | Powers, | 3 | 3 | 3 |
| KDE (Gaussian) | Layer selection | 66 | 42 | 139 |
| Method | Method Hyperparameter(s) | Number of Settings |
| Bayes By Backprop | Monte Carlo Samples, Scoring function, [Mutual Information] | 1 |
| CIDER | Distance function, [Cosine distance] Feature extractor layer, [Output layer] | 1 |
| Outlier Exposure | Scoring Function, [MCP] | 1 |
| Reject Class | 1 | |
| Rotation Prediction | Scoring Function, [Cross Entropy Loss] | 1 |
| Method | Method Hyperparameter(s) | Number of Settings per Model | ||
| ResNet18 | VGG16 | ViT-b32 | ||
| ASH | ASH function, [ASH-b, ASH-p, ASH-s] Percentile, | 12 | 12 | 12 |
| Deep Ensemble | Number of Ensemble members, Scoring function, [MCP] | 1 | 1 | 1 |
| DICE | Sparsity parameter, Truncation layer, [Penultimate layer] | 4 | 4 | 4 |
| GAIA-A | 1 | 1 | 1 | |
| GradNorm | Parameter selection Summation method, | 132 | 64 | 304 |
| Method | Method Hyperparameter(s) | Number of Settings |
| DeepSVDD | 1 | |
| DDPM-MSE | Number of steps, Number of reconstructions, ID comparator, [Training Data] | 1 |
| DDPM-LPIPS | Number of steps, Number of reconstructions, ID comparator, [Training Data] Feature extractor, [Pretrained AlexNet] | 1 |
| Foreign Patch Interpolation | Threshold, | 6 |
| RealNVP | Layer selection | 66 for ResNet18 42 for VGG16 139 for Vit-b32 |
| Colour of chart | Number of Images |
| Blue | 4 203 |
| Yellow | 2 502 |
| Green | 2 315 |
| Orange | 2 193 |
| Red | 1 462 |
| Grey / white | 380 |
| Colour of chart | Number of Images |
| Blue | 2 334 |
| Yellow | 1 202 |
| Green | 648 |
| Orange | 571 |
| Red | 805 |
| Grey / white | 365 |
| Colour of chart | Number of Images |
| Blue | 904 |
| Yellow | 419 |
| Green | 185 |
| Orange | 207 |
| Red | 321 |
| Grey / white | 92 |
| Colour of Ink | Number of Images |
| Purple | 1 558 |
| Black | 887 |
| Green | 26 |
| Red | 25 |
| Colour of Ink | Number of Images |
| Purple | 1 481 |
| Black | 839 |
| Green | 22 |
| Red | 22 |
| Colour of Ink | Number of Images |
| a) Metal Nut | |
| Black | 8 |
| Blue | 8 |
| b) Pill | |
| Red | 12 |
| Yellow | 6 |
| Dataset | Model ROI | Mask | Mean RGB |
| ISIC | Skin Lesion | SAM | (176, 116, 77) |
| MVTec-AD | Metal Nut | SAM | (77, 86, 83) |
| Colour | Mask | Mean RGB | dist | Label |
| Red | SAM | (222, 52, 57) | 81.3 | Sim. |
| Orange | SAM | (207, 123, 48) | 43.0 | Sim. |
| Yellow | SAM | (207, 191, 48) | 86.2 | Sim. |
| Blue | SAM | (65, 52, 57) | 129.7 | Diss. |
| Green | SAM | (53, 152, 69) | 128.4 | Diss. |
| White | SAM | (144, 158, 162) | 100.1 | Diss. |
| Colour | Mask | Mean RGB | dist | Label |
| Blue | GT | (57, 59, 59) | 40.9 | Sim. |
| Black | GT | (49, 53, 68) | 45.1 | Diss. |
| OOD Method | Ink Artefacts | Colour Chart Artefacts | ||
| AURC ( ) | AURC ( ) | |||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 0.11 (0.01) | 17.34 (0.01) | 2.73 (0.01) | 4.28 (0.01) |
| CoRP | 0.14 (0.03) | 17.39 (0.01) | 3.03 (0.01) | 4.71 (0.01) |
| FeatureNorm | 0.15 (0.01) | 26.01 (0.03) | 1.53 (0.01) | 2.11 (0.02) |
| OOD Method | Ink Artefacts | Colour Chart Artefacts | ||
| FPR@TPR80 ( ) | FPR@TPR80 ( ) | |||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 55.30 (0.01) | 61.85 (0.01) | 22.06 (0.02) | 28.34 (0.03) |
| CoRP | 56.91 (0.03) | 61.91 (0.01) | 26.16 (0.03) | 32.39 (0.03) |
| FeatureNorm | 34.91 (0.02) | 77.85 (0.03) | 60.44 (0.02) | 64.73 (0.04) |
| OOD Method | Ink Artefacts | Colour Chart Artefacts | ||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 77.43 (0.02) | 72.08 (0.01) | 91.09 (0.01) | 87.99 (0.02) |
| CoRP | 77.51 (0.03) | 70.05 (0.01) | 89.35 (0.01) | 85.52 (0.02) |
| FeatureNorm | 68.37 (0.03) | 52.33 (0.03) | 86.06 (0.01) | 76.39 (0.04) |
| GRAM | 63.54 (0.03) | 52.68 (0.01) | 78.90 (0.03) | 77.92 (0.03) |
| OOD Method | Ink Artefacts | Colour Chart Artefacts | ||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 64.07 (0.01) | 57.30 (0.01) | 54.70 (0.02) | 54.38 (0.02) |
| CoRP | 63.63 (0.01) | 56.07 (0.01) | 54.63 (0.02) | 54.16 (0.02) |
| FeatureNorm | 82.48 (0.01) | 56.18 (0.01) | 60.49 (0.02) | 59.88 (0.03) |
| GRAM | 68.25 (0.04) | 55.25 (0.03) | 59.32 (0.02) | 59.27 (0.02) |
| OOD Method | Pill | Metal Nut | ||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 88.27 (0.01) | 81.15 (0.02) | 53.07 (0.01) | 39.20 (0.03) |
| CoRP | 81.92 (0.01) | 71.41 (0.02) | 48.86 (0.01) | 39.09 (0.03) |
| FeatureNorm | 71.67 (0.02) | 56.41 (0.02) | 55.00 (0.01) | 52.69 (0.02) |
| GRAM | 74.76 (0.01) | 69.83 (0.01) | 68.94 (0.01) | 64.70 (0.01) |
| OOD Method | Pill | Metal Nut | ||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 72.76 (0.01) | 66.92 (0.01) | 78.79 (0.02) | 42.33 (0.02) |
| CoRP | 69.87 (0.01) | 64.38 (0.01) | 75.19 (0.03) | 41.86 (0.02) |
| FeatureNorm | 66.03 (0.02) | 62.49 (0.02) | 85.23 (0.02) | 68.75 (0.01) |
| GRAM | 57.55 (0.03) | 54.83 (0.02) | 78.23 (0.02) | 52.54 (0.02) |
| OOD Method | Pill | Metal Nut | ||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 76.68 (0.04) | 69.07 (0.03) | 68.18 (0.02) | 53.52 (0.02) |
| CoRP | 69.42 (0.02) | 65.77 (0.02) | 63.63 (0.02) | 50.90 (0.04) |
| FeatureNorm | 52.28 (0.02) | 51.15 (0.01) | 57.95 (0.02) | 45.45 (0.04) |
| GRAM | 64.90 (0.03) | 60.19 (0.03) | 72.46 (0.04) | 65.32 (0.03) |
| OOD Method | Light Augmentation | Heavy Augmentation | ||
| Similar | Dissimilar | Similar | Dissimilar | |
| Feature-based Methods | ||||
| CoP | 77.04 (+5.30) | 70.34 (+4.58) | 79.58 (+7.84) | 69.81 (+4.05) |
| CoRP | 74.60 (+3.44) | 68.72 (+3.74) | 74.33 (+3.17) | 67.00 (+2.02) |
| FeatureNorm | 75.92 (+0.80) | 64.24 (+11.33) | 75.66 (+0.54) | 68.09 (+15.18) |
| GRAM | 67.25 (-13.07) | 59.24 (-13.47) | 66.83 (-13.49) | 61.21 (-11.50) |
| OOD Method | Light Augmentation | |
| Similar | Dissimilar | |
| Feature-based Methods | ||
| CoP | 87.82 (+10.39) | 72.23 (+0.15) |
| CoRP | 80.95 (+3.44) | 69.28 (-0.77) |
| FeatureNorm | 82.09 (+13.72) | 73.27 (+20.94) |
| GRAM | 44.24 (-19.30) | 44.65 (-8.03) |
| Method | Inference Latency (ms) |
| Mahalanobis | 12.15 |
| + proj. | 14.23 |
| Featurenorm | 8.63 |
| + proj. | 10.32 |
| NaN | 11.04 |
| + proj. | 13.09 |
| OOD Artefact | k=2 | k=5 | k=10 | k=20 |
| Similar | 77.2 | 77.5 | 53.7 | 48.2 |
| Dissimilar | 67.0 | 75.8 | 59.4 | 47.0 |
| Method | Ink Artefacts | Colour Charts | ||
| Sim. | Diss. | Sim. | Diss. | |
| Mahalanobis | 77.0 | 63.6 | 96.7 | 95.4 |
| +Proj. | 77.5 | 75.8 | 95.8 | 97.7 |
| MBM | 77.4 | 63.7 | 97.0 | 95.5 |
| +Proj. | 77.6 | 75.3 | 96.1 | 97.2 |
| FeatureNorm | 75.1 | 52.9 | 62.4 | 58.1 |
OOD Detection
Out-of-distribution (OOD) detection identifies inputs unlike a model’s training data so systems can flag uncertainty, reject inputs, or adapt safely.
See all 222 papers