[Paper Review] Towards Robust Blind Face Restoration with Codebook Lookup Transformer
CodeFormer uses a discrete codebook and a Transformer to predict code sequences for blind face restoration, with a controllable feature transformation to trade off fidelity and quality, achieving state-of-the-art results and robustness to heavy degradation.
Blind face restoration is a highly ill-posed problem that often requires auxiliary guidance to 1) improve the mapping from degraded inputs to desired outputs, or 2) complement high-quality details lost in the inputs. In this paper, we demonstrate that a learned discrete codebook prior in a small proxy space largely reduces the uncertainty and ambiguity of restoration mapping by casting blind face restoration as a code prediction task, while providing rich visual atoms for generating high-quality faces. Under this paradigm, we propose a Transformer-based prediction network, named CodeFormer, to model the global composition and context of the low-quality faces for code prediction, enabling the discovery of natural faces that closely approximate the target faces even when the inputs are severely degraded. To enhance the adaptiveness for different degradation, we also propose a controllable feature transformation module that allows a flexible trade-off between fidelity and quality. Thanks to the expressive codebook prior and global modeling, CodeFormer outperforms the state of the arts in both quality and fidelity, showing superior robustness to degradation. Extensive experimental results on synthetic and real-world datasets verify the effectiveness of our method.
Motivation & Objective
- Address the ill-posed nature of blind face restoration by reducing mapping uncertainty.
- Introduce a discrete codebook prior learned via a vector-quantized autoencoder to provide rich HQ details.
- Use a Transformer to predict code sequences globally for robust restoration.
- Enable an adjustable fidelity-to-quality trade-off through a controllable feature transformation module.
Proposed method
- Learn a discrete codebook and decoder through self-reconstruction (Stage I) to store high-quality visual parts.
- Fix the codebook/decoder and train a Transformer to predict code sequences from low-quality inputs (Stage II).
- Fine-tune the encoder with the Transformer while keeping the codebook and decoder fixed.
- Introduce a controllable feature transformation (CFT) module to control information flow from the encoder to the decoder with a weight w.
- Train in three stages with stage-specific losses focusing on codebook reconstruction, code-token prediction, and image-level fidelity when needed.
- Evaluate on synthetic and real-world datasets, including a new WIDER-Test for severe degradation.
Experimental results
Research questions
- RQ1Does a discrete codebook prior reduce LQ-HQ mapping uncertainty in blind face restoration?
- RQ2Can Transformer-based code prediction outperform nearest-neighbor or CNN-based code lookups for codebook restoration?
- RQ3Does the controllable feature transformation enable effective fidelity-quality trade-offs across degradation levels?
- RQ4How does CodeFormer perform on real-world heavy-degradation data compared to state-of-the-art methods?
Key findings
- CodeFormer achieves best LPIPS, FID, and MUSIQ scores and highest IDS on CelebA-Test among listed methods.
- It preserves identity better (high IDS) while maintaining competitive PSNR and SSIM.
- On real-world tests, CodeFormer matches or surpasses peers in mild/medium degradation and yields the best FID under heavy degradation (WIDER-Test).
- Ablation shows removing the codebook or using NN/CNN lookups degrades performance; Transformer-based code prediction outperforms NN and CNN baselines; keeping the decoder fixed is important for preserving learned priors.
- Runtime is competitive (around 0.07s per image on V100), enabling practical use.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.