π€ AI Summary
Earth Moverβs Distance (EMD) is a fundamental metric for distribution similarity, yet its exact computation suffers from prohibitive time and memory complexity, limiting scalability to large-scale applications. This paper proposes NNS-EMDβa novel framework that systematically integrates nearest neighbor search (NNS) into EMD approximation for the first time. Unlike prior methods, NNS-EMD requires no manual hyperparameter tuning and achieves a unified balance of high accuracy, low computational complexity, and memory efficiency. It supports GPU-accelerated vectorized parallelization and explicitly recovers the optimal transport mapping, enabling new applications such as image color transfer. Experiments demonstrate that NNS-EMD accelerates exact EMD computation by 44β135Γ while significantly outperforming existing approximation algorithms in accuracy. It establishes new state-of-the-art results on image classification, retrieval, and color transfer tasks.
π Abstract
Earth Mover's Distance (EMD) is an important similarity measure between two distributions, used in computer vision and many other application domains. However, its exact calculation is computationally and memory intensive, which hinders its scalability and applicability for large-scale problems. Various approximate EMD algorithms have been proposed to reduce computational costs, but they suffer lower accuracy and may require additional memory usage or manual parameter tuning. In this paper, we present a novel approach, NNS-EMD, to approximate EMD using Nearest Neighbor Search (NNS), in order to achieve high accuracy, low time complexity, and high memory efficiency. The NNS operation reduces the number of data points compared in each NNS iteration and offers opportunities for parallel processing. We further accelerate NNS-EMD via vectorization on GPU, which is especially beneficial for large datasets. We compare NNS-EMD with both the exact EMD and state-of-the-art approximate EMD algorithms on image classification and retrieval tasks. We also apply NNS-EMD to calculate transport mapping and realize color transfer between images. NNS-EMD can be 44x to 135x faster than the exact EMD implementation, and achieves superior accuracy, speedup, and memory efficiency over existing approximate EMD methods.