0.1 Series Overview
Real defect examples are chronically scarce in industrial X-ray inspection – especially for rare defect classes like voids, cracks, and bent leads. The usual manual fallback is cut-and-paste: crop a real defect, paste it into a good image. This series explores whether there’s something better, working through the space of synthetic-defect-generation methods from first-principles physics to learned generative models, using the real, public GDXray dataset throughout.
Every post ends with an honest limitation, not just a win – same ethos as the Local-AI Defect Inspection series, which this one complements: that series evaluates and fine-tunes models on real defect data; this one is about generating more of it. The Video & Sound Generation series picks up the same real GDXray data and asks the video+audio version of this question.
0.1.1 Posts in this series
- Part 1 – Physics-Based X-ray Simulation. No imaging-equipment access, so every physical parameter is fit directly from real GDXray pixel statistics: an attenuation-depth calibration, a photon-noise model, a blur kernel – then a real base radiograph is inverted, edited inside a mask, and re-rendered into a synthetic defect image with a ground-truth mask for the injected defect, free.
- Part 2 – Mask-Conditioned Diffusion Fine-Tuning. LoRA fine-tunes a real Stable Diffusion inpainting model on real GDXray defect crops, so it learns actual defect texture instead of physics’s hand-drawn shape – compared directly against Part 1 on the identical mask.
- Part 3 – ControlNet-Conditioned Diffusion. Same SD1.5 setup as Part 2, plus a ControlNet fed the real defect silhouette instead of a synthetic crack shape – confirmed real and measurably different from Part 2’s output, but inconclusive on a single example whether it reads as more authentic; the real test is Part 9’s downstream comparison.
- Part 4 – Flux-Based Mask-Conditioned Generation. Swaps SD1.5 for a 12B-parameter diffusion transformer (real, gated checkpoint – access confirmed via the HF API first) – a genuinely surprising, honestly-reported negative result: the bigger model was less visible than Part 2’s on the identical test case.
- Part 5 – Joint Image and Mask Diffusion. A from-scratch model trained to generate the defect image and its mask together, no conditioning at all – directly inspired by NVIDIA’s MAISI architecture, scoped to 2D. First run overfit with no warning from the loss curve; revised after a reader question surfaced a missing standard technique (EMA weight smoothing) – real, better, still-imperfect results after adding it, still the weakest method in the series so far, but closer.
- Part 6 – Combining what works. Takes whichever of Parts 3-5 actually helped, combines it with Part 1’s calibrated noise model, and reports whether the improvements actually stack. Coming soon.
- Part 7 – GAN-Based Synthesis. A distinct third generative family: a from-scratch, defect-aware conditional GAN. The adversarial half broke almost immediately (the discriminator dominated by step 100 of 3000) – exactly the failure mode this series’ design spec predicted – and the L1 reconstruction term alone produced a real, visible defect mark, but with an architecture-specific checkerboard artifact that inflates local texture variance above the real defect’s own.
- Part 8 – Cut-paste + Poisson blending baseline. Coming soon.
- Part 9 – Post-training a real detector on synthetic data (the payoff). Post-trains the same baseline detector separately on real+synthetic splits from every method above, ablates the real:synthetic ratio, and reports which method’s data actually moves a real downstream model. Coming soon.
Reuse
Citation
@online{goni2026,
author = {Goni, Hasan},
title = {Synthetic {Data} {Series}},
date = {2026-09-04},
langid = {en}
}