Unconditional Image Generation

Enhance model card for Neon with key metadata, paper, code, and usage

#3
by nielsr HF Staff - opened
Files changed (1) hide show
  1. README.md +101 -3
README.md CHANGED
@@ -1,3 +1,101 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: unconditional-image-generation
4
+ ---
5
+
6
+ # Neon: Negative Extrapolation From Self-Training Improves Image Generation
7
+
8
+ This repository contains the models presented in the paper [Neon: Negative Extrapolation From Self-Training Improves Image Generation](https://huggingface.co/papers/2510.03597).
9
+
10
+ **Official GitHub Repository**: [https://github.com/SinaAlemohammad/Neon](https://github.com/SinaAlemohammad/Neon)
11
+
12
+ ## Introduction
13
+
14
+ Scaling generative AI models is bottlenecked by the scarcity of high-quality training data. The ease of synthesizing from a generative model suggests using (unverified) synthetic data to augment a limited corpus of real data for the purpose of fine-tuning in the hope of improving performance. Unfortunately, however, the resulting positive feedback loop leads to model autophagy disorder (MAD, aka model collapse) that results in a rapid degradation in sample quality and/or diversity.
15
+
16
+ **Neon** (for Negative Extrapolation frOm self-traiNing) is a new learning method that turns the degradation from self-training into a powerful signal for self-improvement. Given a base model, Neon first fine-tunes it on its own self-synthesized data but then, counterintuitively, reverses its gradient updates to extrapolate away from the degraded weights. This approach corrects a predictable anti-alignment between synthetic and real data population gradients, better aligning the model with the true data distribution.
17
+
18
+ Neon is remarkably easy to implement via a simple post-hoc merge, requires no new real data, works effectively with as few as 1k synthetic samples, and typically uses less than 1% additional training compute. It demonstrates universality across a range of architectures (diffusion, flow matching, autoregressive, and inductive moment matching models) and datasets (ImageNet, CIFAR-10, and FFHQ). Notably, on ImageNet 256x256, Neon elevates the xAR-L model to a new state-of-the-art FID of 1.02 with only 0.36% additional training compute.
19
+
20
+ ## Method
21
+
22
+ ![Algorithm 1: Neon — Negative Extrapolation from Self‑Training](https://github.com/SinaAlemohammad/Neon/raw/main/assets/algorithm.png)
23
+
24
+ **In one line:** sample with your usual inference to form a synthetic set $S$; briefly fine-tune the reference model on $S$ to get $\theta_s$; then **reverse** that update with a merge $\theta_{\text{neon}}=(1+w)\,\theta_r - w\,\theta_s$ (small $w>0$), which cancels mode-seeking drift and improves FID.
25
+
26
+ ## Benchmark Performance
27
+
28
+ Neon consistently improves performance across various model types and datasets.
29
+
30
+ | Model type | Dataset | Base model FID | Neon FID (paper) | Download model |
31
+ | ------------- | ---------------- | -------------: | ---------------: | ------------------------------------------------------------------------------------------------------- |
32
+ | xAR-L | ImageNet-256 | 1.28 | **1.02** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_xARL_imagenet256.pth) |
33
+ | xAR-B | ImageNet-256 | 1.72 | **1.31** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_xARB_imagenet256.pth) |
34
+ | VAR d16 | ImageNet-256 | 3.30 | **2.01** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_VARd16_imagenet256.pth) |
35
+ | VAR d36 | ImageNet-512 | 2.63 | **1.70** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_VARd36_imagenet512.pth) |
36
+ | EDM (cond.) | CIFAR-10 (32×32) | 1.78 | **1.38** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_conditional_CIFAR10.pkl) |
37
+ | EDM (uncond.) | CIFAR-10 (32×32) | 1.98 | **1.38** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_unconditional_CIFAR10.pkl) |
38
+ | EDM | FFHQ-64×64 | 2.39 | **1.12** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_EDM_FFHQ.pkl) |
39
+ | IMM | ImageNet-256 | 1.99 | **1.46** | [Download](https://huggingface.co/sinaalemohammad/Neon/resolve/main/Neon_imm_imagenet256.pkl) |
40
+
41
+ ## Sample Usage (Evaluation and Generation)
42
+
43
+ To get started with evaluating the Neon-enhanced models, follow the quickstart steps from the [official GitHub repository](https://github.com/SinaAlemohammad/Neon).
44
+
45
+ ### 1) Environment Setup
46
+
47
+ First, set up the required environment:
48
+
49
+ ```bash
50
+ # from repo root
51
+ conda env create -f environment.yml
52
+ conda activate neon
53
+ ```
54
+
55
+ ### 2) Download Pretrained Models & FID Stats
56
+
57
+ Download the pretrained Neon models and necessary FID statistics:
58
+
59
+ ```bash
60
+ bash download_models.sh
61
+ ```
62
+
63
+ This populates `checkpoints/` and `fid_stats/`.
64
+ **Pretrained Neon models can also be downloaded from Hugging Face:** [https://huggingface.co/sinaalemohammad/Neon](https://huggingface.co/sinaalemohammad/Neon)
65
+
66
+ ### 3) Download VAE for xAR Models
67
+
68
+ For xAR models, download the pre-trained VAE:
69
+
70
+ ```bash
71
+ hf download xwen99/mar-vae-kl16 --include kl16.ckpt --local-dir xAR/pretrained
72
+ ```
73
+
74
+ ### 4) Example: Evaluate xAR-L @ ImageNet-256
75
+
76
+ After setting up the environment and downloading models, you can run the evaluation script. This command will generate images and calculate FID:
77
+
78
+ ```bash
79
+ # All examples assume 8 GPUs; adjust `--nproc_per_node` / batch sizes as needed.
80
+ PYTHONPATH=xAR torchrun --standalone --nproc_per_node=8 xAR/calculate_fid.py \
81
+ --model xar_large \
82
+ --model_ckpt checkpoints/Neon_xARL_imagenet256.pth \
83
+ --cfg 2.3 --vae_path xAR/pretrained/kl16.ckpt \
84
+ --num_images 50000 --batch_size 64 --flow_steps 40 --img_size 256 \
85
+ --fid_stats fid_stats/adm_in256_stats.npz
86
+ ```
87
+
88
+ Similar commands for VAR, EDM, and IMM models can be found in the [GitHub Quickstart section](https://github.com/SinaAlemohammad/Neon#quickstart).
89
+
90
+ ## Citation
91
+
92
+ If you find Neon useful, please consider citing the paper:
93
+
94
+ ```bibtex
95
+ @article{neon2025,
96
+ title={Neon: Negative Extrapolation from Self-Training for Generative Models},
97
+ author={Alemohammad, Sina and collaborators},
98
+ journal={arXiv preprint},
99
+ year={2025}
100
+ }
101
+ ```