---
kind: concept
slug: spatial-propagation-network
title: Spatial propagation network
summary: >-
  Refines a dense map by repeated weighted copying from neighbours. Fixed affinity weights (CSPN) are replaced by weights recomputed at every step (DySPN), with a diffusion-suppression term against over-smoothing. Author-reported on KITTI validation, DySPN at six steps beats CSPN at twelve. Only one card so far: DySPN, for depth completion.
tags: [computer-vision, depth, affinity, refinement, attention]
papers: ["2202.09769"]
related: [depth-completion, attention-mechanism, dynamic-convolution, guided-depth-upsampling]
status: draft
updated_at: 2026-11-15
---

## Overview

A spatial propagation network (SPN) refines a map by repeating one update
many times. Each pixel takes a weighted combination of its neighbours, and the
weights are called affinities. The repeated update spreads known values into
unknown regions, guided by the image [arxiv:2202.09769 §2]. The property
shared by the variants is that each step multiplies the map by a matrix whose
rows total one [arxiv:2202.09769 §3.1, eq. 1].

The design choice that separates the variants is when the affinities are
computed. A fixed-affinity model computes them once and reuses them at every
step. An adaptive model recomputes them at each step, so the weights can
depend on how far the refinement has progressed [arxiv:2202.09769 §1, §3.1].
The paper also adds a stopping term, diffusion suppression, so that the
update can converge early and stop blurring [arxiv:2202.09769 §3.2].

## Variants

### Fixed-affinity linear propagation (CSPN)

The baseline that the DySPN paper compares against. Its affinity matrix stays
fixed through all steps, and the paper argues that a 7×7 kernel places most
of the weight in the outer ring, so more steps are needed to reach the same
result [arxiv:2202.09769 §1, §2]. No card exists for this method, so the
details here are only those the DySPN paper gives. Its reported 12-step error
on KITTI validation is 789.6 mm RMSE [arxiv:2202.09769 tab. 3].

### Adaptive-affinity propagation, 7×7 window (DySPN)

Each of the six steps has its own attention maps, and these produce the
affinity weights for that step [arxiv:2202.09769 §3.3]. The neighbourhood is
the full 7×7 window, split into distance rings with one attention map per
ring [arxiv:2202.09769 eq. 9]. This is the variant the paper uses for its
ablation [arxiv:2202.09769 tab. 3]. Card:
[Dynamic Spatial Propagation Network for Depth Completion](/papers/2202.09769).

### Dilated neighbourhood (DySPN)

Two 3×3 blocks, one with spacing 1 and one with spacing 3, replace the full
window [arxiv:2202.09769 eq. 10] [arxiv:2202.09769 §3.3]. It uses fewer
neighbours than the 7×7 window, and the paper reports the lowest per-module
time among the three DySPN variants [arxiv:2202.09769 tab. 4]. Same card as
above.

### Deformable neighbourhood (DySPN)

A fixed 3×3 ring for the nearest neighbours, plus learned real-valued offsets
for the outer distance rings [arxiv:2202.09769 eq. 11] [arxiv:2202.09769 §3.3].
This is the variant submitted to the KITTI depth completion benchmark, and it
has the lowest validation error of the three [arxiv:2202.09769 tab. 2, tab. 4].
Same card as above.

### Diffusion suppression (a component, not a variant)

A diagonal term that holds, for each pixel, the attention between the current
and next depth. When the depth has converged, this term makes the step leave
the map unchanged [arxiv:2202.09769 §3.2, eq. 5, eq. 6]. Removing it raises
the 6-step 7×7 error on KITTI validation from 769.0 mm to 763.9 mm RMSE in the
author's ablation [arxiv:2202.09769 tab. 3]. The gain is about 5 mm.

## When to use which

The paper gives no cost model for other hardware. Compare the timings only
within one table and one machine, since tab. 4 does not state either.

