Context-Aware Mutual Learning for Blind Image Inpainting and Beyond
Organizations: Department of Economic Crime Investigation, Shandong Police College, Jinan 250200, China · College of Electronic Engineering, Ocean University of China, Qingdao 266000, China · Sanya Oceanographic Institution, Ocean University of China, Sanya 572000, China
Abstract
Blind image inpainting, aiming to recover contaminated images in the case of unknown masks, is a challenging task. Motivated by the perspective of human vision and knowledge, blind image inpainting can be decomposed into two stages: mask estimation and image inpainting based on the estimated mask. The two-stage idea exhibits evident advantages in enhancing inpainting quality and augmenting the generalization capability of unknown real-world contamination by explicitly employing the estimated mask for image inpainting compared to one-stage scheme. This two-stage idea has also been intuitively implemented. However, existing two-stage methods excessively emphasize the unilateral relationship of mask estimation to image inpainting, and may overlook the mutual relations between them. Specifically, mask estimation can provide more contextual semantics for image inpainting to strengthen the understanding of semantics, and image inpainting can offer more contextual details (e.g., textures and edges) for mask estimation to improve the learning of details. In this work, we propose a novel Context-Aware Mutual Learning (CAML) framework for blind image inpainting that joints mask estimation and image inpainting to mutually exploit contextual information. In the CAML framework, we design the Inpainting-Guided Context-Mutual (IGCM) learner to acquire the complementary contextual details from image inpainting for assisting mask estimation, and the Estimation-Guided Context-Mutual (EGCM) learner to strengthen the understanding of contextual semantics from mask estimation for assisting image inpainting. Ablation studies validate the efficacy of our CAML. Extensive experiments show that our CAML achieves state-of-the-art performance on both blind image inpainting and additional vision tasks, i.e., snow removal, shadow removal, and watermark removal, indicating its superiority.
Figures & tables
| Estimating Encoder | Output | Inpainting Encoder | Output |
|---|---|---|---|
| ResBlock(3, 64, 3, 1, 1) | 256 | Conv(3, 64, 7, 1, 3)+IN(64)+ReLU() | 256 |
| IGCM learner | 256 | EGCM learner | 256 |
| ResBlock(64, 128, 3, 2, 1) | 128 | Conv(64, 128, 3, 2, 1)+IN(128)+ReLU() | 128 |
| IGCM learner | 128 | EGCM learner | 128 |
| ResBlock(128, 256, 3, 2, 1) | 64 | Conv(128, 256, 3, 2, 1)+IN(256)+ReLU() | 64 |
| IGCM learner | 64 | EGCM learner | 64 |
| Metric | Method | FFHQ | CelebA-HQ | ImageNet | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | - | - | - | ||||
| BCE | VCN | |||||||||||
| CAML | ||||||||||||
| PSNR | PICNet ♯ | |||||||||||
| CTSDG ♯ | ||||||||||||
| LaMa ♯ | ||||||||||||
| Metric | Method | Paris StreetView | Places2 | |||||
|---|---|---|---|---|---|---|---|---|
| - | - | - | - | - | - | |||
| BCE | VCN | |||||||
| CAML | ||||||||
| PSNR | PICNet ♯ | |||||||
| CTSDG ♯ | ||||||||
| LaMa ♯ | ||||||||
| Method | FFHQ | CelebA-HQ | ImageNet | Paris StreetView | Places2 | ||
|---|---|---|---|---|---|---|---|
| CAML | PICNet ♯ | ||||||
| CTSDG ♯ | |||||||
| LaMa ♯ | |||||||
| MISF ♯ | |||||||
| CoordFill ♯ | |||||||
| Repaint ♯ | |||||||
| Dataset | Contaminated Pattern | VCN | TransCNN-HAE | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| BCE | PSNR | SSIM | FID | LPIPS | PSNR | SSIM | FID | LPIPS | |||
| FFHQ | Graffiti | ||||||||||
| Text | |||||||||||
| Image Occlusion | |||||||||||
| CelebA-HQ | Graffiti | ||||||||||
| Text | |||||||||||
| Number | Embedding | BCE | PSNR | SSIM | FID | LPIPS | Params | FLOPs |
| Position | (M) | (G) | ||||||
| IGCM | - | |||||||
| EGCM | ||||||||
| IGCM EGCM | Encoder 1st | |||||||
| Encoder 2nd | ||||||||
| Encoder 3rd |
| Method | BCE | PSNR | SSIM | FID | LPIPS | ||
|---|---|---|---|---|---|---|---|
| CMAT block | w/o | ||||||
| CAML | w/o CMAT block | ||||||
| w/ CMAT block | |||||||
| Method | PSNR | SSIM | FID | LPIPS | ||
|---|---|---|---|---|---|---|
| CMAF block | w/o | |||||
| w/o | ||||||
| Min | ||||||
| Max | ||||||
| Average | ||||||
| CAML | w/o CMAF block | |||||
| Method | BCE | PSNR | SSIM | FID | LPIPS |
|---|---|---|---|---|---|
| Multi-task | |||||
| Simultaneous | |||||
| II first | |||||
| ME first |
| Method | Snow100K | CSD | |||||
|---|---|---|---|---|---|---|---|
| PSNR | SSIM | LPIPS | PSNR | SSIM | LPIPS | ||
| DesnowNet | |||||||
| HDCWNet | |||||||
| DDMSNet | |||||||
| TKL | |||||||
| CAML | |||||||
| Method | ISTD | SRD | |||||
|---|---|---|---|---|---|---|---|
| (RMSE ) | Shadow | Non-Shadow | All | Shadow | Non-Shadow | All | |
| DSC | |||||||
| DHAN | |||||||
| AEF | |||||||
| ShadowFormer | |||||||
| CAML | |||||||
| Method | LOGO30k | CLWD | |||||
|---|---|---|---|---|---|---|---|
| PSNR | SSIM | RMSE | PSNR | SSIM | RMSE | ||
| BVMR | |||||||
| SplitNet | |||||||
| SLBA | |||||||
| CAML | |||||||
Image Inpainting
Image inpainting reconstructs missing or corrupted image regions using surrounding context, learned visual priors, and optional structural or reference guidance.
See all 92 papers