Deep Visual City Recognition Visualization

Xiangwei Shi, Seyran Khademi, Jan van Gemert

TL;DR

This paper tackles the challenge of understanding why deep learning models recognize cities, going beyond simple classification to visualize and quantify which visual features are most discriminative. They introduce a framework using Grad-CAM and semantic segmentation to evaluate the interpretability of CNNs for city recognition, finding that network architecture plays a more significant role than training initialization.

What Problem Does This Paper Address?

Identifying cities from images is a fascinating task with applications in urban planning, history, and more. While Convolutional Neural Networks (CNNs) excel at this, they often act as "black boxes." Understanding what visual cues these networks rely on to distinguish between cities is crucial for building trust and improving these models. The challenge is that city recognition labels (e.g., "Tokyo," "Pittsburgh") don't directly tell us which objects or features within an image are discriminative. Unlike object recognition where labels often correspond to a single dominant object, city recognition involves a complex interplay of architectural styles, street layouts, vegetation, and more, which are not explicitly labeled. This paper aims to bridge this gap by visualizing and quantitatively evaluating the interpretability of CNNs for city recognition.

Methods

The authors propose a multi-step framework to investigate CNN interpretability for city recognition:

  1. Generating Visual Explanations: They use Grad-CAM (Gradient-weighted Class Activation Mapping) to generate heatmaps highlighting regions in an image that are most important for the CNN's city classification decision. These heatmaps are then thresholded and used to create "weighted masks."
  2. Unsupervised Clustering: To find patterns in these visual explanations without explicit object labels, they employ t-distributed Stochastic Neighbor Embedding (t-SNE). The weighted masks themselves are used as descriptors for clustering.
  3. Object-Level Annotation: To enable quantitative evaluation, they use a pretrained semantic segmentation model (trained on MIT ADE20K) to label objects within the images at a pixel level. This model can identify 150 different object categories.
  4. Quantitative Evaluation: They introduce a metric called R (ratio of pixels) to quantify the significance of specific objects as discriminative features. R measures the proportion of pixels belonging to a certain object class that are highlighted by Grad-CAM for a given city class, compared to the total pixels of that object class across all images of that city. A higher R indicates a more discriminative object. They also calculate AR (Average Residual) to measure the divergence between weighted masks generated by different models.

Datasets

The paper uses two datasets for city recognition:

  • Tokyo 24/7: Contains 76,000 images of Tokyo, with 12 images taken from different viewpoints for the same location.
  • Pittsburgh: Contains 250,000 images of Pittsburgh, with 24 images per location from different directions and angles.

For the experiments, they use a subset of 76,000 Pittsburgh images to balance the dataset. All datasets are split into training, validation, and test sets (6:2:2).

Key Insights and Ideas

  • City Recognition is More Than Just Objects: The interpretability of city recognition CNNs is complex because discriminative features are not single objects but rather combinations of architectural styles, urban layouts, and environmental elements.
  • Grad-CAM is a Powerful Tool: Grad-CAM effectively highlights discriminative regions, providing visual cues that align with human intuition about what makes cities distinct.
  • Unsupervised Clustering Reveals Semantic Patterns: Even without explicit object labels, clustering weighted masks using t-SNE can group visually similar explanations, suggesting that the CNNs are learning semantically meaningful features.
  • Network Architecture Matters More Than Initialization: The study strongly suggests that the choice of CNN architecture (e.g., VGG, ResNet vs. shallow networks) has a greater impact on the interpretability of learned features than random initializations during training.
  • Dataset Specificity: Different CNN architectures learn distinct sets of discriminative objects for different cities, highlighting the dataset-specific nature of learned visual representations.

Key Results

  • Visual Separability: t-SNE plots of weighted masks show that images from different cities (Tokyo vs. Pittsburgh) are generally separable, correlating with high classification accuracy.
  • Object Significance (R): Histograms of R values reveal that different CNN architectures learn varying degrees of discriminative power for different object classes. For instance, skyscrapers and ground are more discriminative for Pittsburgh, while signboards and fences are more so for Tokyo.
  • Architectural Influence: The average residual (AR) between weighted masks generated by different network architectures is consistently higher than that between models with different initializations, confirming that architecture is a stronger determinant of interpretability. For example, the average AR between VGG11 and ResNet18 is 0.4349, while between VGG11 and its retrained version it's 0.2679.
  • Deep Networks are More Interpretive: Deep CNN architectures (like VGG11 and ResNet18) tend to learn more semantically interpretable features compared to shallower networks.

Limitations and Future Work

  • Reliance on Pretrained Segmentation: The quantitative evaluation relies on a pretrained semantic segmentation model. While robust, its performance and the completeness of its 150 categories might influence the results.
  • Unsupervised Nature: The initial clustering is unsupervised, meaning human interpretation is still needed to label the discovered patterns.
  • Future Work: The authors suggest further exploring how different architectures learn these discriminative objects and investigating the influence of training data characteristics on interpretability. They also implicitly point towards developing more sophisticated quantitative metrics that can capture the nuanced visual differences between cities.

Summary updated

BibTeX
@inproceedings{shi2019deep,
  author = {Xiangwei Shi and Seyran Khademi and Jan van Gemert},
  title = {{Deep Visual City Recognition Visualization}},
  booktitle = {Workshops @ CVPR},
  year = {2019},
}
Figure