Quantus is an open-source Python toolkit for the quantitative evaluation of neural network explanations. It provides a comprehensive, standardized suite of metrics to measure critical properties of attribution methods—such as faithfulness, robustness, and complexity—moving the field beyond subjective visual inspection of saliency maps toward reproducible, evidence-based validation.
Glossary
Quantus

What is Quantus?
Quantus is an open-source Python toolkit designed for the rigorous, quantitative evaluation of neural network explanation methods, providing a comprehensive suite of metrics to measure properties like faithfulness, robustness, and complexity.
The framework unifies dozens of evaluation metrics from fragmented research into a single API, enabling direct comparison of explanation techniques like Integrated Gradients, SHAP, and Grad-CAM. By quantifying whether an explanation accurately reflects a model's true reasoning process, Quantus is essential for auditing post-hoc explainability methods in high-stakes domains like medical imaging, where regulatory explainability demands verifiable evidence that a diagnostic model is attending to genuine pathology rather than confounding artifacts.
Key Features of Quantus
Quantus provides a structured, reproducible framework for evaluating the quality of neural network explanations, moving beyond subjective visual inspection to rigorous quantitative measurement.
Faithfulness Evaluation
Measures how accurately an explanation reflects the model's true reasoning process. Faithfulness metrics perturb inputs based on attribution scores and measure the resulting change in model output.
- Pixel Flipping: Iteratively removes the most salient pixels and plots the degradation in classification confidence
- Region Perturbation: Replaces highly attributed image regions with random noise or a baseline value
- Selectivity: Quantifies how quickly the model's prediction drops as the most relevant features are removed
- IROF (Iterative Removal of Features): Evaluates faithfulness by segmenting the input and removing segments in order of decreasing attribution
Robustness Assessment
Evaluates the stability of explanations under small, semantically meaningless perturbations to the input. A robust explanation should not change dramatically when imperceptible noise is added.
- Local Lipschitz Estimate: Computes the maximum rate of change of the explanation under bounded input perturbations
- Continuity: Measures how smoothly the attribution changes as the input is continuously deformed
- Max-Sensitivity: Finds the maximum difference in explanations for inputs within a small epsilon-neighborhood
- Relative Input Stability: Compares the explanation's sensitivity to the model's own output sensitivity
Complexity Analysis
Quantifies the conciseness and human-interpretability of an explanation. Effective explanations should be sparse and avoid scattering attribution across irrelevant features.
- Sparseness: Uses the Gini index or entropy to measure how concentrated the attribution mass is across input features
- Effective Complexity: Counts the number of features required to explain a given fraction of the total attribution
- Complexity-Sensitivity Trade-off: Evaluates whether an explanation achieves high faithfulness with minimal feature complexity
- Smoothness: Measures spatial coherence, penalizing fragmented or noisy saliency maps that are difficult for clinicians to interpret
Randomisation & Axiomatic Tests
Applies sanity checks that any valid explanation method must pass, ensuring the attribution is genuinely dependent on the model's learned parameters and not an artifact of the input data.
- Model Parameter Randomisation Test: Cascades randomisation of model layers from top to bottom; a valid explanation should degrade progressively
- Data Randomisation Test: Trains the model on permuted labels; the resulting explanations should differ fundamentally from those of a properly trained model
- Completeness: Verifies that the sum of all feature attributions equals the difference between the model output at the input and a baseline
- Implementation Invariance: Confirms that functionally equivalent networks produce identical attributions
Localisation & Pointing Game
Evaluates how precisely an explanation's high-attribution regions correspond to known ground-truth bounding boxes or segmentation masks, critical for object detection and medical lesion attribution.
- Pointing Game: Measures the fraction of highest-attribution points that fall within the ground-truth object bounding box
- Top-k Intersection: Calculates the overlap between the k most salient pixels and the annotated region of interest
- Relevance Mass Accuracy: Computes the proportion of total attribution that falls inside the target region versus the background
- Energy-Based Pointing Game: Extends the pointing game with distance-weighted scoring for more nuanced localisation assessment
Unified Evaluation Framework
Provides a consistent API and standardised benchmarking protocol for comparing explanation methods across models, datasets, and tasks. Eliminates ad-hoc evaluation scripts and enables reproducible research.
- Metric Taxonomy: Organises 30+ metrics into well-defined categories (faithfulness, robustness, complexity, localisation, randomisation)
- Batch Processing: Evaluates explanations across entire datasets with configurable perturbation parameters and baseline strategies
- Normalisation & Aggregation: Standardises metric outputs to a common scale and provides summary statistics for clean reporting
- Extensible Architecture: Allows custom metrics to be registered and integrated into the evaluation pipeline alongside built-in metrics
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Common questions about the Quantus toolkit for evaluating and validating neural network explanations in high-stakes medical imaging applications.
Quantus is an open-source Python toolkit designed for the quantitative evaluation of neural network explanations, providing a comprehensive and standardized suite of metrics to measure the quality of feature attribution methods like Grad-CAM, Integrated Gradients, and SHAP. It works by taking a trained model, an input sample, and a generated explanation map, then computing a battery of scores across multiple evaluation dimensions—faithfulness, robustness, localisation, complexity, randomisation, and axiomatic properties. Each metric returns a numerical score that indicates how well the explanation aligns with the model's true reasoning process. For example, the Faithfulness Correlation metric iteratively removes the most salient pixels and measures whether the model's prediction probability decreases accordingly. Quantus abstracts the evaluation pipeline into a consistent API, allowing researchers and clinical AI developers to benchmark different explanation methods objectively rather than relying on subjective visual inspection of saliency maps. This is critical in regulatory explainability contexts where demonstrating that a diagnostic model is looking at the correct anatomical region is a safety requirement.
Related Terms
Quantus is part of a broader ecosystem of interpretability libraries and evaluation frameworks. These related tools and concepts are essential for building auditable and trustworthy diagnostic AI systems.
Faithfulness Score
A core metric category within Quantus that measures how accurately an explanation reflects the model's true reasoning. A faithful saliency map will show a significant drop in model confidence when the highlighted regions are perturbed or removed.
- Monotonicity: Higher attribution must correlate with higher impact
- Pixel Flipping: Measures area under the curve when removing most salient pixels
- Selectivity: Evaluates how quickly the model's prediction changes
Robustness Evaluation
Quantus provides metrics to test whether an explanation remains stable under small, imperceptible perturbations to the input. A robust explanation should not change dramatically when minor noise is added to a medical scan.
- Local Lipschitz Estimate: Measures maximum explanation change under bounded input perturbation
- Continuity: Evaluates explanation consistency in the input neighborhood
- Critical for ensuring regulatory explainability in diagnostic AI
Complexity Metrics
Quantus quantifies the human-interpretability of an explanation by measuring its complexity. A saliency map that highlights a sparse, coherent region is more clinically useful than a noisy, fragmented heatmap.
- Sparseness: Measures via the Gini index of attribution values
- Effective Complexity: Counts the number of contiguous, high-attribution regions
- Smoothness: Evaluates attribution variance between neighboring pixels
Attribution Attack
A security vulnerability where an adversary manipulates an input to produce a misleading explanation while maintaining the original classification. Quantus can be used to benchmark explanation methods against such attacks.
- The model correctly classifies a tumor, but the saliency map points to healthy tissue
- Undermines trust calibration between clinicians and AI
- Quantus's robustness metrics help quantify susceptibility to these attacks
Interpretability Illusion
The false sense of security that arises from viewing a plausible-looking but unfaithful saliency map. Quantus directly combats this by providing quantitative, falsifiable metrics that expose explanations that look convincing but do not reflect the model's true decision process.
- A smooth, anatomically-plausible heatmap may still be unfaithful
- Quantus's faithfulness and randomisation tests reveal these illusions
- Essential for SaMD audit trail integrity

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.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us