SAIR: Learning Semantic-Aware Implicit Representation
Introduction
Implicit Neural Representations (INRs) have emerged as a powerful paradigm for representing visual data as continuous functions. Unlike traditional pixel grids, INRs treat an image as a mapping from coordinates $(x, y)$ to color values $(R, G, B)$. While this approach excels at tasks like super-resolution, it often fails in image inpainting. Standard coordinate-based models, such as the Local Implicit Image Function (LIIF), rely heavily on local appearance features. When large regions are masked—such as an eye in a portrait—these models lack the global context to reconstruct the missing feature, often resulting in blurry or anatomically incorrect patches.
Methodology: Decoupling Semantics and Appearance
To overcome the limitations of appearance-only models, the authors propose SAIR (Semantic-Aware Implicit Representation). This framework introduces a two-stage process that treats semantic identity as a continuous signal to be reconstructed alongside color.
- Semantic Implicit Representation (SIR): The model first extracts high-level semantic information using a modified CLIP encoder. By adapting CLIP to produce spatial feature maps rather than a single global vector, the SIR module can generate a "Text-aligned Embedding." This embedding provides a semantic prior for every coordinate, effectively telling the model what should be at a specific location (e.g., "eye" or "nose") even if the original pixels are missing.
- Appearance Implicit Representation (AIR): The AIR module performs the final color synthesis. It fuses local appearance features from unmasked areas with the completed semantic features from the SIR. This allows the model to use semantic knowledge to guide the reconstruction of missing textures and structures.
Key Insights
The core innovation of SAIR is the use of semantics as a prior. While local appearance is easily lost to corruption, the surrounding context of an image often implies the semantic presence of missing objects. By leveraging the pre-trained "world knowledge" of CLIP, SAIR can infer the presence of complex features like eyes or specific textures that are completely absent from the input pixels. Furthermore, because SAIR is an implicit representation, it can perform these reconstructions at any arbitrary resolution, bypassing the constraints of fixed pixel grids.
Experimental Results
SAIR was evaluated on the CelebAHQ (human faces) and ADE20K (complex scenes) datasets. The model demonstrated significant improvements over both traditional inpainting methods and baseline INRs:
- Quantitative Performance: On the CelebAHQ dataset with 20-40% masking, SAIR achieved a PSNR of 31.49, markedly higher than LIIF’s 28.80. It also showed superior results in structural similarity (SSIM) and perceptual metrics (LPIPS).
- Qualitative Fidelity: Visual comparisons highlight SAIR's ability to reconstruct distinct, sharp features where other models produce artifacts or blurs.
- Efficiency: SAIR is highly optimized for speed, boasting an inference time of 0.043s per image. This makes it significantly faster than diffusion-based models like Stable Diffusion, which can take up to 12 seconds for similar tasks.
Conclusion
SAIR proves that for neural networks to effectively "fill in the blanks," they must move beyond simple pixel interpolation. By integrating semantic awareness into implicit representations, SAIR enables more robust and contextually accurate image reconstruction, paving the way for advanced applications in image editing and restoration.
Summary updated