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
Figure 1: Calibration-referenced measurement protocol: match deployment bytes, characterize recalibration variability, compare disagreement with both benchmarks, and stratify decisions by distance from the full-bank threshold. The example is a VisA pcb1 anomaly whose decision changes under 1% budget-matched PQ at α=1% . Each row uses its own score scale and threshold; the gray band marks the median to 97.5th percentile of 200 full-bank recalibrated thresholds. The image is resized from VisA (Zou et al., CC BY 4.0).
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
Table 1: Reference representations and allocation under a common byte cap. Detailed parameters and realized sizes are in Supplementary Tables S6 and S7.
Dataset
α
PQ
SQ
PQ median
PQ upper
PQ I-AUROC
Dcomp
Dcomp
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
Table 2: Core results at the 10% tier for WideResNet-50 with original banks. Disagreement and I-AUROC loss are category-equally weighted proportions; attainment columns give PQ passing/evaluable cells. Full paired uncertainty is shown in Fig. 3 and Supplementary Table S2.
Figure 2: Decision disagreement versus deployed size for WideResNet-50. Shading spans the category-equally weighted calibration median and upper-quantile benchmarks. Lightweight PQ is shown at its single realized size; int8 scalar quantization (SQ) uses the same nominal tiers as the matched methods.
Figure 3: Paired differences in decision disagreement between budget-matched PQ and int8 SQ (PQ − SQ) for WideResNet-50. Horizontal bars are 95% category-bootstrap intervals; the dashed line marks zero, and labels give Holm-adjusted p -values.
Figure 4: Cell-level calibration attainment for fixed 10% budget-matched PQ. The median and upper-quantile benchmarks are evaluated separately for each category–seed cell.
Figure 5: Decision disagreement stratified by distance from the full-bank threshold, separately for truly normal and truly anomalous test images. The category-equally weighted profiles use bins defined within each category–seed cell. The whole-test versus normal-holdout comparison is provided in Supplementary Fig. S3.
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
Table S1 : VisA sensitivity to probe-image source
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
Table S2 : Paired comparisons of fixed budget-matched PQ and fixed int8 SQ (PQ − SQ in Dcomp) for all tiers, datasets and operating levels.
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%
Table S3 : Calibration benchmark attainment for fixed int8 SQ at all tiers.
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
Table S4 : Original-bank backbone comparison for decision disagreement, calibration attainment, ranking and paired tests.
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
Table S5 : Backbone and reference bank comparison. Attainment counts are shown as median and upper-quantile counts separated by a centered dot.
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
Table S6 : Realized deployment size and image-level AUROC on the original WideResNet-50 banks.
Method
Stored representation
Budget allocation
Key parameters
VisA bytes
MVTec AD bytes
Full reference bank
All rows as float32 vectors
Uncapped; defines B0
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
Table S7 : Compression methods compared at matched deployment sizes. Byte columns give deployed sizes at the 10% tier; the full reference bank and lightweight PQ are listed at their single measured sizes.
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
—
—
—
—
—
—
Table S8 : Dataset coverage and calibration and holdout roles. Em dashes mark independent-pool summaries, which are available for VisA and MVTec AD; MPDD has no records in that pool inventory.
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
Table S9 : Experimental settings of the primary comparison and the validation comparisons.
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%
Table S10 : Calibration benchmark attainment under fixed budgets and automatic selection, including int8 SQ at the 10% and 25% tiers.
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
Table S11 : Paired comparisons of automatic selection and fixed-budget PQ.
Figure S1 : Image-level AUROC versus deployed size for WideResNet-50. Sizes are based on the deployed representations. The full bank and lightweight PQ are shown at their respective realized sizes. Int8 scalar quantization (SQ) is plotted at the same nominal tiers.
Figure S2 : Decision disagreement of budget-matched PQ at α = 1% by category and nominal tier for WideResNet-50. Each cell averages three seeds, and each panel uses its own gray scale.
Figure S3 : Normal-holdout disagreement in relation to disagreement across the labeled test set in the same cells.
Figure S4 : Decision disagreement versus deployed size for ResNet-18 with the original reference banks. The VisA and MVTec AD rows use separate vertical scales.
Post-training INT8 quantization is typically validated by checking accuracy retention, which requires ground-truth labels often unavailable in low-resource clinical settings. We show a label-free alternative: comparing a model's own output before and after quantization. We compute cosine similarity between the FP32 and INT8 models' output probability vectors for each prediction, which requires only a single forward pass. This output-agreement similarity separates lower-accuracy predictions across four evaluated architectures (ResNet-50, VGG-16-BN, Wide ResNet-50, and ViT-B/16) under fixed-percentile splits, outperforming a confidence-only baseline for all four. These results show that quantized models can be compared to their baselines to assess their drift and determine whether they are well suited for clinical deployment.
Evaluations of quantized language models attribute the change in a benchmark score to quantization. We write the measured change as the true change plus a term contributed by the instrument. Instrument error that is the same at every precision can shrink a paired comparison but cannot create or reverse an effect. Error that interacts with quantization can do both, and it is reported as an effect of quantization. We estimate this interaction for four measurement choices in 8 instruction-tuned models below two billion parameters, at float16, LLM.int8() and NF4, on identical items. Measured against labels from two human annotators, the 4-bit rise in harmful compliance is about half to two-thirds of the rise in non-refusal that a corrected key word detector records. Cloze and lettered multiple-choice scoring disagree about the effect of quantization far more than their noise allows: their estimates correlate at \r{ho} = 0.10, against a ceiling of about 0.77. LLM.int8() answers and generations depend on which items share a batch, and padding alone changes its answers. Rounding activations to 8 bits is enough to produce this dependence. NF4 is batch-invariant. The two largest reported calibration losses are response-bias shifts. We release item-level predictions, option scores and human annotations, and give recommendations for evaluating compressed small models.
Tanzeel Abbas, Tehseen Zia, David Windridge
COMSATS University Islamabad · Middlesex University London
Post-training compression of pretrained medical segmentation models commonly uses quantization, pruning, or distillation to reduce model size and computational cost. Existing medical segmentation quantization studies mainly evaluate Dice, model size, memory, and latency, but this is incomplete for safety-critical use because compressed models should also preserve uncertainty signals that indicate unreliable predictions. We study this problem in compressed MRI/CT segmentation and formalize why Dice can remain stable while uncertainty changes. Motivated by this failure mode, we propose score-guided aggregate-validated mixed precision (SGAV-MP), a post-training compression framework that selects layer precisions under reliability constraints. SGAV-MP ranks quantization actions with a compact benefit-risk score and accepts them only after full-model reliability validation on a calibration set. Across five 2D backbones and three 3D benchmarks, SGAV-MP preserves FP32-level Dice and high uncertainty-map agreement, achieving 3.59×--7.8× compression in 2D and 4.73×--7.82× in 3D. We also report backend-supported TensorRT deployment measurements separately to distinguish runtime execution from reliability-preserving storage compression.
Sagar Kumar, Shailja Sharma, Tirthajit Baruah +1
Indian Institute of Science, India · Indian Institute of Science (IISc), India