Optimised Propainter for Video Diminished Reality Inpainting

Pengze Li, Lihao Liu, Carola-Bibiane Schönlieb, Angelica I. Avilés-Rivero

Introduction

In the high-stakes environment of oral and maxillofacial surgery, maintaining a clear view of the operative field is critical. However, video feeds from a surgeon's perspective are frequently obscured by hands or medical instruments. Diminished Reality (DR) addresses this by algorithmically "erasing" these obstructions to restore the underlying view of the patient’s anatomy. This paper details a pragmatic adaptation of the state-of-the-art ProPainter video inpainting framework, optimized for medical applications. The proposed approach achieved the top rank in Phase 1 of the DREAMING Challenge, demonstrating superior temporal consistency and accuracy over image-based generative models.

The ProPainter Framework and Optimization

The core of the solution is ProPainter, a video-native inpainting model designed to handle complex motion and maintain long-term coherence. Unlike image-based models that process frames independently, ProPainter utilizes a dual-pathway approach: recurrent flow completion for motion estimation and Mask-guided Sparse Video Transformers (MSVT) for feature propagation.

The ProPainter pipeline, featuring recurrent flow completion, image/feature propagation, and MSVT blocks for high-quality video inpainting.

To deploy this powerful model within the strict resource constraints of the DREAMING Challenge (specifically a T4 GPU with 16GB VRAM), several key optimizations were implemented:

  • Memory Management: A custom strategy was developed to offload inactive tensors from GPU to CPU and aggressively delete intermediate variables.
  • Resolution Scaling: Input resolution was reduced by 30% to ensure the entire processing pipeline fit within the VRAM limit.
  • Temporal Windowing: The system utilizes a sliding window of 18 neighboring frames for local context, supplemented by global reference frames sampled every 20 frames to ensure long-term stability.
  • Mask Expansion: Masks for the objects to be removed were slightly dilated to provide better boundary context for seamless blending.

Evaluation and Results

The model was evaluated on the DREAMING Challenge dataset, which includes 100 diverse surgical scenes, each containing approximately 1,000 frames at $1280 \times 720$ resolution. Notably, the authors employed a zero-shot approach, using weights pre-trained on general video datasets (YouTube-VOS and DAVIS) without further fine-tuning on medical data.

The "Optimised ProPainter" significantly outperformed baseline image-generative models like Stable Diffusion. While Stable Diffusion often suffers from temporal jitter due to a lack of inter-frame memory, ProPainter maintains high visual fidelity across long sequences.

Qualitative comparison of the proposed method against ground truth across two surgical cases. The model successfully removes obstructions while maintaining temporal consistency from $t_1$ to $t_n$.

Quantitatively, the model achieved a Consistency Error (C-Error) of 0.276, a marked improvement over Stable Diffusion's 0.333. It also led in Accuracy Error (A-Error) and Weighted FID (W-FID), confirming that the inpainted regions are both spatially accurate and visually realistic. The pipeline successfully processed the 1,000-frame sequences within the 20-minute limit prescribed by the challenge organizers.

Conclusion

This work demonstrates that general-purpose video inpainting models, when paired with clever engineering and memory optimization, can be highly effective in specialized domains like surgery. The success of the zero-shot approach suggests that the underlying motion and texture propagation mechanisms of ProPainter generalize well to medical textures. Future work will focus on reducing latency to achieve real-time performance, moving closer to providing surgeons with an unobstructed "X-ray vision" during live procedures.

Summary updated

BibTeX
@inproceedings{li2024optimised,
  author = {Pengze Li and Lihao Liu and Carola-Bibiane Schönlieb and Angelica I. Avilés-Rivero},
  title = {{Optimised Propainter for Video Diminished Reality Inpainting}},
  booktitle = {ISBI},
  year = {2024},
  doi = {10.1109/isbi56570.2024.10635380},
}
Figure