How Many Categories Are Enough? Distribution-Free Certification Limits for Few-Shot Anomaly Thresholds
Organizations: University of Science, VNU-HCM, Ho Chi Minh City, Vietnam · Faculty of Information Technology, Van Lang School of Technology, Van Lang University, Ho Chi Minh City, Vietnam
Abstract
Few-shot anomaly detectors are judged by ranking metrics, yet deployment requires an alarm threshold with a controlled false-alarm rate (FAR). We ask how much normal evidence, in images or category units, is needed to certify such a threshold for an unseen category. Using a frozen DINOv2 principal component analysis (PCA) residual ranker on 15 MVTec and 12 VisA categories under four corruption types, we show that target-only leave-one-image-out (LOIO) calibration is resolution-limited and shift-fragile: rank values cannot fall below , and at the attainable level , empirical FAR reaches 0.341 on Gaussian-corrupted MVTec at , 1.7 times the nominal level. A category-count feasibility calculus is then derived: even with all-zero category losses and no multiplicity charged, any deterministic, uniformly valid, distribution-free 95% upper confidence bound (UCB) requires at least 14, 29, and 59 independent and identically distributed (iid) category draws at , , and ; these counts are necessary but not sufficient. The Cross-category Reliability Estimation with Source Support (CRESS) protocol splits source categories into disjoint reference, proposal, and certification roles. With only three or four certification categories, all 960 frozen configurations return the fail-closed threshold , and the smallest category-level UCB is 0.950. Image-unit analyses of the same archive select positive thresholds in 36.7% to 60.3% of target cells; these bounds hold for the selected source mixture, not for the marginal risk of a new-category draw. The contribution is a quantitative feasibility boundary and an estimand-aware protocol specifying when source evidence can, and cannot, support a transferable reliability claim.
Figures & tables
| rule / candidates | |||
| Distribution-free, no multiplicity | 14 | 29 | 59 |
| Distribution-free, | 22 | 46 | 94 |
| Distribution-free, | 29 | 61 | 125 |
| Distribution-free, | 35 | 74 | 152 |
| Hoeffding, | 60 | 240 | 958 |
| Hoeffding, | 80 | 320 | 1,280 |
| dataset | floor | nominal | attainable | FAR | power | |
| VisA (full) | 4 | 0.200 | 0.01 | 0.000 | 0.000 | 0.000 |
| 0.05 | 0.000 | 0.000 | 0.000 | |||
| 0.10 | 0.000 | 0.000 | 0.000 | |||
| 0.20 | 0.200 | 0.142 | 0.595 | |||
| 8 | 0.111 | 0.01 | 0.000 | 0.000 | 0.000 | |
| 0.05 | 0.000 | 0.000 | 0.000 |
| dataset | corruption | FAR | power | precision | |
| VisA (full) | blur | 4 | 0.144 | 0.606 | 0.825 |
| 8 | 0.094 | 0.566 | 0.870 | ||
| bright/contr. | 4 | 0.146 | 0.596 | 0.821 | |
| 8 | 0.098 | 0.557 | 0.864 | ||
| Gaussian noise | 4 | 0.133 | 0.575 | 0.829 | |
| 8 | 0.081 | 0.538 | 0.881 |
| source target | certification unit | units/cell | min UCB | nonzero frac. | interpretation |
| MVTec MVTec | category | 4 | 0.950 | 0.000 | category-unit gate fails |
| VisA VisA | category | 3 | 1.000 | 0.000 | category-unit gate fails |
| MVTec VisA | category | 4 | 0.961 | 0.000 | category-unit gate fails |
| MVTec MPDD | category | 4 | 0.986 | 0.000 | category-unit gate fails |
| MVTec MVTec | source image | 75 to 191 | 0.039 | 0.367 | iid-image sensitivity |
| VisA VisA | source image | 150 to 180 | 0.042 | 0.603 | iid-image sensitivity |
| source target | FAR | power | |
| MVTec MVTec | 0.05 | 0.075 | 0.404 |
| 0.10 | 0.131 | 0.566 | |
| 0.20 | 0.242 | 0.754 | |
| VisA VisA | 0.05 | 0.060 | 0.320 |
| 0.10 | 0.111 | 0.466 | |
| 0.20 | 0.208 | 0.639 |
| Dataset | Method | AUROC | AP | MiB | |
| MVTec | 1 | AnomalyDINO-S (reported) | 0.965 | 0.981 | – |
| WinCLIP (reported) | 0.931 | N/C | N/R | ||
| Controlled DINOv2 NN | 0.914 | 0.952 | 2.005 | ||
| PCA64 (controlled) | 0.904 | 0.951 | 0.095 | ||
| 4 | AnomalyDINO-S (reported) | 0.976 | 0.984 | – | |
| WinCLIP (reported) | 0.952 | N/C | N/R |
| dataset | max | top-0.5% | top-1% | top-2% | top-5% | |
| MVTec | 4 | 0.9571 | 0.9638 | 0.9667 | 0.9693 | 0.9621 |
| 8 | 0.9578 | 0.9685 | 0.9740 | 0.9759 | 0.9727 | |
| VisA | 4 | 0.9039 | 0.9101 | 0.9038 | 0.8944 | 0.8806 |
| 8 | 0.9101 | 0.9200 | 0.9147 | 0.9071 | 0.8941 |
Few-Shot Anomaly Detection
Few-shot anomaly detection uses a small set of examples to identify and localize unusual patterns in new data or domains.
See all 40 papers