---
library: "brainference"
slug: "ConfidenceCascadeTracking"
name: "ConfidenceCascadeTracking"
ref: "ConfidenceCascadeTracking#1973"
hash: "sema:ConfidenceCascadeTracking#mh:SHA-256:19736fba4c132b16ae36577b7d58b119b1437c16b1ceacb61a484c428fea01a3"
type: "Inference"
layer: "Mind"
version: "1.0.0"
root: "8d7193fc97804cdc3aa9080728d8094732206c114f34d36b8ca2b89b943b3990"
license: null
url: "https://semahash.org/vocabularies/brainference/patterns/ConfidenceCascadeTracking"
---

# ConfidenceCascadeTracking

Match confident detections first, consult appearance only on ties, and let weak detections fill gaps, to keep identities unbroken

Mind · Inference

## Mechanism

Multi-object tracking for interaction analysis, where every lost or swapped identity breaks a chain in a [SecondOrderInteractionNetwork](https://semahash.org/vocabularies/brainference/patterns/SecondOrderInteractionNetwork.md). Each track holds a Kalman state (x, y, s, r, dx, dy, ds): box centre, area, aspect ratio and velocities, with a constant-velocity model, large initial velocity uncertainty (1e4) and small process noise. Each frame: (1) match high-confidence detections (score > 0.7) to all active tracks by IoU distance 1 - IoU with the Hungarian algorithm; (2) when best and second-best IoU candidates are too close, use a re-identification network (ResNet-50 fine-tuned with triplet loss, cosine distance on embeddings) as a tie-breaker; (3) match remaining low-confidence detections (0.1-0.7) only to tracks still unassigned, rejecting matches above a distance threshold; treat scores below 0.1 as background. Unmatched tracks keep their last position (no Kalman drift) and are deleted after 60 frames (1 s), which bridges brief occlusions. Export per-frame centroids and keypoints per track.

## Invariants

- Low-confidence detections can never displace a track already matched by a high-confidence one
- Appearance is consulted only when geometry is ambiguous
- A track survives a bounded number of unmatched frames, then is deleted

## Failure modes

- Dense clusters (aggression) still produce identity swaps that need manual or rule-based repair downstream
- A re-ID model trained on few individuals from one viewpoint generalises poorly to new animals or lighting
- Holding position during occlusion mislocates fast movers when they reappear

## Where this came from

- Thesis: do_2026_ant_collective_behavior (Ch. 2.2.4-2.2.5, Eqs. 2.6-2.8; deepSORT/ByteTrack adaptation)

## Builds on

- [SecondOrderInteractionNetwork](https://semahash.org/vocabularies/brainference/patterns/SecondOrderInteractionNetwork.md) (yields)

## Identity

- Library: brainference 1.0.0 (root 8d7193fc9780)
- Ref: ConfidenceCascadeTracking#1973
- Hash: sema:ConfidenceCascadeTracking#mh:SHA-256:19736fba4c132b16ae36577b7d58b119b1437c16b1ceacb61a484c428fea01a3

## Links

- Page: https://semahash.org/vocabularies/brainference/patterns/ConfidenceCascadeTracking
- JSON: https://semahash.org/vocabularies/brainference/patterns/ConfidenceCascadeTracking.json
- Library: https://semahash.org/vocabularies/brainference
- Library index: https://semahash.org/vocabularies/brainference/index.json
