BluViT

Vision Transformer encoder trained from scratch on Indian road imagery (IDD)

Maturity
Not assessed
Platform
GPU workstation
Source
No public repository
License
Not specified
01 · Problem

A camera-only driving stack needs one image encoder that serves cameras of different fields of view and resolutions. BluViT is trained from zero, and its README states that masked-autoencoder pretraining is what makes a from-scratch Vision Transformer work with about ten thousand labelled images. A study with a pre-registered gate tests that on IDD, against a supervised-only arm, a control arm and a from-scratch CNN reference. A second study compares a large-kernel convolutional encoder with ResNet-50, both from scratch, under a go/no-go rule written before the runs.

02 · Architecture

How it is put together.

BluViT is an image encoder for camera-based driving perception, trained from zero on Indian road imagery with no ImageNet weights. BluViT-S is a ViT-S/16 with 2D axial rotary position embeddings, register tokens, QK-norm, LayerScale and a camera-id embedding. It is pretrained as a masked autoencoder on unlabelled frames and fine-tuned for 26-class semantic segmentation on the public India Driving Dataset (IDD), evaluated with the IDD protocol and exported to ONNX. The same repository holds BluConv-T, a convolutional encoder with no attention, compared with ResNet-50 under the same protocol.

Databluvit/data/BluViT encoderbluvit/model/vit.pyMasked autoencoderbluvit/model/mae.pySegmentation headbluvit/model/seg.pyTrain and evaluatebluvit/train/IDD toolstools/masks + framesmasks + framesunlabelled framesunlabelled framespretrained weightspretrained weightspatch tokenspatch tokensfine-tune, evaluate, exportfine-tune, evaluate, ex…Databluvit/data/BluViT encoderbluvit/model/vit.pyMasked autoencoderbluvit/model/mae.pySegmentation headbluvit/model/seg.pyTrain and evaluatebluvit/train/IDD toolstools/masks + framesmasks + framesunlabelled framesunlabelled framespretrained weightspretrained weightspatch tokenspatch tokensfine-tune, evaluate, exportfine-tune, evaluate, ex…
FIG. 01Modules and data flows, from the repository layout and documentation.
  1. 1

    Data

    IDD segmentation pairs with joint augmentation, unlabelled frames from directories, videos or a jsonl manifest

    bluvit/data/
  2. 2

    BluViT encoder

    ViT-S/16 with 2D RoPE, registers, QK-norm, LayerScale and camera-id embedding

    bluvit/model/vit.py
  3. 3

    Masked autoencoder

    75 percent masking, small decoder, normalised-pixel loss; pretrains the encoder

    bluvit/model/mae.py
  4. 4

    Segmentation head

    Multi-tap all-MLP head with deep supervision

    bluvit/model/seg.py
  5. 5

    Train and evaluate

    MAE pretraining, IDD fine-tune, IDD-protocol evaluation, ONNX export

    bluvit/train/
  6. 6

    IDD tools

    Label masks matching the official tool, class weights, frame extraction, benchmark

    tools/
03 · Capabilities

Specification.

Encoder
ViT-S/16 with 2D axial rotary position embeddings (no absolute position table, so inference size can differ from training size), four register tokens, QK-norm, LayerScale, stochastic depth and a six-slot camera-id embedding
Conv encoder
BluConv-T: four BatchNorm stages with 13x13 depthwise kernels trained through dilated reparameterisation branches and merged for export, squeeze-excite, GRN and a camera gate, with an FPN segmentation head; ResNet-50 runs through the same head and training script
Pretraining
Masked autoencoder with 75 percent masking, a small 192-wide, four-block decoder that is discarded afterwards, and a normalised-pixel loss; reads frame directories, videos or a jsonl frame manifest
Segmentation
Multi-tap all-MLP head with deep supervision; fine-tuning with layer-wise lr decay, EMA weights and class-weighted cross-entropy on IDD level 3 (26 classes)
Evaluation
IDD-protocol mean IoU at 1280x720 with per-class IoU; person, rider, motorcycle and autorickshaw are reported separately in every run
IDD tools
Level-3 label masks identical, pixel for pixel, to the official AutoNUE createLabels.py on every Part I and II mask; class weights; video frame extraction
Export
ONNX with input normalisation folded in, and the TensorRT trtexec commands to build an engine
Runs on
Trained and evaluated on one workstation GPU (NVIDIA GeForce RTX 5080); the README also gives setup for a Jetson AGX Orin 64 GB, where it has not been measured. No public repository: a local directory only
Stack
  • Python
  • PyTorch
  • NumPy
  • OpenCV
  • Pillow
  • PyYAML
  • ONNX
  • ONNX Runtime
  • TensorRT (trtexec)
