Aligning Motion-Blurred Images Using Contrastive Learning on Overcomplete Pixels

Leonid Pogorelyuk, Stefan T. Radev · DOI

Abstract

We propose a new contrastive objective for learning overcomplete pixel-level features that are invariant to motion blur. Other invariances (e.g., pose, illumination, or weather) can be learned by applying the corresponding transformations on unlabeled images during self-supervised training. We showcase that a simple U-Net trained with our objective can produce local features useful for aligning the frames of an unseen video captured with a moving camera under realistic and challenging conditions. Using a carefully designed toy example, we also show that the overcomplete pixels can encode the identity of objects in an image and the pixel coordinates relative to these objects.

Introduction

Establishing spatial correspondences—identifying matching pixels across different images—is a cornerstone of computer vision, vital for tasks ranging from autonomous navigation to medical imaging. However, real-world conditions often introduce significant noise, such as motion blur, varying illumination, and perspective shifts, which degrade the performance of traditional alignment methods.

Most current self-supervised learning (SSL) methods focus on "bottlenecking" information—compressing high-dimensional images into low-dimensional representations. While effective for global classification, this compression often discards the fine-grained, pixel-level details necessary for precise spatial alignment. Furthermore, motion blur presents a unique challenge as a mathematical convolution; overcoming it requires a network to implicitly learn deconvolution.

Methodology: Overcomplete Representations and Contrastive Loss

To address these challenges, we utilize overcomplete representations. Instead of reducing data dimensionality, we expand it. For an RGB input, our feature extractor—a standard U-Net—outputs a significantly higher number of channels per pixel (e.g., 32 or more). This redundancy provides the robustness needed to handle noise; if one channel is corrupted by blur, others can still carry the signal needed for a match.

Overview of the proposed method: (a) original image with sampled regions, (b-c) regions augmented with motion blur and noise, (f-g) resulting overcomplete output channels, and (h) remapped output showing alignment.

The core of our approach is a novel pixel-level contrastive loss function. During training, we generate two "views" of an image using random perspective transforms, color shifts, and simulated motion blur. We then select "positive pairs" (pixels mapped to their correct corresponding locations) and "negative pairs" (randomly mapped pixels). We employ an $L^\infty$ norm contrastive loss, which encourages the network to encode information in a discrete, "bit-like" manner, rewarding identical positive pairs while pushing negative pairs apart.

Experiments and Results

The model was trained on 5,790 images from the Image Matching Challenge 2022 dataset. For evaluation, we tested its robustness on a challenging real-world video of a farmers market captured by a moving telescope. This video featured extreme motion blur and overexposure, conditions absent from the training set.

Our model successfully aligned video frames captured 10 seconds apart during a telescope slew. Despite the severe blur, the network extracted sufficient matching keypoints to compute accurate affine transformations using RANSAC. This demonstrates that by forcing the network to match blurred pixels to sharp ones, it implicitly learns to ignore the "signature" of motion blur.

Interpretability via Toy Dataset

To understand the nature of these overcomplete features, we created a synthetic dataset of simple patterns ('A' and 'B') subjected to affine transforms and noise. We discovered that the overcomplete pixels do more than just identify objects; they encode local coordinate systems. Specifically, the features represented polar coordinates (radial distance and angle) relative to the object's center. Essentially, each pixel learns where it sits in the "neighborhood" of a feature.

Discussion and Future Work

While the toy example showed clear coordinate encoding, the features learned from complex real-world images remain "entangled" and difficult for humans to interpret directly. Additionally, while we formulated a version of the loss that compares pixels across different images in a batch, it did not significantly improve performance for the specific task of image alignment in our tests.

Future work will focus on expanding the range of learned invariances. By incorporating training data with seasonal variations or extreme weather, the same framework could potentially produce features robust to even more drastic environmental changes, provided the appropriate training data is available.

Summary updated

BibTeX
@misc{pogorelyuk2024aligning,
  author = {Leonid Pogorelyuk and Stefan T. Radev},
  title = {{Aligning Motion-Blurred Images Using Contrastive Learning on Overcomplete Pixels}},
  year = {2024},
  eprint = {2410.07410},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2410.07410},
}
Figure