Thesis:Conditional Diffusion Models as Generative Classifiers for Out-of-Distribution Detection in Inkjet Print Quality ControlAuthor: Ahmed Mohammed — MSc AI, Johannes Kepler University Linz (2026)
Supervisor: Univ.-Prof. Dr. Sepp Hochreiter · Industrial Partner: PROFACTOR GmbH
What Is This?
This HuggingFace repository stores all artifacts for the inkjet print quality control experiments from the above thesis:
Trained model weights (CDM + YOLO feature detector)
1from src.evaluate import evaluate_cdm, save_results
2# ... (set up test_loader with your data)3scores_df = evaluate_cdm(model, schedule, test_loader, num_trials=100, device=device)4save_results(scores_df, out_dir="results/my_eval")
For full data loading details, see evaluate.py in the GitHub repo.
Step 4 — Load the YOLO detector
python
1from ultralytics import YOLO
2yolo = YOLO("models/yolo_best.pt")3results = yolo("path/to/print_image.png", conf=0.3)4# Each detection is one print feature crop
Models
File
Description
AUROC
Params
models/cdm_v3_yolo_bbox.pt
CDM λ=0.01, base_ch=64 (proposed)
0.8603 single-split
9.33 M
models/cdm_v3_baseline.pt
CDM λ=0, base_ch=128 (thesis CV result)
0.8673 ± 0.023 CV
34.2 M
models/cdm_v3_test.pt
CDM λ=0.01, base_ch=64 (dev checkpoint)
≈0.85
9.33 M
models/yolo_best.pt
YOLOv8 feature detector (8 print features)
mAP@50=0.950
25.86 M
models/semantic_mismatch_angle_model.pt
Per-feature CDM: angle (~9.67:1 imbalance)
~0.82
8.94 M
models/semantic_mismatch_dist1_model.pt
Per-feature CDM: dist1
~0.89
8.94 M
models/semantic_mismatch_dots_model.pt
Per-feature CDM: dots (best feature)
~0.96
8.94 M
Which model should I use?
Quick evaluation:cdm_v3_yolo_bbox.pt — the thesis "proposed CDM", λ=0.01, base_ch=64 (9.33 M params)
Reproducing the thesis CV result:cdm_v3_baseline.pt — λ=0, base_ch=128 (34.2 M params); the 5-fold CV AUROC 0.8673 ± 0.023 comes from this wider model
YOLO feature detection only:yolo_best.pt (25.86 M params, YOLOv8-based)
Per-feature analysis:semantic_mismatch_*.pt — one model per feature, 8.94 M each, trained with a DiffGuard-style contrastive approach
Why does the baseline win on CV? On this small dataset (~1330 samples), the 5-fold CV shows λ=0 and λ=0.01 are statistically indistinguishable (0.8673 vs 0.8628). The single-split evaluation clearly favors λ=0.01 (+2.8 pp AUROC, −19 pp FPR@95). The thesis reports the CV result as the primary finding since it is more reliable.
Results
5-Fold Cross-Validation (Thesis Main Result)
λ
Mean AUROC
Std
Mean FPR@95
0.0 (baseline)
0.8673
0.023
0.563
0.01
0.8628
0.029
0.552
0.02
0.8510
0.033
0.624
0.05
0.8670
0.026
0.570
Protocol: 5-fold stratified CV, K=50 Monte Carlo trials, seed=42.
Single-Split Evaluation (N=266 test, seed=42)
λ
AUROC
FPR@95
K
0.0
0.8325
0.816
100
0.01
0.8603
0.626
100
0.02
0.8541
0.661
100
0.05
0.8553
0.529
100
Per-Feature AUROC (5-Fold CV, λ=0)
Feature
AUROC
Std
dots
0.956
0.035
dist6
0.936
0.067
dist1
0.887
0.073
angle
0.817
0.138
edge2
0.813
0.031
edge1
0.796
0.138
edge4
0.762
0.099
edge3
0.744
0.076
YOLO Feature Detector
Metric
Value
Precision
94.1%
Recall
89.1%
mAP@50
95.0%
mAP@50-95
84.7%
Dataset
The FTI_Zer0P dataset contains inkjet print images with YOLO-format annotations and quality labels.
Path
Contents
data/yolo_format_v2/
Full YOLO dataset (train/val/test images + labels)