Source-linked AI summary

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

arXiv:2609.07462v1cs.CVcs.AI

TL;DR

Document-image LIME relies on segmentation choices whose effects on explanation reliability have received limited attention, despite the mismatch between natural-image superpixels and document structure. The paper compares superpixel and document-aware segmentations on RVL-CDIP. It reports more stable, correct, and locally faithful explanations from document-aware approaches, along with identification-code shortcut discovery.

  • Problem

    How segmentation affects LIME’s stability and reliability on document images is underexamined, although it defines the interpretable features and natural-image superpixels poorly align with document structure.

    Source: §1 · p. 1
  • Method

    The study compares Quickshift and SLIC with OCR-region and regular-grid segmentations for LIME on RVL-CDIP.

    Source: §1 · p. 1
  • Results

    Document-aware segmentations, especially bounding boxes alone, produce more consistent, correct, and locally faithful explanations, converge with fewer perturbations, and reveal identification-code shortcuts often obscured by superpixels.

    Source: §1 · p. 2, §7 · p. 7
  • Takeaways & Limitations

    The findings suggest that post-hoc explanations should use interpretable representations aligned with the input domain’s structure and treat segmentation as part of the explanation method.

    Source: §1 · pp. 1–2, §7 · p. 7

Abstract

from arXiv · show

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

The introduction argues that natural-image superpixels fragment document structure and asks how segmentation affects LIME’s explanation reliability. It presents document-aware segmentation as a way to improve stability and reveal identification-code shortcuts on RVL-CDIP.

1 Introduction

  • Document classification is used for archival categorization, administrative automation, and record processing, yet neural-network decisions can remain difficult to interpret.Source: §1 · p. 1
  • Natural-image methods such as SLIC and Quickshift group pixels by visual similarity, fragmenting document layouts instead of capturing text blocks, columns, or tables.Source: §1 · p. 1, Figure 1 · p. 1
  • Segmentation defines LIME’s interpretable features, shaping their dimensionality, geometry, and semantic coherence; its effect on document-image reliability is underexamined.Source: §1 · p. 1
  • The study compares superpixel methods with OCR-region and regular-grid alternatives on RVL-CDIP, evaluating consistency, correctness, and local fidelity.Source: §1 · pp. 1–2
  • Document-aware segmentation improves explanation stability and reveals RVL-CDIP identification-code shortcuts that superpixel-based LIME often obscures.Source: §1 · p. 2

2 Related Work

Related work describes a gap between document structure and generic image-explanation tools, alongside broader concerns about LIME’s design sensitivity and explanation evaluation. This study focuses on segmentation as one underexamined design choice for document-image LIME.

2 Related Work

  • Document images organize meaning through layout and textual regions, but many explanation pipelines adapt generic vision tools with limited attention to these properties.Source: §2 · p. 2
  • LIME variants modify sampling, neighbourhoods, surrogates, or weighting, while prior work typically improves one component at a time.Source: §2 · p. 2
  • Natural-image superpixels group pixels by visual similarity, an assumption that may miss document layouts; segmentation therefore remains an under-discussed design choice for document explanations.Source: §2 · p. 2
  • Explanation studies use differing quality criteria and protocols, making cross-paper comparisons difficult and leaving the practical importance of design choices unclear.Source: §2 · p. 2
  • The paper studies whether LIME’s segmentation can explain instability on document images, evaluating consistency and correctness rather than proposing a new explanation method.Source: §2 · p. 2

3 Method

The method treats segmentation as part of LIME’s interpretable representation: it sets the regions perturbed and changes the surrogate problem. It compares natural-image superpixels with document-aware OCR- and grid-based regions.

3.1 Problem Setting

  • LIME partitions an image into regions, perturbs their visibility, and fits a local weighted surrogate using the resulting interpretable-space samples.The surrogate’s region-level attributions explain the classifier’s prediction.Source: §3.1 · p. 3, Figure 2 · p. 3

3.2 Why Segmentation Matters

  • Changing segmentation changes LIME’s explanation problem by setting interpretable coordinates, region granularity, surrogate dimensionality, and the structural plausibility of masked perturbations.Document structure includes layout, alignment, whitespace, and textual organization.Source: §3.2 · p. 3

3.3 Segmentation Strategies

  • Quickshift and SLIC partition images into visually homogeneous superpixels, which LIME then uses as binary features.Quickshift uses a 5D spatial-colour feature space; SLIC uses K-means over colour and image location.Source: §3.3 · p. 3
  • Document-aware alternatives use OCR bounding boxes, uniform grids, or intact OCR boxes combined with the remaining grid regions.The combined representation subtracts OCR boxes from the grid before taking the union of intact boxes and residual grid regions.Source: §3.3 · pp. 3–4

4 Experimental Setup

The experiments use RVL-CDIP document classification and compare LIME configurations on a focused subset of visually similar classes. The setup specifies the classifier and the perturbation and surrogate settings.

