D-Convexity: A Unified Differentiable Convex Shape Prior via Quasi-Concavity for Data-driven Image Segmentation

Shengzhe Chen Hao Yan

Overview

D-Convexity is a unified, threshold-free, fully differentiable convex-shape prior for data-driven image segmentation. Instead of constraining the binary mask at a fixed threshold, we require the entire network output $u:\Omega\to[0,1]$ to be quasi-concave — equivalently, every super-level set $S_\gamma=\{\mathbf{x}\in\Omega \mid u(\mathbf{x})\geq\gamma\}$ is convex. From this single principle we derive zero-, first-, and second-order characterizations that turn a hard global geometric constraint into local, differentiable inequalities, yielding a compact convolutional loss and a drop-in Convex Gradient Projection Module (CGPM).

Accepted at CVPR 2026 as a Highlight paper (top 3%).

D-Convexity architecture: Swin Transformer backbone produces a feature map o, which is passed through a sigmoid to give a raw mask u. The Convex Gradient Projection Module (CGPM) then iteratively projects u onto the quasi-concave manifold using the convex loss gradient, yielding a strictly convex final mask. Training uses cross-entropy on the raw mask and the quasi-concavity loss on the projected mask.

Figure 1: Overall framework. A Swin-Transformer encoder–decoder backbone produces feature $o$; a sigmoid yields the raw mask $u=\mathcal{S}(o)$. The Convex Gradient Projection Module (CGPM) is an unrolled gradient-descent block ($v^0 \rightarrow v^1 \rightarrow \cdots \rightarrow v^T$) that projects $u$ onto the quasi-concave manifold by descending the convex loss $\nabla\mathcal{L}_{\mathrm{convex}}$. The network is trained with cross-entropy $\mathcal{L}_{\mathrm{CE}}$ on the raw mask and the quasi-concavity loss $\mathcal{L}_{\mathrm{convex}}$ on the projected mask.


Animated Demo: Zero/First/Second-Order Convexification

The animation below visualizes the midpoint (zero-order), first-order gradient, and second-order Hessian convexification dynamics applied to a non-convex initial mask. All three orders progressively regularize the shape into a convex region, but with increasing levels of spatial smoothness.

Convexification dynamics under the proposed zero-, first-, and second-order quasi-concavity priors. Starting from non-convex inputs, the mask function u is iteratively updated by (left) the local midpoint rule (Algorithm 1, zero-order), (middle) the first-order gradient-based supporting-hyperplane condition, and (right) the second-order quadratic-form penalty Q_2(x). Higher-order priors produce progressively smoother convex shapes.

Motivation

Convexity is a fundamental prior: many anatomical structures (optic disc/cup, blood vessels, organs) and man-made objects are convex or close-to-convex. Enforcing convexity suppresses holes, fragmented predictions, and irregular boundary artifacts, especially under noise, occlusion, and limited training data.

Existing approaches, however, have significant limitations:

  • Discrete formulations (e.g. 1–0–1 collinear-triplet penalties, graph-cuts with convexity constraints, ILP/multicut decompositions) rely on combinatorial solvers and are hard to differentiate through.
  • Level-set/curvature methods (non-negative curvature $\kappa\geq 0$, signed-distance Laplacian $\Delta\phi\geq 0$) certify convexity only at one chosen threshold (e.g. $\phi=0$) and are typically necessary but not sufficient.
  • Recent deep shape priors still lack explicit, principled control over convexity at every confidence level.

D-Convexity resolves all three issues with a single functional view: the mask function $u$ itself should be quasi-concave.


Theory: Quasi-Concavity as a Unified Convex Prior

We formalize convexity threshold-freely as quasi-concavity of $u$:

