Scalable GPU-Accelerated Euler Characteristic Curves: Optimization and Differentiable Learning for PyTorch
Udit Saxena
TL;DR
The paper tackles the computational and differentiability bottlenecks of topological features for dense imaging by focusing on the Euler Characteristic Curve (ECC) and related Euler Characteristic Transform (ECT). It introduces architecture-aware GPU kernels for $\chi$ computation and a differentiable PyTorch layer that learns thresholds in a single direction via a DECT-style sigmoid relaxation $\sigma_\lambda$, enabling end-to-end training on dense grids. The approach yields 16–2000× end-to-end speedups on synthetic $128^2$–$8192^2$ (2D) and $128^3$–$1024^3$ (3D) grids on an Ampere RTX A6000 and provides analytic gradients for $\partial \chi_{\lambda,u}(\tau)/\partial u$, $\partial/\partial X(p)$, and $\partial/\partial \tau$. This work lowers barriers to adopting topological priors in imaging pipelines, with planned batched/multi-GPU extensions and a released codebase.
Abstract
Topological features capture global geometric structure in imaging data, but practical adoption in deep learning requires both computational efficiency and differentiability. We present optimized GPU kernels for the Euler Characteristic Curve (ECC) computation achieving 16-2000Ö speedups over prior GPU implementations on synthetic grids, and introduce a differentiable PyTorch layer enabling end-to-end learning. Our CUDA kernels, optimized for Ampere GPUs use 128B-coalesced access and hierarchical shared-memory accumulation. Our PyTorch layer learns thresholds in a single direction via a Differentiable Euler Characteristic Transform-style sigmoid relaxation. We discuss downstream relevance, including applications highlighted by prior ECC work, and outline batching/multi-GPU extensions to broaden adoption.
