Automatic dataset generation for specific object detection

Xiaotian Lin, Leiyang Xu, Qiang Wang · DOI

Abstract

In the past decade, object detection tasks are defined mostly by large public datasets. However, building object detection datasets is not scalable due to inefficient image collecting and labeling. Furthermore, most labels are still in the form of bounding boxes, which provide much less information than the real human visual system. In this paper, we present a method to synthesize object-in-scene images, which can preserve the objects' detailed features without bringing irrelevant information. In brief, given a set of images containing a target object, our algorithm first trains a model to find an approximate center of the object as an anchor, then makes an outline regression to estimate its boundary, and finally blends the object into a new scene. Our result shows that in the synthesized image, the boundaries of objects blend very well with the background. Experiments also show that SOTA segmentation models work well with our synthesized data.

Introduction

Deep learning models for object detection are notoriously data-hungry. While public datasets like COCO or Pascal VOC provide a foundation, they often fall short for specialized applications. Specifically, niche objects (e.g., unique industrial parts) are rarely represented in standard datasets, and manual labeling for pixel-perfect masks is prohibitively expensive. Moreover, models often develop contextual biases, identifying objects based on their surroundings—like a refrigerator in a kitchen—rather than intrinsic features.

To address these challenges, we developed an automated pipeline that generates high-quality synthetic datasets. By combining polar-coordinate boundary regression with advanced image matting and Poisson blending, the system transforms simple multi-view images of an object into a massive, perfectly labeled training set without manual intervention.

Methodology

The proposed pipeline consists of three primary stages to move from a raw object image to a synthesized scene.

The three-stage pipeline: (1) Center localization, (2) Contour regression, and (3) Object segmentation.
  1. Center Localization: A modified VGG-16 network, operating as a Fully Convolutional Network (FCN), identifies the approximate center of the target object. This center serves as a spatial anchor for subsequent steps.
  2. Outline Regression: To avoid the computational expense of per-pixel classification, we utilize a Stacked Hourglass network for outline regression. The model predicts the distance from the center to the object's edge in 16 radial directions (polar representation), significantly reducing problem complexity.
  3. Refined Segmentation and Matting: Since a 16-point outline can be coarse, the system generates a trimap to define foreground, background, and edge regions. Closed-form image matting is then applied to extract a high-quality alpha map, preserving fine details like sharp edges.
  4. Seamless Blending: The extracted object is placed into a random background from the Places365 dataset. We employ Poisson blending to adjust the object's colors to match the lighting and atmosphere of the new scene, ensuring a natural appearance for neural network training.

Datasets and Experimental Setup

The system leverages the BigBIRD Dataset for multi-view object images and Places365-Standard for diverse background scenes. For evaluation, we generated a custom dataset of 100,000 images featuring 10 random object categories placed across 365 scene types. This massive dataset was produced in approximately one hour using a single Nvidia 3090 GPU, highlighting the efficiency of the approach.

Key Results and Insights

Training a standard Mask R-CNN on this synthetic data yielded impressive results. The model achieved a Mean Average Precision (mAP) of 94.556 across the 10 test categories. Notably, the outline regression method outperformed traditional masks derived from depth data, which are often noisy or incomplete.

Synthetic images showing the target object automatically blended into various indoor and outdoor environments.

A critical insight from this work is the decoupling of object and context. By randomly pairing objects with unrelated backgrounds (e.g., a spray can in a playground), the model is forced to learn intrinsic object features rather than environmental cues. Furthermore, the use of "anchor points" with random offsets during training makes the boundary detection resilient to minor errors in center localization.

Conclusion and Future Work

This automated pipeline successfully bridges the synthetic-to-real domain gap, allowing models trained on generated data to segment objects in unseen real-world environments. Future work will focus on handling more complex or concave shapes that may challenge the 16-direction polar representation, as well as incorporating scenarios with heavy occlusion to further enhance detector robustness.

Summary updated

BibTeX
@misc{lin2022automatic,
  author = {Xiaotian Lin and Leiyang Xu and Qiang Wang},
  title = {{Automatic dataset generation for specific object detection}},
  year = {2022},
  eprint = {2207.07867},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2207.07867},
}
Figure