Perception Visualization: Seeing Through the Eyes of a DNN

Loris Giulivi, Mark James Carman, Giacomo Boracchi · DOI

Abstract

Perception Visualization (PV) is a novel explainability technique that bridges the gap between spatial attention and semantic interpretation in Deep Neural Networks (DNNs). By inverting latent representations into human-interpretable images, PV reveals not just where a model looks, but what it perceives. This approach significantly improves the ability of developers to debug model errors, such as semantic misclassifications, where traditional saliency maps fail to provide actionable insights. User studies demonstrate that PV increases the human ability to predict model errors from 8.3% to 35.0% compared to traditional methods.

Introduction

Deep Neural Networks (DNNs) have achieved remarkable performance across various domains, yet they remain largely "black boxes." While metrics like accuracy provide a high-level view of performance, understanding the underlying reasoning for specific decisions—particularly incorrect ones—is a significant challenge in Explainable AI (XAI).

Current tools, such as Grad-CAM, primarily generate saliency maps that highlight pixels influencing a prediction. However, these maps only indicate where a model is looking, not what it perceives. For example, if a model misclassifies a cat as a "laundry basket," Grad-CAM might highlight the same region for both classes, offering no insight into the root cause of the error.

Grad-CAM often highlights the same spatial regions for different class predictions, failing to explain semantic confusion.

Methodology: Perception Visualization (PV)

To address these limitations, we introduce Perception Visualization (PV). PV combines spatial localization with semantic reconstruction through two main components:

  1. Saliency Mapping: Utilizing Grad-CAM to identify influential input regions for a specific class prediction ($m_c$).
  2. Network Inversion: A pre-trained, frozen encoder (e.g., a truncated ResNet-50) extracts latent features, which are then processed by a separately trained decoder to reconstruct the original image.

The final PV output is a composite image that displays the reconstructed "perception" within the saliency-mapped regions, masking the rest of the image. To ensure the reconstruction faithfully represents the model's internal state, we employ a multi-part loss function including MSE, SSIM, and Deep Perceptual Similarity (DSIM). DSIM forces the reconstructed image to share the same latent representation as the input when passed back through the encoder, preventing the decoder from ignoring the model's internal features.

Experimental Results

We evaluated PV using the PASCAL VOC and ImageNet datasets. A key finding is that the semantic meaning of the reconstruction is tied to the encoder (the model being explained) rather than the decoder. This "semantic resilience" ensures that the visualization remains a faithful explanation of the target model even if the decoder is trained on a different dataset.

PV provides a semantic reconstruction that reveals why a model makes specific errors, such as confusing a neon sign for a TV monitor or a horse for a bus.

User Study and Simulatability

A user study with 98 participants measured "simulatability"—the ability of humans to predict model behavior based on explanations.

  • Error Identification: When the model was incorrect, participant accuracy in guessing the model's prediction rose from 8.3% with Grad-CAM to 35.0% with PV.
  • Statistical Significance: A Mann-Whitney U test confirmed the significance of this improvement ($p = 2.3 \times 10^{-11}$).

While Grad-CAM performed better when the model was correct (95.9% vs 75.5%), PV's strength lies in its ability to facilitate "prescriptive debugging" by revealing the semantic nature of failures. For instance, if a PV reconstruction shows a model perceives a neon sign as a television, the developer knows to augment the training set with more diverse signage.

Conclusion and Future Work

Perception Visualization provides a more nuanced understanding of DNN decision-making by visualizing the model's internal "perception." While current reconstructions can be blurry, the method offers a powerful tool for building more transparent and debuggable AI systems. Future work will focus on improving reconstruction quality and extending the method to non-CNN architectures like Transformers.

Summary updated

BibTeX
@inproceedings{giulivi2021perception,
  author = {Loris Giulivi and Mark James Carman and Giacomo Boracchi},
  title = {{Perception Visualization: Seeing Through the Eyes of a DNN}},
  booktitle = {BMVC},
  year = {2021},
}
Figure