EGC: Image Generation and Classification via a Diffusion Energy-Based Model

Qiushan Guo, Chuofan Ma, Yi Jiang, Zehuan Yuan, Yizhou Yu +1 more
4/4/2023
24 citations
cs.CVcs.AIcs.LG

Official code: GuoQiushan/EGC (46 stars, Python, MIT, last commit 2023-09-01).

Abstract

Learning image classification and image generation using the same set of network parameters is a challenging problem. Recent advanced approaches perform well in one task often exhibit poor performance in the other.

Show full abstract

This work introduces an energy-based classifier and generator, namely EGC, which can achieve superior performance in both tasks using a single neural network. Unlike a conventional classifier that outputs a label given an image (i.e., a conditional distribution $p(y|\mathbf{x})$), the forward pass in EGC is a classifier that outputs a joint distribution $p(\mathbf{x},y)$, enabling an image generator in its backward pass by marginalizing out the label $y$. This is done by estimating the energy and classification probability given a noisy image in the forward pass, while denoising it using the score function estimated in the backward pass. EGC achieves competitive generation results compared with state-of-the-art approaches on ImageNet-1k, CelebA-HQ and LSUN Church, while achieving superior classification accuracy and robustness against adversarial attacks on CIFAR-10. This work represents the first successful attempt to simultaneously excel in both tasks using a single set of network parameters. We believe that EGC bridges the gap between discriminative and generative learning.

View on arXivView PDF

Code Implementations(1)

GuoQiushan/EGCOfficial100%
MIT
463Python, ShellMar 30, 20233 years agoMIT

Similar Papers

Cite this paper

@article{guo2023egc,
  title  = {EGC: Image Generation and Classification via a Diffusion Energy-Based Model},
  author = {Qiushan Guo and Chuofan Ma and Yi Jiang and Zehuan Yuan and Yizhou Yu and Ping Luo},
  year   = {2023},
  eprint = {2304.02012},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2304.02012v3},
  journal = {ICCV 2023 2023}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2304.02012.svg)](https://codeofpaper.com/paper/2304.02012)

Discussion