CS585: Image and Video Computing — Boston University
Team: Assylkhan Geniyat, Zukhriddin Fakhriddinov, Aidan Perez, Pablo Bello, Jaime Bernal
This project studies Video Moment Retrieval (VMR) — localizing temporal segments in untrimmed videos given natural language queries. We reproduce three DETR-style baselines on QVHighlights and conduct interpretability analyses to understand how these models work and fail.
| Model | R1@0.5 | R1@0.7 | mAP |
|---|---|---|---|
| Moment-DETR | 54.06 | 36.52 | 32.80 |
| QD-DETR | 62.06 | 45.48 | 40.56 |
| CG-DETR | 62.84 | 46.84 | 42.00 |
- Temporal Bias Analysis: Models achieve 7x above trivial baselines but systematically fail on short moments (<10s), over-predicting length by 7x.
- Verb vs. Noun Sensitivity: Object nouns are 2.6x more important than action verbs for moment grounding in QD-DETR.
- Head Ablation: No specialized boundary heads found — temporal grounding is a distributed emergent property across all 32 attention heads.
- Reproduce strong baselines (Moment-DETR, QD-DETR, CG-DETR) on QVHighlights
- Intellectual contribution: temporal interpretability, bias analysis, verb-vs-noun sensitivity
# 1. Go to the shared SCC project folder
cd /projectnb/cs585/projects/VMR/vmr_project
# 2. Run the setup script (creates conda env + installs everything)
bash scripts/setup_env.sh
# 3. Normalize the project layout so everyone uses the same data paths
bash scripts/normalize_project_layout.sh
# 4. Verify annotations and linked features
python scripts/verify_data.py
# 5. Optional preprocessing: pack clip features into one HDF5 file
python scripts/preprocess_to_hdf5.py \
--src-dir data/qvhighlights/features/clip \
--out-h5 data/qvhighlights/hdf5/clip_features.h5 \
--out-index data/qvhighlights/hdf5/clip_features_index.json
# 5b. Optional preprocessing: pack slowfast features too
python scripts/preprocess_to_hdf5.py \
--src-dir /projectnb/cs585/projects/VMR/vmr_project/lighthouse/features_tmp/qvhighlight/slowfast_features \
--out-h5 data/qvhighlights/hdf5/slowfast_features.h5 \
--out-index data/qvhighlights/hdf5/slowfast_features_index.json
# 6. Verify GPU access
qrsh -P cs585 -l gpus=1 -l h_rt=00:30:00
conda activate vmr
python scripts/verify_gpu.py
# 7. Train first baseline
qsub scripts/train_moment_detr.sh-
This project requires at least Python 3.10. If you don't have this run the command:
module load python3/3.10.12 -
The project name in the qrsh command is likely something like "cs585"
-
If you're version of Python is outdated and you update it, you'll also probably want to update pip. Run
python -m pip install --upgrade pipto do that -
If
conda activate vmrdoesn't work, you can runsource vmr/bin/activate -
If neither of the above two commands work, you'll want to run
python -m venv vmr, then one of the above two commands should work after that -
If when you run
python scripts/verify_gpu.pyit says any of the libraries are not found, you'll want run the following commands:
python -m pip install torch torchvision torchaudio \
--index-url https://download.pytorch.org/whl/cu126
python -m pip install \
transformers einops spacy scipy pandas matplotlib seaborn \
h5py tensorboard scikit-learn
python -m spacy download en_core_web_sm- If lighthouse says it is not found, you'll want to run the following commands:
cd /projectnb/cs585/projects/VMR/vmr_project/lighthouse
pip install -e .
cd ..- Read through the train_moment_detr.sh script to understand how the training is set up, and modify it as needed for your experiments. You can submit it with
qsubas shown above, or you can run the commands interactively in aqrshsession for faster iteration. There may be some places where it says to uncomment. Be sure to do that if you want to run those parts of the code.
vmr/
├── data/
│ ├── qvhighlights/
│ │ ├── annotations/ # train/val/test jsonl + subs_train.jsonl
│ │ ├── features/ # clip/, slowfast/, pann/
│ │ ├── txt_features/ # clip_text/
│ │ ├── sub_features/ # clip_sub/
│ │ └── hdf5/ # packed HDF5 features + index json
│ └── charades_sta/ # optional generalization dataset
├── src/
│ ├── models/ # model code (from Lighthouse / custom)
│ ├── analysis/ # interpretability, bias, linguistic scripts
│ ├── eval/ # evaluation scripts
│ └── utils/ # data loaders, plotting, helpers
├── configs/ # experiment configs (YAML)
├── checkpoints/ # saved model weights
├── logs/ # TensorBoard + job output logs
├── results/ # eval tables, predictions, figures
├── scripts/ # SCC batch job scripts
├── notebooks/ # Jupyter notebooks for exploration
└── README.md
All experiment results are logged to:
logs/— TensorBoard training curvesresults/experiment_log.csv— metrics summary table- Each checkpoint directory includes its config YAML
Use one shared layout under data/qvhighlights for both preprocessing and training:
bash scripts/normalize_project_layout.shcopies annotations and links feature folders from the local Lighthouse checkout.python scripts/verify_data.pyverifies that annotations and feature files are visible from the shared layout.python scripts/preprocess_to_hdf5.py ...converts per-video.npzfeatures into one HDF5 file plus an offset index.python scripts/demo_hdf5_loading.py ...loads one video's features from the packed HDF5 using itsvideo_id.DATA_LAYOUT.mdexplains the shared SCC data structure, feature types, and which HDF5 files teammates should use.
If a teammate wants to keep the existing training code but read packed HDF5 features instead of thousands of .npz files, they can use training_feature_loader.py.
Minimal replacement for _get_video_feat_by_vid in a dataset class:
from src.utils.training_feature_loader import load_video_features_for_training
def _get_video_feat_by_vid(self, vid):
return load_video_features_for_training(
video_id=vid,
sources=self.v_feat_dirs,
max_v_l=self.max_v_l,
normalize=self.normalize_v,
)Example HDF5 source paths:
self.v_feat_dirs = [
"data/qvhighlights/hdf5/clip_features.h5",
]or for concatenated features:
self.v_feat_dirs = [
"data/qvhighlights/hdf5/clip_features.h5",
"data/qvhighlights/hdf5/slowfast_features.h5",
]| Person | Primary Task | Secondary |
|---|---|---|
| Assylkhan | Infrastructure, SCC setup, Lighthouse | Coordination |
| Zukhriddin | Attention extraction, saliency viz, presentation | Erasure tests |
| Aidan | Linguistic ablation (spaCy + re-encoding) | Verb/noun analysis |
| Pablo | Data pipeline, feature verification | Bias analysis |
| Jaime | Evaluation scripts, result tables | Report |