AttFC: Attention Fully-Connected Layer for Large-Scale Face Recognition with One GPU
Zhuowen Zheng, Yain-Whar Si, Xiaochen Yuan, Junwei Duan, Ke Wang, Xiaofan Li, Xinyuan Zhang, Xueyuan Gong
TL;DR
The paper tackles the memory and compute bottlenecks of the fully connected head in large-scale face recognition by introducing AttFC, which replaces the FC with a Dynamic Class Container that stores a small, rotating set of Generative Class Centers generated via an attention loader. A two-encoder architecture, an attention-weighted GCC generator, and a masking mechanism work together to produce GCCs that closely resemble the true class centers, while significantly reducing parameters and enabling training on a single GPU. Empirical results on MS1MV3 and WebFace-21M show AttFC delivers substantial resource savings with accuracy comparable to or better than strong baselines, demonstrating scalable FR on commodity hardware. The work offers a practical path toward deploying FR systems on ultra-large identity sets and invites future improvements to generate GCCs from even fewer images or a single image without sacrificing performance.
Abstract
Nowadays, with the advancement of deep neural networks (DNNs) and the availability of large-scale datasets, the face recognition (FR) model has achieved exceptional performance. However, since the parameter magnitude of the fully connected (FC) layer directly depends on the number of identities in the dataset. If training the FR model on large-scale datasets, the size of the model parameter will be excessively huge, leading to substantial demand for computational resources, such as time and memory. This paper proposes the attention fully connected (AttFC) layer, which could significantly reduce computational resources. AttFC employs an attention loader to generate the generative class center (GCC), and dynamically store the class center with Dynamic Class Container (DCC). DCC only stores a small subset of all class centers in FC, thus its parameter count is substantially less than the FC layer. Also, training face recognition models on large-scale datasets with one GPU often encounter out-of-memory (OOM) issues. AttFC overcomes this and achieves comparable performance to state-of-the-art methods.
