Master's Thesis · FAU Erlangen-Nürnberg · FAPS
GRADE
Generalizable Reliability-Aware Distillation from Expert VLMs for Zero-Annotation Industrial Defect Detection
Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) · Institute for Factory Automation and Production Systems (FAPS)
An unlabelled production stream and a product name are enough. A VLM inspects each image next to normal references certified from the stream itself, and a small student learns its evidence — then runs alone.
Read the abstract
Automated visual inspection decides for every manufactured part whether it may leave the production line. Learned inspection systems need labelled defects or curated defect-free images, yet after a product changeover only unlabelled production images exist, an unknown and sometimes large share of them defective. Vision-language models know what defects look like, but they judge unreliably, do not know the intended appearance of a specific product and are too slow and costly for inline use; visual zero-shot detectors assume that frequent structures are normal and fail when defects recur or concern the composition of a part. To our knowledge, no published method estimates per product, from the contaminated stream, how far a dense visual detector can be trusted relative to a vision-language model.
This thesis presents GRADE, which uses a frozen vision-language model only offline, as a reliability-aware teacher on the unlabelled stream, and distils its evidence into a cloud-free real-time student. Normal references are certified from the stream by the agreement of two experts with different failure modes, and the language model judges each image next to references from other folds; on MVTec LOCO AD this comparison raises the area under the receiver operating characteristic curve (AUROC) for logical anomalies from 69.4 to 89.1. At teacher level, an agreement test on held-out folds gauges without labels how far a visual memory expert can be trusted; a proposition relates this agreement to the expert's true AUROC under conditional independence, and although positively dependent errors make it optimistic, it tracks the expert's accuracy across categories (Pearson 0.77, Spearman 0.46). Pseudo-boxes proved weak supervision (box average precision 21.2 % against 66.8 % with ground-truth boxes); the deployed student instead distils the comparative verdicts and the dense memory maps and returns an image score, an anomaly map and label-free operating points, with a forward path of 46 to 60 ms per image of up to 900×900 pixels on one GPU (exported predictor: median 80 ms over the 27 development categories, including large images).
All design decisions were made on these categories under time-stamped rules. On six generalisation sets untouched for it, the student of Stages I to VI reaches a mean image AUROC of 91.5, against 88.5 for MuSc and 87.8 for AnomalyVFM on identical images. The final system, frozen before it was scored on this design-untouched suite, reaches 91.6: it equals the student on image AUROC and adds label-free operating points, two-scale localisation on large images and leakage-safe cross-fitting on MVTec AD 2. Thus, cross-fitted certification between experts can take the place of target annotation for image-level detection and localisation on the tested benchmarks, whereas label-free operating points need operator confirmation and feature resolution limits the detection of defects of a few pixels.
How it works
One architecture, seven stages
The VLM works only inside the offline teacher (Stages I–V); the deployed student (VI–VII) runs alone. Click any figure to zoom.
Thesis Fig. 4.1 · offline teacher (I–V, uses the VLM) and deployed student (VI–VII, no VLM).
How the evaluation keeps labels and test images apart
Cross-fitting, label guard and pre-registered suites: every quantity used for an image in fold k comes from the other folds, and labels are read only by the evaluation code.
See it work
Guess first, then reveal
Real test images and the outputs of the deployed GRADE student, including the cases it gets wrong.
Want to try your own image? The live demo runs free in Google Colab.
How these examples were chosen
By a fixed rule, not by hand: per category the defective image with the median GRADE score, plus one logical anomaly, one tiny MVTec AD 2 defect and two normal parts. The decision is the label-free operating point; the colour scale runs from the 80th to the 99.9th percentile of the stream. Images from public benchmarks under their licences.
Results
Six untouched datasets, identical images
Image AUROC. Every baseline was run by the author on exactly the same images, all without target labels.
Image AUROC per dataset
GRADE (final) minus each baseline · percentage points, paired 95 % CI
Six-set mean: +3.1 [+2.0, +4.3] over MuSc, +3.8 [+3.0, +4.8] over AnomalyVFM, +12.2 [+10.9, +13.5] over AnomalyCLIP. AnomalyVFM is ahead on KolektorSDD2 and Eyecandies, where the VLM is weakest.
Show the full table
| Method | Real-IAD Var-20 | Real-IAD Var-B | Magnetic Tile | DAGM | KSDD2 | Eye- candies | Mean | TPR at 1 % FPR |
|---|---|---|---|---|---|---|---|---|
| AnomalyCLIPzero-shot, annotated aux. data | 72.6 | 75.8 | 70.5 | 97.7 | 93.9 | 65.6 | 79.4 | 44.8 |
| MuSctransductive zero-shot | 86.6 | 86.5 | 82.2 | 98.9 | 95.5 | 81.4 | 88.5 | 58.8 |
| AnomalyVFMzero-shot, synthetic aux. data | 85.2 | 83.8 | 74.5 | 99.9 | 97.3 | 85.8 | 87.8 | 58.0 |
| Blind VLMcloud VLM per image | 87.3 | 85.5 | 80.8 | 95.7 | 86.8 | 69.8 | 84.3 | 51.2 |
| Comparative VLM teachercloud VLM per image | 92.9 | 91.2 | 84.1 | 99.9 | 94.8 | 73.1 | 89.3 | 60.2 |
| ACE teachercloud VLM per image | 95.1 | 91.8 | 85.9 | 99.9 | 95.9 | 84.3 | 92.1 | 63.8 |
| GRADE student (I–VI)cloud-free student | 94.0 | 92.8 | 85.5 | 99.9 | 96.2 | 80.7 | 91.5 | 66.1 |
| GRADE (final)cloud-free student | 94.0 | 92.9 | 85.9 | 99.9 | 96.2 | 80.7 | 91.6 | 66.7 |
| GRADE-litecloud-free student | 93.9 | 92.7 | 85.6 | 99.9 | 96.2 | 79.9 | 91.4 | 66.9 |
The six sets were not used for any design decision (Stages I–VI student: untouched; GRADE (final) and GRADE-lite: design-untouched, scored a second time). 95 % CI of the mean of GRADE (final): [90.7, 92.5].
Label-free operating points vs. an oracle threshold · F1
Show the table
| 27 categories, final protocol | Image AUROC | AU-PRO @0.3 | AU-PRO @0.05 | SegF1 | ClassF1 |
|---|---|---|---|---|---|
| GRADE (final) | 90.8 | 87.4 | 70.4 | 34.4 | 76.4 |
| GRADE-lite | 91.0 | 84.1 | 64.8 | 33.3 | 77.7 |
The suite on which the design was selected (MVTec AD, VisA, MPDD, BTAD, MVTec AD 2). Pixel metrics at 518 px. Under the leakage-safe scene-group protocol MVTec AD 2 drops from 86.0 to 68.2 — a protocol correction (same-scene siblings no longer leak between folds), not a model change.
Trust without labels
How far can the visual expert be trusted?
ACE measures its agreement with the confident VLM verdicts on held-out folds. If the two experts erred independently, the agreement would be the true AUROC, shrunk by how pure the VLM's pseudo-labels are.
E[w] = ½ + J (A − ½), J = π+ + π− − 1
Under conditional independence (after Menon et al., 2015). Real experts err together on hard images, so measured agreement is optimistic; it still tracks the true AUROC across categories (Pearson 0.77, Spearman 0.46).
Limitations
Where it falls short
Tiny defects
Features at patch size 14 do not resolve defects of a few pixels: on MVTec AD 2, defects below 0.05 % of the image reach 55.3 image AUROC.
Thresholds need confirmation
Label-free operating points are useful defaults but stay well below an oracle threshold (development results); an operator should confirm them.
Semantics depend on the VLM
Where it is weak, the fixed fusion hurts: Eyecandies 80.7 against 89.8 for the dense branch alone. The teacher also needs a mostly normal stream.
Run it
Try it, or ask for the code
Live demo in Colab
Free · press “Run all” · eight MVTec AD products, your own image in, heatmap and decision out.
Code
Available on request; the public release follows with the paper.
Cite
BibTeX
@mastersthesis{elsherbini2027grade,
author = {ElSherbini, Mohamed},
title = {{GRADE}: Generalizable Reliability-Aware Distillation from Expert {VLMs} for Zero-Annotation Industrial Defect Detection},
school = {Friedrich-Alexander-Universit{\"a}t Erlangen-N{\"u}rnberg},
address = {Erlangen, Germany},
type = {Master's thesis},
year = {2027},
month = jan,
note = {Institute for Factory Automation and Production Systems (FAPS)},
url = {https://msherbinii.github.io/grade/}
}