Semi-Supervised Learning for Optical Flow with Generative Adversarial Networks

Wei-Sheng Lai, Jia-Bin Huang, Ming-Hsuan YangNeurIPS 2017

TL;DR

This paper introduces a semi-supervised framework that uses Generative Adversarial Networks (GANs) to train optical flow models. By using an adversarial loss to learn the structural patterns of "flow warp errors" from unlabeled real-world videos, the model overcomes the limitations of traditional unsupervised assumptions (like brightness constancy) and outperforms both purely supervised and standard semi-supervised baselines.

What Problem Does This Paper Address?

Optical flow estimation—predicting how pixels move between two consecutive frames—is a cornerstone of computer vision. However, training deep neural networks for this task faces a major data bottleneck:

  1. The Labeling Dilemma: Obtaining "ground truth" optical flow for real-world video is incredibly difficult, often requiring expensive hardware like LiDAR. Consequently, most supervised models are trained on synthetic, unrealistic datasets (like FlyingChairs).
  2. The Assumption Trap: Unsupervised methods try to use real-world video by assuming "brightness constancy" (a pixel's color doesn't change as it moves) and "spatial smoothness" (neighboring pixels move similarly). Unfortunately, these assumptions fail miserably at motion boundaries and in occluded areas.

To bridge this gap, the authors propose a semi-supervised framework that leverages a small amount of labeled synthetic data alongside a large volume of unlabeled real-world video.

Methods

The core innovation is the introduction of a Conditional Generative Adversarial Network (GAN) to replace traditional unsupervised loss functions.

Comparison of standard semi-supervised learning (left) and the proposed GAN-based framework (right).
  • The Generator ($G$): A 5-level spatial pyramid network (SPyNet) takes two images as input and predicts the optical flow. The authors enhanced the standard SPyNet by using an encoder-decoder architecture with skip connections to increase the receptive field.
  • The Discriminator ($D$): A "PatchGAN" architecture is employed. Instead of evaluating the whole image, it classifies $N \times N$ overlapping patches as "real" or "fake."
  • The Key Insight (Flow Warp Error): Rather than having the discriminator look at the flow fields directly, it examines the flow warp error—the difference between the first image and the second image after it has been "warped" back using the predicted flow.
  • Adversarial Training: The discriminator learns to distinguish between warp errors generated from ground truth flow (which contain natural structural patterns like occlusions) and those from predicted flow. This forces the generator to produce flow that creates "realistic" warp errors, effectively learning to handle motion boundaries without needing hand-crafted mathematical assumptions.

Datasets

The authors utilized a mix of synthetic and real-world data to train and evaluate their model:

  • Training (Labeled): FlyingChairs (synthetic).
  • Training (Unlabeled): KITTI raw videos (real-world driving sequences).
  • Evaluation: The model was benchmarked on MPI-Sintel (Clean and Final passes), KITTI 2012, KITTI 2015, Middlebury, and the FlyingChairs test set.

Key Insights and Ideas

  • Learning the "Shape" of Errors: Traditional loss functions (like Charbonnier or Laplacian) treat warp errors as independent pixels. The GAN approach recognizes that errors have structure—for example, errors caused by an object moving in front of a background have specific, recognizable shapes.
  • Adversarial Loss as a Regularizer: The adversarial loss acts as a powerful regularizer for both labeled and unlabeled data. It guides the model to refine motion boundaries where traditional smoothness priors usually cause blurring.
  • Receptive Field Sensitivity: The authors found that a discriminator receptive field of $47 \times 47$ pixels was optimal. If it is too small, it cannot see the structure; if it is too large, it loses the ability to penalize local boundary errors.

Key Results

The proposed semi-supervised method consistently outperformed the supervised-only baseline and the standard semi-supervised approach (which relies on brightness/smoothness losses).

  • KITTI 2015: The proposed method achieved an Average End-Point Error (EPE) of 16.02, compared to 17.19 for the supervised baseline and 18.07 for the standard semi-supervised baseline.
  • Sharpness: Qualitative results show that the GAN-based model produces significantly sharper motion boundaries and handles occlusions better than previous methods.
  • Data Efficiency: When training on only 25% of the labeled data, the semi-supervised approach showed a much smaller performance drop compared to the purely supervised version, proving its ability to extract meaningful information from unlabeled video.

Limitations and Future Work

  • Domain Specificity: The performance gains were most significant on the KITTI dataset because the unlabeled training data was also from the KITTI domain. The gain on the Sintel dataset was more modest.
  • Motion Diversity: The current unlabeled data (KITTI) is dominated by forward camera motion in driving scenes. The authors suggest that exploring more diverse unlabeled datasets, such as UCF101 or DAVIS, could help the model generalize to more complex, non-linear motions.
  • GAN Stability: Like most GAN-based approaches, the model is sensitive to the weight of the adversarial loss ($\lambda_{adv}$), requiring careful tuning to avoid visual artifacts.

Summary updated

BibTeX
@inproceedings{lai2017semi,
  author = {Wei-Sheng Lai and Jia-Bin Huang and Ming-Hsuan Yang},
  title = {{Semi-Supervised Learning for Optical Flow with Generative Adversarial Networks}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=By-XCwW_ZH},
}
Figure