04 · Notes

Notes.

Measured on the India Driving Dataset

The author trained and evaluated five arms on the public India Driving Dataset (IDD), each for 40 epochs on the same 14,027 training images and scored on the official val split at the final epoch. Pretrained for 400 epochs as a masked autoencoder on unlabelled IDD frames, BluViT-S reached a mean IoU of 64.48 %. The same encoder trained from random initialisation reached 37.31 %, and the study’s pre-registered gate passed. That supervised arm was handicapped by the recipe’s layer-wise learning-rate decay, so a control arm without it was run: it reached 48.12 %, and pretraining still adds 16.36 points. A DeepLabV3 ResNet-50 trained from scratch with the same data and evaluation reached 60.17 %. A later ResNet-50 with an FPN head and the AdamW optimiser, also from scratch, reached 63.57 %, within one point of the pretrained ViT (below).

QuantityValueConditionsBasis
Mean IoU on IDD val, BluViT-S, MAE init (epoch 400)64.48 %encoder from the MAE checkpoint at epoch 400 (unlabelled IDD frames only); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
Mean IoU on IDD val, BluViT-S, MAE init (epoch 150)62.85 %encoder from the MAE checkpoint at epoch 150 of 400 (unlabelled IDD frames only); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
Mean IoU on IDD val, DeepLabV3 ResNet-50, from scratch (reference)60.17 %reference CNN: torchvision DeepLabV3 ResNet-50, no pretrained weights, SGD with a poly schedule; IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
Mean IoU on IDD val, BluViT-S, supervised only, layer decay 1.0 (control)48.12 %control arm: random initialisation, layer-wise lr decay off (1.0); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-16
Mean IoU on IDD val, BluViT-S, supervised only (random init)37.31 %random initialisation, layer-wise lr decay 0.75 (the MAE arms' recipe); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
Gain in mean IoU from MAE initialisation (epoch 400) over supervised-only27.17 pointsgate pair: MAE init (epoch 400) minus supervised-only, both with layer-wise lr decay 0.75; verdict PASS (must win on mean IoU and on person, rider, motorcycle and autorickshaw); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
Gain in mean IoU from MAE initialisation (epoch 400) over the supervised control (layer decay 1.0)16.36 pointsMAE init (epoch 400) minus the control (supervised-only, layer-wise lr decay off); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-16
Mean IoU on the IDD val split (level 3, 26 classes), final epoch of 40, one seed per arm, at commits 1156461, 4261989 and 59b8054. “Reproduced” rows were run by the author; “Reported” rows are quoted from the repository at the commit shown.

The four road-user classes

Every run reports person, rider, motorcycle and autorickshaw separately. The pretrained encoder is ahead of both supervised ViT arms and of the DeepLabV3 reference on each of the four. The later ResNet-50 with an FPN head and AdamW is ahead of it on person, rider and motorcycle.

QuantityValueConditionsBasis
IoU, person, BluViT-S, MAE init (epoch 400)64.15 %encoder from the MAE checkpoint at epoch 400 (unlabelled IDD frames only); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
IoU, rider, BluViT-S, MAE init (epoch 400)68.92 %encoder from the MAE checkpoint at epoch 400 (unlabelled IDD frames only); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
IoU, motorcycle, BluViT-S, MAE init (epoch 400)73.4 %encoder from the MAE checkpoint at epoch 400 (unlabelled IDD frames only); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
IoU, autorickshaw, BluViT-S, MAE init (epoch 400)84.92 %encoder from the MAE checkpoint at epoch 400 (unlabelled IDD frames only); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-15
IoU, person, DeepLabV3 ResNet-50, from scratch (reference)62.87 %reference CNN: torchvision DeepLabV3 ResNet-50, no pretrained weights, SGD with a poly schedule; IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, rider, DeepLabV3 ResNet-50, from scratch (reference)66.57 %reference CNN: torchvision DeepLabV3 ResNet-50, no pretrained weights, SGD with a poly schedule; IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, motorcycle, DeepLabV3 ResNet-50, from scratch (reference)71.27 %reference CNN: torchvision DeepLabV3 ResNet-50, no pretrained weights, SGD with a poly schedule; IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, autorickshaw, DeepLabV3 ResNet-50, from scratch (reference)82.39 %reference CNN: torchvision DeepLabV3 ResNet-50, no pretrained weights, SGD with a poly schedule; IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, person, BluViT-S, supervised only, layer decay 1.0 (control)43.6 %control arm: random initialisation, layer-wise lr decay off (1.0); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-16
IoU, rider, BluViT-S, supervised only, layer decay 1.0 (control)49.8 %control arm: random initialisation, layer-wise lr decay off (1.0); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-16
IoU, motorcycle, BluViT-S, supervised only, layer decay 1.0 (control)56.65 %control arm: random initialisation, layer-wise lr decay off (1.0); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-16
IoU, autorickshaw, BluViT-S, supervised only, layer decay 1.0 (control)70.18 %control arm: random initialisation, layer-wise lr decay off (1.0); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-16
IoU, person, BluViT-S, supervised only (random init)27.25 %random initialisation, layer-wise lr decay 0.75 (the MAE arms' recipe); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, rider, BluViT-S, supervised only (random init)35.77 %random initialisation, layer-wise lr decay 0.75 (the MAE arms' recipe); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, motorcycle, BluViT-S, supervised only (random init)43.65 %random initialisation, layer-wise lr decay 0.75 (the MAE arms' recipe); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
IoU, autorickshaw, BluViT-S, supervised only (random init)51.43 %random initialisation, layer-wise lr decay 0.75 (the MAE arms' recipe); IDD level 3 (26 classes), official val split (2,036 images), final epoch of 40, EMA weights, scored at 1280x720 (IDD protocol); trained on 14,027 IDD train images, 512x896 crops, batch 8, bf16; one seedReproduced 2026-11-10
Per-class IoU on the IDD val split, final epoch, one seed per arm. “Reproduced” rows were run by the author; “Reported” rows are quoted from the repository at the commit shown.

A convolutional encoder: BluConv-T

The repository also holds BluConv-T, a convolutional encoder with no attention: four BatchNorm stages with 13x13 depthwise kernels, squeeze-excite and GRN. It was compared with ResNet-50, both from scratch with the same FPN segmentation head, under two optimiser recipes fixed before the runs. With AdamW it led by 2.32 points; with SGD it trailed, at a difference of −2.29 points. In TensorRT half precision it took 5.818 ms against ResNet-50’s 2.078 ms on the workstation GPU. A rule written before the runs said that unless BluConv-T clearly beat ResNet-50, the recommendation would be the ResNet-50 route, and that is the study’s verdict. The full comparison, with INT8 results, is technical report IF-TR-2026-07.

QuantityValueConditionsBasis
Mean IoU on IDD val, BluConv-T + FPN head, AdamW, from scratch65.89 %AdamW lr 1e-3, poly; from scratch; IDD val (2,036 images, 26 classes, IDD protocol); final epoch of 40, EMA; one seedReproduced 2026-11-16
Mean IoU on IDD val, ResNet-50 + FPN head, AdamW, from scratch63.57 %AdamW lr 1e-3, poly; from scratch; IDD val (2,036 images, 26 classes, IDD protocol); final epoch of 40, EMA; one seedReproduced 2026-11-17
Mean IoU on IDD val, ResNet-50 + FPN head, SGD, from scratch57.97 %SGD lr 0.01, poly; from scratch; IDD val (2,036 images, 26 classes, IDD protocol); final epoch of 40, EMA; one seedReproduced 2026-11-16
Mean IoU on IDD val, BluConv-T + FPN head, SGD, from scratch55.68 %SGD lr 0.01, poly; from scratch; IDD val (2,036 images, 26 classes, IDD protocol); final epoch of 40, EMA; one seedReproduced 2026-11-16
Mean IoU difference, BluConv-T minus ResNet-50 (both + FPN head), AdamW2.32 pointsboth arms: AdamW lr 1e-3, poly; from scratch; IDD val (2,036 images, 26 classes, IDD protocol); final epoch of 40, EMA; one seedReproduced 2026-11-17
Mean IoU difference, BluConv-T minus ResNet-50 (both + FPN head), SGD−2.29 pointsboth arms: SGD lr 0.01, poly; from scratch; IDD val (2,036 images, 26 classes, IDD protocol); final epoch of 40, EMA; one seedReproduced 2026-11-16
Median latency, BluConv-T + FPN head, TensorRT half precision5.818 msbatch 1, 3x720x1280, median of 300 runs; AdamW weights; workstation GPU, not a deviceReproduced 2026-11-17
Median latency, ResNet-50 + FPN head, TensorRT half precision2.078 msbatch 1, 3x720x1280, median of 300 runs; AdamW weights; workstation GPU, not a deviceReproduced 2026-11-17
From-scratch mean IoU on the IDD val split, final epoch of 40, one seed per arm, at commit df0d01a, and TensorRT half-precision latency at batch 1, 3x720x1280, on one NVIDIA GeForce RTX 5080. “Reproduced” rows were run by the author; “Reported” rows are quoted from the repository at the commit shown.

Pretraining and cost

QuantityValueConditionsBasis
MAE masked-patch loss, epoch 1 of 4000.9053masked autoencoder, 75 percent masking, normalised-pixel loss; 512x896, batch 32, bf16; 42,320 unlabelled IDD frames with nothing from val or test (asserted in code)Reproduced 2026-11-15
MAE masked-patch loss, epoch 50 of 4000.3127masked autoencoder, 75 percent masking, normalised-pixel loss; 512x896, batch 32, bf16; 42,320 unlabelled IDD frames with nothing from val or test (asserted in code)Reproduced 2026-11-15
MAE masked-patch loss, epoch 150 of 4000.2988masked autoencoder, 75 percent masking, normalised-pixel loss; 512x896, batch 32, bf16; 42,320 unlabelled IDD frames with nothing from val or test (asserted in code)Reproduced 2026-11-15
MAE masked-patch loss, epoch 400 of 4000.2888masked autoencoder, 75 percent masking, normalised-pixel loss; 512x896, batch 32, bf16; 42,320 unlabelled IDD frames with nothing from val or test (asserted in code)Reproduced 2026-11-15
MAE pretraining wall clock, 400 epochs29.7 hmasked autoencoder, 75 percent masking, normalised-pixel loss; 512x896, batch 32, bf16; 42,320 unlabelled IDD frames with nothing from val or test (asserted in code); summed over the run's resumed segments; loader reads a 1280-wide resized cache of the corpusReproduced 2026-11-15
MAE pretraining throughput, median179.6 img/smasked autoencoder, 75 percent masking, normalised-pixel loss; 512x896, batch 32, bf16; 42,320 unlabelled IDD frames with nothing from val or test (asserted in code); end to end including data loadingReproduced 2026-11-15
Fine-tune wall clock, 40 epochs, BluViT-S, MAE init (epoch 400)4.45 h40 epochs including a val pass each epoch; one seedReproduced 2026-11-15
Fine-tune wall clock, 40 epochs, DeepLabV3 ResNet-50, from scratch5.62 h40 epochs including a val pass each epoch; one seed; the CNN shared the CPU with a cache build, so its time is slightly pessimistic (study report)Reproduced 2026-11-10
Segmentation inference throughput on the val set46.8 img/sBluViT-S with the segmentation head, batch 1, full image at width 1280, including argmax and the resize to 1280x720; timed over 300 of the 2,036 val images; includes data loadingReproduced 2026-11-09
BluViT-S encoder parameters21.61 MViT-S/16: width 384, depth 12, 6 heads, 4 register tokens; the segmentation model with its head has 25.26 MReproduced 2026-11-15
Differing pixels, BluViT's label masks vs the official IDD tool0 pxall 16,063 Part I + II train and val masks; BluViT's tools/idd_prepare.py masks against masks written by the official AutoNUE createLabels.py (level3Id), after two fixes (fallback background id, polygon rasteriser)Reproduced 2026-11-09
Masked-autoencoder pretraining on 42,320 unlabelled IDD frames, fine-tune and inference cost on one workstation GPU, model size, and label-mask parity with the official IDD tool. “Reproduced” rows were run by the author; “Reported” rows are quoted from the repository at the commit shown.

Not yet measured

Each arm ran with one seed. Nothing here is measured on the lab’s own footage, on a vehicle or on the Jetson AGX Orin the README targets, and the IDD test split was not used. None of the convolutional networks has had masked pretraining, so the comparison with the pretrained ViT does not rank the architectures. The studies are technical reports IF-TR-2026-06 and IF-TR-2026-07.