Table of Contents
Fetching ...

Contrastive Integrated Gradients: A Feature Attribution-Based Method for Explaining Whole Slide Image Classification

Anh Mai Vu, Tuan L. Vo, Ngoc Lam Quang Bui, Nam Nguyen Le Binh, Akash Awasthi, Huy Quoc Vo, Thanh-Huy Nguyen, Zhu Han, Chandra Mohan, Hien Van Nguyen

TL;DR

This work addresses the challenge of interpreting high-resolution whole-slide image (WSI) classifications in computational pathology by introducing Contrastive Integrated Gradients (CIG), a logit-space attribution method that emphasizes class-discriminative signals through a contrastive baseline. CIG defines a path-based attribution $CIG_i^{\gamma}(x)$ that integrates the squared difference between logits along a line in input space, with a Lipschitz-based bound linking feature attributions to input shifts. The method is integrated into a MIL-based WSI pipeline and evaluated using two novel metrics, MIL-AIC and MIL-SIC, under weak supervision across CAMELYON16, TCGA-RCC, and TCGA-Lung datasets, where CIG consistently yields more informative and localized attributions than baselines. Qualitative visualizations corroborate the quantitative gains, showing closer alignment with ground-truth tumor regions. The results support CIG as a principled, interpretable, and practically impactful approach for trustworthy WSI-based diagnostics, with future work including rigorous human-subject interpretability studies.

Abstract

Interpretability is essential in Whole Slide Image (WSI) analysis for computational pathology, where understanding model predictions helps build trust in AI-assisted diagnostics. While Integrated Gradients (IG) and related attribution methods have shown promise, applying them directly to WSIs introduces challenges due to their high-resolution nature. These methods capture model decision patterns but may overlook class-discriminative signals that are crucial for distinguishing between tumor subtypes. In this work, we introduce Contrastive Integrated Gradients (CIG), a novel attribution method that enhances interpretability by computing contrastive gradients in logit space. First, CIG highlights class-discriminative regions by comparing feature importance relative to a reference class, offering sharper differentiation between tumor and non-tumor areas. Second, CIG satisfies the axioms of integrated attribution, ensuring consistency and theoretical soundness. Third, we propose two attribution quality metrics, MIL-AIC and MIL-SIC, which measure how predictive information and model confidence evolve with access to salient regions, particularly under weak supervision. We validate CIG across three datasets spanning distinct cancer types: CAMELYON16 (breast cancer metastasis in lymph nodes), TCGA-RCC (renal cell carcinoma), and TCGA-Lung (lung cancer). Experimental results demonstrate that CIG yields more informative attributions both quantitatively, using MIL-AIC and MIL-SIC, and qualitatively, through visualizations that align closely with ground truth tumor regions, underscoring its potential for interpretable and trustworthy WSI-based diagnostics

Contrastive Integrated Gradients: A Feature Attribution-Based Method for Explaining Whole Slide Image Classification

TL;DR

This work addresses the challenge of interpreting high-resolution whole-slide image (WSI) classifications in computational pathology by introducing Contrastive Integrated Gradients (CIG), a logit-space attribution method that emphasizes class-discriminative signals through a contrastive baseline. CIG defines a path-based attribution that integrates the squared difference between logits along a line in input space, with a Lipschitz-based bound linking feature attributions to input shifts. The method is integrated into a MIL-based WSI pipeline and evaluated using two novel metrics, MIL-AIC and MIL-SIC, under weak supervision across CAMELYON16, TCGA-RCC, and TCGA-Lung datasets, where CIG consistently yields more informative and localized attributions than baselines. Qualitative visualizations corroborate the quantitative gains, showing closer alignment with ground-truth tumor regions. The results support CIG as a principled, interpretable, and practically impactful approach for trustworthy WSI-based diagnostics, with future work including rigorous human-subject interpretability studies.

Abstract

