Back to blog

Diffusion Models for Industrial Defect Detection at PROFACTOR GmbH

How I evaluated a public YOLO + conditional diffusion pipeline on the FTI_Zer0P benchmark under strict 5-fold cross-validation, reaching a 0.8673 +/- 0.0230 AUROC baseline and learning where the method transfers and where it does not.

11 min read
Diffusion ModelsAnomaly DetectionIndustrial AIYOLOv8Quality Control

Industrial Context

At PROFACTOR GmbH in Austria, I worked on machine vision for inkjet-printed building components. The goal was simple to state and difficult to solve: detect defects before a bad component leaves the line.

The challenge was not only model accuracy. The data was small, defects were heterogeneous, and evaluation had to be statistically honest.

The Pipeline

The system used a YOLO + conditional diffusion model pipeline:

  1. YOLOv8 extracted structured visual features from the printed component.
  2. A conditional diffusion model learned what normal feature crops should look like for each feature type.
  3. The reconstruction-based score became the anomaly signal.

This reused the same generative-classification mindset from my thesis, but in a much more constrained industrial environment.

Why the Setting Was Hard

  • only a limited number of source groups
  • strong variation across feature types
  • defect classes were not equally represented
  • cross-validation was mandatory

That means a flashy one-run result would have been misleading. I evaluated the pipeline on the public FTI_Zer0P benchmark with strict 5-fold cross-validation.

Results

The public crop-based baseline at $lambda = 0.0$ reached:

  • **0.8673 +/- 0.0230 AUROC**

In the production thresholded deployment, the system reached:

  • **98.4% defect classification accuracy**

Those numbers describe two different realities:

  • AUROC describes threshold-independent ranking quality under rigorous evaluation
  • the 98.4% number describes an operational decision threshold in deployment

What I Learned About Transfer

One of the most useful outcomes was discovering where the separation-loss idea stopped helping. On CIFAR-10 it was a major win. On this industrial benchmark, non-zero separation settings stayed within the cross-fold variation and did not survive Holm-corrected significance testing.

That does not make the idea weak. It makes the conclusion more precise: some gains are domain-dependent.

Engineering Takeaways

  • industrial ML needs evaluation discipline more than leaderboard energy
  • feature-type heterogeneity can matter more than architecture choice
  • public artifacts matter if you want results other people can trust

Artifacts:

  • Report PDF: https://ahmed-3m.github.io/Diffusion-Based%20Multi-class%20Defect%20Detection.pdf
  • Code: https://github.com/ahmed-3m/InkjetOOD
  • Weights: https://huggingface.co/ahmed-3m/InkjetOOD

Frequently Asked Questions

What result did the industrial system achieve?

On the public benchmark, the strict 5-fold CV baseline reached 0.8673 +/- 0.0230 AUROC. In the production setting, the deployed decision pipeline reached 98.4% defect-classification accuracy.

What was the architecture?

YOLOv8 was used as a feature backbone, and a conditional diffusion model acted as the generative classifier. Multi-head conditioning handled the different inkjet feature types.

Did separation loss help here too?

Not significantly. That became one of the most honest findings of the work: the method transferred well across code and workflow, but not all gains transferred to this small industrial dataset.