# Generowanie syntetycznych obrazów wad

EN: **Few-shot synthetic defect image generation** · id `defectsynthesis` · aliases: defect image generation, anomaly image synthesis, few-shot defect generation, AnomalyDiffusion, DFMGAN, syntetyczne wady, generowanie anomalii

Path: [AI Atlas](https://aiatlasgraph.com/llms.txt) › [AI w przemyśle](https://aiatlasgraph.com/t/industrialai.md) › [Wizyjna kontrola jakości](https://aiatlasgraph.com/t/visualinspection.md) › Generowanie syntetycznych obrazów wad

## Description

- PL: Generowanie par obraz–maska z wadami na podstawie kilku przykładów wad i wielu obrazów poprawnych, jako augmentacja do uczenia detektorów.
- EN: Generating defect image–mask pairs from a few defect examples and many normal images, as augmentation for training detectors.

## In one sentence

- PL: Dorysowywanie realistycznych rys, wgnieceń i plam na zdjęciach dobrych produktów, żeby było na czym uczyć system wykrywania wad.
- EN: Painting realistic scratches, dents and stains onto photos of good products, so there is something to train a defect detector on.

## Problem it solves

- PL: Dobra linia produkuje bardzo mało wadliwych sztuk, więc zebranie setek zdjęć każdego rodzaju wady trwałoby miesiącami.
- EN: A good line makes very few faulty parts, so collecting hundreds of photos of each defect type would take months.

## What it does

- PL: Jak charakteryzator filmowy, który z kilku zdjęć prawdziwych ran uczy się malować wiarygodne rany w dowolnym miejscu.
- EN: Like a film make-up artist who learns from a few photos of real wounds to paint convincing ones anywhere.

## Everyday example

- PL: Producent kabli ma tylko kilka zdjęć przeciętej izolacji, więc generuje z nich setki wariantów w różnych miejscach i uczy na nich kamerę kontrolną.
- EN: A cable maker has only a few photos of cut insulation, so it generates hundreds of variants in different spots and trains the inspection camera on them.

## This concerns you if you…

- PL: masz za mało zdjęć wadliwych produktów
- PL: potrzebujesz dokładnych masek wad do uczenia segmentacji
- PL: wprowadzasz nowy produkt bez historii wad
- EN: have too few photos of faulty products
- EN: need precise defect masks to train segmentation
- EN: are launching a product with no defect history

## Keywords

AnomalyDiffusion · DFMGAN · latent diffusion inpainting · StyleGAN2 · MVTec AD · defect segmentation · data augmentation · copy-paste augmentation

## How it works

- PL: Model generatywny najpierw uczy się wyglądu poprawnych sztuk, a następnie na kilku przykładach wad uczy się osobno wyglądu wady i jej położenia. Warianty dyfuzyjne wpisują wadę w wybrane miejsce poprawnego obrazu na podstawie maski, warianty GAN dokładają małą gałąź edytującą lokalne cechy. Powstają obrazy z dokładnymi maskami do uczenia detekcji i segmentacji.
- EN: A generative model first learns what good parts look like, then from a few defect examples learns the defect's appearance and location separately. Diffusion variants inpaint a defect into a chosen spot of a normal image from a mask; GAN variants add a small branch that edits local features. The output is images with exact masks for training detection and segmentation.

## Limits

- PL: Wygenerowane wady przybliżają tylko te kilka prawdziwych przykładów, więc nowe rodzaje usterek pozostają niepokryte. Realistyczny wygląd nie gwarantuje poprawy detektora na innej linii. Generowanie dyfuzyjne jest powolne.
- EN: Generated defects only approximate the few real examples, so new kinds of faults stay uncovered. Realistic looks do not guarantee a better detector on another line. Diffusion sampling is slow.

## Key terms

- PL: **maska wady**: Obraz zaznaczający piksel po pikselu, gdzie jest wada.
- PL: **few-shot**: Uczenie z zaledwie kilku przykładów danej klasy.
- PL: **inpainting**: Dorysowanie nowej treści w wybranym fragmencie obrazu.
- EN: **defect mask**: An image marking pixel by pixel where the defect is.
- EN: **few-shot**: Learning from only a handful of examples of a class.
- EN: **inpainting**: Filling in new content in a chosen part of an image.

## Know first

- [Modele dyfuzyjne (Diffusion models)](https://aiatlasgraph.com/t/diffusion.md)
- [Generatywne sieci przeciwstawne (GAN) (Generative adversarial networks (GAN))](https://aiatlasgraph.com/t/gan.md)

## Related topics

Untyped, symmetric "see also" links.

- [Dane syntetyczne i augmentacja (Synthetic data and augmentation)](https://aiatlasgraph.com/t/synthetic.md)

## Sources

- [AnomalyDiffusion: Few-Shot Anomaly Image Generation with Diffusion Model](<https://arxiv.org/abs/2312.05767>) `hu-anomalydiffusion-2023` · by Teng Hu, Jiangning Zhang, Ran Yi, Yuzhen Du, Xu Chen, Liang Liu, Yabiao Wang, Chengjie Wang
- [Few-Shot Defect Image Generation via Defect-Aware Feature Manipulation](<https://arxiv.org/abs/2303.02389>) `duan-dfmgan-2023` · by Yuxuan Duan, Yan Hong, Li Niu, Liqing Zhang

---

AI Atlas revision 122 (2026-10-30) · HTML: https://aiatlasgraph.com/t/defectsynthesis · index: https://aiatlasgraph.com/llms.txt · everything: https://aiatlasgraph.com/llms-full.txt · updated 2026-10-30
