File size: 1,624 Bytes
2dabf64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50

# 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 notebook
- `config.json` — model/training/search configuration
- `checkpoints/vit_seg_best.pt` — best model checkpoint (created after training)

## Configuration

See [`config.json`](config.json) for the exact data, model, training, and
evolutionary-search settings used to produce the results below.

## Results

### Training curves

![Training curves](training_curves.png)

Train/val loss, validation mIoU, validation pixel & mean-class accuracy, and
the learning-rate schedule.

### Inference samples

![Inference samples](inference_samples.png)

Image / ground truth / prediction, side by side, for a few validation images.

## How to reproduce

1. Install dependencies (see the first cell of the notebook).
2. Run all cells top to bottom.
3. Images (`training_curves.png`, `inference_samples.png`,
   `benchmark_comparison.png`, `evolution_fitness.png`) and `config.json`
   are 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.