# Computing the distance between unbalanced distributions: the flat metric

**Authors:** Henri Schmidt, Christian Düll

PMC · DOI: 10.1007/s10994-025-06828-8 · Machine Learning · 2025-07-24

## TL;DR

This paper introduces a new way to compute distances between unbalanced data distributions using a neural network-based method.

## Contribution

The paper provides an implementation of the flat metric for unbalanced distributions using a neural network approach.

## Key findings

- The flat metric generalizes the Wasserstein distance to unbalanced distributions.
- A neural network is used to compute optimal test functions for distance calculation.
- The method was validated with experiments and simulated data.

## Abstract

We provide an implementation to compute the flat metric in any dimension. The flat metric, also called dual bounded Lipschitz distance, generalizes the well-known Wasserstein distance \documentclass[12pt]{minimal}
				\usepackage{amsmath}
				\usepackage{wasysym} 
				\usepackage{amsfonts} 
				\usepackage{amssymb} 
				\usepackage{amsbsy}
				\usepackage{mathrsfs}
				\usepackage{upgreek}
				\setlength{\oddsidemargin}{-69pt}
				\begin{document}$$W_1$$\end{document}W1 to the case that the distributions are of unequal total mass. Thus, our implementation adapts very well to mass differences and uses them to distinguish between different distributions. This is of particular interest for unbalanced optimal transport tasks and for the analysis of data distributions where the sample size is important or normalization is not possible. The core of the method is based on a neural network to determine an optimal test function realizing the distance between two given measures. Special focus was put on achieving comparability of pairwise computed distances from independently trained networks. We tested the quality of the output in several experiments where ground truth was available as well as with simulated data.

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12289810/full.md

## Figures

14 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12289810/full.md

## References

20 references — full list in the complete paper: https://tomesphere.com/paper/PMC12289810/full.md

---
Source: https://tomesphere.com/paper/PMC12289810