r/computervision • u/Slight_Analysis_5414 • 14d ago
Discussion [Project] A training-free spatial consistency auditor — could it catch ID switches before tracker state updates?
Quick visual summary first:

- Left: Cup on table → declared constraint PASS
- Right: Same cup floating above table → declared constraint WARN
To be clear: this is currently a naive 2D geometric constraint checker, not a real-world physics engine. Obviously, a cup in mid-air isn't always a model hallucination—it could be falling, being picked up, or thrown. A single static frame cannot distinguish between a dynamic action and a tracking/detection error. This is exactly why we’re extending it to temporal tracking: motion context lets us distinguish normal movement from true detection errors.
Hi computervision,
I've been building a small, training-free consistency auditing layer for object detection and segmentation outputs. The core idea: high detection confidence doesn't necessarily mean consistency with the scene's spatial constraints.
What works today
I have a reproducible prototype for 2D spatial constraint auditing. It checks user-declared geometric rules (e.g. cup:on:table) using detection boxes. It also includes optional Ultralytics YOLO and SAM2 adapters for detection and segmentation.
The synthetic demo runs with only NumPy and Pillow — no GPU, model weights, or model downloads required.
pip install -r requirements.txt
python oscf_cv_mvp.py --demoTo be upfront about limitations:
• It checks declared constraints, not automatically inferred physical rules.
• It's a 2D geometry checker, not a validated 3D physics or causal reasoning system.
• The algebraic features are experimental. Real-model inference and performance gains haven't been validated yet.
Why I'm extending this to object tracking
One problem that interests me: a bad association isn't necessarily just a single-frame error.
When a tracker updates its motion state or appearance embeddings with a wrongly matched detection, that error can bias future associations. In memory-based video segmentation like SAM2, incorrect masks can also affect subsequent propagation.
This becomes particularly difficult with similar-looking targets, occlusions, and detector jitter.
I'm exploring whether an independent temporal consistency auditor could flag suspicious associations before they're committed to persistent tracker state.
Proposed pipeline:
Detections → Candidate associations → Consistency audit → State/memory update
The first version would run in shadow mode, flagging suspect transitions without modifying tracker output.
If validated, later versions could explore pre-update gating — deferring uncertain associations, preserving predicted states, or requesting alternative matches.
I haven't implemented or validated the tracking extension yet. It will require integration with trackers like ByteTrack or BoT-SORT, and separate work for SAM2 memory handling.
I also recognize that motion continuity alone cannot resolve every ID switch, especially when nearly identical targets cross with similar trajectories.
Even a post-processing auditor could be useful for flagging suspect tracks for downstream analytics, human review, or offline re-processing — without modifying tracker internals.
Looking for real failure cases & collaborators
I'm particularly interested in developers working on sports tracking, crowded scenes, animal behavior, or industrial object tracking — especially where appearance-based matching becomes unreliable.
If you have a short video showing ID switches, ID reassignment, or track fragmentation, I'd love to collaborate.
Frame-by-frame detection boxes and track IDs would also be useful. Even descriptions of difficult failures could help identify test scenarios.
I'd like to compare this approach against standard motion gating and existing tracking baselines, measuring ID switches, false alarms, identity consistency, and runtime overhead.
A note on the math
The prototype implements standard Cayley–Dickson octonion multiplication and associator calculations, rather than treating eight values as an ordinary linear vector.
Whether these nonassociative features provide useful information beyond conventional geometry and motion features remains an open experimental question.
I'm not claiming an improvement over existing tracking methods yet. That's what I hope to investigate with real-world data.
Code: https://github.com/ZC502/oscf_cv_mvp.git
If you've encountered stubborn tracking failures, or have suggestions about where to insert a pre-update audit without breaking tracker internals, I'd appreciate your feedback.
Thanks!
-1
u/Dry-Snow5154 14d ago
Here is what my AI thinks of your AI project. Enjoy.
The current prototype is essentially a manually configured bounding-box geometry checker. It detects objects, selects the highest-confidence detection for each class, and checks whether their bounding boxes satisfy predefined relationships. Calling this spatial consistency auditing or physical reasoning is an overstatement. It doesn't infer physical constraints, understand scenes, or independently identify errors. It executes rules supplied by the developer. Even the cup-on-table example is ambiguous: a cup above a table isn't necessarily an inconsistency.
The octonion component is particularly difficult to justify. Encoding eight unrelated quantities (confidence, coordinates, depth, area, orientation, semantic weights, etc.) into an octonion doesn't establish any meaningful relationship between them. The resulting multiplication and associator depend on arbitrary choices of component ordering, scaling, and normalization. Nonassociativity doesn't magically produce relational reasoning. Why should an associator of confidence, coordinates, and proximity tell us anything useful about a scene? Where is the evidence that it captures information beyond ordinary geometric features? Without controlled experiments against conventional representations, this looks like mathematical decoration rather than a useful computer vision technique.
The proposed tracking extension is a different problem altogether. Modern trackers already incorporate motion predictions, covariance, Mahalanobis-distance gating, IoU, and sometimes appearance similarity. What additional information does this auditor have that the tracker doesn't? If it consumes the same detections, track histories, and motion estimates, it isn't particularly independent and will likely share the tracker's failure modes. More importantly, spatial and temporal consistency cannot reliably detect identity switches. Two identical objects can cross, exchange IDs, and continue along perfectly smooth, physically plausible trajectories. This is not an edge case; it's a fundamental limitation of tracking without additional identity information.
The proposed intervention is also underspecified. Rejecting a suspicious association can prevent state contamination, but it can equally cause fragmentation. Selecting an alternative association requires considering the entire assignment matrix, not evaluating individual track-detection pairs independently. Deferring updates requires maintaining uncertainty and potentially multiple hypotheses. At that point, this is becoming a multi-hypothesis tracking problem, not a lightweight auditing layer. The proposal doesn't explain how these decisions would be made or how they would outperform existing assignment and gating mechanisms.
The SAM2 extension further conflates different problems. Preventing incorrect detection-to-track associations in ByteTrack is not equivalent to validating segmentation masks and controlling memory updates in SAM2. They have different architectures, failure modes, and intervention points. Combining spatial constraints, octonion features, conventional MOT, and video segmentation memory management makes the project unnecessarily broad.
Before introducing any of this complexity, the author should establish one basic result: can an external module identify incorrect associations that an existing tracker accepts, using only information available before its state update? Compare it against Mahalanobis gating, motion residuals, acceleration consistency, and alternative assignment costs. Evaluate ID switches, HOTA, IDF1, AssA, fragmentation, false rejection rate, and runtime overhead. Most importantly, test on difficult identity crossings, not just obviously implausible movements. An auditor that prevents some ID switches by rejecting valid associations and creating substantially more fragmented tracks isn't an improvement.
As presented, the project has no demonstrated advantage over conventional geometric rules or motion gating. The octonion machinery adds complexity without an established justification, while the proposed tracking application has not yet defined a mechanism capable of solving its central problem: distinguishing a wrong identity assignment from a perfectly plausible trajectory.