[Paper Review] Contextual Residual Aggregation for Ultra High-Resolution Image Inpainting
The paper introduces Contextual Residual Aggregation (CRA) to enable ultra high-resolution image inpainting by predicting a low-resolution fill and aggregating high-frequency residuals from contextual patches, achieving 8K inpainting with a lightweight, fast model.
Recently data-driven image inpainting methods have made inspiring progress, impacting fundamental image editing tasks such as object removal and damaged image repairing. These methods are more effective than classic approaches, however, due to memory limitations they can only handle low-resolution inputs, typically smaller than 1K. Meanwhile, the resolution of photos captured with mobile devices increases up to 8K. Naive up-sampling of the low-resolution inpainted result can merely yield a large yet blurry result. Whereas, adding a high-frequency residual image onto the large blurry image can generate a sharp result, rich in details and textures. Motivated by this, we propose a Contextual Residual Aggregation (CRA) mechanism that can produce high-frequency residuals for missing contents by weighted aggregating residuals from contextual patches, thus only requiring a low-resolution prediction from the network. Since convolutional layers of the neural network only need to operate on low-resolution inputs and outputs, the cost of memory and computing power is thus well suppressed. Moreover, the need for high-resolution training datasets is alleviated. In our experiments, we train the proposed model on small images with resolutions 512x512 and perform inference on high-resolution images, achieving compelling inpainting quality. Our model can inpaint images as large as 8K with considerable hole sizes, which is intractable with previous learning-based approaches. We further elaborate on the light-weight design of the network architecture, achieving real-time performance on 2K images on a GTX 1080 Ti GPU. Codes are available at: Atlas200dk/sample-imageinpainting-HiFill.
Motivation & Objective
- Motivate inpainting for ultra high-resolution images (up to 8K) under memory constraints.
- Develop a low-resolution predictive pipeline that can produce sharp, high-frequency residuals for missing regions.
- Propose a lightweight network architecture with efficient gated convolutions and multi-scale attention transfer.
- Leverage context-based residual aggregation to transfer high-frequency details from surrounding regions.
- Show that training on low-resolution data can generalize to high-resolution inference while maintaining quality.
Proposed method
- Predict a low-resolution inpainted result from down-sampled input, then up-sample to a large blurry image.
- Compute high-frequency residuals by subtracting the large blurry image from the original, and aggregate residuals using contextual attention scores.
- Use an Attention Computing Module (ACM) to compute patch-wise cosine similarities between inside-hole and outside-hole patches.
- Use an Attention Transfer Module (ATM) to fill in-hole patches at multiple feature levels via weighted averaging with shared attention scores.
- Aggregate residuals across contextual patches to produce a sharp in-hole result when added to the up-sampled blur.
- Adopt Light Weight Gated Convolutions (LWGC) to build a slim, fast generator, with both coarse and refine stages in a two-stage network.
- Train with WGAN-GP adversarial loss and reconstruction loss, using random irregular masks to simulate real-world holes.
Experimental results
Research questions
- RQ1Can ultra high-resolution inpainting be achieved with low-resolution predictions and residual aggregation to reduce memory and compute requirements?
- RQ2How does contextual residual aggregation compare to prior attention-based and patch-based inpainting methods in quality and speed at 2K–8K resolutions?
- RQ3What architectural choices (LWGC, multi-scale attention transfer) most improve performance and efficiency for large-hole inpainting?
- RQ4Is training on 512×512 data sufficient to perform high-quality inpainting on much larger images?
Key findings
- CRA enables inpainting up to 8K with large holes (up to 25%) under limited memory and compute.
- The proposed model achieves real-time performance on 2K images on a GTX 1080 Ti.
- The method delivers strong quantitative results on Places2, with lowest L1 and competitive MS-SSIM and FID across tested sizes.
- CRA with shared attention scores and multi-scale attention transfer reduces parameters and computation while maintaining quality.
- LWGC variants (LWGC sc and LWGC pw) provide substantial efficiency gains with minimal quality loss.
- Compared to other learning-based methods, CRA is faster and yields better or comparable visual quality, especially on higher-resolution inputs.
Better researchstarts right now
From reading papers to final review, dramatically reduce your research time.
No credit card · Free plan available
This review was created by AI and reviewed by human editors.