Research
Extremal Contours: Gradient-driven contours for compact visual attribution
Overview Research area: Explainable AI (XAI) for computer vision — specifically perturbation-based visual attribution for image classifiers. Technical level: Intermediate. The core geometry (star-conv

- arXiv
- 2511.01411
- Published
- 2025-11-03
- Authors
- Reza Karimzadeh, Albert Alonso, Frans Zdyb, Julius B. Kirkegaard, Bulat Ibragimov
AI summary
Overview
Research area: Explainable AI (XAI) for computer vision — specifically perturbation-based visual attribution for image classifiers.
Technical level: Intermediate. The core geometry (star-convex regions, Fourier series) is explained well, but readers benefit from prior familiarity with saliency maps, extremal perturbations, and XAI evaluation metrics.
Scope: The paper introduces a training-free method that replaces dense pixel-wise explanation masks with a small set of smooth, gradient-optimized star-convex contours, and evaluates them on ImageNet and COCO with a supervised ResNet-50 and a self-supervised DINO ViT-B/16.
What This Paper Is About
Most perturbation-based explanations for vision models optimize a mask over every pixel of the image. This produces fragmented, noisy, multi-component regions that need smoothing or post-processing to look usable, and the optimizer can exploit the vast number of free parameters to satisfy the objective in ways that do not reflect real model reasoning. The authors ask whether the mask can instead be constrained by construction — a single smooth closed curve — so that faithful explanations come out compact without any cleanup step.
Key Contributions
-
A Fourier contour parameterization for perturbation masks. Each explanation is a star-convex region whose radius around a learnable center is a truncated Fourier series, requiring only 2K+3 free parameters — described as a reduction of one to two orders of magnitude relative to dense extremal masks.
-
Topological guarantees without post-processing. The parameterization yields a single, simply connected, smooth mask by construction, so fragmented or multi-component outputs are structurally impossible and boundary updates are stable without cleanup.
-
An adaptive area schedule. The authors replace manual tuning of the area penalty with a dynamic weight, λ_a = min(5, 1/(1 − cos(e_o, e_p))), which increases compactness pressure only once the preserved embedding matches the original — plus an optional fixed-area variant that sweeps a target area α* to produce a contour map of faithfulness.
-
Extension to multiple contours. Multiple independent contours are composed via a pixel-wise maximum, allowing the framework to localize several objects in one image.
Main Findings
-
COCO localization. On 100 COCO images, extremal contours achieve the best relevance rank and relevance mass among compared methods for both models: on supervised ResNet-50, relevance rank 0.478 and relevance mass 0.602, versus 0.462/0.514 for Smooth Mask, 0.460/0.465 for Grad-CAM++, 0.430/0.418 for Gradient SHAP, and 0.432/0.423 for Integrated Gradients.
-
COCO with DINO. For the self-supervised DINO ViT-B/16, extremal contours reach relevance rank 0.481 and relevance mass 0.652, compared with 0.454/0.538 for Smooth Mask and 0.434/0.432 for Grad-CAM++.
-
ImageNet trade-off. On 100 ImageNet validation images, Smooth Mask leads most supervised relevance metrics (relevance rank 0.638, relevance mass 0.806 versus 0.596 and 0.779 for extremal contours), but the contour method offers a better balance of localization and compactness.
-
DINO improvements. The abstract reports that on self-supervised DINO models the method improves relevance mass by over 15% and maintains positive faithfulness correlations. In the main results table, extremal contours on DINO show relevance mass 0.814 with faithfulness 0.045, while Smooth Mask shows 0.758 with −0.052 and Grad-CAM++ shows 0.584 with 0.014.
-
Inconsistent faithfulness figures. The results tables with 95% confidence intervals (Appendix C) report different faithfulness values than the main tables: for DINO, extremal contours appear as −0.033 and Smooth Mask as 0.010, rather than 0.045 and −0.052. The paper does not reconcile these differences.
-
Robustness to initialization. Initializing the contour from nine different starting points spread across the image converges to the same object every time, with only minor boundary variation. Closer initialization gives faster convergence and less risk of local optima on irregular objects.
-
Robustness to spectral regularization. A large λ_r produces smooth near-circular contours and small λ_r permits higher-frequency boundaries, but all settings recover the same target object.
-
Avoids adversarial masks by construction. Unlike dense masks, which can satisfy the extremal loss through unconstrained degrees of freedom, the contour construction is limited to compact connected regions, so no Gaussian smoothing of a lower-dimensional mask (used by prior work) is needed.
-
Runtime. On an NVIDIA GeForce RTX 3090 over 10 images, extremal contours average 8.6 ± 2.5 seconds, compared with 6.08 ± 0.04 for Smooth Mask, 0.099 ± 0.005 for Integrated Gradients, 0.032 ± 0.003 for Gradient SHAP, and 0.020 ± 0.003 for Grad-CAM++. Optimization stabilizes at roughly 1000 iterations, with stopping points around 8 seconds.
-
Area–faithfulness trade-off. Sweeping α* over {0.1, ..., 0.7} recovers a characteristic area–faithfulness curve: embedding preservation is maximized and deletion minimized at large mask areas, with a cost in performance for smaller evidence regions.
-
Multi-contour results. With N=2 and N=4 contours, the method consistently lands on the distinct objects driving classification, though one shown N=4 case is a failure where the contours do not cover the salient objects.
Methodology in Plain English
The authors reframe the masking problem geometrically. Instead of deciding a preserve/delete score for every pixel, they place a center point in the image and describe the mask boundary as a radius that varies with angle — a wobbly closed curve drawn from a handful of Fourier coefficients. This curve is always a single blob with no holes, which is exactly the property dense masks lack.
For each candidate contour, they build two versions of the image: one where the masked region keeps the original pixels and the outside is replaced by a heavily blurred version of the image, and one where the masked region is blurred and the rest is kept. Both are pushed through the classifier, and the objective compares their backbone embeddings to the embedding of the original image with cosine similarity — the preserved variant should match, the deleted variant should not.
Three terms shape the loss. The extremal term drives the preserve/delete separation. An area term penalizes large contours, with its weight set automatically: it stays small while the preserved embedding still differs from the original and grows once fidelity is achieved, capped at 5. A spectral term penalizes high-frequency Fourier coefficients, which discourages jagged boundaries.
Optimization uses AdamW at a learning rate of 0.003. The contour starts as a circle of radius 0.5 centered at the image center, and the mask-boundary sharpness parameter τ is annealed from 1 to 100 on a cosine schedule so gradients are smooth early and the mask becomes nearly binary by the end. The blurred background uses Gaussian smoothing with kernel size 21 and σ = 20, computed once before the loop. In the reported experiments, K = 5 Fourier coefficients are used, with K = 20 shown in the robustness analysis. An early stopping rule halts optimization when the loss stops decreasing, and for the fixed-area variant the area penalty is replaced by a term targeting a chosen fraction α*.
Why This Matters
Research impact. The paper argues that topological guarantees in explanation masks matter more than raw pixel flexibility. If a mask cannot fragment or develop holes by construction, comparisons across images become meaningful and stability between runs improves — a recurring failure mode for gradient and dense-perturbation methods. The work also provides concrete evidence that self-supervised models such as DINO are a regime where contour-based explanations hold up better than gradient baselines.
Real-world applications:
- Medical imaging: the authors propose contour explanations for CT, MRI, and pathology slides, where learned contours could serve as editable suggestion masks that clinicians refine with minimal effort instead of drawing or checking pixel-wise labels.
- Clinical training and assessment: compact, didactic contours could support reader-consistency training and improve evaluation quality, and avoid fragmented voxel islands within a single-object segmentation.
- Autonomous driving and other safety-critical vision: the paper motivates interpretability for trust, error diagnosis, and reliability in sensitive deployment settings.
- Dataset annotation: contour masks are cheaper to verify or edit than dense pixel masks, reducing annotation burden while keeping faithful attributions.
Industry relevance. Any team deploying a vision classifier where a reviewer must sign off on a model's decision — radiology, industrial inspection, triage — has an interest in explanations that are stable, single-region, and cheap to audit. The method is model-agnostic and training-free, so it can be applied to an existing classifier without retraining, though the 8.6-second-per-image runtime is a practical constraint compared with single-backward-pass saliency methods.
Future Directions
-
Richer contour parameterizations. The authors call for formulations that balance expressivity with topological guarantees, enabling multi-component or hierarchical masks while preserving the efficiency and stability of the Fourier form.
-
Lifting the star-convex restriction. Every point in the current mask must be visible from its center, which prevents capturing objects with strong concavities or holes and produces an isotropic bias toward rounded shapes — noted as a failure mode for elongated objects even with multiple contours.
-
Extension to other vision tasks. The method is described as inherently model-agnostic: for object detection it could optimize contours against a chosen box or query score with unaltered gradients, while segmentation is flagged as more intricate and requiring investigation into which loss formulations yield the most informative attributions.
-
Deployment in medical imaging and runtime efficiency. Moving contour explanations into CT, MRI, and pathology workflows is named as a natural next step, alongside the open problem of reducing the iterative optimization cost relative to single-backward-pass methods.
Target Audience
Explainable AI researchers working on attribution methods, especially those interested in perturbation-based explanations and structural constraints on masks. Also useful for practitioners deploying vision classifiers in regulated or safety-critical domains — medical imaging, autonomous systems — who need stable, reviewable explanations, and for graduate students looking for a compact, clearly motivated example of encoding geometric priors directly into an optimization objective.
Authors’ abstract
Faithful yet compact explanations for vision models remain a challenge, as commonly used dense perturbation masks are often fragmented and overfitted, needing careful post-processing. Here, we present a training-free explanation method that replaces dense masks with smooth tunable contours. A star-convex region is parameterized by a truncated Fourier series and optimized under an extremal preserve/delete objective using the classifier gradients. The approach guarantees a single, simply connected mask, cuts the number of free parameters by orders of magnitude, and yields stable boundary updates without cleanup. Restricting solutions to low-dimensional, smooth contours makes the method robust to adversarial masking artifacts. On ImageNet classifiers, it matches the extremal fidelity of dense masks while producing compact, interpretable regions with improved run-to-run consistency. Explicit area control also enables importance contour maps, yielding a transparent fidelity-area profiles. Finally, we extend the approach to multi-contour and show how it can localize multiple objects within the same framework. Across benchmarks, the method achieves higher relevance mass and lower complexity than gradient and perturbation based baselines, with especially strong gains on self-supervised DINO models where it improves relevance mass by over 15% and maintains positive faithfulness correlations.