Differentiable Coordinate Regression via Soft Argmax

You are reading version 1 of this direction, frozen 2026-10-04. The latest version is version 2.

Version 1 of 2232 papers289 conceptsfrozen 2026-10-04

In computer vision, we often need to pinpoint the exact location of a feature—whether it is a human joint, a facial landmark, or the depth of a pixel in a stereo pair. Traditionally, deep networks approached this in one of two ways: direct regression, where a fully connected layer spits out $(x, y)$ coordinates, or heatmap detection, where the network predicts a grid of probabilities and we pick the maximum value.

Both have flaws. Direct regression is often unstable and discards spatial context. Heatmap detection is spatially rich but suffers from a "discretization bottleneck": the argmax operation used to find the peak is non-differentiable, preventing end-to-end training for coordinate accuracy, and it limits precision to discrete pixel steps.

The research direction of Differentiable Coordinate Regression—often implemented via the Soft-Argmax or Integral Regression—bridges this gap. By treating spatial feature maps as probability distributions, researchers have enabled models to learn continuous, sub-pixel coordinates in a fully differentiable pipeline.

The Discretization Bottleneck

To understand why this matters, consider a standard pose estimation model. It produces a heatmap where the brightest pixel represents the most likely location of a wrist. To get a coordinate for a loss function, you would typically use argmax. However, argmax has a gradient of zero almost everywhere. If the network predicts a joint one pixel to the left of the ground truth, the gradient doesn't tell the network how to "nudge" the prediction toward the correct spot.

Furthermore, if your heatmap is $64 \times 64$, your prediction is stuck on that grid. You cannot predict a joint at coordinate $32.45$ without significantly increasing the resolution, which is computationally expensive.

From Selection to Expectation

The core insight, popularized by researchers like Xiao Sun and Yichen Wei in Integral Human Pose Regression, is to replace the discrete "selection" of a maximum with a continuous "expectation."

Instead of picking the index of the highest value, we:

  1. Apply a Softmax over the spatial map to turn activations into a probability distribution that sums to one.
  2. Calculate the Expected Value of the coordinates by taking a weighted average of all pixel indices, where the weights are the probabilities from the softmax.

Mathematically, for a 1D case with values $P_i$ at indices $i$, the coordinate $\hat{y}$ is: $$\hat{y} = \sum_{i} i \cdot P_i$$

As David Picard notes in Human Pose Regression by Combining Indirect Part Detection and Contextual Information, this operation is fully differentiable. If the ground truth is at $32.45$, the network can receive a gradient that shifts the probability mass slightly to the right, even if the "peak" pixel remains the same.

Sub-pixel Precision in Stereo and Depth

This mechanism is not limited to 2D landmarks. In stereo vision, the goal is to find the "disparity" (horizontal shift) between two images to calculate depth. Alex Kendall and colleagues introduced the Soft-Argmin in GC-Net. By applying this logic to a cost volume—a 3D structure representing the match quality at different shifts—they achieved sub-pixel depth accuracy.

This approach was further refined by Jia-Ren Chang in PSMNet and Yao Yao in MVSNet. By treating depth as a continuous regression task via soft-attention, these models can resolve ambiguities in textureless regions (like white walls) where a hard argmax would jump erratically between similar-looking pixels.

Enabling Unsupervised and Multi-task Learning

Because the soft-argmax makes the entire pipeline differentiable, it opens the door to training signals that don't rely on direct coordinate labels:

  • Geometric Equivariance: Andrea Vedaldi and James Thewlis used soft-argmax to discover object landmarks without any manual labels in Unsupervised learning of object landmarks. The model learns to find points that move consistently when the image is transformed, a feat only possible because the transformation of coordinates can be backpropagated.
  • High-Level Feedback: In 2D/3D Pose Estimation and Action Recognition, Diogo Luvizon demonstrated that gradients from a downstream task (like recognizing a "golf swing") can flow back through the soft-argmax to refine the joint locations, essentially telling the model: "Your wrist position is slightly off because it doesn't match the physics of this action."
  • Coordinate Warping: Carlos Esteves used a differentiable centroid calculation in Polar Transformer Networks to learn the optimal center for log-polar warping, allowing the network to become invariant to rotation and scale through standard gradient descent.

Summary of Intuition

The shift from argmax to Soft-Argmax is a shift from selection to aggregation. By looking at the entire spatial distribution rather than just the peak, the model gains three critical capabilities:

  1. Differentiability: The loss can be calculated directly on the final numerical coordinates.
  2. Sub-pixel Accuracy: The model can predict locations between grid cells.
  3. Efficiency: High precision can be achieved even with low-resolution feature maps, as the "expectation" naturally interpolates between pixels.

Papers in this version

Showing 60 of 232 papers.

History & citationVersion 2 · 2026-10-04

Current · Permanent link

  1. Version 2 (latest) · 2026-10-04 · 170 papers
  2. Version 1 · 2026-10-04 · 232 papers
Cite this direction

Latest version (a living page):

@misc{lacuna_soft_argmax_coordinate_regression_a86bd246,
  title = {soft-argmax coordinate regression},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/soft-argmax-coordinate-regression/rdr_a86bd246dc124c53b138bf109a0f148e},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-23},
}

This exact version (version 1, frozen text):

@misc{lacuna_differentiable_coordinate_regression_via_a86bd246_v1,
  title = {Differentiable Coordinate Regression via Soft Argmax},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/differentiable-coordinate-regression-via-soft-argmax/rdr_a86bd246dc124c53b138bf109a0f148e/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-23},
}