Papers
Topics
Authors
Recent
Search
2000 character limit reached

ReFlow Inpainting Model

Updated 17 January 2026
  • The paper introduces a novel video inpainting architecture that decouples spatial and temporal reasoning for enhanced restoration quality.
  • It leverages a dual-branch flow-fusion module and ConvLSTM to achieve robust temporal consistency, real-time performance, and an 80% parameter reduction over CombCN.
  • The model is computationally efficient and delivers state-of-the-art visual fidelity with markedly reduced flicker in dynamic scenes.

A ReFlow-based Inpainting Model defines a frame-recurrent video inpainting architecture that decouples spatial and temporal reasoning through interplay between strong single-image inpainting, robust optical flow generation, and sequence modeling via a ConvLSTM. The model’s crucial innovation is its robust flow-generation module, which fuses flows derived from both inpainted frames and directly from corrupted frames, enabling temporally consistent inpainting in videos with arbitrary spatial sizes and temporal lengths in real time. This approach achieves state-of-the-art results in both visual fidelity and temporal stability, while remaining computationally efficient and parameter-efficient (Ding et al., 2019).

1. High-Level Architecture and Workflow

At each time step tt, the model receives:

  • The raw frame ItI_t containing arbitrary-shaped holes,
  • The previous inpainted, temporally smoothed output Ot1O_{t-1}.

Processing proceeds as follows:

  1. A strong image-inpainting network Hs\mathcal{H}_s (partial convolution, as in Liu et al.) produces a plausible but temporally incoherent prediction Pt=Hs(It)P_t = \mathcal{H}_s(I_t).
  2. The robust, blended optical flow Ft1,tF_{t-1,t} between the previous and current frame is computed through the flow-fusion module Hf\mathcal{H}_f.
  3. Encoded representations of Ot1O_{t-1} and PtP_t are concatenated and input to a ConvLSTM Ht\mathcal{H}_t along with its previous hidden (ItI_t0) and cell (ItI_t1) states to update the hidden representation.
  4. A lightweight decoder produces a residual output, refining the previous output: ItI_t2.
  5. Because the architecture is fully convolutional and recurrent, it can process video sequences of arbitrary spatial resolution and temporal length in a single streaming pass (Ding et al., 2019).

ConvLSTM updates follow: ItI_t3 where ItI_t4 denotes convolution and ItI_t5 is elementwise multiplication.

2. Robust Flow Generation and Fusion

Direct optical flow estimation between hole-ridden frames is unreliable. The framework introduces a dual-branch flow inference and fusion:

  1. Flow from Inpainted Frames: Optical flow ItI_t6 is estimated between inpainted frames ItI_t7 and ItI_t8 using an off-the-shelf estimator (e.g., FlowNet2). This yields smooth flow but may propagate hallucinations/artifacts present in ItI_t9.
  2. Flow Completion Branch: Flow Ot1O_{t-1}0 is estimated directly between the corrupted frames Ot1O_{t-1}1 and Ot1O_{t-1}2, then inpainted within missing regions by a small U-Net (Ot1O_{t-1}3), producing Ot1O_{t-1}4. This respects real flow statistics, but may suffer from seams at boundaries.
  3. Flow Blending Network Ot1O_{t-1}5: A 6-layer U-Net fuses Ot1O_{t-1}6 and Ot1O_{t-1}7 via a learned residual-blended average:

Ot1O_{t-1}8

The blending network’s output is supervised by Ot1O_{t-1}9 loss against ground-truth flow Hs\mathcal{H}_s0:

Hs\mathcal{H}_s1

This scheme isolates flow estimation errors due to holes, achieving robust inter-frame motion guidance.

3. Objective Functions

The overall training objective is a weighted sum of six terms: Hs\mathcal{H}_s2 with the authors’ weighting scheme Hs\mathcal{H}_s3, subject to further manual tuning.

Defined losses include:

  • Spatial Reconstruction:

