ViT Semantic Segmentation on ADE20K
A Vision Transformer built from first principles (patch embedding, multi-head self-attention, MLP, transformer encoder blocks) adapted for semantic segmentation on the ADE20K dataset (150 classes), with training, evaluation, benchmarking against published ViT segmentation models, and an evolutionary hyperparameter search.
Contents
vit-ade20k-segmentation.ipynb— the full notebookconfig.json— model/training/search configurationcheckpoints/vit_seg_best.pt— best model checkpoint (created after training)
Configuration
See config.json for the exact data, model, training, and
evolutionary-search settings used to produce the results below.
Results
Training curves
Train/val loss, validation mIoU, validation pixel & mean-class accuracy, and the learning-rate schedule.
Inference samples
Image / ground truth / prediction, side by side, for a few validation images.
How to reproduce
- Install dependencies (see the first cell of the notebook).
- Run all cells top to bottom.
- Images (
training_curves.png,inference_samples.png,benchmark_comparison.png,evolution_fitness.png) andconfig.jsonare written to the working directory as you go.
Notes
- Published benchmark numbers are commonly-cited approximations from the original papers — verify exact figures before citing them elsewhere.
- Demo defaults (small
embed_dim/depth, few epochs) are set to run quickly; scale up for real training.

