Manuscript Offprint

arXiv:2609.07462

When Superpixels Fail on Documents: A Study of Segmentation for LIME Explanations

Quentin Telnoff, Emanuela Boros, Mickaël Coustaty, Robin Jarry, Fabrice Crohas, Antoine Doucet

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Post-hoc explanation methods are widely used to inspect image classifiers, but their reliability depends on design choices that are often treated as implementation details. We study this issue for LIME on document image classification, focusing on the segmentation step that defines the interpretable units being perturbed. Standard image-based LIME typically relies on natural-image superpixels, which are poorly aligned with document structure such as text regions, layout blocks, and identification codes. Using RVL-CDIP, we compare Quickshift and SLIC with document-aware segmentations based on OCR bounding boxes and regular grids. Our results show that segmentation strongly affects explanation consistency, correctness, and local fidelity. Document-aware segmentations produce more stable and faithful explanations, require fewer perturbations to converge, and expose shortcut behaviour based on document identification codes, a known RVL-CDIP bias that superpixel-based LIME often obscures. These findings show that reliable post-hoc explanation requires domain-aware interpretable representations, and that segmentation should be treated as part of the explanation method rather than as neutral preprocessing.

1 Introduction

Explainable artificial intelligence (XAI) has become an important requirement for deploying machine learning systems in high-stakes settings. In document AI, classification models are increasingly used for archival categorization, administrative workflow automation, and large-scale record processing. Although deep neural networks achieve strong predictive performance, their decisions remain difficult to interpret, limiting trust and error analysis in practice [Salih et al., 2025].

Among post-hoc explanation methods, LIME remains widely used due to its model-agnostic formulation and intuitive local surrogate mechanism [Zhao et al., 2024]. In image classification, LIME partitions the image into regions via segmentation, then perturbs their presence or absence

Figure

(a) Quickshift [Vedaldi and Soatto, 2008]

Figure

(b) SLIC [Achanta et al., 2012]

Figure 1: Standard superpixel segmentation fails to capture meaningful structural components in document images.

to estimate local feature importance [Ribeiro et al., 2016]. However, standard implementations rely on algorithms such as SLIC [Achanta et al., 2012] or Quickshift [Vedaldi and Soatto, 2008], designed for natural images, which group pixels by low-level visual similarity rather than structural document properties such as text blocks, columns, or tables. As shown in Figure 1, this results in segmentations that fragment the page layout instead of capturing coherent document regions on a document from RVL-CDIP [Harley et al., 2015].

This matters because segmentation directly defines the dimensionality, geometry, and semantic coherence of the features on which LIME builds its explanations. Yet its role has received comparatively little attention for structured visual data [Knab et al., 2025a]. We therefore ask: how much does the choice of segmentation affect the stability and reliability of LIME explanations on document images?

We compare superpixel-based methods with document-aware alternatives derived from OCR regions and regular grids on RVL-CDIP, and make three contributions:

  1. We show that segmentation is a central design choice in image-based LIME, because it defines the interpretable representation on which post-hoc explanations are computed.

  2. We evaluate the reliability of LIME explanations across segmentation strategies using consistency, correctness, and local fidelity metrics.

  3. We show that document-aware segmentation improves not only explanation stability, but also bias discovery, by revealing RVL-CDIP shortcut behaviour based on document identification codes that superpixel-based LIME often obscures.

References (29)