Visualizing Object Detection Features

Carl Vondrick, Aditya Khosla, Hamed Pirsiavash, Tomasz Malisiewicz, Antonio Torralba

TL;DR

This paper introduces a method to "see" through the eyes of an object detector by inverting high-dimensional features (like HOG or CNN activations) back into natural images. The authors reveal that many baffling detector failures—such as mistaking sea water for a car—occur because the false alarms actually look like the target object in feature space, suggesting that our choice of features, rather than learning algorithms, is often the primary bottleneck in computer vision.

What Problem Does This Paper Address?

Computer vision researchers often struggle to explain why their models fail. When a detector produces a high-scoring false alarm, is it because the training set was too small? Is the learning algorithm flawed? Or are the underlying features simply not descriptive enough?

Because features like Histograms of Oriented Gradients (HOG) are high-dimensional and abstract, they are nearly impossible for humans to inspect directly. This "black box" nature makes debugging difficult. The authors aim to bridge this gap by creating a "visualization toolbox" that translates these abstract mathematical representations back into a visual language humans can understand.

Methods

The core contribution is a general algorithm for feature inversion. Since the mapping from an image to a feature is "many-to-one" (many different images can result in the same feature vector), the goal is to find a set of natural-looking images that could have produced a specific feature.

The authors primarily use a paired dictionary approach:

  1. Learning: They extract millions of image patches and their corresponding features from a large database. They then jointly learn two bases: one for images ($U$) and one for features ($V$).
  2. Inversion: To invert a new feature, they find a sparse set of coefficients ($\alpha$) that best reconstructs the feature using basis $V$. They then apply these same coefficients to image basis $U$ to generate a visualization.
This diagram illustrates how a paired dictionary allows transferring coefficients from feature space to image space to recover a visualization.

They also introduce techniques to generate multiple diverse inversions for a single feature, helping researchers understand the range of images a detector might find "equivalent."

Datasets

  • PASCAL VOC 2007 & 2011: Used for training the dictionaries and evaluating the inversion of HOG features.
  • ImageNet: Used to extract and invert features from the AlexNet convolutional neural network (CNN).
  • Amazon Mechanical Turk (MTurk): Used for a large-scale human study to evaluate how well people can recognize objects in the generated visualizations.

Key Insights and Ideas

  • The "HOG World" is Cluttered: HOG is designed to be invariant to illumination and to amplify gradients. This means a dark, empty-looking room to a human might appear full of sharp edges and textures to a HOG detector.
  • False Alarms are "Reasonable": By visualizing the features of high-scoring false alarms, the authors discovered they often look deceptively like true positives in feature space. For example, ripples in water might perfectly align to form the "ghost" of a car in HOG space.
A high-scoring car detection on sea water (left) actually looks like a car when viewed through the detector's HOG features (right).
  • Features are the Bottleneck: Because these false alarms look like real objects in feature space, the authors argue that simply adding more data or using a better classifier (like a non-linear SVM) won't fix these specific errors. The features themselves are discarding the information needed to tell the difference.
  • Human-in-the-loop Debugging: The authors found that humans looking at these visualizations can predict a detector's performance with high accuracy, suggesting these tools are effective for "human debugging" of machine learning models.

Key Results

  • Semantic Recognition: In a study where MTurk workers had to classify visualizations into 20 categories, the paired dictionary method achieved 38.3% accuracy, vastly outperforming the standard "HOG glyph" visualization (19.1%).
  • Human vs. Machine: The authors created a "Human+HOG" detector by having people classify HOG visualizations. This "ideal" human classifier performed similarly to the state-of-the-art Deformable Parts Model (DPM), suggesting that DPM is already extracting nearly all the useful information available in HOG features for certain categories.
  • CNN Inversion: The method successfully inverted activations from deep layers of a CNN, showing that while these features are more robust, they still retain significant spatial and color information from the original image.
Comparison showing that the proposed visualizations are much more intuitive for humans than traditional HOG glyphs.

Limitations and Future Work

While the visualizations are intuitive, they often lack high-frequency details and appear blurry. The authors noted that a "greedy" (but computationally expensive) search for triangles could produce sharper images, suggesting there is still room to improve the reconstruction quality. Additionally, the inversion performance degrades as the feature template size becomes very small (e.g., $5 \times 5$ cells), as there is simply less information to work with. Future work could involve applying these visualization techniques to even more complex, modern architectures to continue demystifying the "black box" of deep learning.

Summary updated

BibTeX
@article{vondrick2016visualizing,
  author = {Carl Vondrick and Aditya Khosla and Hamed Pirsiavash and Tomasz Malisiewicz and Antonio Torralba},
  title = {{Visualizing Object Detection Features}},
  journal = {Int. J. Comput. Vis.},
  year = {2016},
  url = {https://openreview.net/forum?id=jec0WK5RuOy},
}
Figure