← All projectsBachelor's thesis · inovex · 09/2024 – 01/2025

Synthetic training data for small-object detection

Diffusion inpainting adds cars of different sizes to real images so that a detector learns to find small objects.

  • PyTorch
  • Faster R-CNN
  • Stable Diffusion
  • Segment Anything
  • Hugging Face Diffusers
  • MLflow

Object detectors often miss small objects, because the objects in common training datasets are mostly large and clearly visible. Using small cars as the example, I tested whether synthetic training images can make up for that. A pipeline segments vehicles with Segment Anything (SAM) and inserts them into real KITTI images with Stable Diffusion 2 inpainting, in different sizes, positions and contexts. I compared bounding-box and segmentation-based variants, generative and noise-based ones, and varied the share of synthetic images, training a Faster R-CNN five times per setup and evaluating with COCO metrics and the small-object metrics NWD and DotD. With segmentation-based augmentation, average precision and recall for small objects improved by more than 100 % over the baseline in some setups; the best results came from 75 to 100 % synthetic images.