Learning to Scale Temperature in Masked Self-Attention for Image Inpainting

02/13/2023
by   Xiang Zhou, et al.
0

Recent advances in deep generative adversarial networks (GAN) and self-attention mechanism have led to significant improvements in the challenging task of inpainting large missing regions in an image. These methods integrate self-attention mechanism in neural networks to utilize surrounding neural elements based on their correlation and help the networks capture long-range dependencies. Temperature is a parameter in the Softmax function used in the self-attention, and it enables biasing the distribution of attention scores towards a handful of similar patches. Most existing self-attention mechanisms in image inpainting are convolution-based and set the temperature as a constant, performing patch matching in a limited feature space. In this work, we analyze the artifacts and training problems in previous self-attention mechanisms, and redesign the temperature learning network as well as the self-attention mechanism to address them. We present an image inpainting framework with a multi-head temperature masked self-attention mechanism, which provides stable and efficient temperature learning and uses multiple distant contextual information for high quality image inpainting. In addition to improving image quality of inpainting results, we generalize the proposed model to user-guided image editing by introducing a new sketch generation method. Extensive experiments on various datasets such as Paris StreetView, CelebA-HQ and Places2 clearly demonstrate that our method not only generates more natural inpainting results than previous works both in terms of perception image quality and quantitative metrics, but also enables to help users to generate more flexible results that are related to their sketch guidance.

READ FULL TEXT

page 1

page 2

page 5

page 6

page 8

page 10

page 11

page 12

research
09/13/2022

Switchable Self-attention Module

Attention mechanism has gained great success in vision recognition. Many...
research
04/27/2022

Improving the Transferability of Adversarial Examples with Restructure Embedded Patches

Vision transformers (ViTs) have demonstrated impressive performance in v...
research
08/19/2023

Understanding Self-attention Mechanism via Dynamical System Perspective

The self-attention mechanism (SAM) is widely used in various fields of a...
research
08/21/2022

Improving Speech Emotion Recognition Through Focus and Calibration Attention Mechanisms

Attention has become one of the most commonly used mechanisms in deep le...
research
05/22/2019

PEPSI++: Fast and Lightweight Network for Image Inpainting

Generative adversarial network (GAN)-based image inpainting methods whic...
research
01/26/2022

Interactive Image Inpainting Using Semantic Guidance

Image inpainting approaches have achieved significant progress with the ...
research
08/22/2019

Indoor Depth Completion with Boundary Consistency and Self-Attention

Depth estimation features are helpful for 3D recognition. Commodity-grad...

Please sign up or login with your details

Forgot password? Click here to reset