Extremal Contours: Gradient-driven contours for compact visual attribution

Reza Karimzadeh, Albert Alonso, Frans Zdyb, Julius B. Kirkegaard, Bulat Ibragimov

TL;DR

This paper introduces "Extremal Contours," a novel method for generating compact, interpretable visual explanations for deep learning models. Instead of dense, often fragmented saliency maps, it uses smooth, tunable contours derived from Fourier series, offering better robustness and consistency while maintaining high fidelity.

What Problem Does This Paper Address?

Deep learning models in computer vision have achieved remarkable success, but understanding why they make certain predictions remains a significant challenge. Existing explanation methods, like saliency maps and dense perturbation masks, often produce fragmented, overfitted, or noisy outputs that require extensive post-processing. This makes them difficult to interpret and trust, especially in critical applications like medical imaging or autonomous driving. The core problem is generating explanations that are both faithful to the model's reasoning and easily understandable by humans, ideally in a compact and structured format.

Methods

The paper proposes "Extremal Contours," a training-free explanation method that generates smooth, star-convex contour masks. The key innovation lies in parameterizing these contours using a truncated Fourier series, which significantly reduces the number of free parameters compared to pixel-wise masks. This parameterization defines a star-convex region, ensuring a single, simply connected mask.

The optimization process uses an "extremal preserve/delete" objective, driven by classifier gradients. This objective aims to find a contour such that the region inside the contour preserves the model's prediction, while the region outside (when deleted) strongly suppresses it. The method incorporates an adaptive area penalty to encourage compact masks and a spectral penalty to discourage unstable, high-frequency contours. This approach guarantees topological guarantees and smooth boundary updates without requiring post-processing cleanup.

Datasets

The method was evaluated on:

  • ImageNet: Used for evaluating explanations on both supervised (ResNet-50) and self-supervised (DINO ViT-B/16) models.
  • COCO: Used for evaluating explanations on a supervised ResNet-50 model.

The paper does not introduce new benchmarks but uses existing datasets with ground-truth annotations (bounding boxes or segmentation masks) for quantitative evaluation.

Key Insights and Ideas

  • Contours over Pixels: Shifting from dense pixel-wise explanations to smooth contours offers a fundamentally more interpretable and structured way to represent visual attributions.
  • Fourier Series for Compactness: Using Fourier series to parameterize star-convex shapes drastically reduces the number of parameters needed for an explanation, leading to more efficient and stable optimization.
  • Guaranteed Topology: The star-convex constraint and Fourier parameterization inherently ensure that explanations are single, connected regions, avoiding the fragmentation issues common in other methods.
  • Robustness to Adversarial Artifacts: The smooth, low-dimensional nature of the contours makes them more robust to adversarial masking artifacts.
  • Adaptive Area Control: The ability to explicitly control the area of the explanation mask, even adaptively, allows for exploring the trade-off between fidelity and compactness, yielding "importance contour maps."

Key Results

  • Qualitative Improvement: Extremal Contours produce visually appealing, smooth, and compact masks that consistently enclose objects of interest, unlike the diffuse or fragmented outputs of methods like Gradient SHAP, Integrated Gradients, and Grad-CAM++.
  • Quantitative Performance: The method achieves competitive or superior performance across various metrics (Relevance Rank, Relevance Mass, Complexity, Sparseness) on both COCO and ImageNet datasets.
  • Strong Gains on DINO: Notably, Extremal Contours show significant improvements on self-supervised DINO models, outperforming others in relevance mass (over 15% improvement) and complexity, while maintaining positive faithfulness correlations.
  • Robustness: The method is stable and not reliant on initialization of the contour center. It also demonstrates robustness to the spectral regularization parameter, which controls contour smoothness.
  • Efficiency: While iterative, the optimization converges reliably, and the number of parameters is orders of magnitude smaller than dense masks.

Limitations and Future Work

  • Star-Convex Constraint: The star-convex shape limitation prevents capturing objects with strong concavities or holes.
  • Isotropic Bias: The method's isotropic bias may favor capturing rounder shapes over elongated ones, even with multiple contours.
  • Runtime: The iterative optimization process can be slower than single-pass gradient methods, though convergence is achieved relatively quickly.
  • Future Work: The authors suggest extending the method to other vision tasks like object detection and segmentation, exploring richer contour parameterizations for multi-component or hierarchical masks, and investigating its application in domains like medical imaging where compact, editable explanations are highly valuable.

Summary updated

BibTeX
@inproceedings{karimzadeh2026extremal,
  author = {Reza Karimzadeh and Albert Alonso and Frans Zdyb and Julius B. Kirkegaard and Bulat Ibragimov},
  title = {{Extremal Contours: Gradient-driven contours for compact visual attribution}},
  booktitle = {NLDL},
  year = {2026},
  url = {https://openreview.net/forum?id=EiX4I37Xmr},
}
Figure