Explaining holistic image regressors and classifiers in urban analytics with plausible counterfactuals

Stephen Law, Rikuo Hasegawa, Brooks Paige, Chris Russell, Andrew Elliott

TL;DR

This paper introduces a novel method for explaining "holistic" image analysis models in urban analytics, which consider the entire image rather than just specific regions. They achieve this by generating plausible counterfactual images that show how small changes in the scene would alter the model's prediction, making complex AI more understandable for urban planners and researchers.

What Problem Does This Paper Address?

Urban analytics increasingly relies on computer vision models to analyze street imagery for tasks like estimating building density, greenness, or even house prices. However, explaining why these models make certain predictions is challenging, especially when the models consider the entire image (holistic) rather than just localized features. Traditional methods like heatmaps can highlight important regions but don't show how to change the image to alter the prediction. This lack of interpretability can lead to a lack of trust and potential misuse of these powerful tools, particularly for non-expert users like urban planners who need to understand and rely on these predictions for decision-making.

Methods

The core of the proposed method is a pipeline that generates "plausible counterfactual explanations." This involves:

  1. Generative Model (VAE): A Variational Autoencoder (VAE) is trained to learn a low-dimensional latent representation of street images. This latent space captures the essence of the image, allowing for manipulation.
  2. Regression Model: A standard regressor is trained to map this latent representation to a specific urban attribute (e.g., tree presence, building density, sky coverage).
  3. Image Enhancement: A StarGANv2 model is used to upscale and enhance the quality of generated images, making them more visually appealing.
  4. Counterfactual Generation: This is the key novel step. Instead of directly manipulating pixels, the method searches within the learned latent space for a new representation (z') that, when fed through the regressor, yields a different prediction (T). Crucially, this search is guided by two objectives: changing the prediction and keeping the new latent representation close to the original, ensuring the resulting image is a plausible modification of the original scene. This approach avoids generating adversarial perturbations that are often imperceptible or unrealistic.

Datasets

  • Training and Evaluation: The study utilizes the Google StreetView (GSV) dataset, specifically street images from the Greater London Area. This dataset is described as having good coverage and consistency.
  • Semantic Segmentation Model: A pretrained Segnet model was used to extract ground truth labels for trees, sky, and buildings from the street imagery.

Key Insights and Ideas

  • Holistic Explanations: The paper successfully demonstrates that counterfactual explanations can be generated for models that operate on the entire image, going beyond localized heatmap approaches.
  • Latent Space Manipulation: Operating in a low-dimensional latent space learned by a VAE is more effective for generating plausible and distinctive counterfactuals than direct image space manipulation.
  • Plausibility over Realism: While the generated counterfactuals are not perfectly photorealistic (e.g., artifacts like distorted road markings), they are perceptually plausible and visually distinct enough to convey the intended change in the urban attribute.
  • User Study Validation: A user study showed that non-expert users found the counterfactual explanations more distinctive and easier to understand than traditional GradCam heatmaps, especially for foreground attributes like trees and buildings.

Key Results

  • Qualitative Evaluation: Visual inspection of counterfactuals showed that changes in attributes like trees, buildings, and sky were visually apparent and localized to expected regions of the image.
  • Quantitative Evaluation: Statistical analysis showed a reasonable fit between ground truth and model predictions, with data augmentation improving consistency.
  • User Study Accuracy: Participants using the counterfactual explanations achieved higher accuracy in identifying attribute changes (Experiment 1) and describing highlighted areas (Experiment 3) compared to those using GradCam heatmaps. For instance, accuracy for the tree attribute in the change survey was 0.690 (Ours) vs. 0.498 (GradCam).
  • Comparison to Nearest Neighbors: The generated counterfactuals were visually closer to the original image than nearest neighbors found in the dataset's latent space, suggesting better control over the generated changes.

Limitations and Future Work

  • Realism and Artifacts: The authors acknowledge that the generated counterfactuals still exhibit artifacts and limited realism, particularly at higher levels of attribute change. They suggest that incorporating newer generative models like diffusion models could improve this.
  • Background Attributes: For background attributes like "sky," the counterfactuals were perceptually less evident, and users sometimes struggled to describe the changes.
  • Extreme Values: When attributes have extreme values (e.g., already forested streets), further increases in that attribute might be less noticeable.
  • Reproducibility: The reliance on proprietary datasets like Google StreetView limits direct reproducibility. The authors plan to explore open data sources in the future.
  • Model Agnosticism: While the pipeline is designed to be flexible, the current implementation doesn't exhaustively test each component, leading to some limitations. Future work could involve adapting the pipeline to newer, more powerful generative models.

Summary updated

BibTeX
@article{law2023explaining,
  author = {Stephen Law and Rikuo Hasegawa and Brooks Paige and Chris Russell and Andrew Elliott},
  title = {{Explaining holistic image regressors and classifiers in urban analytics with plausible counterfactuals}},
  journal = {Int. J. Geogr. Inf. Sci.},
  year = {2023},
  doi = {10.1080/13658816.2023.2214592},
}
Figure