Temporally Consistent Semantic Video Editing

Yiran Xu, Badour AlBahar, Jia-Bin Huang · DOI

Abstract

Applying semantic edits to video sequences using pre-trained Generative Adversarial Networks (GANs) often results in significant temporal flickering and identity loss. This paper presents a novel framework that achieves high-quality, temporally consistent video editing by employing a two-phase optimization strategy. By refining latent codes through an implicit Multi-layer Perceptron (MLP) and fine-tuning the generator weights with a perceptual difference mask, the method preserves fine details and identity while ensuring smooth transitions. Experimental results on the RAVDESS dataset and unconstrained internet videos demonstrate superior performance in both sharpness and temporal stability compared to existing baselines.

Introduction

StyleGAN has set the gold standard for photorealistic image manipulation, allowing users to perform complex semantic edits—such as changing age, expression, or accessories—by navigating the model's latent space. However, extending these capabilities to video remains a significant challenge. When edits are applied to video frames independently, the resulting output typically suffers from "temporal flickering," where small, inconsistent reconstructions between frames create a jittery visual experience.

Existing attempts to solve this often fall into two traps: they either over-smooth the video, leading to a loss of high-frequency detail (blurriness), or they fail to maintain the subject's identity across the edit. This paper introduces a framework designed to bridge the gap between high-fidelity image editing and stable video synthesis.

Methodology

The proposed framework addresses temporal inconsistency through a dual-optimization approach that balances latent space manipulation with structural preservation.

Phase 1: Implicit Latent Code Optimization

Rather than optimizing the latent codes for each frame directly—a process prone to instability—the authors introduce an "implicit" update mechanism. They utilize a Multi-layer Perceptron (MLP) to predict residual adjustments for the latent codes. This MLP-based approach acts as a natural regularizer; because the MLP is a continuous function, the predicted updates across the temporal axis are inherently smoother than independent frame-by-frame optimizations. This phase establishes the foundational motion and attribute changes while minimizing jagged transitions.

Phase 2: Generator Weight Refinement

While latent updates handle the broad semantic changes, they often struggle to capture the unique, fine-grained details of a specific individual's identity. In the second phase, the framework fine-tunes the weights of the pre-trained StyleGAN generator itself. To prevent the model from altering parts of the image that should remain untouched (e.g., ensuring the background or hair remains static while editing a facial expression), the authors employ a perceptual difference mask. This mask restricts the generator's updates to the relevant semantic regions, ensuring that the edit is both localized and faithful to the original subject.

Enforcing Temporal Consistency

To mathematically enforce consistency, the system integrates RAFT, a state-of-the-art optical flow network. RAFT allows the system to map pixels from a designated "anchor" frame to subsequent frames. By minimizing a bi-directional photometric loss along these motion paths, the framework ensures that colors and features remain aligned as the subject moves, effectively eliminating the flickering artifacts common in naive GAN inversion.

Experimental Evaluation

The researchers validated their approach using a combination of controlled and unconstrained datasets:

  • RAVDESS: High-quality laboratory videos of actors performing various emotional expressions.
  • Internet Videos: Real-world footage of public figures to test the model's robustness against varied lighting and unconstrained environments.

The method was tested on both "In-domain" edits (standard StyleGAN attributes like "angry" or "beard") and "Out-of-domain" edits (stylized transformations like "Disney Princess" or "Sketch").

Key Results

  • Quantitative Stability: The framework achieved a significant reduction in Warping Error ($E_{warp}$), a metric specifically designed to quantify temporal flickering.
  • Visual Fidelity: Compared to Deep Video Prior (DVP), which often achieves consistency at the cost of sharpness, this method maintained the high-frequency details and crispness characteristic of StyleGAN.
  • Identity Preservation: The approach outperformed the Latent Transformer in maintaining the subject's likeness throughout the video, largely due to the localized generator tuning in Phase 2.

Discussion and Limitations

While the framework represents a significant step forward, several challenges remain. The quality of the final edit is heavily dependent on the initial GAN inversion; if the base model cannot accurately represent a specific detail (like a unique piece of jewelry), that detail will likely be lost. Additionally, the pipeline currently requires face alignment, making it less effective for videos featuring extreme head rotations or rare poses where face detectors might fail.

Furthermore, the optimization process is computationally intensive, requiring approximately 40 minutes for a 150-frame sequence on high-end hardware. Future research will likely focus on accelerating this process and extending the framework to unconstrained video editing where subjects are not centered or aligned.

Conclusion

By combining implicit latent updates with targeted generator fine-tuning, this framework provides a robust solution for semantic video editing. It successfully mitigates the trade-off between temporal consistency and image sharpness, allowing for high-fidelity transformations that remain stable over time.

Summary updated

BibTeX
@inproceedings{xu2022temporally,
  author = {Yiran Xu and Badour AlBahar and Jia-Bin Huang},
  title = {{Temporally Consistent Semantic Video Editing}},
  booktitle = {European Conference on Computer Vision},
  year = {2022},
  doi = {10.1007/978-3-031-19784-0\_21},
}
Figure