TinyFaceNet quantization report

Generated 2026-10-10 · CPU i7-1360P · torch 2.12 / onnxruntime 1.26

How to read: Family acc = centroid argmax on the date-held-out test faces (small set, so ±1 face ≈ ±2%). Open-set acc = same but with unknown threshold 0.45 and 'other' included. Agreement = share of 1500 faces from the full dataset where the quantized model picks the same person as FP32 — statistically the more reliable number. Cos = mean cosine similarity of quantized vs FP32 embeddings. INT4 rows are weight-only simulations (CPU/Pi have no int4 conv kernels; the gain is file size only). Latency here is noisy (measured while a training job was running) and is NOT Pi latency.

v1 — tinyfacenet_v1.pt

test faces: 59 (49 family) · agreement subset: 1500 · THR=0.45

VariantFamily accΔ ptsOpen-set accΔ ptsAgreement vs FP32Cos vs FP32SizeLatency/face (this PC)Note
FP32 (PyTorch)98.0%+0.089.8%+0.0100.0%1.00003.89 MB21.8 msPyTorch fp32 (deploy params only)
FP32 (ONNX Runtime)98.0%+0.089.8%+0.0100.0%1.00003.88 MB59.3 msONNX Runtime fp32
INT8 static (ONNX Runtime)95.9%-2.088.1%-1.799.1%0.99571.09 MB82.3 msONNX Runtime static int8, per-channel, 200 calib imgs (deployable)
INT8 weight-only (simulated)98.0%+0.089.8%+0.099.9%1.00000.97 MB—simulated: int8 weights per-channel, fp32 activations
INT4 weight-only (simulated)93.9%-4.188.1%-1.798.9%0.97550.49 MB—simulated: int4 weights per-channel (coarse)
Per-person accuracy (test set)
VariantPERSON_APERSON_CPERSON_DPERSON_EotherPERSON_GPERSON_I
FP32 (PyTorch)100.0%100.0%90.9%100.0%40.0%100.0%100.0%
FP32 (ONNX Runtime)100.0%100.0%90.9%100.0%40.0%100.0%100.0%
INT8 static (ONNX Runtime)100.0%100.0%90.9%100.0%40.0%100.0%92.3%
INT8 weight-only (simulated)100.0%100.0%90.9%100.0%50.0%100.0%100.0%
INT4 weight-only (simulated)100.0%100.0%90.9%100.0%40.0%100.0%84.6%

v2 — tinyfacenet_v2.pt

test faces: 59 (49 family) · agreement subset: 1500 · THR=0.45

VariantFamily accΔ ptsOpen-set accΔ ptsAgreement vs FP32Cos vs FP32SizeLatency/face (this PC)Note
FP32 (PyTorch)95.9%+0.089.8%+0.0100.0%1.00003.89 MB11.9 msPyTorch fp32 (deploy params only)
FP32 (ONNX Runtime)95.9%+0.089.8%+0.0100.0%1.00003.88 MB63.2 msONNX Runtime fp32
INT8 static (ONNX Runtime)95.9%+0.091.5%+1.799.7%0.99801.09 MB91.3 msONNX Runtime static int8, per-channel, 200 calib imgs (deployable)
INT8 weight-only (simulated)95.9%+0.089.8%+0.099.9%0.99990.97 MB—simulated: int8 weights per-channel, fp32 activations
INT4 weight-only (simulated)93.9%-2.086.4%-3.499.2%0.97830.49 MB—simulated: int4 weights per-channel (coarse)
Per-person accuracy (test set)
VariantPERSON_APERSON_CPERSON_DPERSON_EotherPERSON_GPERSON_I
FP32 (PyTorch)100.0%85.7%90.9%100.0%60.0%100.0%100.0%
FP32 (ONNX Runtime)100.0%85.7%90.9%100.0%60.0%100.0%100.0%
INT8 static (ONNX Runtime)100.0%85.7%90.9%100.0%50.0%100.0%100.0%
INT8 weight-only (simulated)100.0%85.7%90.9%100.0%60.0%100.0%100.0%
INT4 weight-only (simulated)100.0%85.7%90.9%100.0%50.0%100.0%92.3%

Recommendation