Interpretability is essential in Whole Slide Image (WSI) analysis for computational pathology, where understanding model predictions helps build trust in AI-assisted diagnostics. While Integrated Gradients (IG) and related attribution methods have shown promise, applying them directly to WSIs introduces challenges due to their high-resolution nature. These methods capture model decision patterns but may overlook class-discriminative signals that are crucial for distinguishing between tumor subtypes. In this work, we introduce Contrastive Integrated Gradients (CIG), a novel attribution method that enhances interpretability by computing contrastive gradients in logit space. First, CIG highlights class-discriminative regions by comparing feature importance relative to a reference class, offering sharper differentiation between tumor and non-tumor areas. Second, CIG satisfies the axioms of integrated attribution, ensuring consistency and theoretical soundness. Third, we propose two attribution quality metrics, MIL-AIC and MIL-SIC, which measure how predictive information and model confidence evolve with access to salient regions, particularly under weak supervision. We validate CIG across three datasets spanning distinct cancer types: CAMELYON16 (breast cancer metastasis in lymph nodes), TCGA-RCC (renal cell carcinoma), and TCGA-Lung (lung cancer). Experimental results demonstrate that CIG yields more informative attributions both quantitatively, using MIL-AIC and MIL-SIC, and qualitatively, through visualizations that align closely with ground truth tumor regions, underscoring its potential for interpretable and trustworthy WSI-based diagnostics

Paper Structure

This paper contains 16 sections, 2 theorems, 20 equations, 3 figures, 3 tables.

Key Result

Lemma 1

CIG Bound. Assume $f_{\mathrm{logit}}:\mathbb{R}^{n}\!\to\!\mathbb{R}^{m}$ be $L$-Lipschitz in the Euclidean norm, i.e, Then for every feature $i\in\{1,\dots,n\}$,

Figures (3)

  • Figure 1: Overview of Contrastive Integrated Gradients (CIG). Given a whole-slide image (WSI), patch-level features are extracted and compared to a baseline sampled from non-tumor regions. An interpolated path $\gamma(\alpha) = x + \alpha(x' - x)$ is constructed between the input $x$ and the baseline $x'$. CIG computes attributions by integrating the gradients of the squared logit difference along this path, where $f_{\text{logit}}(\cdot)$ denotes the model’s logit output and $\| \cdot \|_2$ is the Euclidean norm. Row (a) shows interpolated features at different $\alpha$ values ($\alpha = 0.167$ to $1$). Row (b) illustrates how contrastive gradients evolve with increasing $\alpha$, indicating the sensitivity of each feature at each interpolation step. The full attribution is computed by summing the gradients across all $\alpha$ values and multiplying by the input difference $x - x'$. The final heatmap (bottom right) shows the CIG attribution result, indicating which regions most strongly influence the model’s decision relative to the baseline.
  • Figure 2: Comparison of Integrated Gradients (IG) and Contrastive Integrated Gradients (CIG) across interpolation steps ($\alpha$), each row shows intermediate gradient maps at increasing $\alpha$ values, from 0.167 to 1.0, illustrating how gradients evolve along the interpolation path. Note that the final heatmap ($\alpha = 1$) shows only the gradient at the last step and is not the complete attribution result. The full attribution is computed by summing the gradients across all $\alpha$ values and multiplying by the input difference $x' - x$. CIG produces more stable and localized gradients in tumor regions throughout the path, while IG exhibits more dispersed patterns.
  • Figure 3: Qualitative comparison of attribution maps generated by five saliency methods (Vanilla Gradient, IGIG, EG EG, IDGidg_walker_integrated_2023, CIG) on Camelyon16 tumor slides. The first column shows the original WSI patch, and the last column shows the ground truth mask. CIG produces more focused and accurate attributions that align closely with tumor regions.

Theorems & Definitions (4)

  • Lemma 1
  • proof
  • Theorem 1: Completeness Axiom
  • proof