| Situation | Use | Why |
|---|---|---|
| Latency matters most and learned offsets are unwanted | Dilated neighbourhood | Lowest module time, 6.9 ms, at 748.5 mm validation RMSE [arxiv:2202.09769 tab. 4] |
| Lowest error on KITTI and offsets are acceptable | Deformable neighbourhood | 739.4 mm validation RMSE, 10.3 ms [arxiv:2202.09769 tab. 4]; the benchmark submission at 709.12 mm RMSE [arxiv:2202.09769 tab. 2] |
| A fixed, dense window is preferred and cost is less critical | 7×7 window | No learned offsets [arxiv:2202.09769 eq. 9]; 745.8 mm validation RMSE and 38 ms [arxiv:2202.09769 tab. 4] |
| Few refinement steps must reach a given accuracy | Adaptive affinity (any DySPN variant) over fixed affinity | At six steps DySPN gives 769.0 mm against CSPN's 811.0 mm; CSPN at twelve steps gives 789.6 mm [arxiv:2202.09769 tab. 3] |
| Indoor depth (NYU Depth v2) and the choice rests on cost | Any DySPN variant | The three variants fall within 0.090–0.091 m RMSE [arxiv:2202.09769 tab. 1] |
| No training data or GPU is available | Not this family | All DySPN results need training on labelled depth; see [depth-completion](/concepts/depth-completion) for a training-free option |

Our arithmetic from tab. 4: the three DySPN variants differ by about 9 mm in
validation RMSE (739.4 to 748.5 mm), while their module times range from 6.9
to 38 ms. On KITTI validation the choice is therefore mostly a latency
decision [arxiv:2202.09769 tab. 4].

## Implementation sketch

The shared core is one refinement loop. Variants differ only in which
neighbours `k` are read and where their attention maps come from.

```pseudocode
# One refinement with N steps, adaptive affinity  [arxiv:2202.09769 eq. 7]
# Inputs: depth0 (H, W) = initial depth h^0
#         weight[k] (H, W): affinity for neighbour part k
#         pi (N, 1 + K, H, W): attention per step; pi[t, 0] is the DS term
# Output: depth (H, W) after N steps

def refine(depth0, weight, pi, steps):
    # Start from the initial depth  [arxiv:2202.09769 §3.1]
    depth = depth0
    for t in range(steps):
        # Signed and absolute normalisers  [arxiv:2202.09769 eq. 8]
        s = pi[t, 0] + sum(pi[t, k] * weight[k] for k in parts)
        s_abs = pi[t, 0] + sum(pi[t, k] * abs(weight[k]) for k in parts)
        # Weighted sum over neighbours, plus the centre term  [eq. 7]
        total = pi[t, 0] * depth + sum(
            pi[t, k] * weight[k] * shift(depth, k) for k in parts
        )
        # Normalise, then pull back towards the initial depth  [eq. 7]
        depth = total / s_abs + (1 - s / s_abs) * depth0
    return depth
```

Points the paper leaves open. Implementers must decide these themselves.

- **Where the attention maps come from.** The head outputs them with a
  sigmoid, but the channel layout is not given [arxiv:2202.09769 §3.4].
- **Zero normaliser.** If every attention and weight in a neighbourhood is
  zero, `s_abs` is zero. The paper has no guard [arxiv:2202.09769 eq. 8].
- **Centre term without diffusion suppression.** The paper does not define
  `pi[t, 0]` when the term is switched off [arxiv:2202.09769 §4.6].
- **Deformable sampling.** Sampling at fractional offsets, such as
  bilinear interpolation, is not specified [arxiv:2202.09769 eq. 11].
- **Confidence map.** The network predicts one, but no equation uses it
  [arxiv:2202.09769 §3.4].
- **Code.** No official code is known. The DySPN card records this, and
  any reimplementation is unchecked against the authors' code.

## Contradictions

No other card lists this concept, so no cross-paper disagreement is known.
Within the DySPN paper, two points need care:

- **Table 4 against Table 3.** The 7×7 DySPN row in tab. 4 reports 745.8 mm
  validation RMSE at six steps. The matching row in tab. 3 with diffusion
  suppression reports 763.9 mm, and the sigmoid-only row reports 769.0 mm. The
  745.8 mm value equals the stochastic-depth-only row of tab. 3, so tab. 4
  probably uses that configuration, but the paper does not say so
  [arxiv:2202.09769 tab. 3, tab. 4].
- **The "nearly 21 mm" claim.** The text reports a gain of nearly 21 mm
  over the prior best [arxiv:2202.09769 §4.5]. In tab. 2, the closest prior
  entry is PENet at 730.08 mm, and 730.08 − 709.12 = 20.96 mm. The claim is
  consistent with that entry, but the paper does not name the comparison
  [arxiv:2202.09769 tab. 2].

## Papers

- [Dynamic Spatial Propagation Network for Depth Completion](/papers/2202.09769):
  adaptive affinity per step, diffusion suppression, and three neighbourhood
  variants (7×7, dilated, deformable) for depth completion.
