LIFE: Lighting Invariant Flow Estimation

Zhaoyang Huang, Xiaokun Pan, Runsen Xu, Yan Xu, Kachun Cheung, Guofeng Zhang, Hongsheng LiarXiv 2021

TL;DR

This paper introduces LIFE, a novel weakly supervised framework for estimating optical flow between images with significant lighting and viewpoint variations. By leveraging readily available camera pose information from Structure-from-Motion (SfM) techniques, LIFE trains a neural network to produce accurate, lighting-invariant flows, which in turn significantly improve sparse feature matching for downstream tasks.

What Problem Does This Paper Address?

Estimating optical flow, which describes the motion of pixels between consecutive images, is a fundamental problem in computer vision with applications in image editing, 3D reconstruction, and more. While deep learning methods have achieved impressive results, they typically rely on large datasets of pixel-wise ground truth flow annotations. Creating such annotations for real-world scenarios with significant changes in lighting and viewpoint is extremely challenging and often infeasible. Existing methods struggle in these conditions, either by failing to generalize or by relying on synthetic data that doesn't accurately capture real-world variations. This paper aims to bridge this gap by developing a method that can learn accurate flow from weakly supervised signals (camera poses) in challenging, real-world scenarios.

Methods

The core of LIFE is a weakly supervised framework that trains a neural network (based on the RAFT architecture) to estimate dense optical flow. The key innovation lies in the training signal:

  • Symmetric Epipolar Distance (SED) Loss: Instead of pixel-wise ground truth, LIFE uses the geometric constraint of epipolar geometry. Given estimated camera poses, a fundamental matrix can be derived. This matrix defines a line (epipolar line) in the target image for each pixel in the source image. The SED loss penalizes flows that do not lie on these epipolar lines in both forward and backward directions, effectively using camera pose information as weak supervision. This is crucial because it's independent of lighting conditions.
  • Cycle Consistency Regularization: To further improve robustness, a cycle consistency loss is employed, ensuring that flowing from image A to B and then back to A returns to the original pixel. However, to avoid issues with occlusions, this loss is adaptively applied only to pixels with small cycle distance errors.
  • Synthetic Dense-Flow Regularization (BiT Loss): To provide stronger, pixel-to-pixel supervision, LIFE synthesizes new image pairs by applying geometric transformations (affine or thin-plate spline) to one of the images. This creates a scenario with known, accurate dense flow, which is used to further train the network. This loss is applied bidirectionally to ensure robustness.
  • LIFE-based Sparse Correspondence Identification: A significant contribution is using the predicted dense flows to improve sparse feature matching. This is done in a two-stage process:
  • Stage 1: For a detected feature point in the source image, its corresponding location in the target image is first estimated using the predicted LIFE flow. Then, the closest feature point within a small radius around this warped location is identified based on descriptor similarity.
  • Stage 2: Any remaining feature points are matched using a more direct descriptor matching approach, but only if they satisfy cycle consistency. This two-stage approach leverages the accuracy of LIFE's dense flows to guide the initial matching, leading to higher quality sparse correspondences.

Datasets

  • Training: The primary training dataset is MegaDepth, which provides images of scenes captured under various viewpoint and lighting conditions, along with their estimated camera poses from SfM techniques.
  • Evaluation:
    • KITTI 2012 & 2015: Standard benchmarks for optical flow with dense ground truth, but with limited lighting and viewpoint variations.
  • HPatches: A dataset with image pairs exhibiting varying levels of viewpoint and illumination changes.
  • RobotCar & MegaDepth: Used for evaluating flow in challenging, real-world scenarios where dense annotations are unavailable.
  • Aachen DayNight: Used for evaluating visual localization performance.

Key Insights and Ideas

  • Camera poses as weak supervision for flow: The paper demonstrates that readily available camera pose information from SfM can be effectively used to train robust optical flow models, overcoming the need for expensive pixel-wise annotations in challenging scenarios.
  • Epipolar geometry is lighting-invariant: The SED loss leverages this fundamental geometric property, making it inherently suitable for handling large lighting variations, a major limitation of photometric consistency losses.
  • Dense flows improve sparse matching: By using predicted dense flows to guide feature matching, LIFE significantly reduces ambiguity and improves the inlier ratio of sparse correspondences, which is critical for downstream tasks like pose estimation.
  • Synergy of different losses: Combining the lighting-invariant SED loss with the strong pixel-to-pixel supervision from synthetic dense flows (BiT loss) and adaptive cycle consistency leads to a more robust and accurate flow estimation network.

Key Results

  • Flow Estimation: LIFE achieves state-of-the-art performance on challenging datasets like HPatches, significantly outperforming previous methods in both AEPE (Average End-Point Error) and accuracy, especially in the most difficult illumination and viewpoint variation scenarios. It also shows competitive results on KITTI.
  • Sparse Correspondence Identification: LIFE, when combined with local features like R2D2 and SuperPoint, significantly improves the mean matching accuracy (MMA) and the number of matches on the HPatches dataset.
  • Whole-Image Transformation Estimation: Using LIFE-derived sparse correspondences, the accuracy of homography estimation on HPatches and relative pose estimation on MegaDepth is substantially improved, demonstrating the practical benefit of LIFE for downstream tasks. LIFE+R2D2 achieves state-of-the-art performance in visual localization on the challenging Aachen DayNight benchmark.

Limitations and Future Work

  • Limitations:
    • The paper notes that while the SED loss works well with real scenes, it provides only weak supervision. The synthetic BiT loss, while providing strong supervision, uses images with zero lighting variation, which might not perfectly align with real-world scenarios.
  • The current approach loosely couples dense flow prediction and sparse correspondence establishment, meaning it doesn't fully exploit the potential for information utilization.
  • Future Work: The authors suggest integrating dense and sparse correspondence estimation into a unified neural network to maximize information utilization. They also believe LIFE's ability to predict remarkable flows in challenging scenarios can enable more downstream applications.

Summary updated

BibTeX
@misc{huang2021life,
  author = {Zhaoyang Huang and Xiaokun Pan and Runsen Xu and Yan Xu and Kachun Cheung and Guofeng Zhang and Hongsheng Li},
  title = {{LIFE: Lighting Invariant Flow Estimation}},
  year = {2021},
  eprint = {2104.03097},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2104.03097},
}
Figure