Evaluating the Use of Reconstruction Error for Novelty Localization

Patrick Feeney, Michael C. HughesarXiv 2021

Introduction

In the field of anomaly detection, one-class novelty detection is a critical task where models are trained exclusively on "normal" data (e.g., healthy medical scans) to identify "novel" or anomalous instances (e.g., scans containing tumors). Deep autoencoders have become the standard tool for this purpose. These models learn to compress and reconstruct normal data; the prevailing assumption is that if an autoencoder fails to reconstruct a specific part of a new image, that region must represent the novelty.

The Localization Problem

This paper challenges the fundamental assumption that reconstruction error maps are reliable proxies for novelty localization. While a high reconstruction error indicates a failure to model a pixel, it does not necessarily mean that specific pixel caused the model's confusion. Due to the nature of fully connected and convolutional layers, a single anomalous input pixel can "smear" error across many output pixels. This research investigates whether these error maps actually point to the correct locations or if they provide a misleading signal for localization.

Methodology

The researchers compared two primary methods for highlighting important image regions:

  1. Reconstruction Error Maps: The standard approach, calculating the squared difference ($L2$ loss) between input and reconstructed pixels.
  2. Saliency Maps: A technique from model explainability that calculates the gradient of the total reconstruction loss with respect to each input pixel. This identifies how much a marginal change in an input pixel affects the overall error.

To quantify the relationship between these maps, the authors introduced the Top K Agreement metric, which measures the overlap between the $K$ most intense pixels in both the error and saliency maps.

Visual comparison of input, reconstruction, and various localization maps for normal (top three rows) and novel (bottom three rows) MNIST digits.

Key Insights

Visual analysis reveals that reconstruction error maps often resemble faint, blurry outlines of the digits, whereas saliency maps capture a broader "field of influence." Crucially, the correlation between these two maps weakens significantly when the model encounters novel data—exactly when accurate localization is most vital.

Furthermore, because reconstruction error is a squared value, the authors found that squaring the saliency map values improved the match. This suggests that researchers should at least align the mathematical scale of their visualizations when comparing these signals.

Quantitative Results

The study utilized the MNIST dataset, training on digits 0-4 and testing on digits 5-9. The results highlight a significant divergence between error and saliency:

  • Low Agreement: For the top 10 most important pixels, the most frequent agreement level was only 4 out of 10 for normal images. For novel images, this dropped to just 2 out of 10.
  • Majority Failure: Only 26% of normal images showed a majority agreement (at least 3 out of 5) in their top pixels. This figure fell to 19% for novel data.
  • Spatial Mismatch: On the 28x28 MNIST grid, the average distance between a salient pixel and its nearest match in the error map was 8 to 9 pixels—a massive gap relative to the image size.
Frequency distribution of Top 10 Agreement between saliency and reconstruction error maps across the test set, showing lower agreement for novel data.

Conclusion

The findings demonstrate that reconstruction error is a poor indicator of pixel importance for novelty localization, particularly for data the model has never seen. While this study was limited to low-resolution MNIST data, it raises serious questions about the reliability of error-based heatmaps in more complex domains like medical imaging. Future research should investigate whether saliency maps can serve as a more accurate direct replacement for reconstruction error in providing heatmaps for human experts.

Summary updated

BibTeX
@misc{feeney2021evaluating,
  author = {Patrick Feeney and Michael C. Hughes},
  title = {{Evaluating the Use of Reconstruction Error for Novelty Localization}},
  year = {2021},
  eprint = {2107.13379},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2107.13379},
}
Figure