Where, How, and When: Query-Guided Grounding for Video Understanding
Organizations: Indian Institute of Technology Jodhpur Department of Computer Science and Engineering
Abstract
Understanding video content requires reasoning at multiple levels of granularity, from identifying objects to interpreting their interactions and localizing when specific actions occur. This thesis studies three query-guided grounding tasks that answer where key objects are (object-level grounding), how they interact (relationship-level grounding), and when specific moments occur (moment-level grounding). For object-level grounding, we present QDETRv, a query-guided extension of the Detection Transformer for one-shot localization of unseen objects in videos, which combines query-context fusion, a memory module for temporal consistency, and unsupervised pretraining on synthetic object trajectories. We further propose the Temporal Object-Aware Vision Transformer (TOViT) for few-shot video object detection, which builds on a language-aligned open-set vision encoder and propagates high-confidence object features across frames. For relationship-level grounding, we introduce few-shot referring relationships in videos: given a (subject, predicate, object) query and a few support videos sharing the predicate, the entities are localized by optimizing a T-partite random field using a meta-learned relation network with query-conditioned translational embeddings, Global Semantic Aggregation, Local Localization Aggregation, and belief-propagation-based message passing. For moment-level grounding, we propose the Moment Alignment Transformer (MATR) for video-to-video moment retrieval, which uses dual-stage Dynamic Time Warping for pre- and post-fusion alignment, learnable queries for boundary prediction, and self-supervised pretraining with temporal augmentations; MATR also extends to text-to-video moment retrieval with performance comparable to, or better than, the state of the art. These contributions advance query-guided video understanding across spatial, relational, and temporal grounding.
Figures & tables
| Model | Modality / Task | Key Contributions and Innovations |
|---|---|---|
| Transformer [ 28 ] | Text (Seq2Seq) | Introduced self-attention and encoder-decoder architecture for sequence modeling. |
| BERT [ 35 ] , GPT [ 36 ] | Text (Pretraining) | Masked LM (BERT) and autoregressive LM (GPT); fine-tuning for downstream tasks. |
| ViT [ 29 ] | Image (Classification) | Treats image as patch sequence; shows Transformers rival CNNs with large-scale pretraining. |
| DeiT [ 40 ] | Image (Classification) | Data-efficient ViT training via distillation and augmentation. |
| Swin Transformer [ 41 ] | Image (Dense Tasks) | Hierarchical features; shifted window attention for scalable vision tasks. |
| DETR [ 10 ] | Image (Detection) | Set prediction via object queries; removes anchors and NMS. |
| Approach | Core Principle | Representative Methods | Strengths / Limitations |
|---|---|---|---|
| Metric-based | Learn a shared embedding space where classification is performed via similarity to class prototypes or exemplars. Often trained episodically. | Prototypical Nets [ 80 ] , Matching Nets [ 76 ] , Siamese Nets [ 77 ] , RelationNet [ 78 ] | + Simple, fast inference; non-parametric adaptation. – Sensitive to embedding quality; vulnerable to domain shift. |
| Optimization-based | Meta-learn an initialization or update rule that enables rapid adaptation to new tasks with few gradient steps. | MAML [ 81 ] , Reptile [ 82 ] , Meta-SGD [ 83 ] , ANIL [ 84 ] , ProtoMAML [ 85 ] | + Strong task-level generalization. – Computationally heavy; unstable in high dimensions. |
| Data Augmentation / Generative | Enrich support data via synthetic samples or feature-level perturbations using generative models or semantic mixing. | FeatGen [ 86 ] , GAN-based [ 87 ] , VAE-based [ 88 ] , Diffusion-based [ 89 ] , CLIP-based [ 90 ] | + Mitigates scarcity; improves diversity. – Risk of unrealistic or biased samples. |
| Self-Supervised / Contrastive | Learn transferable representations via contrastive or self-supervised pretraining, then adapt to few-shot tasks. | MoCo [ 91 ] , SimCLR [ 92 ] , BYOL [ 93 ] , DINO [ 94 ] , SwAV [ 95 ] | + Strong embeddings; reduces label reliance. – Pretraining requires massive unlabeled data. |
| Transformer-based / Prompting | Use attention-based architectures or prompts to model task structure and leverage foundation models. | Few-shot Transformers [ 96 ] , Prompt-tuning [ 97 ] , GPT-4V-assisted FSL [ 98 ] , Flamingo [ 43 ] | + Scales with LLMs; interpretable task conditioning. – Prompt sensitivity; high compute demand. |
| Split | Vid-OR | VidVRD | ||
|---|---|---|---|---|
| Seen | Unseen | Seen | Unseen | |
| #Train Videos | 4,795 | 6,164 | 574 | 758 |
| #Train Object Queries | 53,277 | 57,599 | 3,413 | 4,395 |
| #Train Object Categories | 75 | 75 | 30 | 30 |
| #Test Videos | 1,319 | 32 | 184 | 42 |
| #Test Object Queries | 29,108 | 407 | 1,088 | 112 |
| Method | Pretraining | Vid-OR [ 113 ] | VidVRD [ 114 ] | ||
|---|---|---|---|---|---|
| Seen | Unseen | Seen | Unseen | ||
| CoAE [ 11 ] | - | 35.3 | 32.8 | 29.2 | 27.1 |
| Retrieval-Based [ 12 ] | - | 3.11 | 2.47 | 2.08 | 1.48 |
| OWL-ViT [ 6 ] | - | - | 28.6 | - | 22.5 |
| UP-DETR [ 126 ] | ✗ | 37.4 | 35.4 | 33.7 | 28.5 |
| UP-DETR [ 126 ] | ✓ | 41.7 | 38.1 | 39.4 | 37.1 |
| Recurrent Query | VidVRD | VidOR |
|---|---|---|
| ✗ | 37.9 | 40.3 |
| ✓ | 38.5 | 41.6 |
| Method | Bear | Carrot | Coconut | Frisbee | Kangaroo | Lemon | Leopard | Melon | Orange | Stop sign |
|---|---|---|---|---|---|---|---|---|---|---|
| CoAE | 37.8 | 19.2 | 33.6 | 25.4 | 42.6 | 21.3 | 46.9 | 22.8 | 28.1 | 30.6 |
| OWL-ViT | 35.7 | 20.3 | 28.5 | 21.7 | 38.6 | 22.8 | 42.8 | 20.3 | 25.3 | 27.4 |
| UP-DETR | 47.5 | 32.6 | 36.1 | 32.8 | 50.1 | 30.2 | 50.7 | 31.4 | 30.2 | 35.3 |
| QDETRv | 47.9 | 35.3 | 38.6 | 33.4 | 51.4 | 30.9 | 52.3 | 33.2 | 30.8 | 35.8 |
| Split | Vid-OR | VidVRD | FSVOD | FSYTV |
|---|---|---|---|---|
| #Train Videos | 6,164 | 758 | 2553 | 1627 |
| #Train Object Queries | 57,599 | 4,395 | - | - |
| #Train Object Categories | 75 | 30 | 320 | 30 |
| #Test Videos | 32 | 42 | 949 | 608 |
| #Test Object Queries | 407 | 112 | - | - |
| #Test Object Categories | 9 | 5 | 100 | 10 |
| Method | FSVOD-500 | FSYTV-40 | VidOR | VidVRD | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Non-temporal | FR-CNN | 18.2 | 26.4 | 19.6 | 9.3 | 15.4 | 9.6 | 21.6 | 29.1 | 23.2 | 14.3 | 18.6 | 14.2 |
| FSOD | 21.1 | 31.3 | 22.6 | 12.5 | 20.9 | 13.0 | - | - | - | - | - | - | |
| RDN | 18.2 | 27.9 | 19.7 | 8.1 | 13.4 | 8.6 | - | - | - | - | - | - | |
| CoAE | 18.4 | 29.3 | 18.9 | 9.8 | 18.4 | 10.1 | 35.8 | 43.7 | 36.1 | 30.2 | 38.1 | 31.8 | |
| Retrieval-Based | 1.3 | 2.4 | 1.6 | 0.6 | 1.1 | 0.8 | 1.4 | 2.6 | 1.3 | 1.8 | 2.5 | 2.0 | |
| Method | FSVOD-500 | FSYTV-40 | VidOR | VidVRD | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1-Shot | CoAE | 17.2 | 27.8 | 17.2 | 6.7 | 17.3 | 9.8 | 33.2 | 42.5 | 35.2 | 29.6 | 37.6 | 31.5 |
| UP-DETR | 17.3 | 24.3 | 18.4 | 9.7 | 16.9 | 9.9 | 35.6 | 45.2 | 37.2 | 8.5 | 15.2 | 9.3 | |
| DeepSort+YOLOv8 + CLIP | 12.2 | 20.1 | 12.8 | 4.1 | 7.9 | 4.7 | 21.4 | 28.4 | 22.7 | 21.9 | 31.7 | 22.8 | |
| FSVOD | 20.7 | 29.4 | 21.4 | 11.4 | 18.6 | 12.1 | 36.8 | 45.3 | 36.3 | 34.5 | 45.2 | 35.2 | |
| QDETRv | 25.2 | 34.9 | 25.8 | 13.6 | 24.1 | 14.2 | 41.8 | 50.3 | 42.2 | 40.3 | 49.7 | 40.1 | |
| FSVOD-500 | FSYTV-40 | |||||
|---|---|---|---|---|---|---|
| Temopral Fusion | ||||||
| ✗ | 25.4 | 37.1 | 26.9 | 19.2 | 26.8 | 21.4 |
| ✓ | 30.6 | 42.9 | 32.1 | 21.2 | 29.8 | 23.5 |
| Method | FPS | Memory (GB) | AP (FSVOD-500) |
|---|---|---|---|
| Ours | 14 | 8.1 | 30.6 |
| QDETRv | 11 | 7.6 | 26.1 |
| Video OWL-ViT | 10 | 8.4 | 25.8 |
| FSVOD | 16 | 5.8 | 25.1 |
| UP-DETR | 13 | 7.4 | 20.1 |
| CenterTrack | 12 | 6.2 | 20.6 |
| VidVRD | VidOR | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Approach | Support Set Size | |||||||||||
| tracklet-based | 2 | 12.3 | 12.1 | 12.2 | 11.7 | 8.8 | 10.9 | 10.7 | 10.1 | 10.3 | 7.3 | |
| tracklet-based | 4 | 12.6 | 12.9 | 12.8 | 12.0 | 9.6 | 11.1 | 11.0 | 10.9 | 10.4 | 8.2 | |
| tracklet-based | 8 | 13.4 | 13.2 | 13.7 | 13.3 | 10.4 | 12.8 | 12.6 | 13.2 | 13.0 | 9.7 | |
| w/o vis.sim. potential, w/o GSA, w/o LLA | 2 | 19.2 | 18.2 | 17.8 | 19.9 | 15.9 | 19.3 | 18.1 | 18.4 | 19.8 | 16.7 | |
| w/o vis.sim. potential, w/o GSA, w/o LLA | 4 | 19.6 | 19.1 | 18.2 | 20.8 | 16.3 | 19.8 | 18.7 | 18.5 | 20.4 | 17.3 | |
| ImageNet-VidVRD | VidOR | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Method | ||||||||||||||
| VRC [ 169 ] | 8.4 | 10.7 | 11.9 | 8.6 | 10.3 | 11.2 | 5.8 | 7.2 | 9.9 | 10.3 | 8.0 | 10.1 | 11.1 | 5.6 |
| vRGV-fs [ 4 ] | 8.2 | 11.1 | 12.4 | 8.3 | 11.6 | 12.9 | 6.1 | 7.5 | 10.3 | 10.9 | 7.3 | 10.7 | 11.4 | 6.3 |
| Tracklet-based | 12.6 | 15.1 | 15.9 | 12.8 | 14.8 | 15.3 | 9.6 | 11.1 | 13.7 | 14.2 | 10.9 | 12.6 | 13.8 | 8.2 |
| Ours | ||||||||||||||
| w/o vis.sim. potential, w/o GSA, w/o LLA | 19.6 | 21.4 | 19.1 | 18.2 | 18.7 | 20.8 | 16.3 | 19.8 | 20.7 | 18.7 | 18.5 | 19.2 | 20.4 | 17.3 |
| GSA | LLA | ||||
|---|---|---|---|---|---|
| ✗ | ✗ | 21.3 | 22.1 | 20.8 | |
| ✓ | ✗ | 24.7 | 23.5 | 22.8 | |
| ✗ | ✓ | 22.3 | 21.7 | 21.1 | |
| ✓ | ✓ | 26.8 | 26.0 | 25.1 |
| Relationship Embedding | ||||
|---|---|---|---|---|
| Concatenation | 18.3 | 20.1 | 18.7 | |
| Translation Embedding | 26.8 | 26.0 | 25.1 |
| subject | object | ||||
|---|---|---|---|---|---|
| ✓ | ✓ | 28.3 | 27.6 | 27.3 | |
| ✓ | ✗ | 23.7 | 21.4 | 18.6 | |
| ✗ | ✓ | 19.4 | 20.5 | 17.2 |
| Dataset | Split | # Pairs | # Classes |
| SportsMoments | Train | 750,393 | 16 |
| Val | 10,000 | 4 | |
| Test | 10,000 | 9 | |
| ActivityNet-VRL [ 173 ] | Train | 462,872 | 160 |
| Val | 829 | 20 | |
| Test | 978 | 20 |
| Dataset | Type | Mean | Median | Max. | Min. |
|---|---|---|---|---|---|
| SportsMoment | Target Video | 98.3 | 98.2 | 208.8 | 35.4 |
| Query Video | 6.0 | 5.0 | 66.0 | 1.0 | |
| ActivityNet-VRL | Target Video | 38.2 | 29.3 | 191.5 | 1.3 |
| Query Video | 8.2 | 7.2 | 57.2 | 0.5 |
| 4a5Oou5u3io | GrIOmtbyHNc | 5j2tQfj2Osk | mo3H_qusvxI | RpmSeHG8SJ0 | cpU0GSxliSU |
| EOvpUWZC6ng | Txq8RoclyKM | -vYVBUyEuAA | IvjBlpb8GTA | ukuNlWxcR2k | LmqBbPwCy8o |
| zuPuDzEWI-A | OFbyNU6UQQs | iPXz5XWfj1k | IA5BNsNu6fw | 9sRb61qsoLs | X0we8220k74 |
| MbdWVX2jUhA | 04vWaGaqw-4 | 92s9HCGG4vQ | BMXfphiHj1s | 1yHWGw8DH4A | shyBGceNASI |
| YqKYpgZ9FWU | GxO1tlZKa8E | qElsVosGiXA | zUTUA0TKvfQ | G4vxbWF79f4 | v9Akttif8gY |
| Mtnmvuhs2RA | 3K90O0Y9NZc | 9gyv2xh7qQw | 1-SCubr2yc4 | ezQUPi74IIQ | cTqY53zWypk |
| qQfuOCns4P4 | iGGElV40TcU | X6VNTk-Vl5w | iFYm_ogzmdA | 6j1Oj5N7kwE | WkEvdVImkec |
| ActivityNet-VRL [ 214 ] | SportsMoments | ||||||
| Methods | Variants | Query Modality | mIoU | R@1 | mIoU | R@1 | |
| Fully-supervised | Random | - | Video | 7.3 | 16.2 | - | - |
| Video Match | - | Video | 12.4 | 24.3 | - | - | |
| SST | - | Video | 17.1 | 33.2 | - | - | |
| CGBM | - | Video | 25.7 | 43.5 | - | - | |
| GDP | - | Video | 27.8 | 44.0 | - | - | |
| Recall | mAP | ||||
|---|---|---|---|---|---|
| Method | [email protected] | [email protected] | [email protected] | [email protected] | Avg. |
| Moment-DETR | 53.9 | 34.8 | - | - | 32.2 |
| QD-DETR | 62.7 | 46.7 | 62.2 | 41.8 | 41.2 |
| UniVTG | 59.7 | 45.8 | 61.9 | 41.9 | 38.8 |
| BM-DETR | 63.6 | 46.8 | 63.7 | 43.5 | 44.2 |
| CG-DETR | 67.4 | 52.1 | 65.6 | 45.7 | 44.9 |
| ActivityNet-VRL | SportsMoments | ||||
|---|---|---|---|---|---|
| Pre-Fusion | Post-Fusion | mIoU | R@1 | mIoU | R@1 |
| ✗ | ✗ | 49.7 | 50.2 | 49.1 | 46.6 |
| ✗ | \checkmark | 52.3 | 52.9 | 53.1 | 48.2 |
| \checkmark | ✗ | 50.4 | 51.2 | 52.4 | 46.7 |
| \checkmark | \checkmark | 53.2 | 54.8 | 56.2 | 52.7 |
| ActivityNet-VRL | SportsMoments | ||||
|---|---|---|---|---|---|
| Pre-training | Augmentation | mIoU | R@1 | mIoU | R@1 |
| ✗ | - | 53.2 | 54.8 | 56.2 | 52.7 |
| \checkmark | ✗ | 54.1 | 55.6 | 56.9 | 53.6 |
| \checkmark | \checkmark | 56.8 | 57.1 | 59.2 | 56.5 |
| ActivityNet-VRL | SportsMoments | |||
|---|---|---|---|---|
| mIoU | R@1 | mIoU | R@1 | |
| Pre-fusion alignment ( ) | 34.1 | 32.6 | 31.6 | 29.8 |
| Post-fusion alignment ( ) | 38.3 | 35.2 | 36.4 | 33.5 |
| Prediction-heads | 56.8 | 57.1 | 59.2 | 56.5 |
| ActivityNet-VRL | SportsMoments | |||
|---|---|---|---|---|
| Alignment | mIoU | R@1 | mIoU | R@1 |
| None | 50.4 | 51.8 | 52.1 | 48.6 |
| TCC [ 196 ] | 52.4 | 52.7 | 53.9 | 52.8 |
| Needleman-Wunsch [ 227 ] | 50.8 | 51.2 | 52.6 | 49.5 |
| LCSS [ 228 ] | 50.9 | 52.6 | 53.7 | 49.6 |
| Drop-DTW [ 175 ] | 54.2 | 54.7 | 55.6 | 54.7 |
| ActivityNet-VRL | SportsMoments | |||
|---|---|---|---|---|
| Feature | mIoU | R@1 | mIoU | R@1 |
| ResNet [ 74 ] | 42.3 | 42.8 | 50.6 | 48.1 |
| I3D [ 165 ] | 43.7 | 43.4 | 52.2 | 50.6 |
| S3D [ 188 ] | 46.2 | 47.5 | 53.9 | 52.1 |
| C(2+1)D [ 229 ] | 46.6 | 47.1 | 53.3 | 50.9 |
| CLIP [ 50 ] | 53.2 | 54.8 | 56.2 | 52.7 |
| ActivityNet-VRL | SportsMoments | |||
|---|---|---|---|---|
| Noise Type | mIoU | R@1 | mIoU | R@1 |
| Frame Reverse | 42.7 | 43.1 | 43.1 | 44.6 |
| Speed Variation | 53.3 | 55.9 | 57.4 | 55.3 |
| Gaussian Noise | 55.8 | 56.3 | 58.5 | 56.1 |
| None | 56.8 | 57.1 | 59.2 | 56.5 |
| Method | Params | FLOPs | Inference | Memory | Throughput |
|---|---|---|---|---|---|
| (M) | (G) | Time (ms) | (GB) | (FPS) | |
| Moment-DETR | 45.2 | 12.3 | 48.5 2.1 | 2.1 | 20.6 |
| QD-DETR | 62.8 | 16.7 | 52.3 2.4 | 2.6 | 19.1 |
| UniVTG | 38.4 | 10.2 | 45.8 2.0 | 2.0 | 21.8 |
| CG-DETR | 69.5 | 18.1 | 58.4 2.6 | 3.1 | 17.1 |
| BM-DETR | 81.3 | 23.8 | 71.5 3.5 | 3.8 | 14.0 |
| Sampling Rate | ActivityNet-VRL | SportsMoments | Inference | Memory | ||
|---|---|---|---|---|---|---|
| mIoU | R@1 | mIoU | R@1 | Time (ms) | (GB) | |
| 1 frame/4s | 51.3 | 52.1 | 53.8 | 50.2 | 30.1 | 1.7 |
| 1 frame/3s | 54.2 | 55.4 | 56.4 | 53.6 | 41.2 | 2.1 |
| 1 frame/2s (default) | 56.8 | 57.1 | 59.2 | 56.5 | 53.8 | 2.5 |
| 1 frame/1s | 56.2 | 56.8 | 59.5 | 56.1 | 95.6 | 4.4 |
| 1.5 frames/s | 55.8 | 56.3 | 58.1 | 55.4 | 137.4 | 6.3 |