Hs\mathcal{H}_s4

where Hs\mathcal{H}_s5 masks out non-hole regions.

Hs\mathcal{H}_s6

Hs\mathcal{H}_s7

and likewise in reverse: Hs\mathcal{H}_s8.

  • Long-term Consistency:

Hs\mathcal{H}_s9

No adversarial loss is employed.

4. Training Strategy and Implementation

Training proceeds in two phases:

  1. Pre-train the single-image inpainter Pt=Hs(It)P_t = \mathcal{H}_s(I_t)0 and flow-completion network Pt=Hs(It)P_t = \mathcal{H}_s(I_t)1 separately. Pt=Hs(It)P_t = \mathcal{H}_s(I_t)2 is optimized on static images with incomplete regions; Pt=Hs(It)P_t = \mathcal{H}_s(I_t)3 on incomplete flow data.
  2. Freeze Pt=Hs(It)P_t = \mathcal{H}_s(I_t)4 and Pt=Hs(It)P_t = \mathcal{H}_s(I_t)5. Jointly train the flow-fusion network Pt=Hs(It)P_t = \mathcal{H}_s(I_t)6 and the ConvLSTM-based temporal smoother Pt=Hs(It)P_t = \mathcal{H}_s(I_t)7.

Implementation details:

  • Adam optimizer with learning rate Pt=Hs(It)P_t = \mathcal{H}_s(I_t)8.
  • At test time: Pt=Hs(It)P_t = \mathcal{H}_s(I_t)9 on 32-frame clips; real-time Ft1,tF_{t-1,t}0 at 30 FPS on a Titan Xp.
  • Data augmentation: random cropping/rotation for DAVIS+VIDEVO; center cropping for FaceForensics.
  • No specified batch size or epoch count in the report.

The fully convolutional and recurrent structure allows for arbitrary spatial and temporal scales during inference.

5. Quantitative and Qualitative Evaluation

Evaluation employs:

  • Datasets: FaceForensics (1,004 facial clips), DAVIS+VIDEVO (190 wild-object clips).
  • Masks: fixed rectangle, random rectangles per frame, random walker paths.
  • Metric: frame-wise Ft1,tF_{t-1,t}1 error.

Comparison with CombCN (Wang et al. 2018) as the reference end-to-end video-inpainting CNN shows:

Dataset CombCN Ft1,tF_{t-1,t}2 ReFlow Ft1,tF_{t-1,t}3
FaceForensics 8.20 6.10
DAVIS+VIDEVO 40.87 13.89
  • Inference time: Ft1,tF_{t-1,t}4 ms/frame (ReFlow) vs. Ft1,tF_{t-1,t}5 ms/frame (CombCN), approximately Ft1,tF_{t-1,t}6 faster.
  • Parameters: Ft1,tF_{t-1,t}7 reduction over CombCN.

Qualitatively, outputs show sharper details and substantially reduced flicker, especially with moving objects or dynamically changing masks. No adversarial training is used; visual quality derives from loss structure and architecture (Ding et al., 2019).

6. Significance and Context in Video Inpainting

The ReFlow-based inpainting model represents a marked shift from direct spatio-temporal “all-at-once” completion to a hybrid approach where spatial and temporal consistency are handled by specialized modules—single-image inpainting and robust, flow-guided ConvLSTM smoothing. The two-branch flow-fusion module is architected to address the unreliability of flow estimation in the presence of large, arbitrarily shaped holes, which is a persistent challenge for video inpainting.

A plausible implication is that decoupling spatial and temporal modeling via this architecture facilitates scale-out to very large and long video streams, with real-time performance and strong generalization. The methodology demonstrates that competitive video inpainting performance can be achieved without adversarial losses or bulky, monolithic networks, and strongly motivates the use of modular, robust flow-guided temporal models in future video restoration research (Ding et al., 2019).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to ReFlow-based Inpainting Model.