$$ u \text{ is quasi-concave} \;\Longleftrightarrow\; \forall \gamma,\; S_\gamma=\{\mathbf{x}\mid u(\mathbf{x})\geq\gamma\}\ \text{is convex}. $$
Left: a concave function lies below its tangent plane everywhere. Right: a quasi-concave function may be steeper than any tangent plane, but every horizontal slice (super-level set) is still a convex region. The gradient at a level-set point x defines the supporting hyperplane (y-x) perpendicular to grad u.

Figure 2: Concave vs. quasi-concave functions. A concave function (left) lies below every tangent plane — a strong property that most segmentation masks violate. A quasi-concave function (right) is the weaker, threshold-free notion D-Convexity uses: it only requires that every super-level set $S_\gamma$ be a convex region. At any boundary point $\mathbf{x}$, the supporting hyperplane is given by $\nabla u(\mathbf{x})^{\top}(\mathbf{y}-\mathbf{x})=0$ — this is the geometric content of our first-order condition.

By considering different smoothness assumptions on $u$, we derive three equivalent (or sufficient) characterizations:

Zero-order condition ($u\in C^0$)

$u$ is quasi-concave $\Longleftrightarrow$ for all $\mathbf{x},\mathbf{y}\in\Omega,\ \lambda\in[0,1]$:

$$u(\lambda\mathbf{x}+(1-\lambda)\mathbf{y}) \;\geq\; \min\{u(\mathbf{x}),u(\mathbf{y})\}.$$

A line segment joining two points above a level cannot dip below that level.

First-order condition ($u\in C^1$)

$u$ is quasi-concave $\Longleftrightarrow$ if $u(\mathbf{x})\geq u(\mathbf{y})$, then $\nabla u(\mathbf{y})^{\top}(\mathbf{x}-\mathbf{y})\geq 0.$

The gradient at every point defines a supporting hyperplane of the local super-level set.

Second-order condition ($u\in C^2$, sufficient)

If for all $\mathbf{x}\in\Omega$ with $\nabla u(\mathbf{x})\neq 0$ the Hessian $\nabla^2 u(\mathbf{x}) \prec 0$ (strict negative definite) on the tangent space $T_\mathbf{x}=\{\mathbf{d}\mid \nabla u(\mathbf{x})^{\top}\mathbf{d}=0\}$, then $u$ is quasi-concave.

For 2D images this has the compact convolutional form:

$$ Q_2(\mathbf{x}) \;=\; u_x^2\,u_{yy} \;-\; 2\,u_x u_y\,u_{xy} \;+\; u_y^2\,u_{xx} \;<\;0, $$

a quadratic form in the image gradient that can be evaluated densely as a tiny fixed-kernel convolution — no thresholding required.

A unifying lens

Following Section 3.6 of the paper, D-Convexity recovers many existing convex priors as special cases, with each prior mapped to one of our zero-, first-, or second-order quasi-concavity conditions. The mapping below uses the exact references from the CVPR 2026 paper (arXiv:2605.19210v1):

Related discrete convexity priors (discussed in Section 2 of the paper, and subsumed at the pixel-graph scale by our zero-order view) include 1–0–1 collinear-triple penalties (Gorelick, Veksler, Boykov & Nieuwenhuis, ECCV 2014 / TPAMI 2017), multicut / ILP convexity constraints (Royer, Richmond, Rother, Andres & Kainmüller, CVPR 2016), and relaxed star-type families (Veksler, ECCV 2008; Gulshan et al., CVPR 2010; Isack, Veksler, Sonka & Boykov, CVPR 2016).

So a single quasi-concavity principle subsumes discrete, half-disk, level-set, and curvature-based shape priors in one continuous, differentiable framework, with each prior corresponding to the smoothness order ($C^0$ / $C^1$ / $C^2$) at which it operates.


Loss Functions and CGPM

