TL;DR
Counting objects in a static photo is straightforward, but counting unique objects across a video is a classic game of object permanence: when a penguin waddles behind a rock and re-emerges, is it a new penguin or the same one? IDTCount solves open-vocabulary video counting by treating it not just as a detection problem, but as a persistent identity management challenge. With a tiny 13K-parameter memory module and a lightweight post-video verifier layered onto a frozen vision model, it drastically cuts counting errors across crowds, occlusions, and camera cuts without breaking your GPU budget.
What Problem Does This Paper Address?
Open-vocabulary counting (OVC) lets you type any natural-language query—say, "shoe", "dancer", or "crystal"—and count how many matching objects exist, zero-shot. Extending this from single images to video requires finding the cumulative number of distinct physical instances across time.
Existing video counters pair an open-vocabulary detector with a standard video tracker and simply equate the final count to the total number of generated track IDs. The catch? Standard trackers rely on short-term frame-to-frame continuity. If an object gets hidden (occluded), leaves the frame and comes back, or gets caught in a dense crowd, the tracker loses the thread and assigns a brand-new ID upon re-detection—leading to rampant double-counting. Even trackers equipped with re-identification still suffer from false-positive flickers and fragmented trajectories that inflate the final tally.
Methods
Instead of training a massive end-to-end video model, IDTCount leaves its underlying detector and tracker (SAM3) completely frozen and builds a smart, modular identity layer on top.
Here is how the pipeline flows:
- Frozen Observations: SAM3 processes text queries to output masks, confidence scores, native track IDs, and 256-dimensional visual features pooled directly over each mask. If a native track continues smoothly, IDTCount leaves it alone.
- Dormant Identity Bank: When a local track goes missing (after ~0.167s), it isn't forgotten; it enters a dormant bank for up to 30 seconds, storing an exponential moving average of its visual appearance, recent bounding boxes, and visibility stats. Crucially, there is no spatial filter—an object can reappear anywhere on screen.
- Learned Association Module: When an unlinked observation appears, a compact neural module (just 13,026 trainable parameters!) evaluates 16 cues (appearance similarity, motion consistency, time gap, etc.). Two jointly trained heads score candidate reactivations alongside a dynamic
NEWidentity logit, which acts as a learned threshold during one-to-one Hungarian matching. - Post-Tracking Merge & Verifier: Once the video ends, IDTCount cleans house. First, a geometric merge consolidates split trajectories that overlap in space or show clean short-gap handovers. Finally, a lightweight, CPU-based gradient-boosted tree classifier (200 depth-3 trees examining 18 trajectory features) filters out spurious flickers and residual duplicates before tallying the final surviving identities.
To prevent GPU memory from exploding on long or crowded videos (a fatal flaw in vanilla SAM3), IDTCount evicts stale frames outside the tracker's attention window and processes massive videos in overlapping sessions.
Datasets
- Training: The association module is trained on replayed tracking decisions from OVIS, YouTube-VIS, LV-VIS, and AIC22 CityFlowV2. The tree-based verifier is trained on OVIS-valid, DanceTrack-train, and MOT17-train.
- Evaluation (Existing): Evaluated on four VideoCount benchmarks (TAO-Count, MOT20-Count, Penguins, Crystals) for counting, plus OVIS-test, YT-VIS, and LV-VIS to explicitly measure identity tracking quality.
- Newly Constructed Benchmarks: The authors introduce BURST-Count (built from the BURST test split to test long-tailed, open-vocabulary counting under heavy motion and re-entries) and AnimalTrack-Count (25 dense videos of look-alike animal groups).
Key Insights and Ideas
- Online re-ID isn't enough; hindsight matters: Ablations on BURST-Count reveal a great "aha" moment. Adding the online association module drops identity switches from 341 to 327, and geometric merging nudges it to 326. However, adding the post-video verifier slashes ID switches down to 186. Looking at completed trajectories holistically makes spotting fake or duplicate tracks vastly easier than guessing frame-by-frame.
- Plug-and-play modularity: IDTCount’s identity layer isn't wedded to SAM3. Slapping it onto classical multi-object trackers like ByteTrack and MASA substantially lowers their counting errors. Conversely, when SAM3’s detector completely strike-outs on scientific microscopy (Crystals, returning 0 detections), feeding CountGD-Box detections into IDTCount rescues performance and achieves the best error rates.
- Tiny footprint, massive payoff: CountVid fine-tunes ~265K parameters; IDTCount trains ~20x fewer (13K) and runs its post-video verification across 224 test queries in just 4.42 seconds on a CPU.
Key Results
- Counting Accuracy: IDTCount beats prior state-of-the-art across all five counting benchmarks. It slashes CountVid’s Mean Absolute Error (MAE) by 62.5% on BURST-Count (1.433 $\rightarrow$ 0.537), 78.2% on TAO-Count (2.595 $\rightarrow$ 0.565), and 78.0% on dense crowds in MOT20-Count (50.0 $\rightarrow$ 11.0)—a benchmark where vanilla SAM3 and SAM3Count crash an 80 GB H100 GPU with out-of-memory errors. Against SAM3Count, it cuts MAE by 9.6% (BURST-Count) and 27.6% (TAO-Count).
- Identity Consistency: Across the three VIS benchmarks, IDTCount improves over CountVid by up to 8.8% in AssA, 55.8% in HOTA, and 78.1% in IDF1.
- Speed & Memory: On OVIS-test, IDTCount runs at 105.2 ms/frame using 6.89 GB of peak VRAM, compared to CountVid's sluggish 1,424.3 ms/frame and 14.98 GB.
Limitations and Future Work
Because IDTCount relies on a frozen backbone for observations, it operates under a strict "garbage in, nothing out" constraint: it can link and verify objects that are detected, but it cannot count objects that the backbone completely misses throughout a video (as seen when vanilla SAM3 failed to detect anything on the Crystals dataset). Future work points toward boosting underlying open-vocabulary detection recall in ultra-dense crowds without sacrificing zero-shot generalization.
Summary updated