---
kind: concept
slug: chamfer-distance
title: Chamfer distance
summary: >-
  Chamfer distance measures how far two unordered point sets are from each other by averaging nearest-neighbour distances. Covers the squared-L2 form used for training and evaluation (GRNet), a density-aware variant for measuring deformation (SoGraB), a plain form used to score generated objects (OLiDM), an L1 appendix variant, and a grid loss that is not Chamfer.
tags: [point-cloud, loss-function, evaluation-metric, shape-completion, grasping, lidar]
papers: ["2006.03761", "2411.19408", "2412.17226"]
related: [residual-learning, explicit-feature-grid, iterative-closest-point, benchmark-validity]
status: draft
updated_at: 2026-10-25
---

## Overview

A point cloud has no order, so its points cannot be compared one by one with
the points of another cloud. Chamfer distance avoids the matching problem: each
point is paired with its nearest neighbour in the other set, and the squared
distances are averaged [arxiv:2006.03761 §4.2] [eq. 9]. The measure is taken
in both directions, from the prediction to the ground truth and back
[arxiv:2006.03761 §4.2].

Three papers use the measure, each in a different role. GRNet uses it to
train and to evaluate point-cloud completion [arxiv:2006.03761 §4.2]. Its
introduction also argues that networks trained with Chamfer distance tend to
output a mean shape [arxiv:2006.03761 §1] [§3.7]. SoGraB uses a density-aware
variant to measure how much a grasped object deforms [arxiv:2411.19408 §3.1]
[eq. 2]. OLiDM reports plain Chamfer distance as a quality score for generated
foreground objects [arxiv:2412.17226 tab. 2] [§4.1].

## Variants

### Squared-L2 Chamfer distance (both directions)

The form in GRNet's evaluation section. Each direction takes the mean
squared distance to the nearest point, and the paper reports the result scaled
by 10^4 [arxiv:2006.03761 §4.2] [tab. 1]. The paper does not state how the
two directions are combined into one number [arxiv:2006.03761 §4.2]. Results on
ShapeNet and Completion3D are reported in this form. Card:
[GRNet: Gridding Residual Network for Dense Point Cloud Completion](/papers/2006.03761).

### Training with two Chamfer terms

The paper's text does not state a full training objective [arxiv:2006.03761 §3.7].
The released training code uses a sum of two Chamfer distances, one for the
coarse cloud and one for the dense cloud, each against the ground truth. The
GRNet card records this under Paper vs code: [GRNet](/papers/2006.03761).

### Density-aware Chamfer distance (deformation)

SoGraB measures the deformation of a soft object by comparing its point cloud
before and after a grasp [arxiv:2411.19408 §3.1]. The paper rejects plain
Chamfer and Earth Mover's distance for this use [arxiv:2411.19408 §3.1]. Its
variant adds a damping term. For each point, the term is one minus an
exponential of the distance to its nearest neighbour, divided by how many
points chose that neighbour. The two directions are averaged [arxiv:2411.19408
eq. 2]. The sensitivity alpha of the exponential is not given in the paper
[arxiv:2411.19408 §3.1]. The paper aligns the two clouds with ICP first, from a
start estimate taken from the robot's kinematics [arxiv:2411.19408 §3.2].
Card: [SoGraB: A Visual Method for Soft Grasping Benchmarking and Evaluation](/papers/2411.19408).

### Plain Chamfer distance as a quality score (generated objects)

OLiDM reports Chamfer distance, labelled CD, as one of three measures of
generated foreground objects. Lower is better [arxiv:2412.17226 tab. 2]. The
paper says CD is used to evaluate the quality of foreground objects
[arxiv:2412.17226 §4.1]. The paper's text does not give the point count or the
scale used for CD [arxiv:2412.17226 §4.1]. Card:
[OLiDM: Object-aware LiDAR Diffusion Models for Autonomous Driving](/papers/2412.17226).

### L1-norm Chamfer distance (appendix)

The appendix reports a Chamfer variant labelled as using the L1 norm, with its
own table of values [arxiv:2006.03761 app. B] [tab. 8]. Its values are on a
different scale, x10^3 rather than x10^4 [tab. 8]. The released repository does
not implement this metric [arxiv:2006.03761 app. B].

### Grid-based Gridding loss (not Chamfer)

The paper also defines a Gridding loss: an L1 distance between two occupancy
grids, built from the predicted and true clouds [arxiv:2006.03761 §3.7] [eq. 8].
It is a different measure, so it is listed here only to separate it from the
Chamfer family. The paper credits it with recovering finer detail [arxiv:2006.03761 §1].
The released training loop does not call it, so the paper's ablation with and
without it cannot be reproduced from that code [arxiv:2006.03761 tab. 7].

## When to use which