The first- and second-order conditions become local convolutional losses, evaluated densely over the image without any thresholding:

  • First-order loss ($\mathcal{L}_{\text{1st}}$): penalize the positive part of the asymmetric pair inequality $\mathrm{ReLU}\big(\nabla u(\mathbf{y})^{\top}(\mathbf{y}-\mathbf{x})\big)$ over a small $r$-radius neighborhood $\mathbf{x}\in N_{\mathbf{y}}$.
  • Second-order loss ($\mathcal{L}_{\text{2nd}}$): penalize the positive part of $Q_2(\mathbf{x})+\delta$ weighted by $\|\nabla u(\mathbf{x})\|$:
$$ \mathcal{L}_{\text{2nd}}(u) \;=\; \frac{1}{|\Omega|}\sum_{\mathbf{x}\in\Omega} \|\nabla u(\mathbf{x})\|\cdot \mathrm{ReLU}\big(Q_2(\mathbf{x})+\delta\big). $$

Both losses cost $\mathcal{O}(r^2|\Omega|)$ for the first-order and $\mathcal{O}(|\Omega|)$ for the second-order condition, are GPU-parallel, and have explicit closed-form gradients (see Appendix E of the paper).

Convex Gradient Projection Module (CGPM)

At inference time, the loss alone may not strictly enforce convexity. The CGPM solves a small proximal optimization on the network logits:

$$ u_p \in \arg\min_{v\in[0,1]} \tfrac{1}{2}\|v-u\|^2 + \lambda\cdot \mathcal{L}_{\text{convex}}(v), $$

with $\mathcal{L}_{\text{convex}}\in\{\mathcal{L}_{\text{1st}},\mathcal{L}_{\text{2nd}}\}$. Implemented as an unrolled gradient-descent module on the logit space, CGPM is a drop-in projection layer compatible with any segmentation backbone (U-Net, nnU-Net, TransUNet, etc.):

from CGPM import SegModelWithCGPM

model = UNet2D().to(device)
model.load_state_dict(ckpt)
model.eval()

SegCGPM = SegModelWithCGPM(model, backprop_to_backbone=False)
cgpm_output = SegCGPM(images)

CGPM can be used in train mode (back-propagated into the backbone) or as a post-hoc projection (frozen backbone, projection only).


Experimental Results

We evaluate D-Convexity on four segmentation benchmarks spanning cardiac MRI (ACDC), iris segmentation (CASIA), and retinal optic-disc/cup segmentation (REFUGE, RIM-ONE-r3). To assess out-of-distribution generalization, models trained on REFUGE are evaluated directly on RIM-ONE-r3 without fine-tuning. Reported metrics are Dice ↑, IoU ↑, and Hausdorff Distance HD ↓.

Qualitative comparison

Qualitative segmentation comparison across cardiac MRI, eye, and retinal fundus images. Each row is one image; columns show (a) image, (b) ground truth, and predictions from (c) U-Net, (d) Swin-Unet, (e) Dcan, (f) Dmtn, (g) ConvMCD, (h) ActiveBoundary, (i) the proposed D-Convexity. Baselines produce fragmented holes (green false-negatives) and spurious lobes (red false-positives), while D-Convexity returns clean, simply-connected, convex regions that closely follow the ground truth boundary.
Figure 3: Qualitative segmentation comparison. Rows: cardiac MRI (ACDC), iris (CASIA), and retinal optic-disc/cup (REFUGE & RIM-ONE-r3). Columns: (a) input, (b) ground truth, (c)–(h) six baselines, (i) Proposed (D-Convexity). Color code: ▢ white = true positive, ■ black = true negative, red = false positive, green = false negative, blue = predicted boundary. Baselines tend to produce fragmented holes (green) and spurious lobes (red); D-Convexity yields clean, simply-connected, convex regions that tightly track the ground-truth boundary.

Quantitative results