4.1 Data

  • RVL-CDIP contains 400,000 grayscale documents across 16 classes; explanation tests focus on Invoice, Budget, and Form, which are visually similar and often confused.The standard split contains 320,000 training, 40,000 validation, and 40,000 test images.Source: §4.1 · p. 4

4.2 Backbone Model

  • A ResNet-50 initialized with ImageNet weights was adapted with a target-class output layer and trained for document classification on RVL-CDIP.The model was trained and evaluated on the dataset’s full training and testing splits, respectively.Source: §4.2 · p. 4

4.3 LIME Configurations

  • LIME uses black masking, uniform binary sampling, linear surrogates, Euclidean distance with σ=1, no regularization, and N from 100 to 8,000.The sample size increases in steps of 100 through 1,000, then in steps of 1,000.Source: §4.3 · p. 4

5 Evaluation Protocol

The evaluation measures explanation reliability through consistency, correctness, and local fidelity. These complementary tests assess run-to-run stability, effects on classifier scores, and the local surrogate’s approximation of the classifier.

5.1 Consistency

  • Consistency compares explanations across repeated runs with the same image, classifier, segmentation, and hyperparameters but different perturbation samples.It is measured as average pairwise Spearman rank correlation across runs; higher values mean more similar rankings of regions.Source: §5.1 · p. 5

5.2 Correctness

  • Deletion masks regions in importance order, where lower AUC is better; insertion restores them, where higher AUC is better.These metrics test whether highlighted regions affect the classifier’s score, but not whether they are semantically meaningful to a human reader.Source: §5.2 · p. 5

5.3 Local Fidelity

  • Local fidelity uses surrogate R2: values near 1 indicate accurate capture of local classifier behavior, while values near 0 indicate poor capture.The metric evaluates the interpretable linear regression model.Source: §5.3 · p. 5

6 Results and Discussion

Segmentation strongly shapes LIME consistency, explanation quality, and whether explanations expose identification-code shortcuts. Document-aware regions generally outperform superpixels, though fine-grained grids can lose stability.

6.1 Segmentation: Main Driver of Consistency

  • Quickshift has the lowest average Spearman consistency (0.432), while BBs only and Grid 4×4 w/o BBs reach 0.933 and 0.975, respectively.Across tested settings, segmentation is the dominant factor affecting consistency.Source: §6.1 · pp. 5–6
  • Consistency rises with perturbations, but fewer structured regions reach high consistency sooner; normalized area under the curve falls as segment count grows, while fine-grained BBs w grid variants lose stability.Superpixels create many irregular components and a higher-dimensional perturbation space, making repeated runs more sensitive to sampling; fine-grained variants such as 10×10, 20×10, and 30×10 become less stable than SLIC.Source: Figure 4 · p. 6, Figure 5 · p. 6, §6.1 · p. 6

6.2 Explanation Quality: Correctness & Fidelity

  • 0.764 insertion AUC and 0.031 deletion AUC make BBs only the superior correctness strategy; Quickshift has the lowest insertion AUC (0.080).Grid 4 × 4 w/o BBs ranks second on insertion at 0.589, but its deletion AUC of 0.389 suggests it may bundle predictive features with background noise; SLIC and Quickshift deletion AUCs are 0.073 and 0.089.Source: §6.2 · p. 6
  • 0.571 and 0.557 are the highest local fidelity scores for BBs w/ 1 × 1 Grid and BBs only, while Quickshift and SLIC yield R2 values of 0.389 ± 0.040 and 0.218 ± 0.142.The paper attributes the gap to superpixels fragmenting text and layout into irregular units, producing structurally unrealistic perturbations.Source: §6.2 · p. 6

6.3 Bias Discovery

  • In one example, BBs only assigns the identification code the highest coefficient while SLIC dilutes it; in another, both detect it, but BBs only isolates it most distinctly.The authors attribute SLIC’s weaker attribution in the first case to coarse superpixels merging the small identifier with surrounding background.Source: Figure 6 · p. 7, §6.3 · p. 7
  • Among 60 images, BBs only ranked the identification code first in 15; SLIC placed it in the top five for only 5 of those, with average rank about 39 and a maximum of 71.The analysis was limited to 60 images because explanation extraction, alignment, and assessment required substantial computation and manual verification; the authors note that a larger sample would be preferable.Source: §6.3 · p. 7

7 Conclusions

The paper concludes that segmentation is a major factor in LIME explanation quality for document image classification. It favors document-aware regions and recommends representations aligned with input structure, while identifying extension beyond RVL-CDIP as future work.

7 Conclusions

  • Document-aware segmentations, especially BBs only, produce more consistent, correct, and locally faithful explanations than standard superpixel methods.Source: §7 · p. 7
  • More coherent, lower-dimensional interpretable spaces let document-aware segmentations converge with fewer perturbations.Source: §7 · p. 7
  • Document-aware segmentation helps reveal RVL-CDIP identification-code shortcuts that superpixel segmentation often obscures.The authors suggest aligning interpretable representations with input-domain structure and plan to extend analysis to more classifiers and beyond RVL-CDIP.Source: §7 · p. 7
Loading 2609.07462v1…