A Calibration-Referenced Protocol for Measuring Decision Stability under Reference Bank Compression
Organizations: Shanghai University of Sport
Abstract
Reference banks used for industrial image inspection can be compressed to fit a deployment budget, but the resulting anomaly decisions depend on both the compressed scores and the operating threshold. We present a four-step protocol that compares compression methods at matched deployment sizes, establishes a reference distribution from 200 recalibrations, evaluates disagreement against two calibration benchmarks, and measures changes by distance from the full-bank threshold. With WideResNet-50, budget-matched product quantization (PQ) at the 10% budget has the lowest decision disagreement among five matched methods, including int8 scalar quantization, on VisA and MVTec AD at both operating levels. Int8 scalar quantization gives lower disagreement than PQ at the other four budgets. On MVTec AD at the lower operating level, PQ meets the calibration median in 34/39 cells and the upper quantile in 39/39 cells. Category-equally weighted image-level AUROC loss at this budget ranges from 0.0003 to 0.0037 across the evaluated configurations. On VisA at the 1% budget and a 1% operating level, disagreement reaches 28.12% (95% CI 23.25--33.58%) among near-threshold anomalies and 1.30% (0.79--2.14%) across the normal holdout. The 10% budget-matched PQ setting retains the lowest disagreement among four compared methods with ResNet-18, with clean reference banks, and when thresholds are estimated from normal-directory probes. The protocol connects deployment size to a calibration-referenced decision measure and identifies the evaluation populations most informative for inspection.
Figures & tables
| Method | Stored representation | Allocation |
|---|---|---|
| Full bank | All float32 reference vectors | Uncapped reference |
| Prefix | Leading float32 rows | Rows fitting after the header |
| Random | Random float32 subset in bank order | Rows fitting after the header |
| Rebuilt greedy | Coverage-selected float32 subset | Rows fitting after the header |
| Budget-matched PQ | Codes for all rows and subspace codebooks | Feasible layout prioritizes code precision, then payload |
| Int8 SQ | Leading int8 rows and per-dimension minimum/range | Rows fitting with the two float32 vectors |
| Dataset | PQ | SQ | PQ median | PQ upper | PQ I-AUROC | |
|---|---|---|---|---|---|---|
| attainment | attainment | loss | ||||
| VisA | 1% | 0.002984 | 0.004632 | 35/36 | 36/36 | 0.000276 |
| VisA | 5% | 0.005286 | 0.009206 | 35/36 | 36/36 | 0.000276 |
| MVTec AD | 1% | 0.01400 | 0.02595 | 34/39 | 39/39 | 0.001513 |
| MVTec AD | 5% | 0.01193 | 0.02724 | 32/39 | 38/39 | 0.001513 |
| Backbone and bank | Probe source | Prefix Dcomp | Random Dcomp | Rebuilt greedy Dcomp | Budget-matched PQ Dcomp | J2 median | J2 97.5th percentile | |
|---|---|---|---|---|---|---|---|---|
| WideResNet-50 original | 0.01 | All recorded probe images | 0.010220 | 0.019702 | 0.009629 | 0.002984 | 35/36 | 36/36 |
| WideResNet-50 original | 0.01 | Normal directories | 0.034941 | 0.065929 | 0.042914 | 0.010088 | 33/36 | 36/36 |
| WideResNet-50 original | 0.05 | All recorded probe images | 0.019600 | 0.040281 | 0.022073 | 0.005286 | 35/36 | 36/36 |
| WideResNet-50 original | 0.05 | Normal directories | 0.053127 | 0.095792 | 0.060188 | 0.015700 | 28/36 | 36/36 |
| ResNet-18 original | 0.01 | All recorded probe images | 0.009114 | 0.020931 | 0.008909 | 0.002550 | 35/36 | 36/36 |
| ResNet-18 original | 0.01 | Normal directories | 0.041193 | 0.064180 | 0.036387 | 0.009535 | 33/36 | 36/36 |
| Dataset | Tier | PQ Dcomp | SQ Dcomp | Mean difference | 95% CI | Holm p | Categories | |
|---|---|---|---|---|---|---|---|---|
| MPDD | 0.01 | 0.5% | 0.1755 | 0.1451 | 0.03041 | [ 0.008439, 0.06926] | 1.00 | 2 |
| MPDD | 0.01 | 1% | 0.2292 | 0.1605 | 0.06864 | [0.04091, 0.1027] | 0.313 | 5 |
| MPDD | 0.01 | 5% | 0.07760 | 0.05831 | 0.01930 | [ 0.004547, 0.04837] | 1.00 | 6 |
| MPDD | 0.01 | 10% | 0.02755 | 0.03935 | 0.01180 | [ 0.03396, 0.002786] | 1.00 | 6 |
| MPDD | 0.01 | 25% | 0.006845 | 0 | 0.006845 | [0.0007032, 0.01455] | 1.00 | 6 |
| MPDD | 0.05 | 0.5% | 0.2837 | 0.2356 | 0.04811 | [ 0.03797, 0.1342] | 1.00 | 2 |
| Dataset | Benchmark | Configuration | Pass | Eligible | Planned | NA | Fallback | Eligible rate | Planned rate | |
|---|---|---|---|---|---|---|---|---|---|---|
| MPDD | 0.01 | Median | Fixed SQ 0.5% | 2 | 15 | 18 | 3 | 0 | 13.33% | 11.11% |
| MPDD | 0.01 | Upper quantile | Fixed SQ 0.5% | 6 | 15 | 18 | 3 | 0 | 40.00% | 33.33% |
| MPDD | 0.01 | Median | Fixed SQ 1% | 3 | 15 | 18 | 3 | 0 | 20.00% | 16.67% |
| MPDD | 0.01 | Upper quantile | Fixed SQ 1% | 7 | 15 | 18 | 3 | 0 | 46.67% | 38.89% |
| MPDD | 0.01 | Median | Fixed SQ 5% | 5 | 15 | 18 | 3 | 0 | 33.33% | 27.78% |
| MPDD | 0.01 | Upper quantile | Fixed SQ 5% | 9 | 15 | 18 | 3 | 0 | 60.00% | 50.00% |
| Dataset | Metric | WideResNet-50 | ResNet-18 | |
|---|---|---|---|---|
| VisA | 0.01 | Dcomp Prefix | 0.01022 | 0.00911 |
| VisA | 0.01 | Dcomp Random | 0.01970 | 0.02093 |
| VisA | 0.01 | Dcomp Rebuilt greedy | 0.00963 | 0.00891 |
| VisA | 0.01 | Dcomp Budget-matched PQ | 0.00298 | 0.00255 |
| VisA | 0.01 | Median attainment | 35/36 | 35/36 |
| VisA | 0.01 | Upper-quantile attainment | 36/36 | 36/36 |
| Measure | WideResNet-50 original | ResNet-18 original | ResNet-18 clean |
|---|---|---|---|
| J1 minimum Dcomp | 4/4 | 4/4 | 4/4 |
| J2 joint calibration attainment | 4/4 | 4/4 | 4/4 |
| J3 nearest-bin anomaly > holdout | 4/4 | 4/4 | 4/4 |
| VisA, = 1%, median / upper quantile | 35/36 36/36 | 35/36 36/36 | 35/36 36/36 |
| VisA, = 5%, median / upper quantile | 35/36 36/36 | 35/36 36/36 | 36/36 36/36 |
| MVTec AD, = 1%, median / upper quantile | 34/39 39/39 | 34/39 39/39 | 32/39 39/39 |
| Dataset | Method | Nominal fraction | Mean bytes | I-AUROC | Categories |
|---|---|---|---|---|---|
| VisA | Prefix | 0.005 | 106520 | 0.601200 | 12 |
| VisA | Prefix | 0.01 | 217112 | 0.729600 | 12 |
| VisA | Prefix | 0.05 | 1089560 | 0.877600 | 12 |
| VisA | Prefix | 0.10 | 2183192 | 0.900000 | 12 |
| VisA | Prefix | 0.25 | 5455896 | 0.908800 | 12 |
| VisA | Random | 0.005 | 106520 | 0.556400 | 12 |
| Method | Stored representation | Budget allocation | Key parameters | VisA bytes | MVTec AD bytes |
|---|---|---|---|---|---|
| Full reference bank | All rows as float32 vectors | Uncapped; defines | 5331 rows 1024 dimensions; 24-byte header | 21835800 | 21835800 |
| Prefix | Leading rows in bank order, float32 | Rows that fit under the cap after the header | 533 rows at the 10% tier | 2183192 | 2183192 |
| Random | Rows drawn without replacement, stored in bank order, float32 | Rows that fit under the cap after the header | 533 rows at the 10% tier; sampling seed 17 | 2183192 | 2183192 |
| Rebuilt greedy | Rows added by greatest squared distance to the selected set, float32 | Rows that fit under the cap after the header | 533 rows at the 10% tier; selection starts from the first row | 2183192 | 2183192 |
| Budget-matched PQ | PQ codes for every row with per-subspace codebooks | Layout chosen under the cap, code precision first, then payload size | 190 subspaces of width 6 and 256 centroids per subspace at the 10% tier; codebooks trained on 4096 rows with 8 k-means iterations | 2180360 | 2180360 |
| Int8 SQ | Leading rows as signed 8-bit codes with per-dimension float32 minimum and range | Leading rows that fit under the cap with the two per-dimension vectors | 8 bits per coordinate; 2124 rows at the 10% tier | 2183192 | 2183192 |
| Dataset | Categories | Seeds | Cells | Independent-pool records | Eligible normal images (total) | Calibration pool (total) | Normal holdout (total) | Eligible normal images (mean) | Calibration pool (mean) | Normal holdout (mean) |
|---|---|---|---|---|---|---|---|---|---|---|
| VisA | 12 | 17, 29, 43 | 36 | 36 | 14117 | 12965 | 1152 | 392.1389 | 360.1389 | 32.0000 |
| MVTec AD | 13 | 17, 29, 43 | 39 | 39 | 6201 | 4953 | 1248 | 159.0000 | 127.0000 | 32.0000 |
| MPDD | 6 | 17, 29, 43 | 18 | 0 | — | — | — | — | — | — |
| Item | Setting |
|---|---|
| Datasets and cells | VisA: 12 categories, 36 cells; MVTec AD: 13 categories, 39 cells; MPDD: 6 categories, 18 cells |
| Seeds | 17, 29 and 43 for every category |
| Primary backbone and feature layers | ImageNet-pretrained WideResNet-50; second and third residual groups, 28 28 patch grid, 1024-dimensional descriptors |
| Second backbone | ImageNet-pretrained ResNet-18 on VisA and MVTec AD with the original and clean banks at the 1%, 5% and 10% tiers |
| Input size | Shorter edge resized to 256 pixels, 224 224 center crop, ImageNet normalization |
| Budget tiers | 0.5%, 1%, 5%, 10% and 25% of the full-bank vector payload |
| Dataset | Benchmark | Configuration | Pass | Eligible | Planned | NA | Fallback | Eligible rate | Planned rate | |
|---|---|---|---|---|---|---|---|---|---|---|
| MPDD | 0.01 | Median | Fixed PQ 1% | 1 | 12 | 18 | 6 | 0 | 8.33% | 5.56% |
| MPDD | 0.01 | Upper quantile | Fixed PQ 1% | 5 | 12 | 18 | 6 | 0 | 41.67% | 27.78% |
| MPDD | 0.01 | Median | Fixed PQ 10% | 9 | 15 | 18 | 3 | 0 | 60.00% | 50.00% |
| MPDD | 0.01 | Upper quantile | Fixed PQ 10% | 10 | 15 | 18 | 3 | 0 | 66.67% | 55.56% |
| MPDD | 0.01 | Median | Automatic selection PQ | 8 | 15 | 18 | 3 | 2 | 53.33% | 44.44% |
| MPDD | 0.01 | Upper quantile | Automatic selection PQ | 12 | 15 | 18 | 3 | 2 | 80.00% | 66.67% |
| Dataset | Contrast | Mean difference | 95% CI | p | Holm p | Categories | |
|---|---|---|---|---|---|---|---|
| VisA | 0.01 | Automatic selection Fixed PQ 1% | 0.00120 | [ 0.0131, 0.0106] | 0.814 | 0.814 | 12 |
| VisA | 0.01 | Automatic selection Fixed PQ 10% | 0.01790 | [0.0094, 0.0264] | 0.000488 | 0.00195 | 12 |
| VisA | 0.05 | Automatic selection Fixed PQ 1% | 0.01040 | [ 0.0274, 0.0067] | 0.210 | 0.420 | 12 |
| VisA | 0.05 | Automatic selection Fixed PQ 10% | 0.02690 | [0.0200, 0.0337] | 0.000488 | 0.00195 | 12 |
| MVTec AD | 0.01 | Automatic selection Fixed PQ 1% | 0.03840 | [ 0.1008, 0.0240] | 0.210 | 0.419 | 13 |
| MVTec AD | 0.01 | Automatic selection Fixed PQ 10% | 0.08920 | [0.0234, 0.1549] | 0.000244 | 0.000977 | 13 |
Product Quantization
Product quantization compresses high-dimensional vectors by encoding subvectors separately, enabling compact storage and fast approximate similarity search.
See all 15 papers