| Situation | Use | Why |
|---|---|---|
| Points are unordered and counts may differ between prediction and target | Squared-L2 Chamfer, both directions | The nearest-neighbour pairing needs no correspondence and works with different point counts [arxiv:2006.03761 §4.2] [eq. 9] |
| Comparing with published numbers | The same variant and scale the baseline used | The GRNet tables use squared-L2 at 10^4 [tab. 1]; the L1 numbers are in a separate appendix table at 10^3 [tab. 8] |
| Training a coarse-to-fine completion network | Chamfer on both the coarse and the dense output | This is what the released code does; the paper's text does not give the objective [arxiv:2006.03761 §3.7] |
| Output should keep fine detail and avoid a mean shape | Chamfer alone may not be enough; the paper proposes a grid loss | The paper's argument is in [arxiv:2006.03761 §1] [§3.7]. Its ablation supports the grid loss [tab. 7], but the code does not reproduce that ablation |
| Measuring how much a soft object deforms between two scans | Density-aware Chamfer, after alignment | The damping term keeps differences in point density from dominating [arxiv:2411.19408 eq. 2]; SoGraB's score is built on it [arxiv:2411.19408 §3.1] |
| Scoring generated objects against reference objects, alongside other measures | Plain Chamfer, lower is better | OLiDM uses it this way next to JSD and a semantic score [arxiv:2412.17226 tab. 2]. Scale and point count are not given, so compare only within one protocol |
| Comparing scores across datasets | Match the point count and split of the benchmark | GRNet evaluates on ShapeNet at 16,384 ground-truth points [arxiv:2006.03761 §4.1] and on Completion3D with 2,048-point outputs [§4.5] [tab. 3] |

## Implementation sketch

Squared-L2 Chamfer distance, both directions. GRNet does not state how the
two directional means are combined; the sum is shown here as a choice. SoGraB
averages them instead [arxiv:2411.19408 eq. 2].

```pseudocode
# Squared-L2 Chamfer distance  [arxiv:2006.03761 §4.2] [eq. 9]
# Inputs: pred (N, 3), gt (M, 3); outputs a scalar

def chamfer_l2(pred, gt):
    # Squared distance between every predicted and every true point
    d = pairwise_sq_dist(pred, gt)            # (N, M)
    # Nearest true point for each prediction, averaged over predictions
    pred_to_gt = d.min(dim=1).mean()
    # Nearest prediction for each true point, averaged over true points
    gt_to_pred = d.min(dim=0).mean()
    # Combination of the two directions is not stated by GRNet; sum is shown
    return pred_to_gt + gt_to_pred
```

The L1 variant replaces the squared distance with an absolute distance
[arxiv:2006.03761 app. B]. The density-aware variant changes the per-point term
to the damped exponential described above [arxiv:2411.19408 eq. 2]. The
grid-based loss needs a voxelised version of both clouds and is not a
point-set distance [arxiv:2006.03761 §3.7] [eq. 8].

## Contradictions

Inside GRNet, the text does not give a training objective [arxiv:2006.03761 §3.7],
while the released code trains on a sum of two Chamfer terms. The paper does
not say which training loop produced its grid-loss ablation [arxiv:2006.03761
tab. 7]. Scale also differs: the paper tables use 10^4 for squared-L2 Chamfer
[arxiv:2006.03761 tab. 1], and the code logs the same quantity at 10^3. Card for
all of these: [GRNet](/papers/2006.03761).

Across papers, the two directions are combined differently. GRNet does not
state a combination [arxiv:2006.03761 §4.2]. SoGraB averages the two directions
[arxiv:2411.19408 eq. 2]. Numbers from the two are not directly comparable.

SoGraB's sensitivity alpha has no value in the paper [arxiv:2411.19408 §3.1].
Its released code sets one value, while the code's own comment and default
give another. Which value produced the paper's scores is not stated. Card:
[SoGraB](/papers/2411.19408).

OLiDM reports CD without giving its scale or point count [arxiv:2412.17226 §4.1].
Its linked repository holds only the project website, so the CD values cannot
be checked against code. Card: [OLiDM](/papers/2412.17226).

## Papers

- [GRNet: Gridding Residual Network for Dense Point Cloud Completion](/papers/2006.03761): uses squared-L2 Chamfer distance for evaluation and training, and defines a grid-based loss that its released training code does not use.
- [SoGraB: A Visual Method for Soft Grasping Benchmarking and Evaluation](/papers/2411.19408): uses a density-aware Chamfer distance, aligned with ICP, to score the deformation of soft-gripper grasps.
- [OLiDM: Object-aware LiDAR Diffusion Models for Autonomous Driving](/papers/2412.17226): reports plain Chamfer distance (CD) as one of three quality measures for generated foreground objects.
