Views
No views yet
| Component | Source paper | Why it's here |
|---|---|---|
| Swin Transformer Tiny visual encoder | Liu et al. 2021 | Best feature extractor on Isharah-500 / -1000 (per Table 4 of the Isharah paper) |
| Multi-Scale Temporal Perception (MSTP) | Alyami & Luqman, Neurocomputing 2025 | Captures short, medium, and long temporal patterns simultaneously |
| BiLSTM sequence model | standard CSLR | Long-range context for CTC alignment |
| Visual Alignment Constraint (VAC) | Min et al. 2021 | Auxiliary CTC head supervises the visual branch directly |
| Self-Mutual Knowledge Distillation (SMKD) | Hao et al. 2021 | Best generalisation on unseen sentences/signers in the paper |
saudi_cslr/
├── configs/
│ └── default.yaml # all hyperparameters
├── data_module/
│ ├── vocabulary.py # gloss <-> id mapping (idx 0 = <blank>)
│ ├── transforms.py # frame-level + clip-level augmentations
│ └── dataset.py # frame-folder Dataset + collate_fn
├── models/
│ ├── visual_encoder.py # Swin-T / ResNet backbones
│ ├── temporal_module.py # MSTP stack
│ ├── sequence_model.py # packed BiLSTM
│ └── cslr_model.py # the full model with two heads
├── losses/
│ └── cslr_loss.py # CTC + VAC + SMKD
├── utils/
│ ├── decoder.py # greedy + beam-search CTC decoders
│ ├── metrics.py # WER (Levenshtein-based)
│ └── train_utils.py # AverageMeter, warmup scheduler, checkpointing
├── train.py # main training entry point
├── eval.py # standalone evaluation script
├── requirements.txt
└── README.mdvideos/
├── 00_0001/
│ ├── frame_001.jpg
│ ├── frame_002.jpg
│ └── ...
├── 00_0002/
└── ...
annotations/
├── train.txt
├── dev.txt
└── test.txtid|gloss|text
00_0001|سوال هو|من هو
00_0002|هو معلم لغه اشاره|هو مدرس لغه اشاره
00_0003|استفهام هو معلم هو|هل انت مدرس
00_0004|هو معلم لا انا مدرسه|انت لست مدرس انا طالبid — must match the frame folder name under videos/.gloss — space-separated SSL gloss tokens. This is the training target for CSLR.text — Arabic spoken-language translation. Carried through the pipeline but
not used by the CSLR loss (it's reserved for the SLT extension).1# 1. Create a fresh venv (recommended)
2python -m venv .venv
3source .venv/bin/activate
4
5# 2. Install deps
6pip install -r requirements.txt
7
8# 3. Edit configs/default.yaml — at minimum set:
9# data.videos_root, data.train_file, data.dev_file, data.test_filemodel.backbone to resnet18 and reduce data.image_size
to 192.python train.py --config configs/default.yamltrain.txt (saved to work_dir/vocab.json).train.epochs epochs with:
batch_size * grad_accum_steps)lr * backbone_lr_mult) and the headwork_dir/checkpoints/best.pth — best dev-WER checkpointwork_dir/checkpoints/epoch_NNN.pth — last few epoch checkpointswork_dir/train.log — full training log1python train.py --config configs/default.yaml \
2 --resume work_dir/checkpoints/epoch_020.pth1python eval.py --config configs/default.yaml \
2 --checkpoint work_dir/checkpoints/best.pth \
3 --split test \
4 --output work_dir/test_predictions.txt ┌──── visual_classifier ──→ vis_logits ──┐
│ │ CTC(vis) ← VAC
frames → backbone → MSTP ─────────┤ ├── SMKD(KL bidirectional)
│ │
└──── BiLSTM ── seq_classifier ─→ seq_logits ──→ CTC(seq) ← mainL_total = ctc_weight · CTC(seq_logits, labels) # main supervision
+ vac_weight · CTC(vis_logits, labels) # auxiliary supervision (VAC)
+ smkd_weight · T² · 0.5 · [ KL(seq‖vis) + KL(vis‖seq) ] # mutual KD (SMKD)smkd_weight=25, T=8) follow the SMKD paper's recommendations.
You can disable any component by setting its weight to 0.model.backbone — swin_tiny is best; switch to resnet18 only for tight VRAM.loss.smkd_weight — 25 is the sweet spot per the paper; try 15-50 if you have
compute to grid-search.train.augmentations.color_jitter_strength — 0.4 works well for the
"in-the-wild" smartphone footage that Isharah uses; lower it for cleaner studio data.data.max_frames — the paper has clips up to ~700 frames. The default 300
uniformly subsamples longer clips. Increase if you have VRAM headroom.optim.backbone_lr_mult — keep at 0.1 when starting from ImageNet weights;
raise to 0.5 once fine-tuned for a few epochs.work_dir/vocab.json. Delete that file if you change train.txt or the
vocabulary will be stale.pyctcdecode) — the architecture is unchanged.