Multiscale Sliced Wasserstein Distances as Perceptual Color Difference Measures

Jiaqi He, Zhihua Wang, Leon Wang, Tsein-I Liu, Yuming Fang, Qilin Sun, Kede Ma · DOI

Introduction

Quantifying the perceptual color difference (CD) between two images is a fundamental task in image processing, with applications ranging from camera benchmarking to image enhancement. Traditional metrics, such as CIEDE2000, rely on pixel-wise comparisons, assuming that images are perfectly aligned. However, in real-world photography—such as comparing photos of the same scene taken by different smartphones—perfect alignment is rarely achieved due to camera shake, varying viewpoints, or moving subjects. When images are even slightly misaligned, these "co-located" metrics report significant errors that do not correlate with human perception.

While deep learning-based metrics have been developed to address these challenges, they often require extensive training data, lack the mathematical properties of a true metric, and can be computationally heavy. This paper introduces Multiscale Sliced Wasserstein Distance (MS-SWD), a training-free, robust metric designed to measure perceptual color differences by comparing the statistical distributions of image patches across multiple scales.

Methodology

The MS-SWD framework moves away from rigid pixel-to-pixel comparisons, instead treating image patches as samples from a probability distribution. The method follows a structured pipeline:

1. Multiscale Decomposition

To capture color information at various spatial frequencies, the input images are decomposed into Gaussian pyramids. This allows the metric to account for both fine-grained color details and broader, coarse color blobs, mimicking the multiscale nature of human vision.

2. Perceptual Color Space Conversion

Images are converted from RGB to the CIELAB color space. CIELAB is designed to be perceptually uniform, meaning that the numerical distance between two points in the space corresponds to the magnitude of the difference perceived by the human eye.

3. Patch Distribution Matching via SWD

Rather than comparing individual pixels, the algorithm extracts overlapping patches (e.g., $11 \times 11$) from the images. These patches are treated as high-dimensional data points. To compare the distributions of these patches efficiently, the authors utilize the Sliced Wasserstein Distance (SWD).

The SWD works by projecting high-dimensional data onto random 1D lines and calculating the distance between the sorted projections. The sorting step is critical: it inherently finds "non-local" correspondences. For example, a red patch that has shifted five pixels to the left in the second image will still be matched with the original red patch because their values in the sorted distribution remain similar. This allows the metric to remain robust to geometric shifts without requiring explicit motion estimation.

4. Aggregation

The distances calculated across multiple random projections and all pyramid scales are averaged to produce a single, final perceptual score. This approach ensures that the metric satisfies the mathematical requirements of a true metric, including non-negativity, symmetry, and the triangle inequality.

Experimental Evaluation

The researchers evaluated MS-SWD using the Smartphone Photography Color Difference (SPCD) dataset, which contains 30,000 image pairs. This includes 20,000 perfectly aligned pairs (simulated) and 10,005 non-perfectly aligned pairs captured by different flagship devices.

Performance on Misaligned Data

On the non-perfectly aligned portion of the SPCD dataset, MS-SWD achieved a Pearson Correlation (PLCC) of 0.841, significantly outperforming the standard CIEDE2000, which scored only 0.653. This demonstrates the metric's superior ability to handle real-world capture conditions.

Robustness to Geometric Transformations

To test the limits of the metric, the authors applied random translations, scaling, and horizontal flips. While traditional metrics and even many deep-learning models saw their correlations drop below 0.4 under horizontal flipping, MS-SWD maintained a high correlation of 0.836. This robustness is a direct result of the distribution-based matching strategy.

Application in Color Transfer

Beyond evaluation, MS-SWD can serve as an effective loss function. In color transfer tasks—where the color palette of a source image is applied to a target image—MS-SWD successfully matched the desired colors while preserving the structural integrity of the target. It outperformed other popular perceptual losses, such as DISTS, by providing a better balance between color accuracy and structural preservation.

Discussion and Conclusion

MS-SWD represents a significant advancement in perceptual color measurement. By combining multiscale analysis with the Sliced Wasserstein Distance, the authors have created a metric that is both mathematically rigorous and exceptionally robust to the geometric misalignments common in practical photography.

While the method is more computationally intensive than simple pixel-wise calculations (taking approximately 9.5ms per image pair on an A100 GPU), its training-free nature and high reliability make it a powerful tool for image quality assessment. Future work may explore the use of different pyramid types, such as Laplacian or steerable pyramids, to further refine the metric's sensitivity to human edge perception. Ultimately, the "non-local" sorting mechanism introduced here provides a promising foundation for broader image quality metrics beyond the domain of color.

Summary updated

BibTeX
@inproceedings{he2024multiscale,
  author = {Jiaqi He and Zhihua Wang and Leon Wang and Tsein-I Liu and Yuming Fang and Qilin Sun and Kede Ma},
  title = {{Multiscale Sliced Wasserstein Distances as Perceptual Color Difference Measures}},
  booktitle = {European Conference on Computer Vision},
  year = {2024},
  doi = {10.1007/978-3-031-73668-1\_25},
}
Figure