This repository introduces StyleGANCA, the first lightweight, general-purpose GAN based on Neural Cellular Automata (NCA) for synthetic medical image generation. By combining StyleGAN-inspired latent modulation with multi-scale NCA synthesis, StyleGANCA achieves competitive image quality using only 617k parameters, outperforming larger baselines on PathMNIST while generating synthetic data that effectively supports downstream classifier training. The paper can be found at https://arxiv.org/abs/2608.28909.
git clone https://github.com/anhthi2000/Generative-Adversarial-NCA.git
cd Generative-Adversarial-NCAFor natten installation, make sure that torch and cuda version exactly match (https://whl.natten.org). Examplary installation:
conda create -n project python=3.10
conda activate project
pip3 install torch torchvision --index-url https://download.pytorch.org/whl/cu126
pip install natten==0.17.5+torch260cu126 -f https://whl.natten.org
pip install -r requirements.txtSpecify training parameters and save path in config.py, src/paths.py and run.sh.
Start training and evaluation:
bash run.shpython evaluate.py \
--g_type style \
--network path/to/model.pth \
--data bloodmnist \
--metrics fid2048_full kid2048_full \
--fake_data_dir /path/to/generated/imagespython classifier/classify_generated.py \
--image_folder /path/to/generated/images \
--model_path /path/to/pretrained/classifier.pth \
--data_flag pathmnist \
--model_flag resnet18 \
--output_file /path/to/predictions.txtpython classifier/train_classifier.py \
--data_flag bloodmnist \
--as_rgb \
--train_synthetic \
--synth_data_path /path/to/generated/images \
--synth_label_file /path/to/labels.txt \python classifier/evaluate_classifier.py \
--model_path /path/to/classifier.pth
--data_flag pathmnist
--model_flag resnet18
--as_rgb
--split test- DCGAN: specify configuration in
config.pyand runtrain_DCGAN.py - VAE: specify configurations in and run
baselines/vae/train.py - StyleGAN: specify configurations in
baselines/stylegan/configs/sample.yamland runbaselines/stylegan/train.py - VNCA: specify configurations in and run
baselines/vnca/medmnist_training.py - FouerierDiffNCA: specify configurations and run
baselines/fourierdiffnca_dit_unet/train2.py - UNet, DiT: specify configurations and run
baselines/fourierdiffnca_dit_unet/diff_unet_train.py
@misc{luu2026coarsefineiterativeadversarial,
title={Coarse to Fine: Iterative Adversarial Neural Cellular Automata for Medical Image Synthesis},
author={Anh Thi Luu and Nick Lemke and Anirban Mukhopadhyay},
year={2026},
eprint={2608.28909},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2608.28909},
}