Deep Template-based Object Instance Detection

Jean-Philippe Mercier, Mathieu Garon, Philippe Giguère, Jean-François LalondearXiv 2019

TL;DR

This paper introduces a deep learning framework for zero-shot object instance detection, allowing a system to find specific, unique objects (like a particular toy or industrial part) at test time without any additional training. By using a set of rendered templates and a novel "Object Attention Branch," the model achieves performance on par with specialized detectors while being significantly more robust to occlusion than traditional template-matching methods.

What Problem Does This Paper Address?

Standard object detection usually focuses on classes (e.g., "find all chairs"). However, many applications in robotics and augmented reality require finding a specific instance (e.g., "find this exact chair model").

The current state-of-the-art for instance detection involves training a dedicated neural network for every single object. This is incredibly expensive, requiring a custom dataset and hours of training for every new item you want to detect. Traditional alternatives, like template matching (e.g., LINE-2D), don't require retraining but are notoriously "brittle"—they fail easily under heavy occlusion, lighting changes, or cluttered backgrounds.

The authors bridge this gap by creating a generic model that can take a few images (templates) of a new, unseen object and immediately locate it in a complex scene.

Methods

The authors propose a two-stage end-to-end architecture that treats detection as a sophisticated template-matching problem.

Figure 2: Our proposed architecture. In stage 1, the network learns to localize an object solely from a set of templates. Object- specific features are learned by the “object attention” and “pose-specific” branches, and are subsequently correlated/subtracted with the generic features of the backbone network. In stage 2, the network leverages the learned representation to perform different tasks: binary segmentation, center and bounding box prediction. At test time, a single “global” template is randomly selected, while several “local” templates are combined.

Stage 1: Correlations

The network processes a query image through a DenseNet121 backbone. The core innovation lies in how it uses two types of templates:

  • Global Template: Fed into an Object Attention Branch (OAB). This branch generates "tunable filters" that are injected into the early layers of the backbone. This effectively tells the backbone, "Look for features relevant to this specific object," such as its unique color or low-level textures.
  • Local Templates: Multiple viewpoints of the object are fed into a Pose-Specific Branch (PSB). These generate embeddings that are cross-correlated with the backbone's high-level features to find matches across different orientations.

Stage 2: Object Detection

The correlation maps are passed to several "Task Heads" that predict:

  1. Binary Segmentation: A pixel-wise mask of the object.
  2. Center Prediction: A heatmap indicating the object's center.
  3. Bounding Box: The final location and size of the instance.

Training on Synthetic Data

The model is trained entirely on synthetic data using Domain Randomization (DR). They used 125 different 3D models (none of which appear in the test sets) and rendered them in physically simulated scenes with randomized lighting, textures, and backgrounds to ensure the model generalizes to the real world.

Figure 3: Examples of the domain randomization used for training, including physics-based renders.

Datasets

  • Training: A custom dataset of 20,000 synthetic images generated from 125 textured 3D models (excluding those in Linemod).
  • Evaluation:
    • Linemod: A standard benchmark for instance detection in cluttered scenes.
  • Occluded Linemod: A much more challenging subset where objects are significantly hidden by other items.

Key Insights and Ideas

  • Instance-Specific Attention is Key: The ablation study showed that the Object Attention Branch was the most critical component. Removing it caused a nearly 20% drop in performance. This suggests that "tuning" the backbone's early filters is more effective than just doing a final correlation at the end.
  • Synthetic-Only Training Works: By training on a wide enough variety of objects (125+) with heavy domain randomization, the model learns a generic concept of "object-ness" and "template-matching" that transfers perfectly to real-world images of objects it has never seen before.
  • Robustness to Occlusion: Unlike traditional template matching, which looks for exact pixel patterns, this deep approach learns high-level feature embeddings, making it much more resilient when only part of the object is visible.

Key Results

  • Occluded Linemod: The method achieved a 50.71 mAP, a massive improvement of nearly 30 points over the traditional LINE-2D method (21.0 mAP).
  • Competitive with Specialized Models: Remarkably, this generic model performed on par with methods like Brachmann et al., which are explicitly trained on the test objects.
  • Generalization: The model showed that increasing the number of objects in the training set directly improved its ability to generalize to new test objects.

Limitations and Future Work

  • Inference Speed: The current implementation takes about 0.43 seconds to detect a single object instance. Because the backbone must be "tuned" by the OAB for each specific object, the computation time scales linearly with the number of objects you are looking for.
  • Clutter Sensitivity: The authors noted that false positives still occur when the background contains clutter with very similar colors or shapes to the target object.
  • Future Directions: The authors suggest extending this framework to predict full 6-DOF pose (3D orientation and translation) rather than just 2D bounding boxes. They also envision a cascaded approach to improve speed when searching for many objects simultaneously.

Summary updated

BibTeX
@misc{mercier2019deep,
  author = {Jean-Philippe Mercier and Mathieu Garon and Philippe Giguère and Jean-François Lalonde},
  title = {{Deep Template-based Object Instance Detection}},
  year = {2019},
  eprint = {1911.11822},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1911.11822},
}
Figure