Abstract
Numerous computer vision problems such as stereo depth estimation, object-class segmentation and foreground/background segmentation can be formulated as per-pixel image labeling tasks. Given one or many images as input, the desired output of these methods is usually a spatially smooth assignment of labels. While state-of-the-art approaches have moved from CRF-based methods to deep CNNs, they are often not designed for low-compute scenarios. We present HashMatch, a general framework for computer vision labeling tasks designed to be both fully parallel and low-compute. With a model complexity an order of magnitude less than existing approaches, HashMatch achieves high computational efficiency while producing high-quality results across disparity estimation, image retrieval, and background subtraction.
Introduction
Many core computer vision tasks involve "labeling" every pixel in an image—for instance, determining depth or identifying foreground elements. Currently, the field is dominated by two paradigms: Deep Convolutional Neural Networks (CNNs), which are accurate but computationally and memory-intensive, and Conditional Random Fields (CRFs), which ensure spatial smoothness but often require slow, sequential optimization. This creates a significant gap for low-compute scenarios, such as mobile devices or high-speed robotics, where real-time results are required without excessive power consumption. HashMatch aims to bridge this gap with a framework designed for massive parallelism and minimal arithmetic operations.
Methodology
HashCodes Learning
Instead of relying on expensive deep features, HashMatch utilizes learned binary embeddings. Image patches are mapped to short binary codes using a linear function: $h(x) = \text{sign}(xW)$. To overcome the challenge of training a non-differentiable "sign" function, the authors decouple the task into a novel optimization problem using "anti-sparsity" constraints. This forces internal representations to be binary-like during training. Furthermore, the resulting hyperplanes ($W$) are extremely sparse, typically containing only four non-zero elements. This ensures that computing a hash code requires only a few additions and multiplications per pixel, maximizing efficiency.
Fully Parallel Inference
Standard CRF solvers often rely on sequential message passing. HashMatch employs a simplified version of Variational Inference (Mean-Field) by assuming the probability distribution at each pixel is "peaky" (low entropy). By approximating this distribution with a Dirac delta function, the need for a normalization step is removed, making the complexity independent of the number of possible labels. This allows every pixel to be updated simultaneously in a few parallel steps. A key insight is that the inference speed remains constant regardless of the number of labels, a significant departure from standard methods where complexity scales with label count.
Experimental Evaluation
The authors evaluated HashMatch across several distinct tasks:
- Stereo Depth: Tested using a custom hardware setup with active IR illumination and synthetic datasets.
- Nearest Neighbor Retrieval: Evaluated on the GIST1M dataset containing one million feature vectors.
- Feature Approximation: Tested on EPFL wide-baseline stereo data to approximate complex SIFT descriptors.
- Background Subtraction: Evaluated on a custom dataset of indoor environments.
Results and Discussion
Computational Efficiency
HashMatch demonstrates exceptional speed, achieving 1000 fps on 1.3-megapixel images using an NVIDIA Titan X and 200 fps on a mobile NVIDIA Tegra TX1. This performance is an order of magnitude faster than traditional CNN or CRF-based approaches.
Stereo Accuracy and Quality
In active stereo tests, HashMatch outperformed sensors like Kinect V1 and RealSense R200 in terms of depth jitter and bias. It matched the quality of significantly more complex algorithms like HyperDepth while maintaining its speed advantage.
Image Retrieval Performance
On the GIST1M dataset, HashMatch significantly outperformed other popular hashing schemes, such as ITQ and LSH, particularly when using a small number of bits (16–64 codes). This demonstrates the effectiveness of the learned binary embeddings for high-dimensional feature approximation.
Conclusion
HashMatch offers a compelling solution for real-time, low-power computer vision tasks. By prioritizing sparsity and parallel inference, it achieves state-of-the-art speeds without sacrificing significant accuracy. While the current implementation relies on a "low entropy" assumption and linear hashing, future work could explore non-linear extensions or applications in more complex structured prediction tasks like object detection and pose estimation.
Summary updated