Diffusion Models Beat GANs on Image Classification
Soumik Mukhopadhyay, Matthew Gwilliam, Vatsal Agarwal, Namitha Padmanabhan, Archana Swaminathan, Srinidhi Hegde, Tianyi Zhou, Abhinav Shrivastava
TL;DR
This paper shows that state-of-the-art diffusion models, traditionally used for image generation, can serve as unified self-supervised learners for both discriminative and generative tasks. By extracting frozen features from a pre-trained guided diffusion U-Net at different diffusion steps $t$ and blocks $b$ and applying various lightweight classification heads, the authors achieve strong ImageNet classification results (best linear probe with an Attention head reaching $71.89\%$ accuracy) and competitive FGVC transfer, while also surpassing BigBiGAN on both generation (FID around $26.21$) and classification metrics. They provide practical guidelines for feature extraction, ablate the effects of $t$, $b$, pooling, and head design, and analyze representations via CKAs to compare diffusion features with ResNets and ViTs. Overall, diffusion models emerge as powerful, flexible unified representations, enabling effective classification without modifying pre-trained weights, albeit with notable computational costs and some dataset-specific considerations.
Abstract
While many unsupervised learning models focus on one family of tasks, either generative or discriminative, we explore the possibility of a unified representation learner: a model which uses a single pre-training stage to address both families of tasks simultaneously. We identify diffusion models as a prime candidate. Diffusion models have risen to prominence as a state-of-the-art method for image generation, denoising, inpainting, super-resolution, manipulation, etc. Such models involve training a U-Net to iteratively predict and remove noise, and the resulting model can synthesize high fidelity, diverse, novel images. The U-Net architecture, as a convolution-based architecture, generates a diverse set of feature representations in the form of intermediate feature maps. We present our findings that these embeddings are useful beyond the noise prediction task, as they contain discriminative information and can also be leveraged for classification. We explore optimal methods for extracting and using these embeddings for classification tasks, demonstrating promising results on the ImageNet classification task. We find that with careful feature selection and pooling, diffusion models outperform comparable generative-discriminative methods such as BigBiGAN for classification tasks. We investigate diffusion models in the transfer learning regime, examining their performance on several fine-grained visual classification datasets. We compare these embeddings to those generated by competing architectures and pre-trainings for classification tasks.
