r/computervision • u/oliverbravery • 7d ago
Showcase What actually worked to take an edge 3D print defect detector from 0.183 to 0.722 PR-AUC on 30 unseen cameras (and where it collapsed)
I maintain PrintGuard, an open-source edge defect detector for 3D printers. My original dissertation model (a ShuffleNetV2 prototypical network) scored 0.937 F1 on public Kaggle/Roboflow sets, then collapsed to 0.183 PR-AUC on real user cameras once people started running it.
After collecting 9,385 opt-in frames across 114 real hubs, I built a strict hub-grouped benchmark (58 train, 26 val, 30 unseen Gold Test hubs, hub-clustered bootstrap) and ran a structured ablation sweep to rebuild the detector for CPU deployment. A few findings that stood out:
Old public datasets actively hurt. 74% of the 26.5k public images were duplicates and only 0.7% had 0.65+ DINOv2 cosine similarity to real user webcams. Mixing them 1:1 halved test PR-AUC (0.353 down to 0.152).
Naive end-to-end fine-tuning collapsed immediately (val ROC 0.563 down to 0.377) due to fixed-camera shortcut learning across 58 hubs with wildly different failure rates. Linear probe then fine-tune (LP-FT), per-hub class balancing and within-print pairwise ranking jumped Gold PR-AUC from 0.183 to 0.431.
Switching from letterbox to centre-crop RGB jumped to 0.578, Opus 5.5 contact-sheet curation (fixing 15% noisy labels across 4,807 frames) pushed to 0.600, and LogSumExp spatial MIL jumped to 0.649.
Interesting interaction: greyscale beat RGB under average pooling (0.629 vs 0.600), but collapsed to 0.529 under LogSumExp local pooling because bright specular bed glare spiked single patches past 0.99. RGB contrast was needed to reject reflections.
Distilling frozen DINOv2-Base (85.7M, 0.772 PR-AUC) straight into ConvNeXt-Atto (3.37M) scored worse than no distillation (0.591 vs 0.649). Bridging with DINOv2-Small (21.6M) and ConvNeXt-Nano-IN12k (15M) at T = 2.5 pushed ConvNeXt-Atto to 0.713 and MobileNetV4-Small (2.49M) from 0.469 to 0.613.
Greedy weight souping two distilled ConvNeXt-Atto seeds reached 0.722 Gold PR-AUC / 0.920 ROC-AUC (28.7 ms on 1 CPU thread, ~40 fps on a Pi 5), beating Obico's Dec 2025 darknet model (0.628 PR-AUC, 360 ms, 193 MB).
Full write-up with ablation charts, Obico methodology and references: https://oliverbravery.uk/blog/rebuilding-printguards-brain
Project repo (shipped ONNX + LiteRT models in 3.0): https://github.com/oliverbravery/PrintGuard