Storage as a function of video length. Offline methods keep the whole recording or its per-frame features; RETAIN keeps a fixed number of object slots.
0.37 GBfixed storage for any video length, with 2,048 object slots and a 20 s frame buffer
+30%relative tAP25 over EAGLE, the strongest offline method, on Ego4D VQ2D
0.19 smedian query time, answered from memory alone; 10–44× faster than offline methods on average
Abstract
With the growing adoption of smart glasses, wearable cameras and autonomous robots, an increasing amount of egocentric video is becoming available, powering applications such as lost-object retrieval, personalised assistance and robot navigation. Many of these applications rely on visual query localisation (VQL), which involves localising the most recent occurrence of a given object in previously observed video. However, existing VQL methods mostly operate offline, storing the entire recording and searching it for every query, which causes storage and latency to grow with the video length and makes their deployment on edge devices impractical.
To address this, we propose RETAIN, an online, memory-based VQL framework that condenses the stream into a bounded memory containing a fixed number of object slots. As the video streams, each object either updates its existing slot or occupies a new one, thereby maintaining the track of its latest occurrence. At inference time, queries are answered solely from these slots using lightweight learned components, without revisiting the video. On the Ego4D VQ2D benchmark, RETAIN achieves relative gains of 30% in temporal AP25 and 5% in spatio-temporal AP25 over the best offline method, while keeping its storage fixed regardless of video length and answering queries 10–44× faster on average.
Inside the memory
Replay how the memory fills while a video streams. The left panel shows each display frame with the objects written at that moment; the grid on the right shows all 2,048 slots. A slot shows a strong shade when it is written and fades as it ages; once every slot is taken, the least recently updated one is evicted to make room. Hover or focus a slot to see what it holds, and pin it to mark its writes on the timeline.
Switch to What it holds to see the stored crops of every object in memory at the current moment, newest first; play the video to watch objects arrive and leave. The write log below lists the latest writes and evictions, and the lifetime chart shows how long objects stay before they are evicted.
The replay re-runs the paper's model on the same GPU type (A100, fp16) and reproduces its memory: every example query reads the same slots, with the same similarity scores, as in the reported results.
The interactive replay loads when this section scrolls into view.
Videos
Short clips rendered from the same replay data as the interactive demos above. The first shows a long stream; each of the others follows one example query from the query crop to the answer, including three failures.
Long stream. Occupancy reaches 2,048 slots after 1.5 minutes and then stays flat while slots are recycled.
Success. The top-cosine slot is the right moment, 80 s after the pillow was last seen.
Distractor. The top-cosine slot is wrong; re-ranking and verification move the answer to the right slot.
Old sighting. Last seen almost four minutes before the query, and its slot still answers it.
Small object. Scissors under 1% of the frame, found in a full long-stream memory.
Late in a long stream. Asked over nine minutes in; the slot from 90 s earlier is still in memory.
Failure: evicted. The hammer's slots are evicted shortly before the query, so no candidate points to the right moment.
Failure: wrong choice. A correct slot is among the top three, but the choice step picks another sighting.
Failure: box misses. The right moment is found, but the box on this tiny object does not overlap enough.