GPTFace: Generative Pre-training of Facial-Linguistic Transformer by Span Masking and Weakly Correlated Text-image Data
Yudong Li, Hao Li, Xianxu Hou, Linlin Shen
TL;DR
GPTFace addresses the challenge of learning broad facial knowledge from large-scale, weakly correlated text-image data by proposing a generative pre-training framework that jointly models text and face images. It introduces span image-text masking (MILM) and image-text matching (ITM) within a shared Transformer backbone, coupled with a gradient-based controllable generation mechanism that uses ITM guidance to steer non-autoregressive generation. The approach achieves competitive performance on facial attribute classification and expression recognition, while enabling a range of face editing and image-to-text generation tasks such as text-guided editing, image tagging, and inpainting. By training on LAION-FACE with a VQGAN-based discrete image representation, GPTFace demonstrates rapid convergence and versatile applicability to both analytical and creative facial tasks, suggesting a scalable path for facial knowledge pre-training from web data. The combination of span masking, ITM supervision, and gradient-based control provides a practical framework for integrated face understanding and generation in real-world applications.
Abstract
Compared to the prosperity of pre-training models in natural image understanding, the research on large-scale pre-training models for facial knowledge learning is still limited. Current approaches mainly rely on manually assembled and annotated face datasets for training, but labeling such datasets is labor-intensive and the trained models have limited scalability beyond the training data. To address these limitations, we present a generative pre-training model for facial knowledge learning that leverages large-scale web-built data for training. We use texts and images containing human faces crawled from the internet and conduct pre-training on self-supervised tasks, including masked image/language modeling (MILM) and image-text matching (ITM). During the generation stage, we further utilize the image-text matching loss to pull the generation distribution towards the control signal for controllable image/text generation. Experimental results demonstrate that our model achieves comparable performance to state-of-the-art pre-training models for various facial downstream tasks, such as attribution classification and expression recognition. Furthermore, our approach is also applicable to a wide range of face editing tasks, including face attribute editing, expression manipulation, mask removal, and photo inpainting.
