Synthetic Data Series

Generating synthetic X-ray defect images for industrial inspection when real defective examples are scarce – physics-based simulation, generative fine-tuning, GANs, and the classic cut-paste baseline, measured against each other.
series
computer-vision
synthetic-data
X-ray
semiconductor
Author

Hasan Goni

Published

September 4, 2026

Modified

September 4, 2026

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

  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Part 8 – Cut-paste + Poisson blending baseline. Coming soon.
  9. 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

BibTeX citation:
@online{goni2026,
  author = {Goni, Hasan},
  title = {Synthetic {Data} {Series}},
  date = {2026-09-04},
  langid = {en}
}
For attribution, please cite this work as:
Goni, Hasan. 2026. “Synthetic Data Series.” September 4.
Free email course · 7 days

Industrial Vision Foundations

AI can write the code, but someone still has to know which method fits a real inspection line. One short lesson a day for 7 days on the classical computer vision techniques that still run production systems.

Runnable code in every lesson. No spam, unsubscribe any time.

Questions, corrections or feedback?

Found a mistake, or want a topic covered next? Leave a comment below (sign in with GitHub), or write to hasanme1412@gmail.com. I read everything.