Inferensys

Glossary

Integrated Gradients

An attribution method that assigns importance scores to input features by integrating the gradients of the model's output with respect to the input along a straight-line path from a baseline to the actual input, satisfying the completeness axiom.
Data engineer managing feature store on laptop, feature definitions visible, casual data engineering session.
AXIOMATIC ATTRIBUTION

What is Integrated Gradients?

A model interpretability method that assigns importance scores to input features by accumulating gradients along a path from a baseline to the input, satisfying the completeness axiom.

Integrated Gradients is a feature attribution method that computes the contribution of each input feature to a neural network's prediction by integrating the model's gradients along a straight-line path from a non-informative baseline input (e.g., a black image) to the actual input. This path integral ensures the attributions sum exactly to the difference between the model's output for the input and the baseline, a property known as completeness or the summation-to-delta axiom.

Unlike simpler gradient-based methods such as saliency maps, Integrated Gradients satisfies the sensitivity axiom, meaning if a single feature change alters the prediction, that feature receives non-zero attribution. The method requires selecting an appropriate baseline—often a zero-valued tensor in medical imaging—and approximating the integral via Riemann summation over m steps, making it implementation-agnostic and suitable for regulatory explainability requirements in SaMD audit trails.

AXIOMATIC ATTRIBUTION

Key Features of Integrated Gradients

Integrated Gradients is a model-agnostic feature attribution method that satisfies the completeness axiom, ensuring the sum of all feature importances exactly equals the difference between the model's output at the input and a baseline. This makes it a foundational tool for auditing diagnostic AI decisions.

01

The Completeness Axiom

Integrated Gradients is one of the few attribution methods that mathematically guarantees completeness: the sum of all pixel attributions equals the model's output difference from a baseline. For a diagnostic classifier, this means if a model outputs a 0.92 probability for 'malignant' and 0.08 for a blank baseline, the attributions across all voxels sum to exactly 0.84.

  • Why it matters: No attribution mass is created or destroyed during the explanation process
  • Contrast with Grad-CAM: Grad-CAM produces coarse localization maps but does not satisfy completeness
  • Regulatory relevance: Auditors can verify that the total attributed evidence matches the prediction confidence
100%
Attribution Sum Fidelity
02

Path Integral Formulation

The method computes attributions by integrating the gradients of the model's output with respect to the input along a straight-line path from a baseline to the actual input. This path integral accumulates the contribution of each pixel as it transitions from absence to presence.

  • Mathematical form: Attribution_i = (x_i - x'_i) × ∫₀¹ ∂F(x' + α(x - x'))/∂x_i dα
  • Baseline selection: In medical imaging, a black image, blurred scan, or zero-signal reference serves as the 'absence of information' starting point
  • Implementation: The integral is approximated using Riemann summation with 20-300 discrete steps along the path
20-300
Integration Steps
03

Sensitivity and Implementation Invariance

Integrated Gradients satisfies two critical axioms that many saliency methods violate. Sensitivity ensures that if a single feature change alters the prediction, that feature receives non-zero attribution. Implementation invariance guarantees that functionally equivalent networks produce identical attributions regardless of architecture.

  • Sensitivity example: If changing a single pixel from baseline to input value flips a diagnosis from 'benign' to 'malignant', that pixel must receive attribution
  • Implementation invariance: Two networks with identical input-output behavior yield the same Integrated Gradients explanation, even if one uses ReLU and another uses GELU activations
  • Contrast with LIME: LIME is model-agnostic but not implementation-invariant; different runs can produce different explanations
2
Core Axioms Satisfied
04

Baseline Selection in Medical Imaging

The choice of baseline critically shapes the explanation. In radiology, common baselines include a black image (zero pixel intensity), a Gaussian-blurred version of the input, or a population-average template from healthy patients. Each encodes a different definition of 'feature absence.'

  • Black baseline: Attributes highlight any non-zero pixel that influences the prediction; may produce noisy saliency maps in dark regions of CT scans
  • Blurred baseline: Removes high-frequency detail while preserving anatomical structure; attributions highlight diagnostically relevant edges and textures
  • Clinical best practice: Use multiple baselines and aggregate attributions to avoid baseline-dependent artifacts in regulatory submissions
3+
Common Baseline Types
06

Clinical Audit and Regulatory Use

Integrated Gradients is increasingly referenced in FDA pre-submission meetings and SaMD audit trails as a method for demonstrating that a diagnostic model's decisions are based on clinically relevant anatomy rather than confounding artifacts. The completeness property enables quantitative verification.

  • Audit trail integration: Store attributions alongside predictions for post-hoc review of every clinical decision
  • Artifact detection: If a model attributes high importance to scanner bed markings or text annotations, Integrated Gradients will reveal this shortcut learning
  • Clinician-in-the-loop: Radiologists can review overlaid saliency maps to calibrate their trust in AI-assisted diagnoses, reducing both automation bias and algorithm aversion
FDA
Regulatory Relevance
INTERPRETABILITY INSIGHTS

Frequently Asked Questions

Clear answers to the most common technical and regulatory questions about Integrated Gradients and its role in making medical imaging AI transparent and auditable.

Integrated Gradients is a model interpretability technique that assigns an attribution score to each input feature (e.g., every pixel in a chest X-ray) by calculating the path integral of the model's gradients from a neutral baseline input (like a black image) to the actual input. It works by accumulating the gradients of the model's output with respect to the input at every point along this straight-line path. The fundamental principle is that the sum of all feature attributions exactly equals the difference between the model's output for the actual input and its output for the baseline, satisfying the completeness axiom. This ensures no importance is lost or created during the explanation process, making it a rigorous method for identifying which pixels most influenced a diagnostic prediction.

ATTRIBUTION METHOD COMPARISON

Integrated Gradients vs. Other Attribution Methods

A feature-level comparison of Integrated Gradients against other common post-hoc attribution techniques used in medical imaging explainability.

FeatureIntegrated GradientsGrad-CAMSHAP

Completeness Axiom

Implementation Invariance

Sensitivity to Model Internals

Requires gradients

Requires final conv layer

Model-agnostic

Spatial Resolution

Pixel-level

Coarse heatmap

Pixel-level (KernelSHAP)

Computational Cost

Moderate (50-300 steps)

Low (single backward pass)

High (exponential in features)

Requires Baseline Input

Typical Medical Imaging Use

Lesion attribution, regulatory audit

Localization for clinician review

Feature importance for tabular biomarkers

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.