Abstract
In this work, we propose an approach to perform non-uniform image interpolation based on a Gaussian Mixture Model. Traditional image interpolation methods, like nearest neighbor, bilinear, Hamming, Lanczos, etc. assume that the coordinates you want to interpolate from, are positioned on a uniform grid. However, it is not always the case in practice and we develop an interpolation method that is able to generate an image from arbitrarily positioned pixel values. We do this by representing each known pixel as a 2D normal distribution and considering each output image pixel as a sample from the mixture of all the known ones. Apart from the ability to reconstruct an image from arbitrarily positioned set of pixels, this also allows us to differentiate through the interpolation procedure, which might be helpful for downstream applications. Our optimized CUDA kernel and the source code to reproduce the benchmarks is located at https://github.com/universome/non-uniform-interpolation.
Introduction
Traditional image interpolation—the math used to resize an image or fill in missing pixels—almost always assumes that data points live on a perfect, uniform grid. Methods like bilinear or nearest-neighbor interpolation rely on this regularity to calculate values for "in-between" spaces. However, in modern computer vision and graphics, we increasingly encounter "functional" representations of images (like Implicit Neural Representations or differentiable rendering pipelines) where pixel values exist at arbitrary, scattered coordinates. Standard tools struggle or fail in these non-uniform settings.
This paper introduces a novel, differentiable interpolation method for images where pixels are scattered across a non-uniform grid. By representing known pixels as a Gaussian Mixture Model (GMM), the authors can reconstruct high-quality images from arbitrarily positioned data points, outperforming standard interpolation techniques in sparse data scenarios.
Methods
The core idea is to treat interpolation as an inference problem using a Gaussian Mixture Model (GMM).
- Pixels as Gaussians: Each known pixel (with a specific color and coordinate) is treated as a 2D normal distribution. The mean of the distribution is the pixel's coordinate, and the "spread" is controlled by a fixed variance parameter ($\sigma^2$).
- Expected Color: To find the color at any unknown coordinate $q$, the method calculates the expected value of the color across all known "Gaussian pixels." It functions as a weighted average where pixels closer to $q$ have a much stronger influence.
- Differentiability: Because the entire process is based on standard Gaussian math, the interpolation procedure is fully differentiable, allowing for backpropagation through the interpolation step.
- Optimized Implementation: A custom CUDA kernel was developed for both forward and backward passes to ensure computational feasibility compared to naive implementations.
Evaluation and Results
The method was evaluated using 1,000 images from the ImageNet dataset to benchmark reconstruction quality. The GMM approach was compared against six standard interpolation methods: Nearest Neighbour, Box, Bilinear, Bicubic, Hamming, and Lanczos.
On the ImageNet benchmark, the GMM interpolation method outperformed all six standard methods in terms of $L_1$ reconstruction error, particularly as the downsampling factor increased. While standard methods are faster for simple resizing, the optimized CUDA kernel makes the GMM approach practical for tasks where non-uniformity is a requirement.
Key Insights and Discussion
- Robustness to Sparsity: While standard methods excel on dense grids, they degrade quickly as data becomes sparse. The GMM approach maintains better image structure even at high downsampling factors.
- The Importance of Variance: The hyperparameter $\sigma^2$ (the variance of each Gaussian) is critical. Choosing the right $\sigma^2$ often matters more than the exact placement of the points.
- Optimization Resistance: Interestingly, the model is "reluctant" to move point coordinates during gradient descent. When optimizing pixel locations to minimize reconstruction error, the system often gets stuck in local minima, suggesting a complex optimization landscape.
Conclusion
The proposed GMM-based interpolation provides a robust and differentiable solution for non-uniform grids. While the difficulty of optimizing point locations remains a limitation, this work opens doors for "active sampling" techniques where models learn to sample the most informative parts of an image for optimal reconstruction.
Summary updated