Table 1. Performance of baseline and shape-aware methods on the ACDC, CASIA, REFUGE, and RIM-ONE-r3 datasets. Models trained on REFUGE are evaluated directly on RIM-ONE-r3 to assess cross-dataset generalization. Best values per column are in blue; our method (Proposed) is highlighted.
MethodACDCCASIAREFUGERIM-ONE-r3
Dice ↑IoU ↑HD ↓Dice ↑IoU ↑HD ↓Dice ↑IoU ↑HD ↓Dice ↑IoU ↑HD ↓
U-Net [28]89.5281.0228.0494.6589.842.54984.6673.7111.0776.4861.9220.57
Swin-Unet [3]95.4291.234.96594.7690.052.39984.0072.427.86381.0068.0715.32
DCAN [4]93.3887.596.94694.9090.292.41380.6667.599.37976.2361.5916.53
DMTN [31]92.6086.228.50094.9290.342.33782.3670.019.33778.3964.4616.80
ConvMCD [25]93.4487.6815.5395.0390.542.32378.3864.4512.5176.7162.2218.18
Active Boundary [35]90.9381.3824.7194.4989.552.65684.8273.6310.5975.3760.4820.64
Proposed (D-Convexity)95.4691.314.70294.7189.942.28888.6179.545.85983.0971.0812.59

Takeaways.

  • Best overall on 3 of 4 datasets. D-Convexity is the top performer on ACDC, REFUGE, and RIM-ONE-r3 across all three metrics, and is best on Hausdorff Distance on CASIA. Dice/IoU on CASIA are essentially saturated for all methods (within 0.3% of each other).
  • Largest gains on hard, shape-driven tasks. On REFUGE, D-Convexity improves Dice from 84.82 → 88.61 ( +3.79) and reduces HD from 7.863 → 5.859 ( −2.0) versus the strongest baseline, with similar gains on the ACDC cardiac task.
  • Strong out-of-distribution generalization. When the REFUGE-trained model is applied directly to RIM-ONE-r3 (different acquisition device and population), D-Convexity still wins by +2.1 Dice and −2.7 HD over Swin-Unet — evidence that the convex shape prior acts as a robust, task-agnostic regularizer rather than overfitting to a particular dataset.
  • Drop-in improvement. All gains are obtained with the same backbone segmentation network as the baselines, with CGPM as a plug-in module — no architectural changes are required.

Key Contributions

  • Quasi-concavity as a unified convex prior. We formalize convexity of all super-level sets as quasi-concavity of the network output $u$, yielding a threshold-free, differentiable, image-domain constraint.
  • Multi-order characterizations. Zero-, first-, and second-order conditions for $u\in C^0,C^1,C^2$, corresponding to different mask smoothness regimes.
  • Compact convolutional losses. The first- and second-order conditions reduce to tiny fixed-kernel convolutions, allowing dense evaluation across the image at $\mathcal{O}(|\Omega|)$ cost.
  • Convex Gradient Projection Module (CGPM). A plug-and-play unrolled-optimization module that strictly enforces convexity at inference time.
  • Theoretical unification. Discrete 1–0–1 priors, half-disk convolution priors, and curvature / signed-distance Laplacian priors are all recovered as special cases or necessary weakenings of our framework.
  • Empirical gains. Consistent convexity and shape-regularity improvements across multiple medical-imaging datasets (retinal fundus, cardiac MRI, iris, etc.), outperforming task-specific networks and prior shape-aware methods.

Quick Start

The reference implementation is available on GitHub: ShengzheC/D-Convexity.

For intuition on the convexification algorithm and the zero-order dynamics, start with the notebook:

Convexification_Algorithm.ipynb

The CGPM segmentation framework lives in CGPM.py, and the first- and second-order losses in loss.py.


Resources


BibTeX

@inproceedings{chen2026dconvexity,
  title     = {D-Convexity: A Unified Differentiable Convex Shape Prior via Quasi-Concavity for Data-driven Image Segmentation},
  author    = {Chen, Shengzhe and Yan, Hao},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year      = {2026},
  note      = {Accepted as Highlight (top 3\%)},
  eprint    = {2605.19210},
  archivePrefix = {arXiv},
  primaryClass = {cs.CV},
  url       = {https://arxiv.org/abs/2605.19210v1}
}