RETAIN: Online Visual Query Localisation with Bounded Object-Level Memory
Rastogi et al. in Vision
Can a fixed memory beat methods that search the whole video?
RETAIN: Online Visual Query Localisation with Bounded Object-Level Memory
A query asks for the latest past sighting
VQL takes an object crop and query time, then asks where that object appeared most recently beforehand. Offline methods retain video or per-frame features and search again.
RETAIN processes frames before the query is known, merging sightings into bounded object slots. Later queries read those slots alone.
The design hinge is what to preserve when frames cannot be revisited.
How each sighting enters memory
- 1
Sample and encode
At 2 frames per second, a region encoder turns each written frame into object-level tokens.
- 2
Merge repeats
A token updates its nearest slot only when similarity clears a threshold, refreshing appearance and last-seen time.
- 3
Make room
A token below threshold starts a slot; at capacity, the least recently updated slot is evicted.
- 4
Complete the track
A tracker fills in each completed observation from a 20-second rolling buffer; a few crops persist after those frames expire.
Three parts of RETAIN

Read left to right: the online write condenses observations into object slots; bounded memory sits in the middle, and query-time read retrieves and refines a response track.
What happens when the query arrives
- 1
Retrieve by appearance
The query crop uses the slot encoder; cosine similarity ranks candidates, and temporal suppression drops nearby duplicate observations.
- 2
Re-rank by time
It reranks the ten candidates using recency, update frequency, position and relationships, passing the top three onward.
- 3
Verify and refine
Stored crops help distinguish lookalikes; a chooser selects one candidate, then a refinement head adjusts its boxes into the latest pre-query track.
The primary score rises, but box recovery trails
Ego4D VQ2D validation, 4,507 queries; AP@.25, success at stIoU .05, recovery at box IoU .5. Results table; *prior report, †extra data.
Object slots beat frame memories at equal storage
Matched storage, same read components; 4,507 Ego4D VQ2D validation queries. Source: object-level versus frame-level memory ablation.
The memory often has the object; retrieval still errs
In a 100-clip validation sample, the queried object occupied a memory slot at query time for 88.8% of queries.
Across 4,507 queries, 15.7% are wrong-candidate selections; 5.6% have no matching object among the ten slots read.
Wrong-candidate selection is the largest named failure class here.
Storage is fixed; query time includes active tracking
VQ2D validation efficiency table, rerun baselines; *includes the 20-s buffer, storage fixed; †mean includes candidate tracking on 29% of queries.
Fixed memory does not yet mean real-time use
Tracking throughput
With SAM 3, tracking every observation costs about 930 compute-seconds per second of video; limiting propagation to 2-fps writes still costs about 170.
Very small objects
For objects at most 0.39% of frame area, success is 36.8%, below RELOCATE's 43.9%; sparse prompt coverage may explain the gap.
Validation-only evidence
Only 2D VQL is evaluated, on Ego4D's validation split; test labels were not public and the server no longer accepted submissions.
Why it matters
- Object-level merging lets a fixed budget cover distinct objects better than recent or evenly spaced frame storage.
- For visual-query memory, preserve each object's latest sighting and a few crops to verify ambiguous candidates at query time.
- The open engineering problem is tracking those observations fast enough for genuinely real-time, on-device video.
11 slides, 3 min
9 hours ago