Kd-tree Based Wasserstein Distance Approximation for High-Dimensional Data
Kanata Teshigawara, Keisho Oh, Ken Kobayashi, Kazuhide Nakata
TL;DR
This work tackles the scalability bottleneck of Wasserstein distance computations in retrieval by introducing kd-Flowtree, a kd-tree–based embedding that enables deep, dimension-robust trees for Flowtree-like transport approximations. The method preserves linear-time transport costs and adds a probabilistic, dataset-size–independent bound on nearest-neighbor search accuracy, improving performance in high-dimensional ground spaces. Empirical results on text datasets (e.g., 20NEWS, AMAZON, BBC) show kd-Flowtree achieves higher recall than prior tree-based methods and maintains competitive runtimes, highlighting the practical impact for large-scale OT-based retrieval. Overall, the kd-tree embedding demonstrates a promising direction for scalable, accurate Wasserstein-distance approximations in high dimensions, with potential broader applicability beyond retrieval.
Abstract
The Wasserstein distance is a discrepancy measure between probability distributions, defined by an optimal transport problem. It has been used for various tasks such as retrieving similar items in high-dimensional images or text data. In retrieval applications, however, the Wasserstein distance is calculated repeatedly, and its cubic time complexity with respect to input size renders it unsuitable for large-scale datasets. Recently, tree-based approximation methods have been proposed to address this bottleneck. For example, the Flowtree algorithm computes transport on a quadtree and evaluates cost using the ground metric, and clustering-tree approaches have been reported to achieve high accuracy. However, these existing trees often incur significant construction time for preprocessing, and crucially, standard quadtrees cannot grow deep enough in high-dimensional spaces, resulting in poor approximation accuracy. In this paper, we propose kd-Flowtree, a kd-tree-based Wasserstein distance approximation method that uses a kd-tree for data embedding. Since kd-trees can grow sufficiently deep and adaptively even in high-dimensional cases, kd-Flowtree is capable of maintaining good approximation accuracy for such cases. In addition, kd-trees can be constructed quickly than quadtrees, which contributes to reducing the computation time required for nearest neighbor search, including preprocessing. We provide a probabilistic upper bound on the nearest-neighbor search accuracy of kd-Flowtree, and show that this bound is independent of the dataset size. In the numerical experiments, we demonstrated that kd-Flowtree outperformed the existing Wasserstein distance approximation methods for retrieval tasks with real-world data.
