Dv04 commited on
Commit
686f3f6
·
verified ·
1 Parent(s): d8026b8

Deep expansion pass: full mechanism taxonomy (01), WILDTRACK two-leg real-data campaign + Frigate gate (02), four-act CrowdHuman saga (03), per-product paragraphs + edge-box composition (04), refusal-gate mechanics + three-bug case study + 36/36 OOD demo (05); README index with reading times

Browse files
01_ai_that_refuses_to_guess.md CHANGED
@@ -10,125 +10,205 @@ anomaly detector why it fired and you get a score, not a reason. Ask a model fac
10
  compressed model is still good enough, and by default it ships the compressed model regardless.
11
 
12
  At Dhi Labs we build the opposite: components whose **honesty is a feature, not a disclaimer**.
13
- Four mechanisms show up again and again across our six products, and we treat each as a
14
- first class deliverable that has to be *measured*, not asserted. This post lays out all four,
15
- with the actual numbers behind each claim, and goes one layer deeper than before: the specific
16
- code paths that enforce each mechanism, the places where our own reproduction did not match our
17
- own prior prose, and what a real dataset does to a method once you actually run it there.
18
- Posts 2 and 3 go deeper on two of the six products, post 4 is a portfolio level tour of all six,
19
- and post 5 covers the newest addition to the program, a language guided model factory that just
20
  shipped its first tagged release.
21
 
22
- ## 1. Calibrated intervals instead of bare point estimates
23
-
24
- A count of "12" implies a precision that occlusion has already destroyed. Our
25
- [amodal counting](https://huggingface.co/datasets/Dhi-Technologies/amodal-counting-benchmark)
26
- work (A4) reports a *calibrated interval* whose coverage is itself a reported number, not an
27
- assumption. We do not get to pick that coverage by taste: the textbook analytic error bar
28
- measured **0.50 to 0.63 actual coverage against a claimed 0.90** on our synthetic benchmark.
29
- That is an order of magnitude too confident for an operator to trust. The honest fix is
30
- conformal calibration, and the multiplier it produces (6.7x to 14.5x wider than the naive bar,
31
- depending on crowding density) *is* the headline: we publish how wrong the overconfident
32
- version would have been, not just how right the calibrated version now is.
33
-
34
- | crowding | naive MAE | corrected MAE | claimed 90% coverage, actual analytic | claimed 90% coverage, actual conformal |
35
- |---:|---:|---:|---:|---:|
36
- | 0.0 | 2.8 | 2.4 | about 0.50 to 0.63 (undercovers) | 0.90 |
37
- | 0.3 | 2.6 | 1.97 | about 0.50 to 0.63 (undercovers) | 0.90 |
38
- | 0.6 | 2.85 | 2.34 | about 0.50 to 0.63 (undercovers) | 0.975 |
39
- | 0.8 | 3.73 | 2.46 | about 0.50 to 0.63 (undercovers) | 0.975 |
40
-
41
- That table is synthetic, and we say so every time we quote it. What makes the calibration
42
- argument more than a synthetic party trick is what happened when the same correction was tried
43
- on real photographs. On CrowdHuman validation images (a SAHI tiled YOLOv8s detector, 270 images,
44
- 6,809 ground truth boxes, run on external GPU hardware, attributed here to the repository's own
45
- evidence log and not independently re-run in this pass), the one directional Horvitz Thompson
46
- correction did **not** beat naive counting: naive MAE was 11.767, and the corrected estimate came
47
- in *worse*, at 22.475 for the single feature curve and 28.228 for the multivariate one, with
48
- interval coverage collapsing to about 39 to 41% against a 90% target. That is a real regression
49
- on real data, and it is published rather than quietly dropped. The fix that did work was a
50
- two sided estimator that adds a second fitted model for whether a detection is a genuine object
51
- at all, not just how visible it is; that variant reached MAE 11.031 (finally better than naive)
52
- with 90.67% coverage against the 90% target. Even that fix is disclosed as incomplete: on the
53
- twenty densest scenes in the same evidence log, where a detector saw as few as 20 to 30 raw
54
- boxes standing in for up to 227 true people, naive counting is still better and the estimator's
55
- own coverage flag correctly drops to 50%, signaling extrapolation instead of silently failing.
56
- We would rather publish a correction that sometimes loses to naive counting, with the exact
57
- conditions under which it loses, than publish only the crowding sweep where it wins.
58
-
59
- ## 2. Refusal gates: "I don't know" beats a wrong answer
60
-
61
- In cross camera linking, a false merge poisons weeks of memory: every future query about
62
- either person returns the other person's history. A missed link only costs a duplicate row.
63
- So our
64
- [multicam reasoning memory](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark)
65
- linker (E1) scores a candidate pairing against three gates in `src/fleetmind/linker.py`, not
66
- two: the best score has to clear a plausibility bar (0.5), it has to beat the runner up by a
67
- margin (0.2), and, the one that actually matters, a **uniqueness guard** requires that at most
68
- one candidate sits above a lower plausibility bar (0.2) at all. If a second candidate is even
69
- plausibly in the running, the link is refused outright and a new entity is created instead. The
70
- first two gates alone measured 0.918 site precision on our synthetic site, meaning about one in
71
- twelve links was silently wrong; adding the uniqueness guard took precision to **1.0** across a
72
- 24 site synthetic grid (165,902 events, 3 to 8 cameras, zero false merges on every site),
73
- deliberately trading recall down to a range of 0.0476 to 0.6788 that scales with how much
74
- external identity reference coverage is available: 0.377 on the committed seed 1 demo (26 of 69
75
- true same person pairs linked, zero wrong). When we are not sure, we do not guess, and we report
76
- exactly how much recall that costs, on that single seed and across the whole grid.
77
-
78
- The same pattern shows up in our model factory,
79
- [Prompt2Model](https://huggingface.co/datasets/Dhi-Technologies/prompt2model-examples) (B1), now
80
- public on GitHub with a tagged v0.1.0 release (post 5 covers it in full). At inference time it
81
- compares the nonconformity of a prediction (1 minus the predicted probability) against a
82
- validation calibrated threshold, and abstains rather than guessing when the input looks
83
- unfamiliar. The threshold itself is fit from held out data, not chosen by hand: on the toy
84
- classification smoke test it came out to 0.491826 at alpha=0.1 (a 90% target coverage), fit from
85
- 7 held out validation samples, and the card that ships that number also discloses that
86
- calibrating on only 7 samples is noisy (ece_before 0.065, ece_after 0.272) rather than smoothing
87
- that over. Separately, the factory's compression step refuses to ship a quantized or distilled
88
- model that drops more than 2% below the uncompressed model's accuracy (a 98% retention floor,
89
- hard coded, not a documentation promise); if the compressed candidate fails that floor, the
90
- pipeline ships the uncompressed model instead and logs the refusal, rather than silently
91
- shipping a worse model to save size.
92
-
93
- ## 3. Provenance on every answer
94
-
95
- A memory system that cannot show its work is a liability. Every query function in E1's memory
96
- store (`src/fleetmind/queries.py`) attaches a `provenance` dict to its return value: `where_is`
97
- returns an `episode_id`, `history` returns a list of `episode_ids`, `who_was_at` attaches
98
- per-entity episode lists, and `journeys` attaches the specific episodes a transit-time estimate
99
- was recovered from. The module's own docstring states the principle as plainly as we would want
100
- to say it ourselves: "An answer without provenance is an assertion; these are receipts." So a
101
- statement like "person X was last seen on cam3 at t=387" traces back to the exact observation
102
- that supports it, and a journey query such as "cam0 to cam1" returns the real transit times it
103
- recovered, each tagged with its episode, rather than a bare aggregate. A local LLM can optionally
104
- narrate an answer for readability, but the code and its docstring are explicit that the model
105
- only rephrases a fact the query layer already computed; it is never allowed to be a source of
106
- facts.
107
-
108
- ## 4. Falsification ledgers
109
-
110
- Our
111
- [causal predictive alerting](https://huggingface.co/datasets/Dhi-Technologies/causal-predictive-alerting-benchmark)
112
- system (E4) predicts incidents seconds before they happen, and then *grades itself* with a
113
- `FalsificationLedger` (`src/precausal/grounding.py`). Every prediction is filed the moment it
114
- fires, with a deadline based on its own claimed lead time; if the predicted event is later
115
- observed to actually happen before that deadline, the ledger resolves it `fulfilled` with the
116
- *measured* lead time, not the predicted one; if the deadline passes and it still has not
117
- happened, the ledger resolves it `falsified`, full stop. There is no third, softer verdict. Every
118
- alert also ships a counterfactual from an **ablation replay** engine: the same predictor is
119
- re-run with a candidate cause either removed entirely or motion-frozen in place, on the exact
120
- observation history the original alert used, and a cause only earns "would not have fired if..."
121
- status when removing it actually kills the alert on that literal replay. Nothing is narrated;
122
- every causal claim corresponds to an executed, rerunnable run.
123
-
124
- Over an earlier 200 scenario battery: 150 alerts fired (75%), and of those, 63 were later graded
125
- fulfilled and 87 falsified, with 50 scenarios producing no alert at all (87 + 63 + 50 = 200,
126
- 87 + 63 = 150, arithmetic we checked rather than took on faith). We publish the falsified count
127
- as prominently as the fulfilled one, because a system that hides its false alarms is not really
128
- being graded by anyone but itself.
129
-
130
- A newer, harder 210 scenario battery breaks that down further by scenario kind, and precision
131
- varies a lot by kind:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
 
133
  | alert kind | n | precision | recall | mean lead error (s) |
134
  |---|---:|---:|---:|---:|
@@ -137,61 +217,95 @@ varies a lot by kind:
137
  | convergence (multi party, 3 track decoy check) | 10 | 0.500 | 1.000 | 0.43 |
138
  | crowd buildup | 45 | 0.356 | 1.000 | 1.34 |
139
 
140
- Recall stays at 1.0 for every kind (the system never misses a true incident in this battery); the
141
- cost of that is a false positive rate of 8.0% overall on the 75 negative scenarios, concentrated
142
- in the two hardest edge cases: stationary loiterers, at 20%, and cases where the incident falls
143
- just outside the prediction horizon, at 13.3%. The battery's own root cause analysis traces both
144
- to the same mechanism: a short, noisy velocity estimate can read an apparent speed several times
145
- the track's true speed from jitter alone, enough to cross the minimum speed gate. Precision below
146
- 1.0 is disclosed per kind, not averaged away, and crowd buildup, the weakest of the three core
147
- kinds, is named as such rather than folded into an overall number that would look better. The
148
- counterfactual engine's own necessity rate is a second honest signal: presence removal was
149
- necessary for 100% of zone entry and convergence alerts, but only 21.7% of crowd buildup alerts
150
- (267 per-occupant checks), which is the correct answer, not a bug: a crowd well above threshold
151
- genuinely does not depend on any single occupant, and the system reports that low necessity
152
- instead of inflating per-person blame to make the explanation look more decisive than it is.
 
 
 
 
 
 
153
 
154
  ## A fifth pattern: disclose the hard case instead of dropping it
155
 
156
- Two more products round out the six, and they add a variant of the same instinct applied to
157
- reporting rather than to a decision rule. Our
158
- [fixed camera 3D](https://huggingface.co/datasets/Dhi-Technologies/fixed-camera-3d-benchmark)
159
- work (A3) self calibrates height, tilt, and focal length from ordinary people walking through a
160
- static camera's field of view, no GPU, no model weights. Its conditioning probe,
161
- `sensitivity_m_per_half_deg`, perturbs the recovered tilt by half a degree and measures how far
162
- the estimated ground position moves in response, because a shallow mount camera can converge to
163
- a low optimizer residual while its recovered tilt is still off by a few degrees, an error the
164
- residual alone cannot see but that becomes meters of far field position error. The shallow angle
165
- case (3 meter height, 20 degree tilt) is reported at 4.30 meters position RMSE, next to 0.16
166
- meters at a well conditioned geometry (5 meter height, 30 degree tilt), in the same table, not a
167
- footnote.
168
-
169
- Our [thermal perception](https://huggingface.co/datasets/Dhi-Technologies/thermal-perception-benchmark)
170
- work (A5) applies the same instinct to an entire category of unfinished work: a hard coded
171
- `min_corpus_frames = 200,000` floor labels anything trained on fewer frames a mechanics pilot,
172
- not a quality claim, and both of its GPU pretraining runs on record (2,503 synthetic frames,
173
- 15,488 real infrared frames) sit far below that floor and are reported as pilots, in the repo's
174
- own results documents, rather than presented as evidence the pretraining works.
175
-
176
- ## The honesty tax we pay openly
177
-
178
- Every dataset on this org is **synthetic**: procedurally generated with known ground truth so
179
- every claim can be checked exactly. Real world validation is in progress for all six products
180
- and clearly marked as such on every dataset card; where a real world attempt has actually been
181
- made, as with A4's CrowdHuman re-test above, we publish it even when the first version of the
182
- correction made things worse. We never claim state of the art or foundational status, and there
183
- are no customer names or deployment claims anywhere on this org. The point of an honest system is
184
- that you can check it, so we make that easy: every number in this post traces to a committed
185
- evidence file or test run in the matching dataset repo, reproducible with a one line command in
186
- that dataset's README, and where our own past prose did not match a fresh reproduction (a memory
187
- size quoted as "61 KB" against a measured 61,440 bytes, a test count quoted as 13 against a
188
- counted 14 in one file), we say so instead of quietly fixing the number and moving on.
189
-
190
- - Datasets and demos: [Dhi Labs collection](https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  - Blog index: [Dhi-Technologies/blog](https://huggingface.co/datasets/Dhi-Technologies/blog)
192
- - Code: proprietary, closed source permanently for five of the six products; Prompt2Model is a
193
- deliberate exception with one public, MIT-licensed release (see post 5). The GitHub org
194
- [github.com/DHI-Technologies-Inc](https://github.com/DHI-Technologies-Inc) is an identity link,
195
- not a browsable source destination for the other five. Partnership or access inquiries:
196
  [dhi-tech.com](https://dhi-tech.com).
197
  - Next: [Precision first cross camera linking (E1)](02_e1_precision_first_linking.md), [When the error bar is the product (A4)](03_a4_calibration_over_accuracy.md), [Six products, one honesty thesis](04_portfolio_overview.md), [Prompt2Model v0.1.0](05_prompt2model_v010.md)
 
10
  compressed model is still good enough, and by default it ships the compressed model regardless.
11
 
12
  At Dhi Labs we build the opposite: components whose **honesty is a feature, not a disclaimer**.
13
+ Four mechanisms show up again and again across our products, and we treat each as a first class
14
+ deliverable that has to be *measured*, not asserted. This post lays out the full taxonomy, with
15
+ a worked micro example for each mechanism drawn from the actual products and their actual
16
+ numbers, a section on why the industry default is the opposite and what that default costs the
17
+ people who operate these systems, and the measurement philosophy that makes any of it
18
+ checkable. Posts 2 and 3 are deep dives into two of the products, post 4 is a portfolio tour,
19
+ and post 5 covers the newest piece of the program, a language guided model factory that just
20
  shipped its first tagged release.
21
 
22
+ One framing note before the numbers. The code behind these products is proprietary and closed
23
+ source. What is open is the *evidence*: the synthetic benchmark datasets with exact ground
24
+ truth, the demo Spaces, the committed evidence logs these posts quote, and the reproduction
25
+ commands and verbatim test output lines included throughout. Closed source, open evidence. You
26
+ cannot read our linker, but you can check every number we publish about it.
27
+
28
+ ## Why the industry default is overclaiming
29
+
30
+ It is worth being specific about the incentive structure, because none of the individual actors
31
+ in it are behaving irrationally. Benchmarks score point estimates: a counting paper reports MAE,
32
+ a re identification paper reports rank 1 accuracy, a detection paper reports mAP. Almost no
33
+ leaderboard grades the *uncertainty statement* attached to a prediction, so the uncertainty
34
+ statement is the first thing to rot. A vendor selling a people counter gets asked "how accurate
35
+ is it," never "when it says 90% sure, how often is it right." A tracker that links aggressively
36
+ demos better than one that refuses, because a demo audience sees the links it made, not the
37
+ weeks of corrupted history a wrong merge will cause later. And a model card that says
38
+ "validation in progress" reads as weakness next to a competitor's card that simply omits the
39
+ subject.
40
+
41
+ The result is a market where overclaiming is the default output format, not an occasional lie.
42
+ And the cost lands on operators, in at least four concrete ways. We can attach a measured
43
+ number from our own work to each one, because in each case we built the overconfident version
44
+ first, measured it, and kept the measurement:
45
+
46
+ 1. **Overconfident intervals misallocate people and money.** The textbook analytic error bar on
47
+ our own occlusion corrected counter claimed 90% confidence while actually covering the truth
48
+ 50 to 63% of the time on our benchmark. An operator staffing a platform, a kitchen, or a gate
49
+ from that interval is wrong about the interval itself almost half the time, which is arguably
50
+ worse than getting no interval at all, because it converts a guess into a false guarantee.
51
+
52
+ 2. **Silent wrong answers compound.** In cross camera linking, one false merge does not cost one
53
+ error. Every future query about either identity now returns the other person's history, for
54
+ as long as the record lives. Our margin only linker was measured at 0.918 site precision,
55
+ which sounds high until you restate it: about one in twelve links silently wrong, each one
56
+ poisoning everything downstream of it. Nobody notices at demo time. The operator notices
57
+ weeks later, when the answer to "where was this person before the incident" is confidently,
58
+ untraceably wrong.
59
+
60
+ 3. **Ungraded alarms train operators to ignore alarms.** A predictive alerting system that never
61
+ reports its own false alarm rate does not have a zero false alarm rate; it has an unmeasured
62
+ one, and the operator's attention silently becomes the measurement instrument. Our own
63
+ predictor, graded by its own ledger over a 200 scenario battery, fired 150 alerts of which 87
64
+ were later falsified by its own deadline based grading. We publish that number first, before
65
+ the 63 fulfilled ones, because a system that hides its false alarms is being graded by nobody
66
+ except the operator it is exhausting.
67
+
68
+ 4. **Degenerate models ship when nobody is forced to look.** The most instructive failure in
69
+ this whole program was our own: the first published smoke test artifact for our model factory
70
+ reported a toy classification accuracy of 0.0, produced by a chain of three real bugs
71
+ (unseeded RNGs, a class dropping split, an untrained from scratch backbone) that a
72
+ healthier looking pipeline would have hidden behind a lucky seed. The fix and the full
73
+ post mortem are in post 5. The point here: the artifact was degenerate, it was published, and
74
+ the honest response was to diagnose it in public rather than delete it.
75
+
76
+ The rest of this post is the taxonomy of mechanisms we use to make the opposite default
77
+ concrete. Each one costs something measurable, and the cost is published next to the benefit.
78
+
79
+ ## The four mechanisms
80
+
81
+ ### 1. Calibrated intervals instead of bare point estimates
82
+
83
+ **Definition.** A prediction ships as an interval whose claimed coverage has been *measured*
84
+ against held out ground truth, not derived from a formula and assumed. If the measured coverage
85
+ of the analytic interval misses its claim, the interval is widened by a calibrated multiplier
86
+ until it meets it, and the multiplier itself is published, because the multiplier is the
87
+ measurement of how wrong the original confidence was.
88
+
89
+ **Worked micro example, from amodal counting (A4).** A count of "12" implies a precision that
90
+ occlusion has already destroyed. Our amodal counting engine reports a calibrated interval
91
+ instead, and the calibration story has a number in it that we consider the honest headline of
92
+ the whole method. The textbook Horvitz Thompson analytic error bar, the one you would derive on
93
+ a whiteboard and ship without checking, measured **0.50 to 0.63 actual coverage against a
94
+ claimed 0.90** on our synthetic benchmark. The fix is split conformal calibration: run inference
95
+ over labeled calibration scenes, collect the ratio of actual error to claimed sigma, and take a
96
+ finite sample quantile of those ratios as a multiplier on the analytic bar. That multiplier came
97
+ out between **6.726 and 14.4634** depending on crowding density (re measured this session,
98
+ `bench --seed 0`). In other words, the uncalibrated error bar was roughly an order of magnitude
99
+ too tight, and we publish exactly how wrong it would have been:
100
+
101
+ | crowding | naive MAE | corrected MAE | analytic coverage (claimed 0.90) | conformal coverage | z multiplier |
102
+ |---:|---:|---:|---:|---:|---:|
103
+ | 0.0 | 2.8 | 2.4 | about 0.50 to 0.63 | 0.90 | 6.726 |
104
+ | 0.3 | 2.6 | 1.97 | about 0.50 to 0.63 | 0.90 | 8.2022 |
105
+ | 0.6 | 2.85 | 2.34 | about 0.50 to 0.63 | 0.975 | 14.4634 |
106
+ | 0.8 | 3.73 | 2.46 | about 0.50 to 0.63 | 0.975 | 7.7541 |
107
+
108
+ That table is synthetic, and we say so every time we quote it. What makes it more than a
109
+ synthetic party trick is what happened on real photographs. On CrowdHuman validation images (a
110
+ SAHI tiled YOLOv8s detector, 270 images, 6,809 ground truth person boxes, run on rented GPU
111
+ hardware and documented in the repository's committed evidence log), the one directional
112
+ correction did **not** beat naive counting: naive MAE was 11.767 and the corrected estimate came
113
+ in worse, 22.475 for the single feature curve and 28.228 for the multivariate one, with interval
114
+ coverage collapsing to 39 to 41% against the 90% target. That is a real regression on real data,
115
+ published rather than quietly dropped. The fix that finally worked, a two sided estimator that
116
+ also models whether each detection is a genuine object at all, reached MAE **11.031** (better
117
+ than naive at last) with **90.67%** coverage against the 90% target. And even the fix is
118
+ disclosed as incomplete: on the twenty densest scenes in the same evidence log, where the
119
+ detector saw as few as 20 to 30 raw boxes standing in for up to 227 true people, naive counting
120
+ still wins and the estimator's own coverage flag drops to 50%, correctly signaling extrapolation
121
+ instead of failing silently. Post 3 tells this story in full, all four acts of it.
122
+
123
+ **What it costs.** Interval width. A calibrated interval 6.7x to 14.5x wider than the flattering
124
+ one is harder to sell and easier to trust.
125
+
126
+ ### 2. Refusal gates: "I don't know" beats a wrong answer
127
+
128
+ **Definition.** The system has an explicit code path whose output is *no answer*, and reaching
129
+ that path is treated as correct behavior, exercised by tests, rather than as an error state. The
130
+ refusal condition is calibrated or measured, not hand tuned to taste.
131
+
132
+ **Worked micro example one, from multicam reasoning memory (E1).** The linker decides whether a
133
+ track that just appeared on camera B is the same person who left camera A. It scores candidates
134
+ with a per camera pair Gaussian transit time prior and requires three things before linking: the
135
+ best score clears a plausibility bar (0.5), the best score beats the runner up by a margin
136
+ (0.2), and, the gate that actually matters, a **uniqueness guard**: at most one candidate may
137
+ sit above a lower plausibility bar (0.2) at all. The first two gates alone measured **0.918 site
138
+ precision** on our synthetic site. The failure case is concrete: two people leave the same
139
+ camera about 20 seconds apart, both consistent with the learned transit prior; because Gaussian
140
+ scores are peaky, the wrong one can win by a *large margin*, so margin reads as confidence
141
+ precisely when the situation is most ambiguous. The uniqueness guard refuses that link outright
142
+ and creates a new entity instead. Adding it took precision to **1.0**, and that is not one lucky
143
+ seed: across a 24 site synthetic grid (3 to 8 cameras, 20 to 100 people per site, 165,902 events
144
+ total), precision is exactly 1.0000 on every single site, while recall spans 0.0476 to 0.6788,
145
+ scaling with external identity reference coverage (mean 0.2008 at 20% coverage up to 0.6044 at
146
+ 60%) and with camera count. The recall is the published price of the precision; on the committed
147
+ seed 1 demo, that means 26 of 69 true same person pairs linked, zero wrong, recall 0.3768 (re run
148
+ this session, identical digits). The same guard then held on real data: on the WILDTRACK seven
149
+ camera dataset, with 313 real people milling through overlapping views, the system produced
150
+ **zero wrong merges in every condition**, across 1,663 ground truth replay tracks and across
151
+ 1,373 tracks from a real YOLO11n plus ByteTrack detector and tracker pipeline, at recall 0.4087
152
+ and 0.3502 respectively with 40% reference coverage, and recall 0.0 with none. That last zero is
153
+ an honest negative that defines the operating envelope rather than a failure to hide, and the
154
+ diagnosis behind it, including what the transit prior did and did not contribute, is in post 2.
155
+
156
+ **Worked micro example two, from Prompt2Model (B1).** The model factory ships two refusal gates
157
+ in one pipeline. At inference time, a split conformal check compares each prediction's
158
+ nonconformity (1 minus the temperature scaled confidence) against a threshold fit from held out
159
+ validation data at alpha 0.1. On the healthy toy smoke test, that threshold came out to
160
+ **0.004888**, meaning the model only answers when its calibrated confidence is at least 0.9951,
161
+ and abstains otherwise. Run against all 36 toy images this session, the exported model
162
+ classified **36 of 36 correctly with zero abstentions**; fed two inputs it never saw, a yellow
163
+ star (calibrated confidence 0.9845) and uniform noise (0.9391), it **abstained on both** instead
164
+ of guessing a label. Separately, the factory's compression step refuses to ship a quantized or
165
+ distilled model that drops below 98% of the uncompressed model's accuracy; the floor is a
166
+ hard coded constant, not a documentation promise, and a failed candidate means the pipeline
167
+ ships the uncompressed model and logs the refusal. Post 5 covers the mechanics, including the
168
+ finite sample caveat on calibrating from only 7 validation samples.
169
+
170
+ **What it costs.** Recall in E1 (0.3768 where an aggressive linker would score higher and be
171
+ silently wrong), and answer rate in B1 (an abstaining model answers fewer queries than one that
172
+ always guesses).
173
+
174
+ ### 3. Provenance on every answer
175
+
176
+ **Definition.** Every answer the system returns carries machine readable references to the exact
177
+ stored observations that support it, so any claim can be traced back and audited. An LLM may
178
+ rephrase an answer for readability, but it is never a source of facts.
179
+
180
+ **Worked micro example, from E1's query layer.** Every query function attaches a `provenance`
181
+ structure to its return value: `where_is` returns the supporting episode id, `history` returns
182
+ the list of episode ids, `who_was_at` attaches per entity episode lists, and `journeys` attaches
183
+ the specific episodes each transit time estimate was recovered from. The module's own docstring
184
+ states the principle better than a marketing page would: "An answer without provenance is an
185
+ assertion; these are receipts." Concretely, this session's fresh demo run answered a where is
186
+ query with the string "ent_9d0d3c5133e6 was last seen on cam3 at t=387 (episode 31)", episode
187
+ number included, and a journeys query for cam0 to cam1 returned three actual recovered transit
188
+ times, 37.85 s, 42.85 s, and 53.65 s, each tagged to a specific entity and episode rather than
189
+ collapsed into a bare average. The optional local LLM narration layer is wired so that it only
190
+ rephrases an answer the query layer already computed; turning it off changes no number.
191
+
192
+ **What it costs.** Storage discipline and API surface. Every answer path has to carry its
193
+ receipts, which forbids convenient shortcuts like returning aggregates whose inputs were thrown
194
+ away.
195
+
196
+ ### 4. Falsification ledgers
197
+
198
+ **Definition.** A system that makes predictions files each one, at fire time, with a deadline
199
+ derived from its own claimed lead time, and later grades itself *fulfilled* or *falsified*
200
+ against what actually happened. There is no third, softer verdict, and the falsified count is
201
+ published as prominently as the fulfilled one.
202
+
203
+ **Worked micro example, from causal predictive alerting (E4).** The predictor claims incidents
204
+ seconds before they happen. Its `FalsificationLedger` files every alert the moment it fires; if
205
+ the predicted event is observed before the deadline, the entry resolves fulfilled with the
206
+ *measured* lead time, not the predicted one; if the deadline passes, it resolves falsified, full
207
+ stop. Over an earlier 200 scenario battery: 150 alerts fired, 63 later graded fulfilled, 87
208
+ falsified, 50 scenarios produced no alert. The arithmetic reconciles (87 + 63 = 150 alerts,
209
+ 150 + 50 = 200 scenarios), and we checked it rather than took it on faith, because a ledger
210
+ whose counts do not add up is not a ledger. A newer, harder 210 scenario battery breaks
211
+ performance down by alert kind rather than averaging it away:
212
 
213
  | alert kind | n | precision | recall | mean lead error (s) |
214
  |---|---:|---:|---:|---:|
 
217
  | convergence (multi party, 3 track decoy check) | 10 | 0.500 | 1.000 | 0.43 |
218
  | crowd buildup | 45 | 0.356 | 1.000 | 1.34 |
219
 
220
+ Recall is 1.0 for every kind in this battery, and the disclosed price is an 8.0% false positive
221
+ rate on the 75 negative scenarios, concentrated in two named edge cases: stationary loiterers
222
+ (20%) and incidents falling just outside the prediction horizon (13.3%). The battery's own root
223
+ cause analysis traces both to the same mechanism, a short noisy velocity estimate reading
224
+ jitter as speed. Crowd buildup is named as the weakest kind at 0.356 precision instead of being
225
+ folded into a friendlier overall number.
226
+
227
+ Every alert also ships a counterfactual from an ablation replay engine: the same predictor re
228
+ run on the same observation history with a candidate cause removed or motion frozen, so a
229
+ "would not have fired without X" claim corresponds to an executed, rerunnable run. The engine's
230
+ own necessity statistics are a second honesty signal: presence removal was necessary for 100%
231
+ of zone entry and convergence alerts, but only 21.7% of crowd buildup alerts across 267 per
232
+ occupant checks. That low number is the correct answer, not a bug: a crowd well above threshold
233
+ genuinely does not depend on any single occupant, and the system says so instead of inflating
234
+ per person blame to make its explanations look more decisive.
235
+
236
+ **What it costs.** The system generates a permanent, quotable record of its own failures. 87
237
+ falsified predictions is not a number a marketing page would volunteer; the ledger volunteers it
238
+ by construction.
239
 
240
  ## A fifth pattern: disclose the hard case instead of dropping it
241
 
242
+ Two more products apply the same instinct to *reporting* rather than to a decision rule, and it
243
+ belongs in the taxonomy because dropped rows are how honest tables become dishonest ones.
244
+
245
+ Our fixed camera 3D work (A3) self calibrates a camera's height, tilt, and focal length from
246
+ people already walking through the scene, no GPU, no model weights. Its conditioning probe
247
+ perturbs the recovered tilt by half a degree and measures how far the estimated ground position
248
+ moves, because a shallow mounted camera can converge to a low optimizer residual while its
249
+ recovered tilt is still off by degrees, an error the residual cannot see but which becomes
250
+ meters of far field position error. The shallow geometry (3 m height, 20 degree tilt) reports
251
+ 1.72 meters of position movement per half degree of tilt perturbation and 4.30 meters position
252
+ RMSE, and it sits in the same results table as the well conditioned geometry's 0.16 meters RMSE,
253
+ not in a footnote.
254
+
255
+ Our thermal perception work (A5) applies it to an entire category of unfinished work: a hard
256
+ coded floor of 200,000 corpus frames labels anything pretrained on fewer frames a *mechanics
257
+ pilot*, not a quality claim. Both GPU pretraining runs on record, 2,503 synthetic frames and
258
+ 15,488 real infrared frames, sit far below that floor and are reported as pilots in the repo's
259
+ own results documents. Nothing on this org implies a thermal foundation model exists, because
260
+ none does.
261
+
262
+ ## The measurement philosophy
263
+
264
+ The four mechanisms are only as honest as the measurements behind them, so the measurement
265
+ rules are part of the thesis.
266
+
267
+ **Synthetic ground truth first.** Every benchmark dataset on this org is procedurally generated
268
+ with exact, complete ground truth. This is not a cost saving shortcut; it is what makes claims
269
+ *checkable*. On a synthetic site we know all 69 true same person pairs, so "26 linked, 0 wrong"
270
+ is a verifiable count rather than an estimate against partial annotation. On synthetic crowds we
271
+ know the true count behind every occlusion, so coverage numbers like 0.90 and 0.975 are exact.
272
+ Seeds are committed, and the tables in these posts were re run from those seeds before
273
+ publishing, digit for digit.
274
+
275
+ **Real data second, and published whichever way it goes.** Synthetic validation tells you the
276
+ math is right; it cannot tell you the assumptions survive contact with a real detector or a
277
+ real camera topology. Two real data campaigns have run so far, and both produced results the
278
+ synthetic benchmarks could not have predicted. On CrowdHuman, the first real test of A4's
279
+ correction made counting *worse* (post 3). On WILDTRACK, E1's precision guarantee held
280
+ perfectly but the transit prior mechanism contributed exactly zero links, for a structural
281
+ reason the evidence log diagnoses rather than hides (post 2). Both campaigns are committed as
282
+ evidence logs, negative findings included, because a validation program that only reports its
283
+ wins is a marketing program.
284
+
285
+ **Negative results are deliverables.** The record so far includes: uncapped Horvitz Thompson
286
+ weights measured worse than naive counting (2.89 vs 2.63 MAE); calibration on ground truth
287
+ visibility instead of inference aligned visibility turning the correction harmful (3.13 vs
288
+ 2.63); the one directional corrector losing to naive on CrowdHuman (22.475 vs 11.767); the
289
+ WILDTRACK zero prior link finding; the model factory's degenerate 0.0 accuracy artifact and its
290
+ three bug post mortem. Every one of these stayed in the record.
291
+
292
+ **Verbatim evidence lines, and arithmetic that reconciles.** Test suite results are quoted as
293
+ verbatim final lines (this session: `34 passed in 4.33s` for E1, `46 passed in 2.22s` for A4,
294
+ `118 passed in 87.73s (0:01:27)` for Prompt2Model on current main), not paraphrased as "all
295
+ tests pass." Counts are cross checked (87 + 63 + 50 = 200). And where our own past prose
296
+ disagreed with a fresh reproduction, the disagreement is disclosed rather than silently fixed:
297
+ a memory size once quoted as "61 KB" against a measured 61,440 bytes (exactly 60.0 KB), a test
298
+ count once quoted as 13 against a counted 14, a release note's 117 tests against today's 118 on
299
+ a main branch that gained one test since the tag. Small discrepancies, but the habit of
300
+ disclosing small ones is the only reason to trust us with large ones.
301
+
302
+ ## Where to look
303
+
304
+ - Datasets and demos: the [Dhi Labs collection](https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7)
305
  - Blog index: [Dhi-Technologies/blog](https://huggingface.co/datasets/Dhi-Technologies/blog)
306
+ - Code: proprietary, closed source. The open surface is the evidence: benchmark datasets with
307
+ exact ground truth, demo Spaces, committed evidence logs, and the reproduction commands and
308
+ verbatim output quoted in these posts. Prompt2Model additionally shipped one tagged,
309
+ MIT licensed public release, v0.1.0, covered in post 5. Partnership or access inquiries:
310
  [dhi-tech.com](https://dhi-tech.com).
311
  - Next: [Precision first cross camera linking (E1)](02_e1_precision_first_linking.md), [When the error bar is the product (A4)](03_a4_calibration_over_accuracy.md), [Six products, one honesty thesis](04_portfolio_overview.md), [Prompt2Model v0.1.0](05_prompt2model_v010.md)
02_e1_precision_first_linking.md CHANGED
@@ -7,7 +7,9 @@ track ID. A cross camera system has to decide whether those two tracks are the s
7
  person, and it has to do that thousands of times a day, for weeks, without its memory
8
  exploding or its identities quietly corrupting. This post is a deep dive into how our
9
  multicam reasoning memory product (E1, package name `fleetmind`) makes that decision, what
10
- it costs, what it is built from, and what we have and have not verified yet.
 
 
11
 
12
  The design principle we started from is asymmetric on purpose:
13
 
@@ -34,7 +36,7 @@ face free embedding cluster id from a sister product, a badge swipe, any stable
34
  identity. When present, linking is exact. When absent, the engine has to earn the link itself
35
  from timing alone, which is the harder and more interesting case below. Only `t`, `camera_id`,
36
  and `track_id` are actually required; `position_m` is stored for provenance only and, notably,
37
- the linker itself does not use spatial position, only per-camera-pair transit time.
38
 
39
  The library is small on purpose and has no third party dependency beyond `numpy`: 9 Python
40
  files, 1,290 lines total (`wc -l` across `src/fleetmind/*.py` and
@@ -42,87 +44,96 @@ files, 1,290 lines total (`wc -l` across `src/fleetmind/*.py` and
42
  logic:
43
 
44
  - `memory.py` (303 lines): `MemoryStore`, SQLite in WAL mode. Raw events never persist; each one
45
- extends an episode (one row per entity per camera per contiguous-presence span), so storage is
46
  `O(entities + episodes + links)`, not `O(events)`. A retention policy (`prune`) ages episodes
47
- out by day and deactivates links for entities with nothing left.
 
 
 
48
  - `linker.py` (179 lines): `CrossCameraLinker`, `TransitPrior`, `LinkerConfig`. An `identity_ref`
49
- match is exact; otherwise a candidate is scored by a per camera-pair Gaussian transit time
50
- prior, learned online (Welford's algorithm for streaming mean/variance) only from
51
- ref-confirmed links, never from the linker's own probabilistic guesses.
 
 
 
 
52
  - `queries.py` (97 lines): `where_is`, `history`, `who_was_at`, `journeys`, `co_occurrences`,
53
  `summarize`.
54
 
55
  Supporting modules: `synth.py` (104 lines, the synthetic ground truth site generator and pairwise
56
- precision/recall scorer that produced every number below), `cli.py` (196 lines), and
57
- `integrations/frigate.py` (330 lines, a bridge that maps the open source Frigate NVR's own
58
- `frigate/events` MQTT stream into the same `TrackEvent` contract, so a real, already-deployed
59
- open source tracker can feed this engine without a bespoke adapter).
60
 
61
  ## Three gates, and why the third one is not decorative
62
 
63
  Our linker scores a candidate pairing on two things: transit time plausibility (the learned
64
  Gaussian prior over how long it takes to walk from camera *i* to camera *j*) and, when available,
65
  the `identity_ref` term. A natural design stops at two gates: score above a bar, and margin over
66
- the runner up above a bar. Concretely, in `_assign_new_track` (`linker.py`, lines 116-138), a
67
- probabilistic (non `identity_ref`) link requires the best score to clear `link_threshold` (0.5)
68
- *and* beat the runner up by `margin_threshold` (0.2).
69
-
70
- We measured what that natural, two-gate design actually gets you. **Margin alone gave 0.918 site
71
- precision**, because peaky Gaussian transit time scores produce a large margin even when the
72
- winner is the wrong person; a confident looking margin is not the same thing as a correct link.
73
- That gap, 8.2% of links wrong under a margin only design, is exactly the failure mode the
74
- asymmetry above says we cannot tolerate.
75
-
76
- So we added a third gate, a **uniqueness guard**: at most one candidate may sit above a lower
 
 
 
 
 
 
 
77
  plausibility bar, `plausible_threshold` (0.2), at all. If a second candidate is also plausible,
78
- at any margin, the link is refused outright rather than resolved by whichever score happened to
79
- be marginally higher; a new entity is created instead. A code comment in `linker.py` (line 68)
80
- records the effect of adding this gate as lifting site precision from 0.918 to 1.0; that specific
81
- ablation is a source-code statement we did not independently re-run this session (it would
82
- require disabling the guard and re-scoring against the same site), so we report it as an
83
- attributed claim from the code rather than a number we personally reproduced. One clarification
84
- in the same honest spirit: the words "refuse" or "refusal" appear in this repository's own
85
- prose, not as a literal function or string named `refusal_gate` in the source; the mechanism is
86
- real and load-bearing, it is exactly what the code does, but there is no API literally called
87
- that.
88
 
89
  | configuration | site precision | recall |
90
  |---|---:|---:|
91
  | margin only | 0.918 | higher, not separately reported |
92
  | plus uniqueness guard | **1.0** (measured across 24 sites) | 0.0476 to 0.6788, scaling with reference coverage and camera count (grid below) |
93
 
94
- ## The headline evidence: a 24 site grid, not one lucky seed
95
 
96
  A single demo run is a good walkthrough but a thin evidence base on its own. We scored the same
97
  linker, unchanged, against a 24 site synthetic benchmark suite spanning 3 to 8 cameras, 20 to 100
98
  people per site, and 20% to 60% external identity reference coverage, 165,902 events total. The
99
  full per site output is published as
100
- [`linking_report.json`](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark),
101
- and we downloaded and re-read it directly for this post rather than quoting a cached number:
 
102
 
103
  | result | value |
104
  |---|---:|
105
  | sites scored | 24 |
106
  | total events | 165,902 |
107
  | precision, every single site | **1.0000** (zero false merges anywhere in the grid) |
108
- | recall, full range across sites | 0.0476 to 0.6788 |
109
- | recall by reference coverage (mean) | 20%: 0.2008 · 40%: 0.3904 · 50%: 0.4490 · 60%: 0.6044 |
110
- | recall by camera count (mean) | 3 cam: 0.3606 · 4 cam: 0.3990 · 5 cam: 0.3998 · 6 cam: 0.4016 · 7 cam: 0.4292 · 8 cam: 0.4767 |
111
 
112
  Precision does not move: it is exactly 1.0000 on all 24 sites, so the uniqueness guard refuses
113
  every ambiguous pairing regardless of how sparse the reference coverage or how many cameras are
114
  in play. Recall is the variable the design deliberately trades away, and it moves exactly where
115
- the mechanism predicts it should: more reference coverage gives the transit time prior more
116
- ref-confirmed links to learn from, so mean recall climbs from 0.2008 at 20% coverage to 0.6044 at
117
- 60% coverage; more cameras give the linker more transit legs to score, so mean recall climbs from
118
- 0.3606 at 3 cameras to 0.4767 at 8 cameras. This is the precision-first design working as
119
- intended, not a limitation we are hiding: recall is the dial, coverage and topology turn it, and
120
- we would rather report the honestly low end of that range than round it up.
121
-
122
- For one seed unpacked in full detail, not just the aggregate: on the committed synthetic demo
123
- (`seed=1`, the four camera site, 20 people, 40% carrying an external identity reference, one
124
- configuration distinct from the 24 site grid above and run separately), we reproduced the full
125
- pipeline ourselves this session with `PYTHONPATH=src python -m fleetmind.cli demo --seed 1`:
126
 
127
  | metric | value |
128
  |---|---:|
@@ -135,89 +146,207 @@ pipeline ourselves this session with `PYTHONPATH=src python -m fleetmind.cli dem
135
  | entities in memory | 46 |
136
  | episodes in memory | 61 |
137
  | active links | 61 |
138
- | relations (co-presence) | 58 |
139
  | memory store size | 61,440 bytes (60.0 KB) |
140
 
141
- We traded recall to buy zero error linking, and we report both halves of that trade rather than
142
- only the number that looks good. A regression gate lives in the test suite,
143
- `test_site_linking_precision_over_recall`, asserting precision `>= 0.95` and recall `>= 0.35` on
144
- this same synthetic site, so a future change that quietly eroded either bound would fail CI, not
145
- just this blog post.
146
-
147
- While reproducing these numbers we also found two small discrepancies between this repository's
148
- own README prose and a fresh run against the same fixed seed: the README states memory size as
149
- "61 KB" (measured: 61,440 bytes, which is exactly 60.0 KB) and states the `cam0 -> cam1` journey
150
- transit range as "40 to 54 s" (this session's run produced 37.85 s, 42.85 s, and 53.65 s, i.e. a
151
- 37.85 to 53.65 s range). Both read the same code path and the same fixed seed, so the most likely
152
- explanation is stale prose from an earlier run rather than nondeterminism, since precision,
153
- recall, and pair counts all matched exactly. We are noting it here rather than quietly rounding
154
- the earlier post to match; treat the table above as the currently-verified numbers.
155
-
156
- ## Bounded memory: weeks of presence in kilobytes
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
 
158
  A tracker that remembers everyone forever is a memory leak with a user interface. Our store
159
- prunes daily and keeps the footprint bounded by construction, not by luck. Two measured facts:
 
 
 
 
 
 
160
 
161
- - The entire synthetic site's memory (entities, episodes, links, and relations together) fits
162
- in **61,440 bytes**: 46 entities and 61 episodes for the seed 1 demo, measured directly this
163
- session.
164
- - A regression test, `test_month_of_events_stays_byte_bounded`, drives a *simulated month* of
165
- per second presence (20 visits per day, 60 events per visit, three cameras) through daily
166
- pruning and asserts the result stays **under 2 megabytes**. We read this assertion directly in
167
- the test source; we did not personally re-run the month-long simulation this session, since the
168
- regression suite already exercises it on every CI run.
169
 
170
- Weeks scale memory that fits in single digit megabytes is what makes this deployable on an edge
171
- box instead of a data center, and it is a property we verify with a test, not a claim we assert
172
- in a README.
 
 
 
 
 
173
 
174
  ## Provenance, not vibes
175
 
176
- Every answer the memory returns carries the episode IDs behind it, so a statement like
177
- "`ent_60f555e8b279` was last seen on cam3 at t=387 (episode 31)" is traceable to the exact
178
- observations that support it. Concretely, in `queries.py`: `where_is` attaches
179
- `"provenance": {"episode_id": ...}` (line 23), `history` attaches a list of `episode_ids`
180
- (line 34), `who_was_at` attaches per-entity episode lists (line 46), and `journeys` attaches
181
- `{"from_episode": ..., "to_episode": ...}` (line 66). The module's own docstring states the
182
- principle directly: "An answer without provenance is an assertion; these are receipts." A
183
- journey query, for example cam0 to cam1, returns the real transit times it recovered for that
184
- pair, each tagged with its episode: on the seed 1 demo it recovered three such journeys, at 37.85
185
- seconds, 42.85 seconds, and 53.65 seconds, each one attributable to a specific entity and episode
186
- rather than a bare aggregate number.
187
 
188
  ```
189
  journey(cam0 -> cam1):
190
- ent_51e21bf65c9b 37.85s (episode ...)
191
- ent_fe2c6229be0b 42.85s (episode ...)
192
- ent_60f555e8b279 53.65s (episode ...)
193
  ```
194
 
195
  `summarize` can optionally narrate an answer through a local LLM (qwen3.5 via Ollama's native
196
  `/api/chat`), but the docstring and the CLI wiring are both explicit that the model only
197
  rephrases an answer already computed by the query functions; it is never a source of facts, and
198
- it can be turned off entirely without changing a single number the query layer returns.
199
 
200
  ## Test suite
201
 
202
- Two test files, run this session with `python -m pytest tests/ -v`. Verbatim final line:
203
 
204
  ```
205
- 34 passed in 4.74s
206
  ```
207
 
208
- Dependencies for the test run: `numpy`, `pytest` (both declared in `pyproject.toml`); the
209
- optional `frigate` extra (`paho-mqtt`) is not required, the Frigate integration's own tests
210
- exercise the "no MQTT client installed" fallback path explicitly. The repository's own README
211
- states "13 tests green" for `tests/test_fleetmind.py` alone; this session counted 14 tests in
212
- that file (34 total across both files), so the README's own count is one test stale relative to
213
- this clone. We flag it rather than let a stale README number sit uncorrected next to a freshly
214
- reproduced one.
215
 
216
  ## What running it looks like
217
 
218
- The repository is proprietary and not publicly clonable; the commands below are the exact install
219
- and run sequence used to produce every number in this post, included for transparency about how
220
- the numbers were produced, not as a public installation guide.
221
 
222
  ```bash
223
  # proprietary repository, shown for reproducibility context only
@@ -225,46 +354,43 @@ cd multicam-reasoning-memory
225
  python -m venv .venv && source .venv/bin/activate
226
  pip install -e ".[dev]"
227
 
228
- # Run the test suite
229
- pytest tests/ -q
230
 
231
- # Run the synthetic end-to-end demo (ingest + scored linking + sample queries)
232
  PYTHONPATH=src python -m fleetmind.cli demo --seed 1
233
 
234
- # Ingest a real JSONL event stream and query the resulting memory
235
- fleetmind ingest --events events.jsonl --memory site.db
236
- fleetmind query where-is --memory site.db --entity ent_abc123
237
- fleetmind query journeys --memory site.db --from-camera cam0 --to-camera cam1
238
  ```
239
 
240
- Machine this session's numbers were measured on: macOS, Python 3.12.13, CPU only, fresh
241
- virtualenv, `numpy` plus stdlib `sqlite3` only, no GPU and no external services running.
242
-
243
- ## What we have NOT done yet
244
-
245
- This is validated on **synthetic** sites with exact ground truth, 24 of them spanning 3 to 8
246
- cameras. We have written the adapters to score against public multi target multi camera datasets
247
- (AI City, WILDTRACK); the scoring reduces any such dataset to "person to camera:track" pairs, the
248
- same reduction our own ground truth already uses, but those benchmark runs are **not yet done**.
249
- We will publish them when they are, including whatever the uniqueness guard costs in recall on
250
- real data, which may differ meaningfully from the 0.0476 to 0.6788 range measured across our 24
251
- site synthetic grid. If it costs more recall on real data, we will say so; the whole point of
252
- measuring rather than asserting is that we do not get to pick which half of the result we
253
- publish.
254
-
255
- A few more limitations worth stating plainly, drawn directly from the code and its docs:
256
-
257
- - Timestamps are assumed clock aligned (NTP) across cameras; there is no per camera clock offset
258
- estimation yet.
259
- - `position_m` is stored as provenance only; the linker does not use spatial position at all,
260
- only per camera-pair transit time.
261
- - No demo assets (images, GIFs, notebooks) exist in the repository itself; the linked HF Space is
262
- the closest thing to a visual demo.
263
- - No model weights ship with this repository, and none are needed; this is an algorithmic
264
- engine, not a neural model, so there is nothing to publish to a model hub for this product.
265
-
266
- - Dataset: [multicam-reasoning-memory-benchmark](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark)
267
  - Live demo: [multicam-reasoning-memory-demo](https://huggingface.co/spaces/Dhi-Technologies/multicam-reasoning-memory-demo)
268
- - Code: proprietary, closed source permanently; not a publicly browsable repository. Partnership
269
  or access inquiries: [dhi-tech.com](https://dhi-tech.com).
270
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 3, A4 calibration](03_a4_calibration_over_accuracy.md), [post 4, portfolio overview](04_portfolio_overview.md), [post 5, Prompt2Model v0.1.0](05_prompt2model_v010.md)
 
7
  person, and it has to do that thousands of times a day, for weeks, without its memory
8
  exploding or its identities quietly corrupting. This post is a deep dive into how our
9
  multicam reasoning memory product (E1, package name `fleetmind`) makes that decision, what
10
+ it costs, what it is built from, and, new since the last revision of this post, how it behaved
11
+ the first time we ran it against real data: the WILDTRACK seven camera dataset, both as a
12
+ ground truth replay and behind a real YOLO11n plus ByteTrack detection pipeline.
13
 
14
  The design principle we started from is asymmetric on purpose:
15
 
 
36
  identity. When present, linking is exact. When absent, the engine has to earn the link itself
37
  from timing alone, which is the harder and more interesting case below. Only `t`, `camera_id`,
38
  and `track_id` are actually required; `position_m` is stored for provenance only and, notably,
39
+ the linker itself does not use spatial position, only per camera pair transit time.
40
 
41
  The library is small on purpose and has no third party dependency beyond `numpy`: 9 Python
42
  files, 1,290 lines total (`wc -l` across `src/fleetmind/*.py` and
 
44
  logic:
45
 
46
  - `memory.py` (303 lines): `MemoryStore`, SQLite in WAL mode. Raw events never persist; each one
47
+ extends an *episode*, one row per entity per camera per contiguous presence span, so storage is
48
  `O(entities + episodes + links)`, not `O(events)`. A retention policy (`prune`) ages episodes
49
+ out by day and deactivates links for entities with nothing left. The distinction matters more
50
+ than it sounds: a camera watching a person for one minute at 1 Hz produces 60 events and
51
+ exactly one episode row, so the store's growth rate is set by how many *visits* happen, not by
52
+ frame rate.
53
  - `linker.py` (179 lines): `CrossCameraLinker`, `TransitPrior`, `LinkerConfig`. An `identity_ref`
54
+ match is exact; otherwise a candidate is scored by a per camera pair Gaussian transit time
55
+ prior, learned online (Welford's algorithm for streaming mean and variance) **only from
56
+ ref confirmed links, never from the linker's own probabilistic guesses**. That restriction is
57
+ load bearing: a prior that learned from its own guesses would drift toward whatever it already
58
+ believed, and a wrong early link would teach the prior to make more of them. A camera pair
59
+ with no ref confirmed samples yet returns a flat, uninformative likelihood of 0.3 to every
60
+ candidate, which matters in the WILDTRACK diagnosis below.
61
  - `queries.py` (97 lines): `where_is`, `history`, `who_was_at`, `journeys`, `co_occurrences`,
62
  `summarize`.
63
 
64
  Supporting modules: `synth.py` (104 lines, the synthetic ground truth site generator and pairwise
65
+ precision/recall scorer that produced every synthetic number below), `cli.py` (196 lines), and
66
+ `integrations/frigate.py` (330 lines, covered in its own section below).
 
 
67
 
68
  ## Three gates, and why the third one is not decorative
69
 
70
  Our linker scores a candidate pairing on two things: transit time plausibility (the learned
71
  Gaussian prior over how long it takes to walk from camera *i* to camera *j*) and, when available,
72
  the `identity_ref` term. A natural design stops at two gates: score above a bar, and margin over
73
+ the runner up above a bar. Concretely, in `_assign_new_track` (`linker.py`), a probabilistic
74
+ (non `identity_ref`) link requires the best score to clear `link_threshold` (0.5) *and* beat the
75
+ runner up by `margin_threshold` (0.2).
76
+
77
+ We measured what that natural, two gate design actually gets you. **Margin alone gave 0.918 site
78
+ precision.** The failure mechanism is worth spelling out, because it is the counterintuitive
79
+ heart of the design. Gaussian transit time scores are *peaky*: near the prior's mean they are
80
+ high and fall off fast. So when two people leave camera A about 20 seconds apart and one arrival
81
+ appears at camera B at a prior consistent time, both are genuinely plausible, but whichever one
82
+ happens to sit closer to the prior mean scores far above the other. The margin gate sees a big
83
+ margin and reads it as confidence. It is not confidence; it is the shape of a Gaussian. The
84
+ winner is the wrong person often enough to put roughly one link in twelve silently wrong, which
85
+ is exactly the failure the asymmetry above says we cannot tolerate. The linker's own code
86
+ comment records the mechanism: any second candidate above a plausibility floor makes the arrival
87
+ ambiguous, no link, full stop, because margin alone is not ambiguity when Gaussian scores are
88
+ peaky and two travelers 20 seconds apart can produce a large margin with the wrong winner.
89
+
90
+ So there is a third gate, a **uniqueness guard**: at most one candidate may sit above a lower
91
  plausibility bar, `plausible_threshold` (0.2), at all. If a second candidate is also plausible,
92
+ at any margin, the link is refused outright and a new entity is created instead. The test suite
93
+ pins the exact scenario: two ref less people leave cam0 at t=5000.0 and t=5002.0, one arrival
94
+ appears at cam1 at t=5046.0 at a prior consistent transit; the correct behavior, asserted by
95
+ `test_ambiguity_prefers_no_link`, is a new entity, not a coin flip link. One clarification in
96
+ the honest spirit of this series: "refusal gate" is our prose name for this mechanism, not a
97
+ literal identifier in the source; the mechanism is real and load bearing, but there is no
98
+ function named `refusal_gate`.
 
 
 
99
 
100
  | configuration | site precision | recall |
101
  |---|---:|---:|
102
  | margin only | 0.918 | higher, not separately reported |
103
  | plus uniqueness guard | **1.0** (measured across 24 sites) | 0.0476 to 0.6788, scaling with reference coverage and camera count (grid below) |
104
 
105
+ ## The synthetic evidence: a 24 site grid, not one lucky seed
106
 
107
  A single demo run is a good walkthrough but a thin evidence base on its own. We scored the same
108
  linker, unchanged, against a 24 site synthetic benchmark suite spanning 3 to 8 cameras, 20 to 100
109
  people per site, and 20% to 60% external identity reference coverage, 165,902 events total. The
110
  full per site output is published as
111
+ [`linking_report.json`](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark)
112
+ on the benchmark dataset, and we downloaded and recomputed its aggregates directly for this
113
+ revision rather than quoting a cached number:
114
 
115
  | result | value |
116
  |---|---:|
117
  | sites scored | 24 |
118
  | total events | 165,902 |
119
  | precision, every single site | **1.0000** (zero false merges anywhere in the grid) |
120
+ | recall, full range across sites | 0.0476 to 0.6788 (mean 0.4112) |
121
+ | recall by reference coverage (mean) | 20%: 0.2008, 40%: 0.3904, 50%: 0.4490, 60%: 0.6044 |
122
+ | recall by camera count (mean) | 3 cam: 0.3606, 4 cam: 0.3990, 5 cam: 0.3998, 6 cam: 0.4016, 7 cam: 0.4292, 8 cam: 0.4767 |
123
 
124
  Precision does not move: it is exactly 1.0000 on all 24 sites, so the uniqueness guard refuses
125
  every ambiguous pairing regardless of how sparse the reference coverage or how many cameras are
126
  in play. Recall is the variable the design deliberately trades away, and it moves exactly where
127
+ the mechanism predicts: more reference coverage gives the transit prior more ref confirmed links
128
+ to learn from, so mean recall climbs from 0.2008 at 20% coverage to 0.6044 at 60%; more cameras
129
+ give the linker more transit legs to score, so mean recall climbs from 0.3606 at 3 cameras to
130
+ 0.4767 at 8. Recall is the dial; coverage and topology turn it; and we report the honestly low
131
+ end of the range instead of rounding it up.
132
+
133
+ For one seed unpacked in full detail: on the committed synthetic demo (`seed=1`, a four camera
134
+ site, 20 people, 40% carrying an external identity reference, a configuration distinct from the
135
+ 24 site grid and run separately), we reproduced the full pipeline again this session with
136
+ `PYTHONPATH=src python -m fleetmind.cli demo --seed 1`:
 
137
 
138
  | metric | value |
139
  |---|---:|
 
146
  | entities in memory | 46 |
147
  | episodes in memory | 61 |
148
  | active links | 61 |
149
+ | relations (co presence) | 58 |
150
  | memory store size | 61,440 bytes (60.0 KB) |
151
 
152
+ A regression gate lives in the test suite, `test_site_linking_precision_over_recall`, asserting
153
+ precision `>= 0.95` and recall `>= 0.35` on this same synthetic site, so a future change that
154
+ quietly eroded either bound would fail CI, not just this blog post.
155
+
156
+ While reproducing these numbers on an earlier pass we also found two small discrepancies between
157
+ the repository's own README prose and a fresh run against the same fixed seed: the README stated
158
+ memory size as "61 KB" (measured: 61,440 bytes, which is exactly 60.0 KB) and stated the
159
+ `cam0 -> cam1` journey transit range as "40 to 54 s" (fresh runs produce 37.85 s, 42.85 s, and
160
+ 53.65 s). Both have since been corrected in the repository, and we note the history here rather
161
+ than pretending the prose was always right; precision, recall, and pair counts matched exactly
162
+ throughout, so the explanation was stale prose from an earlier run, not nondeterminism.
163
+
164
+ ## First contact with real data: WILDTRACK, two ways
165
+
166
+ Everything above is synthetic, with exact ground truth. This section is what happened when the
167
+ same engine, unchanged, met WILDTRACK: seven overlapping HD cameras watching one university
168
+ courtyard, 400 annotated frames at 2 fps (200 seconds), 313 unique people, person level bounding
169
+ boxes per view. The evaluation ran as two legs feeding the same `fleetmind ingest` plus
170
+ `fleetmind score` CLI and the same pairwise metric as the synthetic benchmark, so every row is
171
+ directly comparable. We re ran the ingest and scoring stages of all four conditions ourselves,
172
+ on CPU, from the converted event streams, and the numbers below are from those fresh runs; the
173
+ GPU detector and tracker pass in leg 2 is attributed to the product's evidence log, which
174
+ commits the tracker outputs it produced.
175
+
176
+ - **Leg 1, ground truth replay.** Per camera track segments are derived from WILDTRACK's own
177
+ annotation visibility runs; no detector, no GPU. This isolates the linker: perfect tracks in,
178
+ linking quality out.
179
+ - **Leg 2, real pipeline.** Ultralytics YOLO11n plus ByteTrack, person class only, confidence
180
+ 0.25, run on a rented RTX 5060 Ti over all 2,807 frames (401 per camera, about 16.6 fps
181
+ processing rate). fleetmind ingests the real tracker's output, fragmentation, false positives
182
+ and all; ground truth is used only afterward, to label tracks for scoring.
183
+
184
+ Getting the data was its own small engineering story, and since the whole point of this series
185
+ is showing work, here it is. The official download is gated behind a form, but the archive it
186
+ points to serves over plain HTTPS with Range request support, and the same 6.8 GB file is
187
+ mirrored publicly on Hugging Face. We only needed the 13 MB of annotation JSON plus, for leg 2,
188
+ the camera frames, so the evidence tooling reads the zip central directory remotely and fetches
189
+ individual entries by byte range instead of downloading 6.8 GB. Doing that surfaced a real bug:
190
+ Python's `zipfile` machinery computes a spurious "prepended data" offset of exactly 2 to the
191
+ power 32 for this archive, so every entry whose true offset is below 4 GB reports a header
192
+ offset exactly 4,294,967,296 bytes too high, while entries above 4 GB (whose offsets live in
193
+ zip64 extra fields) report correctly. Confirmed empirically: the first annotation JSON reports
194
+ offset 4,294,968,051 but its local header magic sits at byte 755. The workaround probes both the
195
+ reported offset and the reported offset minus 2 to the power 32, then inflates the raw deflate
196
+ stream directly. All 400 annotation files round tripped as valid JSON, with an md5 over the
197
+ sorted concatenation recorded in the evidence log.
198
+
199
+ Conversion was designed to avoid the obvious leak: `track_id` is built from per camera
200
+ *visibility runs*, not from the ground truth person ID, because a real tracker does not know
201
+ person IDs. For each person and view, visible frames are split into a new track segment whenever
202
+ the gap exceeds 3.0 seconds; the threshold is empirical (annotation flicker gaps of 0.5 to 3.5 s
203
+ are common, longer gaps are rare real departures) and the result is insensitive to it (1.5 s
204
+ gives 1,693 segments, 3.0 s gives 1,663, 5.0 s gives 1,653, against a floor of 1,639 if you
205
+ never split). In the refs=40% condition, 125 of 313 people (seed 42) carry an opaque
206
+ `pid:<personID>` reference on their events, mirroring how a real deployment would attach a
207
+ plate, badge, or embedding cluster id; the person ID never appears anywhere else.
208
+
209
+ The results, all four conditions, reproduced this session on CPU:
210
+
211
+ | run | precision | recall | true pairs | linked pairs | wrong links |
212
+ |---|---:|---:|---:|---:|---:|
213
+ | synthetic seed 1 baseline (non overlapping 4 cam chain, refs 40%) | 1.0 | 0.3768 | 69 | 26 | 0 |
214
+ | WILDTRACK ground truth replay, refs 0% | 1.0 | 0.0 | 3,903 | 0 | 0 |
215
+ | WILDTRACK ground truth replay, refs 40% | 1.0 | 0.4087 | 3,903 | 1,595 | 0 |
216
+ | WILDTRACK real tracker (YOLO11n + ByteTrack), refs 0% | 1.0 | 0.0 | 4,366 | 0 | 0 |
217
+ | WILDTRACK real tracker (YOLO11n + ByteTrack), refs 40% | 1.0 | 0.3502 | 4,366 | 1,529 | 0 |
218
+
219
+ **Precision is 1.0 with zero wrong links in every condition.** That includes the leg 2 stream,
220
+ which is deliberately hostile: the 2 fps frame spacing fragments tracks heavily (1,373 track
221
+ segments total, of which 993 matched to 253 real people), and the other 380 tracks (28 percent)
222
+ matched no ground truth person at all, false positives and reflections kept in the stream as
223
+ distractors,
224
+ where linking any of them to anything would have counted against precision. The design promise,
225
+ no link beats a wrong link, held under 313 real people and up to 1,023 simultaneous link
226
+ candidates per arrival.
227
+
228
+ **And recall without references is exactly zero, in both legs.** We are publishing that as
229
+ prominently as the precision, because it is the honest boundary of the current design, and the
230
+ diagnosis is more useful than the number. The linker's world model is sequential: a candidate
231
+ must have a *closed* episode on another camera before the new track's arrival, because the model
232
+ of the world is "a person leaves camera A, then later arrives at camera B." WILDTRACK's seven
233
+ cameras all overlap on one courtyard, so people are visible on several cameras at once, and
234
+ "transits" between cameras are mostly zero lag co visibility, not walks. Measured, not guessed:
235
+ in the refs 0% replay, 155 of 1,663 new track decisions had no candidates at all, and the rest
236
+ saw hundreds of simultaneous candidates, every one scoring the flat unlearned prior likelihood
237
+ of 0.3, so the uniqueness guard refused them all; with no references, no transit prior was ever
238
+ learned. In the refs 40% replay, only 2 of 42 camera pairs ever accumulated a ref confirmed
239
+ transit sample, with means of 0.5 to 1.8 seconds, which is cross view jitter, not walking time.
240
+ In the leg 2 stream, 29 camera pairs learned priors (fragmented tracker tracks re link via
241
+ references constantly), but every learned mean is 0.5 to 9.5 seconds of overlap jitter, and the
242
+ crowded candidate field kept the guard closed: the decision mix was 1,003 new, 269 ref link, 101
243
+ ref new, and **zero prior link**. This is the refusal design working as specified in a topology
244
+ it was not built for: it would rather link nothing than guess among hundreds of simultaneous
245
+ candidates.
246
+
247
+ Two scoring subtleties, stated before anyone quotes these numbers. First, all WILDTRACK recall
248
+ is 100 percent reference driven; the transit prior mechanism contributed zero links, so this
249
+ eval validates the exact match path, the refusal behavior under extreme candidate pressure, and
250
+ the full CLI path on real tracker output, but it does **not** validate the transit prior
251
+ learning that the synthetic grid measures. A fair prior path real data eval needs a genuinely
252
+ non overlapping camera topology, such as an AI City MTMC subset, and is still ahead of us.
253
+ Second, in leg 2 the reference labels and the truth mapping both derive from the same IoU
254
+ matching, so they simulate a *perfect* external identity source; leg 2 precision on ref links is
255
+ partly correct by construction, and the leg 2 refs 40% recall (0.3502) lands below the sampled
256
+ reference fraction (0.399) because fragmented tracks of ref less people contribute many
257
+ unrecoverable pairs.
258
+
259
+ ## The Frigate bridge: meeting a real NVR's data where it is
260
+
261
+ `integrations/frigate.py` (330 lines) maps the open source Frigate NVR's `frigate/events` MQTT
262
+ stream into the same `TrackEvent` contract, so a tracker that thousands of people already run at
263
+ home and at small sites can feed this engine without a bespoke adapter. The interesting design
264
+ decision is how it populates `identity_ref`, because that field is the engine's only integration
265
+ surface and, per the asymmetry above, a *wrong* reference is the most expensive input the system
266
+ can receive: references link exactly, so a bad one causes precisely the false merge the three
267
+ gates exist to prevent.
268
+
269
+ Frigate attaches recognition results to its events in two places: a recognized license plate
270
+ (with its own score field) and a `sub_label`, whose documented shape is a `[name, score]` pair
271
+ (a face recognition hit, for example). The bridge applies a confidence gate to both:
272
+ `DEFAULT_MIN_IDENTITY_SCORE = 0.5`. A plate or sub label whose score falls below the gate is
273
+ dropped entirely, and the track falls back to probabilistic transit prior linking as if no
274
+ recognition had happened. The rationale is the same asymmetry once more: a below threshold
275
+ identity is worse than no identity, because the exact match path trusts it completely. When both
276
+ a plate and a sub label are present, the plate wins for vehicle labels, since the plate is the
277
+ thing Frigate actually recognized about the vehicle; plates are normalized (uppercased,
278
+ whitespace stripped) into `plate:<TEXT>` and sub labels become `face:<name>`. And if the score
279
+ field is absent, the reference passes through, which is a documented trust decision about
280
+ Frigate's own defaults rather than an accident. The integration's tests exercise the
281
+ no MQTT client fallback path explicitly, so the optional `paho-mqtt` dependency stays optional.
282
+
283
+ ## Bounded memory: a month of presence under 2 MB, asserted
284
 
285
  A tracker that remembers everyone forever is a memory leak with a user interface. Our store
286
+ prunes daily and keeps its footprint bounded by construction, and the bound is enforced by a
287
+ test, not asserted in a README. `test_month_of_events_stays_byte_bounded` simulates a month of
288
+ continuous per second presence: 30 days, 20 visits per day, 60 events per visit at 1 Hz, across
289
+ 3 cameras, which is 36,000 events through the ingest path, with `prune` applied daily at 7 day
290
+ retention. The test then asserts two literals: the episode count stays at or below 480 (20
291
+ visits times 3 cameras times about 8 retained days) and the database file stays strictly under
292
+ `2_000_000` bytes. We re ran exactly that test in isolation this session; verbatim:
293
 
294
+ ```
295
+ 1 passed, 33 deselected in 2.67s
296
+ ```
 
 
 
 
 
297
 
298
+ The mechanism is the episode aggregation described earlier: 36,000 events collapse into one
299
+ episode row per visit per camera, and pruning ages out whole days. For scale, the entire seed 1
300
+ demo site, entities, episodes, links, and relations together, fits in 61,440 bytes; the
301
+ WILDTRACK ground truth replay, 42,707 events from 313 people across 7 cameras, lands at
302
+ 7,405,568 bytes before any pruning. Weeks scale memory in megabytes is what makes this
303
+ deployable on a small box rather than a data center, and it is a measured property, not a
304
+ projection. (That is a statement about the engine's measured footprint, not a claim that any
305
+ particular deployment exists; no deployment claims are made anywhere in this series.)
306
 
307
  ## Provenance, not vibes
308
 
309
+ Every answer the memory returns carries the episode IDs behind it. Concretely, in `queries.py`:
310
+ `where_is` attaches `"provenance": {"episode_id": ...}`, `history` attaches a list of
311
+ `episode_ids`, `who_was_at` attaches per entity episode lists, and `journeys` attaches
312
+ `{"from_episode": ..., "to_episode": ...}`. The module's own docstring states the principle
313
+ directly: "An answer without provenance is an assertion; these are receipts." This session's
314
+ fresh demo run answered a where is query with "ent_9d0d3c5133e6 was last seen on cam3 at t=387
315
+ (episode 31)", episode id included, and a journeys query for cam0 to cam1 returned the three
316
+ actual transit times it recovered, 37.85 s, 42.85 s, and 53.65 s, each tagged to a specific
317
+ entity and episode rather than collapsed into an average:
 
 
318
 
319
  ```
320
  journey(cam0 -> cam1):
321
+ ent_580c7b77bfe5 37.85s (episode ...)
322
+ ent_9d0d3c5133e6 42.85s (episode ...)
323
+ ent_2b396d770e67 53.65s (episode ...)
324
  ```
325
 
326
  `summarize` can optionally narrate an answer through a local LLM (qwen3.5 via Ollama's native
327
  `/api/chat`), but the docstring and the CLI wiring are both explicit that the model only
328
  rephrases an answer already computed by the query functions; it is never a source of facts, and
329
+ turning it off changes no number the query layer returns.
330
 
331
  ## Test suite
332
 
333
+ Two test files, re run this session. Verbatim final line:
334
 
335
  ```
336
+ 34 passed in 4.33s
337
  ```
338
 
339
+ Dependencies for the test run: `numpy` and `pytest` (both declared in `pyproject.toml`); the
340
+ optional `frigate` extra (`paho-mqtt`) is not required. An earlier revision of this post flagged
341
+ that the repository's README said "13 tests green" for one file while a fresh count found 14;
342
+ that count has since been corrected in the repository, and we keep the note here as part of the
343
+ record rather than silently retiring it.
 
 
344
 
345
  ## What running it looks like
346
 
347
+ The repository is proprietary and not publicly clonable; the commands below are the exact
348
+ sequence used to produce the numbers in this post, included for transparency about how the
349
+ numbers were produced, not as an installation guide.
350
 
351
  ```bash
352
  # proprietary repository, shown for reproducibility context only
 
354
  python -m venv .venv && source .venv/bin/activate
355
  pip install -e ".[dev]"
356
 
357
+ # Test suite
358
+ pytest tests/
359
 
360
+ # Synthetic end to end demo (ingest + scored linking + sample queries)
361
  PYTHONPATH=src python -m fleetmind.cli demo --seed 1
362
 
363
+ # WILDTRACK evidence, ingest + score (any leg/condition)
364
+ PYTHONPATH=src python -m fleetmind.cli ingest --events evidence/wildtrack/events_refs40.jsonl --memory /tmp/wt.db
365
+ PYTHONPATH=src python -m fleetmind.cli score --memory /tmp/wt.db --truth evidence/wildtrack/truth.json
 
366
  ```
367
 
368
+ Machine for this session's CPU numbers: macOS, Python 3.12.13, fresh virtualenv, `numpy` plus
369
+ stdlib `sqlite3` only, no GPU. The leg 2 detector and tracker pass ran on a rented RTX 5060 Ti
370
+ (torch 2.12.0+cu130, ultralytics 8.4.90) and is attributed to the committed evidence log and its
371
+ committed tracker outputs.
372
+
373
+ ## What we have NOT done yet, and what the limits are
374
+
375
+ - **The transit prior path has no real data validation yet.** WILDTRACK's overlapping topology
376
+ structurally starves it (diagnosed above, zero prior links in all four conditions), so the
377
+ prior's synthetic grid numbers stand alone until a genuinely non overlapping real dataset,
378
+ such as an AI City MTMC subset with disjoint coverage, is run. If the uniqueness guard costs
379
+ more recall there than the 0.0476 to 0.6788 synthetic range suggests, we will publish that.
380
+ - **Timestamps are assumed clock aligned (NTP) across cameras.** There is no per camera clock
381
+ offset estimation yet; it is the documented v1 non feature and the natural upgrade, since it
382
+ would tighten transit priors without touching the linking logic. Until then, a site with
383
+ drifting camera clocks would silently widen or bias the learned priors.
384
+ - **Recall is deliberately partial, and scales with reference coverage.** Concurrent ref less
385
+ travelers at the same camera pair transit trip the uniqueness guard on purpose. A split costs
386
+ one duplicate entity row; a wrong merge costs weeks of poisoned history.
387
+ - `position_m` is stored as provenance only; the linker uses per camera pair transit time and
388
+ nothing spatial.
389
+ - No model weights ship with this product and none are needed; it is an algorithmic engine, so
390
+ there is nothing to publish to a model hub.
391
+
392
+ - Dataset (benchmark + per site grid report): [multicam-reasoning-memory-benchmark](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark)
 
 
393
  - Live demo: [multicam-reasoning-memory-demo](https://huggingface.co/spaces/Dhi-Technologies/multicam-reasoning-memory-demo)
394
+ - Code: proprietary, closed source; the open surface is the evidence quoted above. Partnership
395
  or access inquiries: [dhi-tech.com](https://dhi-tech.com).
396
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 3, A4 calibration](03_a4_calibration_over_accuracy.md), [post 4, portfolio overview](04_portfolio_overview.md), [post 5, Prompt2Model v0.1.0](05_prompt2model_v010.md)
03_a4_calibration_over_accuracy.md CHANGED
@@ -4,188 +4,256 @@
4
 
5
  Counting people through occlusion is the kind of problem where it is easy to publish a good
6
  looking accuracy number and quietly bury the uncertainty. We want to argue the opposite: for
7
- occluded counting, **the calibrated interval is the real deliverable, and the point estimate
8
- is almost a side effect.** This post walks through the method, the numbers, and the failure
9
- modes we found while building it, in the order we found them, including a real dataset result
10
- that at first made the method look worse, not better.
 
 
 
11
 
12
  ## What this is, and what it is not
13
 
14
  `amodal-counting` (package name `amodal`) is a library and CLI, not a hosted model: no detector
15
- is bundled and no weights ship in the repository. You bring your own box-output detector; this
16
- library corrects its count. It is not a claim of a universal win, and the evidence below
17
- includes a real, measured case where the correction did **not** beat naive counting, documented
18
- in detail rather than hidden. It is not deployed at any customer site, and no customer or
19
- deployment claim is made anywhere in this post.
 
20
 
21
  ## The setup
22
 
23
  A detector in a crowded scene systematically *undercounts*: it never reports the people it
24
- cannot see. The textbook fix is Horvitz Thompson estimation: weight each detection by
25
- 1 divided by p(detect given visibility), so a barely visible detection stands in for the
26
- several similar ones it represents. Visibility itself (`src/amodal/visibility.py`) is computed
27
- from box geometry alone, the fraction of a detection's box not covered by known occluders, not
28
- covered by other detections in front of it (bottom edge depth order: lower in frame is closer,
29
- the standard fixed camera convention), and not truncated by the image border. A missed occluding
30
- object can only ever make this estimate look *less* occluded than reality, so the bias runs one
31
- direction, down, which keeps the downstream correction conservative by construction. We fit the
32
- detectability curve itself from data (a logistic curve with parameters k and v0, refit per
33
- crowding level), and it carries its own calibrated support: a query outside the 2nd to 98th
34
- percentile range of visibilities actually seen during fitting is clamped to the boundary and the
35
- result is flagged `extrapolation_limited`, never silently extrapolated.
36
-
37
- The estimator (`src/amodal/estimator.py`) has three honesty gates in the code itself, not just in
38
- the docs: the corrected estimate can never drop below the raw detection count
39
  (`estimate = max(estimate, n_detected)`); every per detection weight is capped at `1 / min_p`
40
- (default `min_p=0.30`, a maximum weight of about 3.3x) so a single deep occlusion detection
41
  cannot conjure a crowd on its own; and any detection whose visibility fell outside the curve's
42
- calibrated support sets `extrapolation_limited=True` on the whole estimate.
43
-
44
- ## Finding 1: the point estimate helps, but modestly, and not always
45
-
46
- On our synthetic benchmark (160 scenes, 40 per crowding level, scored by
47
- `amodal.cli bench --seed 0`, calibrated on 60 training worlds and evaluated fresh on 40 held out
48
- worlds per crowding level, so nothing below is computed on data the calibration saw), correction
49
- lowers mean absolute error at every crowding level tested:
50
-
51
- | crowding | naive MAE | corrected MAE | 90% interval coverage (conformal, calibrated) |
52
- |---:|---:|---:|---:|
53
- | 0.0 | 2.8 | 2.4 | 0.90 |
54
- | 0.3 | 2.6 | 1.97 | 0.90 |
55
- | 0.6 | 2.85 | 2.34 | 0.975 |
56
- | 0.8 | 3.73 | 2.46 | 0.975 |
57
-
58
- We reproduced this table digit for digit this session by re-running the command in a clean
59
- virtual environment: `PYTHONPATH=.venv/bin/python -m amodal.cli bench --seed 0` against Python
60
- 3.12, dependencies `numpy` and `scipy` only.
61
-
62
- But here is the honest part we put in the dataset README, not an appendix: the correction is
63
- **not** a free lunch. Uncapped Horvitz Thompson weights (`min_p=0.1`, meaning no detection's
64
- weight is capped below a probability of 0.1) remove the undercount bias in principle, but at
65
- realistic scene sizes (about 12 objects per scene) the variance from a handful of near zero
66
- probability detections *swamps* the benefit: per scene MAE actually came out **worse than
67
- naive**, 2.89 versus 2.63, at crowding 0.6. That is a real regression, measured and kept in
68
- the record rather than tuned away quietly. A related regression: calibration must be done on
69
- *inference-aligned* visibility, computed the same way the deployed pipeline computes it, not on
70
- ground truth visibility. Skipping that step was measured to turn a helpful correction into a
71
- harmful one: MAE 3.13 versus a naive 2.63 at one crowding level.
72
-
73
- The `min_p` weight cap knob exists specifically because we measured that failure and had to
74
- tune against it. Sweeping the cap at crowding 0.6:
 
 
 
 
 
 
 
 
75
 
76
  | min_p | 0.1 | 0.2 | 0.3 | 0.4 |
77
  |---|---:|---:|---:|---:|
78
  | MAE | 2.89 | 2.21 | 1.71 | 1.52 |
79
 
80
- Raising the floor on how much weight any single detection can carry monotonically improved
81
- MAE across this sweep, at the cost of reintroducing some of the undercount bias the weighting
82
- was meant to remove; the value we ship is chosen from this measured tradeoff, not from taste.
83
- When a detector's recall collapses on a truly dense crowd, no reweighting saves you: you are
84
- extrapolating from detections that are not there, and the honest response is a wider interval,
85
- not a more aggressive point estimate.
86
-
87
- ## Finding 2: the interval is where the real value, and the real danger, lives
88
-
89
- The reason to care about the interval more than the point estimate: the naive analytic error
90
- bar is a **lie of overconfidence**. The textbook independent Bernoulli Horvitz Thompson
91
- variance formula measured **0.50 to 0.63 actual coverage against a claimed 0.90** on our
92
- benchmark. If you shipped that formula as is, you would be telling operators "90% sure" while
93
- being right barely half the time, which is arguably worse than reporting no interval at all,
94
- because it actively misleads.
95
-
96
- We do not hand tune the formula to fix this. We calibrate it conformally
97
- (`fit_interval_scale`, a standard split conformal procedure that runs inference over labeled
98
- calibration scenes, collects `|error| / sigma_raw` scores, and takes their finite sample
99
- quantile as a multiplier, `z_scale`, on the analytic sigma), and that multiplier lands in the
100
- **6.7x to 14.5x** range depending on crowding density. That number is the honest headline of the
101
- whole method: **the uncalibrated error bar was roughly an order of magnitude too tight.** After
102
- calibration, coverage meets or exceeds its 90% claim at every crowding level tested (0.90 at
103
- crowding 0.0 and 0.3, 0.975 at crowding 0.6 and 0.8), and never falls below its claim in this
104
- benchmark. An estimate only reports a calibrated coverage claim if its curve actually carries a
105
- fitted `z_scale`; otherwise the CLI marks `interval_calibrated: false` rather than implying a
106
- guarantee that was never measured.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
107
 
108
- ```
109
- crowding 0.0: analytic coverage ~0.50-0.63 -> conformal multiplier applied -> 0.90
110
- crowding 0.3: analytic coverage ~0.50-0.63 -> conformal multiplier applied -> 0.90
111
- crowding 0.6: analytic coverage ~0.50-0.63 -> conformal multiplier applied -> 0.975
112
- crowding 0.8: analytic coverage ~0.50-0.63 -> conformal multiplier applied -> 0.975
113
- ```
114
 
115
- ## Finding 3: what happened when we actually ran this on real photographs
116
-
117
- Everything above is synthetic. The repository's own evidence log,
118
- `evidence/a4_realdata/RESULTS.md`, documents a multi stage external re-test on CrowdHuman
119
- validation data: a SAHI tiled YOLOv8s detector, person class, 270 images, 6,809 ground truth
120
- boxes, run on external GPU hardware. We are attributing these numbers to that evidence file, not
121
- independently re-running them in this post, because reproducing them needs a GPU,
122
- `ultralytics`/`sahi`, and the CrowdHuman dataset, none of which this drafting pass had access to.
123
-
124
- The honest headline: **the one directional correction did not beat naive counting on real
125
- data.** Naive MAE was 11.767; the corrected estimate came in worse, at 22.475 for the single
126
- feature detectability curve and 28.228 for the multivariate variant, with interval coverage
127
- collapsing to about 39 to 41% against the 90% target, the opposite of the synthetic result above.
128
- The evidence trail's own diagnosis: the geometric visibility signal alone was a weak predictor of
129
- real misses on this detector (the fitted detectability curve came out nearly flat), because this
130
- detector's real error was a comparable *two sided* mix of genuine occlusion undercount and
131
- tiling driven overcount (an artifact of SAHI's sliding-window tiling), which a one directional,
132
- weight only correction cannot fix by construction, no matter how well calibrated.
133
-
134
- The fix that did work adds a second fitted model, `p_true` (the probability a detection is a real
135
- object rather than a duplicate or tiling artifact, from confidence, scale, local density, and
136
- tile seam proximity), and reweights each detection by `p_true / p_detect` instead of `1 / p_detect`
137
- alone. That two sided estimator is the first variant in the evidence trail to beat naive on this
138
- real dataset: MAE improved from 11.767 to 11.031, and coverage reached 90.67% against the 90%
139
- target. It comes at a deliberate cost: the two sided estimator drops the never-below-raw-count
140
- honesty floor by design, documented as an intentional, narrow relaxation once a detection can
141
- itself be spurious rather than merely hidden. And even this improved variant is disclosed as
142
- incomplete on the hardest cases: on the 20 single densest scenes in the same evidence log (up to
143
- 227 true people counted from as few as 20 to 30 raw detections), naive counting remains better,
144
- and the estimator's own coverage flag correctly drops to 50%, signaling extrapolation rather than
145
- silently failing. We are publishing the regression alongside the fix, and the fix's own remaining
146
- weak spot, because that is the entire point of measuring instead of asserting.
147
 
148
  ## Test suite
149
 
150
  `tests/test_core.py` (37 test functions) and `tests/test_temporal_bench_cli.py` (9 test
151
- functions), 46 test functions total, counted directly with `grep -c "^def test_"`. Command run
152
- this session: `PYTHONPATH=src python -m pytest tests/ -q`. Verbatim final line:
153
 
154
  ```
155
- 46 passed in 12.76s
156
  ```
157
 
158
- ## A fifth mechanism: occlusion persistence over time
159
-
160
- Beyond the per-frame estimator, `src/amodal/temporal.py`'s `PersistentCounter` treats a tracked
161
- object that vanishes mid frame, away from any exit region, as probably occluded rather than gone,
162
- with a survival probability that decays over hidden time. The decay half life is fit from
163
- observed reappearance gap statistics (`fit_halflife`, a maximum likelihood exponential fit:
164
- half life = mean times ln 2), not hand picked, and a track last seen near the image border is
165
- credited as departed, not occluded, so the persistence model does not fight the geometry model's
166
- own border truncation logic.
167
 
168
  ## What we have NOT done yet, and will not pretend we have
169
 
170
- Beyond the CrowdHuman re-test above (a real but partial and externally run result), the rest of
171
- this method is validated on **synthetic** scenes with exact ground truth. We have written the
172
- protocol to adapt further real crowd datasets (ShanghaiTech and JHU CROWD++), including the
173
- awkward part, deriving ground truth *boxes* from point annotations, but that evaluation has not
174
- been run yet. When it is, we expect the interesting result to be about *coverage*, not accuracy:
175
- whether the calibrated 90% interval still covers on a different real dataset, and by how much the
176
- point estimate advantage shrinks when a real detector's recall falls apart in dense scenes. We
177
- will publish that honestly, including the unflattering half, the same way we published the
178
- uncapped weight regression and the CrowdHuman regression above instead of hiding either one. This
179
- is also still a research stage engine: a GPU phase learned amodal completion model, intended as a
180
- stronger visibility and detectability source behind the same interfaces, is not yet implemented.
181
-
182
- The takeaway is not "we count crowds better." It is: **we tell you how much to trust the
183
- count, we have measured how wrong the naive confidence would have been, and when a first version
184
- of the fix made real-world counting worse, we said so and kept working instead of quietly
185
- retracting the claim.**
 
 
 
186
 
187
  - Dataset: [amodal-counting-benchmark](https://huggingface.co/datasets/Dhi-Technologies/amodal-counting-benchmark)
188
  - Live demo: [amodal-counting-demo](https://huggingface.co/spaces/Dhi-Technologies/amodal-counting-demo)
189
- - Code: proprietary, closed source permanently; not a publicly browsable repository. Partnership
190
  or access inquiries: [dhi-tech.com](https://dhi-tech.com).
191
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 2, E1 precision first linking](02_e1_precision_first_linking.md), [post 4, portfolio overview](04_portfolio_overview.md), [post 5, Prompt2Model v0.1.0](05_prompt2model_v010.md)
 
4
 
5
  Counting people through occlusion is the kind of problem where it is easy to publish a good
6
  looking accuracy number and quietly bury the uncertainty. We want to argue the opposite: for
7
+ occluded counting, **the calibrated interval is the real deliverable, and the point estimate is
8
+ almost a side effect.** This post walks through the method and its numbers in the order we found
9
+ them, and then tells the story this series exists to tell: what happened when the method met
10
+ real photographs for the first time, failed, was diagnosed, failed again more instructively,
11
+ and finally won, with every intermediate defeat kept in the record. The synthetic results come
12
+ first because they came first chronologically; the real data saga is the second half, and it is
13
+ the longer half on purpose.
14
 
15
  ## What this is, and what it is not
16
 
17
  `amodal-counting` (package name `amodal`) is a library and CLI, not a hosted model: no detector
18
+ is bundled and no weights ship. You bring your own box output detector; this library corrects
19
+ its count and, more importantly, tells you how much to trust the correction. It is not a claim
20
+ of a universal win: the evidence below includes measured cases where the correction loses to
21
+ naive counting, on synthetic data and on real data, each documented with the conditions under
22
+ which it loses. It is not deployed at any customer site, and no customer or deployment claim
23
+ appears anywhere in this post.
24
 
25
  ## The setup
26
 
27
  A detector in a crowded scene systematically *undercounts*: it never reports the people it
28
+ cannot see. The textbook fix is Horvitz Thompson estimation: weight each detection by 1 divided
29
+ by p(detect given visibility), so a barely visible detection stands in for the several similar
30
+ ones it statistically represents. Visibility itself (`src/amodal/visibility.py`) is computed
31
+ from box geometry alone: the fraction of a detection's box not covered by known occluders, not
32
+ covered by other detections in front of it (bottom edge depth order, lower in frame is closer,
33
+ the standard fixed camera convention), and not truncated by the image border. A missed occluder
34
+ can only make this estimate look *less* occluded than reality, so the bias runs one direction,
35
+ down, which keeps the correction conservative by construction. The detectability curve, a
36
+ logistic in visibility with parameters k and v0, is fit from data and refit per crowding level,
37
+ and it carries its own calibrated support: a query outside the 2nd to 98th percentile of
38
+ visibilities seen during fitting is clamped to the boundary and the result is flagged
39
+ `extrapolation_limited`, never silently extrapolated.
40
+
41
+ The estimator (`src/amodal/estimator.py`) has three honesty gates in the code itself, not just
42
+ in the docs: the corrected estimate can never drop below the raw detection count
43
  (`estimate = max(estimate, n_detected)`); every per detection weight is capped at `1 / min_p`
44
+ (default `min_p = 0.30`, a maximum weight of about 3.3x) so a single deeply occluded detection
45
  cannot conjure a crowd on its own; and any detection whose visibility fell outside the curve's
46
+ calibrated support sets `extrapolation_limited = True` on the whole estimate. Hold on to that
47
+ first gate, the never below raw count floor. It encodes an assumption, "detections are real,
48
+ errors are only misses," and the real data section below is largely the story of that assumption
49
+ meeting a detector for which it is false.
50
+
51
+ ## The synthetic results: where the method works, and where it already loses
52
+
53
+ On our synthetic benchmark (160 scenes, 40 per crowding level, calibrated on 60 training worlds
54
+ and evaluated fresh on 40 held out worlds per level, so nothing below is computed on data the
55
+ calibration saw), correction lowers mean absolute error at every crowding level tested. We
56
+ re ran this table digit for digit this session with `bench --seed 0` in a clean virtualenv
57
+ (Python 3.12, `numpy` and `scipy` only):
58
+
59
+ | crowding | naive MAE | corrected MAE | 90% interval coverage (conformal) | z multiplier |
60
+ |---:|---:|---:|---:|---:|
61
+ | 0.0 | 2.8 | 2.4 | 0.90 | 6.726 |
62
+ | 0.3 | 2.6 | 1.97 | 0.90 | 8.2022 |
63
+ | 0.6 | 2.85 | 2.34 | 0.975 | 14.4634 |
64
+ | 0.8 | 3.73 | 2.46 | 0.975 | 7.7541 |
65
+
66
+ The last column is the honest headline of the method, and it needs its own paragraph. The
67
+ textbook analytic error bar, the independent Bernoulli Horvitz Thompson variance formula you
68
+ would derive on a whiteboard, measured **0.50 to 0.63 actual coverage against a claimed 0.90**
69
+ on this benchmark. Shipped as is, it would tell operators "90% sure" while being right barely
70
+ half the time, which is arguably worse than no interval at all, because it converts a guess into
71
+ a false guarantee. We do not hand tune the formula. We calibrate it conformally
72
+ (`fit_interval_scale`, a standard split conformal procedure: run inference over labeled
73
+ calibration scenes, collect the ratios of actual absolute error to claimed sigma, take their
74
+ finite sample quantile as a multiplier `z_scale` on the analytic sigma). The fitted multipliers
75
+ in the table run from **6.726 to 14.4634**: the uncalibrated error bar was roughly an order of
76
+ magnitude too tight, and publishing the multiplier is publishing exactly how wrong the
77
+ overconfident version would have been. After calibration, measured coverage meets or exceeds the
78
+ 90% claim at every crowding level. An estimate only reports a calibrated coverage claim if its
79
+ curve actually carries a fitted `z_scale`; otherwise the CLI marks `interval_calibrated: false`
80
+ rather than implying a guarantee that was never measured.
81
+
82
+ Even on synthetic data, the point estimate correction is not a free lunch, and two measured
83
+ regressions are kept in the record. First, uncapped weights: with `min_p = 0.1`, the variance
84
+ from a handful of near zero probability detections swamps the bias reduction, and per scene MAE
85
+ came out **worse than naive**, 2.89 versus 2.63, at crowding 0.6. Sweeping the cap at that
86
+ crowding level made the tradeoff explicit:
87
 
88
  | min_p | 0.1 | 0.2 | 0.3 | 0.4 |
89
  |---|---:|---:|---:|---:|
90
  | MAE | 2.89 | 2.21 | 1.71 | 1.52 |
91
 
92
+ The shipped default is chosen from that measured sweep, not from taste. Second, calibration must
93
+ be done on *inference aligned* visibility, computed exactly the way the deployed pipeline
94
+ computes it, not on ground truth visibility; skipping that step was measured to turn a helpful
95
+ correction into a harmful one (MAE 3.13 versus a naive 2.63 at one crowding level). Both
96
+ regressions stayed in the benchmark documentation, because a method whose failure modes you have
97
+ not published is a method whose failure modes you have not finished finding.
98
+
99
+ ## The real data saga: four acts on CrowdHuman
100
+
101
+ Everything above has exact synthetic ground truth. The repository's evidence log,
102
+ `evidence/a4_realdata/RESULTS.md`, documents what happened when the method was pointed at real
103
+ photographs, in four chronological stages, each committed on 2026-07-09 with its own numbers.
104
+ The setup, fixed across all four acts: CrowdHuman validation images, 270 of them split into 80
105
+ calibration, 40 interval calibration, and 150 evaluation images (disjoint, seed 42), containing
106
+ 6,809 ground truth person boxes; a SAHI tiled YOLOv8s detector (640x640 tiles, 20% overlap),
107
+ person class only, run on a rented RTX 5060 Ti. We attribute these numbers to that evidence log
108
+ and its committed per scene outputs rather than re running them for this post, because
109
+ reproducing them needs a GPU, `ultralytics` and `sahi`, and the CrowdHuman images; everything
110
+ synthetic in this post we re ran ourselves.
111
+
112
+ **Act 1: the fair re test, and a clean failure.** After fixing the detector configuration
113
+ itself (the first, naive full image detector pass had 16% recall, useless for testing a
114
+ correction; SAHI tiling brought recall to 56.25% at IoU 0.5), the one directional correction
115
+ got its first fair test. It failed: naive MAE 14.08, corrected MAE **28.204**, interval coverage
116
+ **0.3933** against the 90% target. The fitted detectability curve told the story of why: it came
117
+ out nearly flat, k = 0.2925, v0 = 0.0603, with p(detect given visibility) spanning only 0.50 to
118
+ 0.57 across the whole visibility range. On this detector, geometric visibility barely predicts
119
+ misses. And the error structure was the deeper problem: decomposing naive error across the 150
120
+ evaluation scenes showed 85 scenes *overcounted* (total +1,045) against 55 undercounted (total
121
+ -1,067), a nearly balanced two sided mix, with mean signed error -0.15. Naive counting was
122
+ already nearly unbiased on average. A one directional correction, whose weights are always at
123
+ least 1 and whose floor forbids ever going below the raw count, can only push counts up; applied
124
+ to an already balanced error, its almost constant 1.8 to 2x multiplier turned a mean signed
125
+ error of -0.15 into +21.05. The floor that was an honesty gate on synthetic data, where all
126
+ error is misses, became the mechanism of failure on real data, where half the error is spurious
127
+ detections. The overcount half of the problem traced to SAHI itself: sliding window tiling
128
+ produces duplicate and partial boxes along tile seams that survive fusion.
129
+
130
+ **Act 2: a richer curve, an unchanged failure, and the diagnosis confirmed.** The obvious
131
+ objection to act 1 is "your visibility feature is just weak; fit a better detectability model."
132
+ So that is what happened next: a multivariate logistic detectability curve over visibility,
133
+ scene relative log scale, local density, and normalized image position, fit on 2,174 calibration
134
+ pairs (1,181 detected, 993 missed). The fit itself confirmed the diagnosis quantitatively: point
135
+ biserial correlations with detection were 0.458 for log scale and 0.433 for vertical position,
136
+ against **0.051 for visibility**. On this detector, size and position predict detection; the
137
+ occlusion geometry the whole method was built around barely does. And the result got *worse*,
138
+ not better: corrected MAE **34.039** (against the same naive 14.08), coverage 0.4067. The
139
+ evidence log's root cause analysis explains why more information can hurt: the correlation
140
+ between a scene's naive error and its mean predicted detectability came out at -0.37, meaning
141
+ the scenes with the most false positives are exactly the scenes where the curve predicts the
142
+ lowest detectability and therefore applies the largest upward multiplier. The failure was
143
+ structural, one directional weights against two sided error, not a fixable weakness in the
144
+ curve. That is worth pausing on, because it is the shape of a lot of real regressions: the first
145
+ fix attempt targets the visible symptom (a weak feature) and instead sharpens the underlying
146
+ mismatch.
147
+
148
+ **Act 3: fix the detector, watch the correction still lose.** If tiling artifacts cause the
149
+ overcount half, tune the tiling. A 25 configuration sweep over SAHI's postprocessing (algorithm,
150
+ match metric, match threshold, confidence threshold, overlap) found a setting, GREEDYNMM with
151
+ IoU matching at threshold 0.3 and confidence 0.15, that improved recall and precision
152
+ *simultaneously*: recall 56.25% to 61.89%, precision 57.53% to 61.82%, false positives 2,827
153
+ down to 2,603 even as total detections rose. That was the single biggest win in the whole
154
+ evidence trail for the *point estimate*: naive MAE dropped from 14.08 to **11.767**, a 16.4%
155
+ relative improvement, before any correction at all. Rebuilt on the better detector, the
156
+ corrected estimators improved too (one directional: 22.475; multivariate: 28.228) but **still
157
+ lost to naive**, and the error decomposition explained why with the same shape as before: 87
158
+ scenes overcounted (+922) against 51 undercounted (-843). Cleaning up the detector reduced the
159
+ problem's size, not its two sided shape. Act 3's lesson is the cheapest in the saga: before
160
+ correcting a detector statistically, spend a day tuning the detector, because the best
161
+ correction of a bad configuration lost to the uncorrected output of a good one.
162
+
163
+ **Act 4: make the estimator two sided, and finally win.** The structural diagnosis dictated the
164
+ fix: if detections can be spurious, the estimator needs a model of *that*, not just of misses.
165
+ Act 4 adds a second fitted model, `p_true`, the probability that a detection is a real object
166
+ rather than a duplicate or tiling artifact, fit on 2,196 calibration split detections (1,321
167
+ matched to ground truth, 875 not) over four features that need no ground truth at inference
168
+ time: the detector's own confidence, scene relative log scale, local detection density, and
169
+ proximity to the nearest SAHI tile seam. The fitted coefficients (standardized) came out
170
+ confidence 0.326, log scale 0.687, density -0.181, seam proximity -0.287, every sign in the
171
+ direction it should be, with a held out Brier score of about 0.10. Interestingly, scale, not
172
+ confidence, carried the largest weight; the evidence log flags that rather than tidying it into
173
+ the expected story. Each detection's weight becomes `p_true / max(p_detect, min_p_detect)`
174
+ instead of `1 / p_detect`, and the never below raw count floor is **deliberately dropped**,
175
+ documented in the estimator as an intentional, narrow relaxation: once a detection can itself be
176
+ spurious, forbidding the estimate to go below the raw count would forbid the correction from
177
+ correcting. The one free parameter, `min_p_detect`, was selected by sweeping 0.05 to 0.95 on the
178
+ 40 image interval split only, never touching evaluation data; the minimum sat at 0.70 in a broad
179
+ basin, where the interval split already showed the estimator beating naive (11.807 versus
180
+ 12.025). Applied once to the held out 150 scene evaluation split:
181
+
182
+ | estimator | MAE | 90% interval coverage |
183
+ |---|---:|---:|
184
+ | naive count | 11.767 | n/a |
185
+ | one directional (act 3 detector) | 22.475 | ~0.39 |
186
+ | **two sided (p_true / p_detect)** | **11.031** | **0.9067** |
187
+
188
+ A 6.3% relative MAE improvement over naive, and, for the first time on real data, an interval
189
+ that means what it says: 90.67% measured coverage against a 90% claim. On the pre specified
190
+ occlusion heavy subset (the top 30% of scenes by CrowdHuman's own per box occlusion flags, 45
191
+ scenes with mean ground truth occlusion fraction 0.877), the two sided estimator also wins,
192
+ 17.222 versus 18.867 naive, which is exactly the regime where act 3's one directional variant
193
+ had been losing by 1.7 to 2.2x.
194
+
195
+ **The boundary that remains, disclosed.** On the 20 densest scenes in the evaluation split, up
196
+ to 227 true people represented by as few as 20 to 30 raw detections, naive counting is still
197
+ better: naive MAE 40.0 versus two sided 46.171, and the estimator's own coverage flag drops to
198
+ 0.50, correctly signaling extrapolation far outside the calibration density range instead of
199
+ failing silently. Up weighting genuine but sparse detections is inherently unstable when the
200
+ detector has collapsed; the honest response is the wider flagged interval the estimator already
201
+ produces, and the honest scope statement is the one the evidence log makes: the product's valid
202
+ regime is moderate density scenes with a reasonably configured detector, and dense crowd
203
+ counting beyond detector collapse belongs to density map methods, not detection reweighting.
204
+
205
+ Four acts, one pattern: every failure was measured, diagnosed to a mechanism, and published
206
+ before the next attempt, and the fix that finally worked was dictated by the diagnosis rather
207
+ than by trying harder with the same assumption. The two sided estimator exists *because* acts 1
208
+ through 3 are in the record; a lab that buried act 1 would still be tuning curve features.
209
 
210
+ ## A fifth mechanism: occlusion persistence over time
 
 
 
 
 
211
 
212
+ Beyond the per frame estimator, `src/amodal/temporal.py`'s `PersistentCounter` treats a tracked
213
+ object that vanishes mid frame, away from any exit region, as probably occluded rather than
214
+ gone, with a survival probability that decays over hidden time. The decay half life is fit from
215
+ observed reappearance gap statistics (`fit_halflife`, a maximum likelihood exponential fit: half
216
+ life equals mean gap times ln 2), not hand picked, and a track last seen near the image border
217
+ is credited as departed rather than occluded, so the persistence model does not fight the
218
+ geometry model's border truncation logic.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
219
 
220
  ## Test suite
221
 
222
  `tests/test_core.py` (37 test functions) and `tests/test_temporal_bench_cli.py` (9 test
223
+ functions), 46 total, counted with `grep -c "^def test_"`. Re run this session,
224
+ `PYTHONPATH=src python -m pytest tests/`; verbatim final line:
225
 
226
  ```
227
+ 46 passed in 2.22s
228
  ```
229
 
230
+ (An earlier revision of this post quoted `46 passed in 12.76s` from a previous session's run on
231
+ the same suite; the count is what is load bearing, the wall time varies with the machine.)
 
 
 
 
 
 
 
232
 
233
  ## What we have NOT done yet, and will not pretend we have
234
 
235
+ - The CrowdHuman result is one real dataset, one detector family, one tiling configuration. The
236
+ protocol for adapting further real crowd datasets (ShanghaiTech, JHU CROWD++) is written,
237
+ including the awkward part, deriving ground truth boxes from point annotations, but those runs
238
+ have not happened. The interesting question there is coverage, not accuracy: whether the
239
+ calibrated interval still holds its claim on a dataset it was not developed against.
240
+ - The two sided estimator's `p_true` model includes a SAHI specific feature (tile seam
241
+ proximity). On a detector that does not tile, that feature is inert and the model would lean
242
+ on confidence, scale, and density alone; that configuration has not been separately measured.
243
+ - The dense scene boundary above is real and currently unsolved in this product: past detector
244
+ collapse, reweighting loses to naive counting, and the estimator's contribution is to *flag*
245
+ that regime (coverage 0.50, extrapolation limited) rather than fix it.
246
+ - A GPU phase learned amodal completion model, intended as a stronger visibility and
247
+ detectability source behind the same interfaces, is not implemented. This remains a research
248
+ stage engine.
249
+
250
+ The takeaway is not "we count crowds better." It is: **we tell you how much to trust the count,
251
+ we measured how wrong the naive confidence would have been (6.7x to 14.5x too tight), and when
252
+ the first real world test made the correction worse, we published the regression, diagnosed it
253
+ to a mechanism, and kept the diagnosis in the record next to the fix it eventually produced.**
254
 
255
  - Dataset: [amodal-counting-benchmark](https://huggingface.co/datasets/Dhi-Technologies/amodal-counting-benchmark)
256
  - Live demo: [amodal-counting-demo](https://huggingface.co/spaces/Dhi-Technologies/amodal-counting-demo)
257
+ - Code: proprietary, closed source; the open surface is the evidence quoted above. Partnership
258
  or access inquiries: [dhi-tech.com](https://dhi-tech.com).
259
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 2, E1 precision first linking](02_e1_precision_first_linking.md), [post 4, portfolio overview](04_portfolio_overview.md), [post 5, Prompt2Model v0.1.0](05_prompt2model_v010.md)
04_portfolio_overview.md CHANGED
@@ -2,44 +2,52 @@
2
 
3
  *Dhi Labs, post 4 of 5: a portfolio overview*
4
 
5
- The first three posts in this series made a specific argument about two of our six products:
6
- that a refusal gate and a calibrated interval are not decoration, they are the actual product,
7
- verified with numbers rather than asserted with adjectives. This post is the wide angle
8
- version: a tour of all six Dhi Labs products, each tied back to that same thesis, each with
9
- its honesty mechanism named, its one clearest measured number attached, and its test suite
10
- counted rather than assumed. Read it as an index into the rest of the org: every product below
11
- links to its dataset, its demo Space, and where one exists, its deep dive post. Post 5 covers a
12
- seventh piece of the program that just crossed from private research into a public, tagged
13
- release.
14
-
15
- Across the six products below, the combined test suite this org's own code carries is 34 (E1) +
16
- 46 (A4) + 27 (A3) + 16 (E4) + 99 (A5) + 117 (B1, at v0.1.0) = 339 tests, each one run and its
17
- final summary line quoted rather than paraphrased, in the sections below and in the deep dive
18
- posts. None of that is a claim that 339 passing tests makes a product production ready; it is a
19
- claim that the honesty mechanisms described below are exercised by code that runs, not only
20
- described in prose.
 
21
 
22
  ## A4: amodal counting
23
 
24
- **One liner:** counts people and objects through occlusion, reporting a calibrated interval
25
- instead of a bare point count.
26
-
27
- **Honesty mechanism:** conformal calibration of the uncertainty interval, checked against
28
- measured coverage rather than assumed. The textbook analytic error bar undercovers badly
29
- (about 0.50 to 0.63 actual coverage against a claimed 0.90); the conformally calibrated
30
- version meets or exceeds its 90% claim at every crowding level tested, at the cost of being
31
- 6.7x to 14.5x wider than the naive bar. On a real, externally run CrowdHuman re-test, the first
32
- version of the correction made counting *worse* than naive (MAE 11.767 to 22.475) before a
33
- two-sided estimator fixed it (MAE 11.031, 90.67% coverage) - both numbers are published, not
34
- just the second one.
35
-
36
- **One verified number:** corrected count MAE of 2.46 versus naive MAE of 3.73 at the hardest
37
- occlusion density tested (crowding 0.8), with 97.5% measured interval coverage against a
38
- 90% claim; 46 tests passed in 12.76s on the synthetic suite.
39
-
40
- **Under the hood:** 9 source files, 1,662 lines (`geometry.py`, `synth.py`, `visibility.py`,
41
- `calibrate.py`, `estimator.py`, `temporal.py`, `bench.py`, `cli.py`), no third party dependency
42
- beyond `numpy` and `scipy`, no GPU anywhere in the synthetic path.
 
 
 
 
 
 
 
43
 
44
  - Dataset: [amodal-counting-benchmark](https://huggingface.co/datasets/Dhi-Technologies/amodal-counting-benchmark)
45
  - Demo: [amodal-counting-demo](https://huggingface.co/spaces/Dhi-Technologies/amodal-counting-demo)
@@ -47,25 +55,32 @@ beyond `numpy` and `scipy`, no GPU anywhere in the synthetic path.
47
 
48
  ## E1: multicam reasoning memory
49
 
50
- **One liner:** links the same person or vehicle across cameras and answers where, when, and
51
- who was there questions, with a provenance trail on every answer.
52
-
53
- **Honesty mechanism:** a uniqueness guard refusal gate. A margin only linker measured 0.918
54
- site precision; adding a gate that refuses to link whenever a second candidate is even
55
- plausible took precision to 1.0, deliberately trading recall down to buy zero wrong merges,
56
- because a false merge poisons weeks of memory while a missed link only costs a duplicate row.
57
-
58
- **One verified number:** precision **1.0000** across a 24 site synthetic grid (165,902 events, 3
59
- to 8 cameras, 20% to 60% reference coverage), zero false merges on any site; recall scales with
60
- reference coverage and camera count from 0.0476 to 0.6788 by design. On the single committed seed
61
- 1 demo: precision 1.0, recall 0.377 (69 true same person pairs, 26 linked, 0 wrong); the entire
62
- four camera site's memory fits in 61,440 bytes, and a month long simulated stream stays under 2 MB
63
- by construction, enforced by a regression test, not just documented; 34 tests pass in 4.74s.
64
-
65
- **Under the hood:** 9 files, 1,290 lines, stdlib `sqlite3` plus `numpy` only, and a shipped
66
- `integrations/frigate.py` bridge (330 lines) that maps the open source Frigate NVR's own MQTT
67
- event stream into the engine's input contract, so a real, already-deployed tracker can feed it
68
- without a bespoke adapter.
 
 
 
 
 
 
 
69
 
70
  - Dataset: [multicam-reasoning-memory-benchmark](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark)
71
  - Demo: [multicam-reasoning-memory-demo](https://huggingface.co/spaces/Dhi-Technologies/multicam-reasoning-memory-demo)
@@ -73,150 +88,172 @@ without a bespoke adapter.
73
 
74
  ## A3: fixed camera 3D
75
 
76
- **One liner:** turns an ordinary fixed camera into a metric 3D sensor, self calibrating
77
- height, tilt, and focal length from people already walking through the scene, no GPU and no
78
- model weights involved.
79
-
80
- **Honesty mechanism:** the hard case is disclosed, not dropped from the table, and it is caught
81
- by a real conditioning probe in the code, not a post hoc caveat. `sensitivity_m_per_half_deg`
82
- perturbs the recovered camera tilt by half a degree and measures how far the estimated ground
83
- position moves in response, because a shallow mount camera can converge to a low optimizer
84
- residual while the recovered tilt is still off by a few degrees, and at that geometry a few
85
- degrees of tilt error becomes meters of far field position error that the residual alone cannot
86
- see. The shallow angle configuration (3 meter camera height, 20 degree tilt) is flagged by this
87
- probe as reporting 1.72 meters of position movement per half degree of tilt perturbation,
88
- against 0.72 and 0.20 meters at two well conditioned geometries, and it is reported in the same
89
- results table as the easy cases rather than excluded as an outlier.
90
-
91
- **One verified number:** position RMSE of 0.16 meters at 5 meters height and 30 degree tilt,
92
- versus 4.30 meters at the disclosed hard case of 3 meters height and 20 degree tilt, both
93
- measured on the same self calibration and localization pipeline with no configuration specific
94
- tuning; 27 tests pass in 20.20s (the repo's own docs claim 29, a discrepancy caught and
95
- disclosed rather than silently repeated).
96
-
97
- **Under the hood:** 916 lines across 7 files (`camera.py`, `calibration.py`, `metric.py`,
98
- `depth_fusion.py`, `bench.py`, `cli.py`), `numpy` and `scipy` only. A depth-fusion path
99
- (`fit_depth_scale`, Theil-Sen median-of-slopes anchor fitting) takes any relative-depth model as
100
- a plain callable, so the fusion math is fully unit-tested today with no model plugged in;
101
- concrete depth-model adapters and an edge TensorRT path are explicit future work, not shipped.
102
 
103
  - Dataset: [fixed-camera-3d-benchmark](https://huggingface.co/datasets/Dhi-Technologies/fixed-camera-3d-benchmark)
104
  - Demo: [fixed-camera-3d-demo](https://huggingface.co/spaces/Dhi-Technologies/fixed-camera-3d-demo)
105
 
106
  ## E4: causal predictive alerting
107
 
108
- **One liner:** predicts an incident a few seconds before it happens from kinematic
109
- trajectories, and proves why with a counterfactual replay, rather than shipping a bare anomaly
110
- score.
111
-
112
- **Honesty mechanism:** a falsification ledger plus an ablation-replay counterfactual engine.
113
- Every prediction is later graded fulfilled or falsified against what actually happened, and the
114
- falsified count is published as prominently as the fulfilled count. Every "why" is not narration
115
- but a literal re-run of the same predictor with a candidate cause removed or motion-frozen, so a
116
- causal claim is either true of an executed replay or it is not made at all.
117
-
118
- **One verified number:** across an earlier 200 scenario battery, 63 predictions were later
119
- graded fulfilled and 87 falsified, out of 150 alerts fired; recall is 1.0 across every scenario
120
- kind in the newer 210 scenario battery, at a disclosed cost of an 8.0% false positive rate on
121
- negative scenarios, and the weakest alert kind, crowd buildup, is named as the weakest (0.356
122
- precision) rather than folded into a friendlier overall average; 16 tests pass in 1.97s.
123
-
124
- **Under the hood:** 1,146 lines across 7 modules (`state.py`, `predict.py`,
125
- `counterfactual.py`, `grounding.py`, `battery.py`, `cli.py`), `numpy` only, no torch, no GPU, no
126
- network calls anywhere in `src/`. The counterfactual engine's own necessity rate is a second
127
- honest signal beyond precision and recall: presence removal was necessary for 100% of zone
128
- entry and convergence alerts but only 21.7% of crowd buildup alerts (267 per-occupant checks
129
- run), correctly reporting that a crowd well above threshold does not depend on any one occupant
130
- instead of inflating per-person blame to sound more decisive.
131
 
132
  - Dataset: [causal-predictive-alerting-benchmark](https://huggingface.co/datasets/Dhi-Technologies/causal-predictive-alerting-benchmark)
133
  - Demo: [causal-predictive-alerting-demo](https://huggingface.co/spaces/Dhi-Technologies/causal-predictive-alerting-demo)
134
 
135
  ## A5: thermal perception
136
 
137
- **One liner:** a radiometric data engine and self supervised pretraining harness for thermal
138
- native perception, built so the math is CPU verifiable ahead of any GPU pretraining run.
139
-
140
- **Honesty mechanism:** no trained checkpoint is published where none was trained. A hard coded
141
- floor, `min_corpus_frames = 200,000`, labels anything trained on fewer frames a mechanics pilot,
142
- not a quality claim, in the repo's own training logs, and both of its real GPU training runs to
143
- date (2,503 and 15,488 frames) sit far below that floor and are reported as such rather than
144
- presented as validation. The GPU pretraining run itself is emitted as a costed *recipe*, not
145
- shipped as a model, specifically so nothing on this org implies a thermal foundation model
146
- exists when it does not.
147
-
148
- **One verified number:** `thermalcore.cli selfcheck` passes all four AGC normalization
149
- variants and the self supervised loss correctness check, with a linear probe separability
150
- sanity check scoring 0.94, on a CPU only, 99 test suite (`99 passed in 0.39s`); this validates
151
- the math, not real world thermal accuracy, and the dataset card says so explicitly.
152
-
153
- **Under the hood:** 2,222 lines across 21 Python files (synthetic radiometric scene generator,
154
- an AGC normalization zoo, cross-sensor domain tooling, a pretraining corpus engine, MAE masking
155
- math, and closed-form evaluation metrics with no `sklearn`/`torch` dependency). Two GPU pilots on
156
- record (2,503 synthetic frames, 32 minutes; 15,488 real LLVIP infrared frames, 40 minutes, both
157
- on a rented RTX 5060 Ti) sit far below the repo's own 200,000-frame pretraining floor and are
158
- both labeled mechanics pilots, not quality evidence, in the repo's own results docs.
159
 
160
  - Dataset: [thermal-perception-benchmark](https://huggingface.co/datasets/Dhi-Technologies/thermal-perception-benchmark)
161
  - Demo: [thermal-perception-demo](https://huggingface.co/spaces/Dhi-Technologies/thermal-perception-demo)
162
 
163
  ## B1: Prompt2Model
164
 
165
- **One liner:** a language guided vision model factory: prompt in, dataset config, training,
166
- calibration, ONNX export, and an optional accuracy gated compression step, out. As of today it
167
- has its first tagged public release, v0.1.0, covered in full in post 5.
168
-
169
- **Honesty mechanism:** two refusal gates in one pipeline. At inference, a split conformal
170
- abstention check compares each prediction's nonconformity against a validation calibrated
171
- threshold and abstains rather than guessing on unfamiliar inputs. At the factory level, the
172
- compression step refuses to ship a distilled or quantized model that drops more than 2% below
173
- the uncompressed model's accuracy, shipping the uncompressed model instead and logging the
174
- refusal. What is and is not validated is tracked in the open on GitHub, as numbered issues
175
- against the release, not smoothed into marketing copy: detection mAP for the emitted artifact
176
- and on Jetson TensorRT latency are both explicitly flagged as not yet measured.
177
-
178
- **One verified number:** the inference time abstention threshold is fit from held out
179
- validation data, not chosen by hand, at alpha=0.1 (a 90% target coverage); on the toy
180
- classification smoke test it came out to a conformal threshold of 0.491826 from 7 held out
181
- samples, and the compression gate's default accuracy floor is 98% of baseline accuracy,
182
- enforced in code, not documentation. At v0.1.0, the repository's full test suite passed 117
183
- of 117 tests with zero skips, in roughly 106 seconds.
184
-
185
- **Under the hood:** classification and COCO-style detection dataset loaders, a lightweight model
186
- registry, ONNX export with metadata verification, and pluggable deployment targets (ONNX Runtime
187
- by default, TensorRT when `trtexec` is present, otherwise a reproducible on-device build recipe).
188
- The toy smoke test's exported classification model runs at roughly 150 ms per image on CPU
189
- (1.52M parameters); the toy detection model runs at roughly 36 ms per image on CPU (2.22M
190
- parameters, mAP@0.5 of 0.053 on a training set of a few dozen images, disclosed as a pipeline
191
- smoke test, not a benchmark).
192
 
193
  - Dataset: [prompt2model-examples](https://huggingface.co/datasets/Dhi-Technologies/prompt2model-examples)
194
  - Demo: [prompt2model-demo](https://huggingface.co/spaces/Dhi-Technologies/prompt2model-demo)
195
- - Code (public, MIT licensed): [Prompt2Model-Language-Guided-Vision-Model-Factory](https://github.com/DHI-Technologies-Inc/Prompt2Model-Language-Guided-Vision-Model-Factory)
196
  - Deep dive: [Prompt2Model v0.1.0](05_prompt2model_v010.md)
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  ## The pattern across all six
199
 
200
- Four mechanisms recur across these six products, in different combinations: calibrated
201
- intervals (A4), refusal gates (E1, B1), provenance (E1), and falsification ledgers (E4). A3
202
- and A5 add a fifth pattern that is really the same instinct applied to reporting: disclose the
203
- hard case and the unfinished step instead of smoothing over them, whether that is a shallow
204
- camera mount's sensitivity number or a GPU pretraining run that is honestly labeled a mechanics
205
- pilot rather than a quality result. None of these are free. Every one of them costs something
206
- measurable: recall in E1, interval width in A4, false positives in E4, model size headroom in
207
- B1, and we publish that cost next to the benefit rather than only the benefit. It also shows up
208
- in how we handle our own mistakes: three separate reproductions across this org (E1's memory
209
- size and journey range, A3's test count, A4's real-data regression before the fix) found small
210
- gaps between prior prose and a fresh run, and every one of them is disclosed in the matching
211
- post rather than quietly rounded away. That is the whole thesis from post 1, applied six times,
212
- plus a seventh product now stepping into the same public accountability the moment it ships its
213
- first release.
214
 
215
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 2, E1 deep dive](02_e1_precision_first_linking.md), [post 3, A4 deep dive](03_a4_calibration_over_accuracy.md), [post 5, Prompt2Model v0.1.0](05_prompt2model_v010.md)
216
  - Collection: [Dhi Labs, honest edge vision AI](https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7)
217
  - Org: [Dhi-Technologies](https://huggingface.co/Dhi-Technologies)
218
- - Code: proprietary, closed source permanently for five of the six products; Prompt2Model (B1) is
219
- a deliberate exception with one public, MIT-licensed release, above. The GitHub org
220
- [github.com/DHI-Technologies-Inc](https://github.com/DHI-Technologies-Inc) is an identity link,
221
- not a browsable source destination for the other five. Partnership or access inquiries:
222
- [dhi-tech.com](https://dhi-tech.com).
 
2
 
3
  *Dhi Labs, post 4 of 5: a portfolio overview*
4
 
5
+ The first three posts in this series made a specific argument about two of our products: that a
6
+ refusal gate and a calibrated interval are not decoration, they are the actual product, verified
7
+ with numbers rather than asserted with adjectives. This post is the wide angle version: a tour
8
+ of all six Dhi Labs products, each tied back to that thesis, each with its honesty mechanism
9
+ named, its clearest measured numbers attached, its stated limitation kept in the same paragraph
10
+ as its headline, and its test suite counted rather than assumed. It closes with the part the
11
+ individual posts cannot show: how the pieces are designed to compose on a single edge box. Read
12
+ it as an index into the rest of the org: every product links to its dataset and demo Space, and
13
+ where one exists, its deep dive post.
14
+
15
+ Across the six products, the combined test count is 34 (E1) + 46 (A4) + 27 (A3) + 16 (E4) + 99
16
+ (A5) + 118 (B1, current main) = 340 tests; B1's tagged v0.1.0 release carried 117, and current
17
+ main gained one test with the training determinism fix covered in post 5, so the portfolio
18
+ total moved from the previously published 339 to 340. Each suite's final summary line is quoted
19
+ verbatim in its product's section or deep dive rather than paraphrased. None of this is a claim
20
+ that 340 passing tests make a product production ready; it is a claim that every honesty
21
+ mechanism described below is exercised by code that runs, not only described in prose.
22
 
23
  ## A4: amodal counting
24
 
25
+ Counting through occlusion is a problem where the point estimate gets the attention and the
26
+ uncertainty does the damage, so this product treats the calibrated interval as the deliverable.
27
+ A detector undercounts what it cannot see; the estimator reweights each detection by a fitted
28
+ detectability curve, caps every weight so one deep occlusion cannot conjure a crowd, and clamps
29
+ queries outside the curve's calibrated support with an explicit `extrapolation_limited` flag.
30
+ The honesty mechanism is conformal calibration of the interval, checked against measured
31
+ coverage: the textbook analytic error bar measured 0.50 to 0.63 actual coverage against a
32
+ claimed 0.90 on the synthetic benchmark, and the conformal multiplier that repairs it, 6.7x to
33
+ 14.5x wider depending on crowding, is published as the headline rather than hidden as an
34
+ implementation detail. On synthetic scenes the corrected count also beats naive at every
35
+ crowding level tested (2.46 versus 3.73 MAE at the hardest level, with 0.975 measured coverage
36
+ against a 0.90 claim, re run digit for digit this session).
37
+
38
+ The real data arc is the flagship honesty story of the whole program, told in full in post 3.
39
+ Short version: on CrowdHuman with a SAHI tiled YOLOv8s detector (270 images, 6,809 ground truth
40
+ boxes), the one directional correction *lost* to naive counting, 22.475 versus 11.767 MAE,
41
+ because this detector's real error was a two sided mix of occlusion misses and tiling driven
42
+ false positives that a weights only correction cannot fix by construction. The fix, a two sided
43
+ estimator that also fits a per detection probability of being a genuine object, is the first
44
+ variant to beat naive on real data, 11.031 MAE with 90.67% interval coverage against the 90%
45
+ target. The stated limitation stays next to the win: on the twenty densest scenes (up to 227
46
+ people seen as 20 to 30 raw boxes), naive still wins and the estimator's own coverage flag drops
47
+ to 0.50, correctly signaling extrapolation; dense crowds past detector collapse are outside this
48
+ product's valid regime, and it says so at runtime. Suite: `46 passed in 2.22s`, re run this
49
+ session. Under the hood: 9 source files, 1,662 lines, `numpy` and `scipy` only, no GPU anywhere
50
+ in the synthetic path.
51
 
52
  - Dataset: [amodal-counting-benchmark](https://huggingface.co/datasets/Dhi-Technologies/amodal-counting-benchmark)
53
  - Demo: [amodal-counting-demo](https://huggingface.co/spaces/Dhi-Technologies/amodal-counting-demo)
 
55
 
56
  ## E1: multicam reasoning memory
57
 
58
+ The linking engine answers where, when, and who was there questions across a camera network,
59
+ and its founding asymmetry is that a false merge poisons weeks of memory while a missed link
60
+ costs one duplicate row. The honesty mechanism is a uniqueness guard refusal gate: a margin only
61
+ linker measured 0.918 site precision because peaky Gaussian transit scores produce confident
62
+ margins for wrong winners; the guard refuses any link where a second candidate is even
63
+ plausible, and took precision to 1.0. The evidence is no longer one seed: across a 24 site
64
+ synthetic grid (3 to 8 cameras, 20 to 100 people, 165,902 events), precision is exactly 1.0000
65
+ on every site while recall spans 0.0476 to 0.6788, scaling with identity reference coverage
66
+ (mean 0.2008 at 20% up to 0.6044 at 60%), the published price of the precision.
67
+
68
+ It is also the first product in the portfolio with a completed real data campaign, run two
69
+ ways on WILDTRACK's seven overlapping cameras: a ground truth replay and a real YOLO11n plus
70
+ ByteTrack pipeline whose stream included 380 unmatched false positive tracks as live
71
+ distractors. Zero wrong merges in every condition (precision 1.0 across 1,663 replay tracks
72
+ and 1,373 real tracker tracks; recall 0.4087 and 0.3502 at 40% reference coverage), and the
73
+ honest negative published with it: with no references at all, recall is exactly 0.0 on this
74
+ dataset, because WILDTRACK's overlapping topology structurally starves the transit prior
75
+ mechanism, which contributed zero links in all four conditions. That zero is the operating
76
+ envelope stated plainly: the prior path needs non overlapping cameras and reference coverage to
77
+ learn from, and its real data validation is still open until a disjoint topology dataset is
78
+ run. Memory stays bounded by construction, one episode row per contiguous presence rather than
79
+ one row per event: the seed 1 site fits in 61,440 bytes and a simulated month of per second
80
+ presence (36,000 events) stays under 2 MB, asserted by a regression test re run this session.
81
+ Suite: `34 passed in 4.33s`. Under the hood: 9 files, 1,290 lines, stdlib `sqlite3` plus
82
+ `numpy`, and a 330 line Frigate NVR bridge that maps its MQTT events into the input contract
83
+ with a 0.5 confidence gate before trusting any recognized plate or face as an identity.
84
 
85
  - Dataset: [multicam-reasoning-memory-benchmark](https://huggingface.co/datasets/Dhi-Technologies/multicam-reasoning-memory-benchmark)
86
  - Demo: [multicam-reasoning-memory-demo](https://huggingface.co/spaces/Dhi-Technologies/multicam-reasoning-memory-demo)
 
88
 
89
  ## A3: fixed camera 3D
90
 
91
+ This product turns an ordinary fixed camera into a metric 3D sensor by self calibrating height,
92
+ tilt, and focal length from people already walking through the scene, no GPU and no model
93
+ weights involved. The honesty mechanism is disclosure backed by a real conditioning probe in the
94
+ code rather than a post hoc caveat: `sensitivity_m_per_half_deg` perturbs the recovered tilt by
95
+ half a degree and measures how far the estimated ground position moves in response. The reason
96
+ it exists is a genuinely nasty failure mode of shallow camera geometry: a shallow mounted camera
97
+ can converge to a low optimizer residual while its recovered tilt is still off by a few degrees,
98
+ an error the residual cannot see but which becomes meters of far field position error. The
99
+ shallow configuration (3 m height, 20 degree tilt) is flagged by the probe at 1.72 meters of
100
+ position movement per half degree of tilt perturbation, against 0.72 and 0.20 meters at two well
101
+ conditioned geometries, and it reports 4.30 meters position RMSE against 0.16 meters at the good
102
+ geometry (5 m height, 30 degree tilt), in the same results table, with no configuration specific
103
+ tuning between them. The hard case is a row, not a footnote.
104
+
105
+ Suite: 27 tests pass (in 20.20s on the recorded run); the repo's own docs once claimed 29, a
106
+ discrepancy caught and disclosed rather than silently repeated. Under the hood: 916 lines across
107
+ 7 files, `numpy` and `scipy` only. A depth fusion path (Theil-Sen median of slopes anchor
108
+ fitting) takes any relative depth model as a plain callable, so the fusion math is fully unit
109
+ tested today with no model plugged in; concrete depth model adapters and an edge TensorRT path
110
+ are explicit future work, not shipped, and the product says so instead of listing them as
111
+ features.
 
 
 
 
 
112
 
113
  - Dataset: [fixed-camera-3d-benchmark](https://huggingface.co/datasets/Dhi-Technologies/fixed-camera-3d-benchmark)
114
  - Demo: [fixed-camera-3d-demo](https://huggingface.co/spaces/Dhi-Technologies/fixed-camera-3d-demo)
115
 
116
  ## E4: causal predictive alerting
117
 
118
+ The predictor claims incidents seconds before they happen from kinematic trajectories, which is
119
+ exactly the kind of claim that is cheap to make and expensive to check, so the product's core is
120
+ the checking machinery. Its falsification ledger files every alert at fire time with a deadline
121
+ derived from the alert's own claimed lead time, then grades it fulfilled (with the measured, not
122
+ predicted, lead time) or falsified, with no third verdict. Over an earlier 200 scenario battery:
123
+ 150 alerts fired, 63 fulfilled, 87 falsified, 50 scenarios with no alert, arithmetic that
124
+ reconciles and is published with the falsified count first. The newer 210 scenario battery
125
+ reports per kind rather than averaging: recall 1.0 on every kind, precision 0.667 (zone entry),
126
+ 0.657 (convergence), 0.500 (multi party convergence with decoy tracks), and 0.356 (crowd
127
+ buildup), with crowd buildup named as the weakest kind, plus a disclosed 8.0% false positive
128
+ rate on the 75 negative scenarios concentrated in two named edge cases (stationary loiterers at
129
+ 20%, incidents just outside the horizon at 13.3%), both root caused to noisy short window
130
+ velocity estimates crossing the minimum speed gate.
131
+
132
+ Every alert also ships a counterfactual from an ablation replay engine: the same predictor
133
+ re run on the same observation history with a candidate cause removed or motion frozen, so a
134
+ causal claim corresponds to an executed, rerunnable run rather than narration. The engine's
135
+ necessity statistics are themselves honest: presence removal was necessary for 100% of zone
136
+ entry and convergence alerts but only 21.7% of crowd buildup alerts across 267 per occupant
137
+ checks, which is the correct answer for a crowd well above threshold, reported instead of
138
+ inflated. Suite: `16 passed in 1.97s` on the recorded run. Under the hood: 1,146 lines across 7
139
+ modules, `numpy` only, no torch, no GPU, no network calls anywhere in `src/`.
 
140
 
141
  - Dataset: [causal-predictive-alerting-benchmark](https://huggingface.co/datasets/Dhi-Technologies/causal-predictive-alerting-benchmark)
142
  - Demo: [causal-predictive-alerting-demo](https://huggingface.co/spaces/Dhi-Technologies/causal-predictive-alerting-demo)
143
 
144
  ## A5: thermal perception
145
 
146
+ This is the portfolio's discipline case: a radiometric data engine and self supervised
147
+ pretraining harness for thermal native perception, built so every piece of math is CPU
148
+ verifiable ahead of any GPU spend. The honesty mechanism is a refusal to publish a model where
149
+ none was validly trained: a hard coded floor, `min_corpus_frames = 200,000`, labels anything
150
+ pretrained on fewer frames a *mechanics pilot*, not a quality claim, in the repo's own training
151
+ logs. Both GPU runs on record sit far below that floor and are labeled accordingly: a 2,503
152
+ synthetic frame pilot (32 minutes) and a 15,488 real infrared frame pilot on LLVIP data (40
153
+ minutes), both on a rented RTX 5060 Ti, both reported as evidence the machinery runs, not that
154
+ the pretraining works. The GPU pretraining run itself ships as a costed recipe rather than a
155
+ checkpoint, specifically so nothing on this org implies a thermal foundation model exists when
156
+ none does.
157
+
158
+ What is verified is the math: `thermalcore.cli selfcheck` passes all four AGC normalization
159
+ variants and the self supervised loss correctness checks, with a closed form linear probe
160
+ separability sanity check scoring 0.94, on a CPU only suite whose recorded verbatim line is
161
+ `99 passed in 0.39s`. The dataset card says explicitly that this validates mechanics, not real
162
+ world thermal accuracy. Under the hood: 2,222 lines across 21 files: a synthetic radiometric
163
+ scene generator, an AGC normalization zoo, cross sensor domain tooling, a pretraining corpus
164
+ engine, MAE masking math, and closed form evaluation metrics with no `sklearn` or `torch`
165
+ dependency in the core.
 
 
166
 
167
  - Dataset: [thermal-perception-benchmark](https://huggingface.co/datasets/Dhi-Technologies/thermal-perception-benchmark)
168
  - Demo: [thermal-perception-demo](https://huggingface.co/spaces/Dhi-Technologies/thermal-perception-demo)
169
 
170
  ## B1: Prompt2Model
171
 
172
+ The newest product is a language guided vision model factory: a plain English task description
173
+ compiles into a typed pipeline that runs dataset loading, training, evaluation, calibration,
174
+ ONNX export, and optional accuracy gated compression end to end. It carries two refusal gates.
175
+ At inference, a split conformal check abstains rather than guessing when a prediction's
176
+ nonconformity exceeds a threshold fit from held out validation data; on the healthy toy smoke
177
+ test that threshold is 0.004888 at alpha 0.1, and the exported model, re run this session,
178
+ classified 36 of 36 in distribution toy images correctly with zero abstentions while abstaining
179
+ on both out of distribution probes it was fed (a yellow star, calibrated confidence 0.9845, and
180
+ uniform noise, 0.9391). At the factory level, the compression step refuses to ship a distilled
181
+ or quantized model that falls below 98% of the uncompressed model's accuracy, a hard coded
182
+ floor; a failing candidate means the uncompressed model ships and the refusal is logged.
183
+
184
+ It is also the program's engineering candor case study: the first published smoke test artifact
185
+ reported 0.0 accuracy, and the diagnosis, a chain of three real bugs (unseeded RNGs, a class
186
+ dropping data split, a from scratch backbone whose BatchNorm statistics collapsed to constant
187
+ logits), is told in full in post 5, along with the deterministic healthy rerun (accuracy 1.0,
188
+ macro F1 1.0 against a 0.33 chance floor) and the corrections it forced to previously published
189
+ numbers. Suite: 117 of 117 at the tagged v0.1.0 release per its release notes; current main,
190
+ re run this session, `118 passed in 87.73s (0:01:27)`. The release ships with eight numbered
191
+ known limitation issues, including no measured detection mAP for the emitted artifact and no on
192
+ device TensorRT latency yet, tracked openly rather than smoothed into marketing copy.
 
 
 
 
 
 
193
 
194
  - Dataset: [prompt2model-examples](https://huggingface.co/datasets/Dhi-Technologies/prompt2model-examples)
195
  - Demo: [prompt2model-demo](https://huggingface.co/spaces/Dhi-Technologies/prompt2model-demo)
 
196
  - Deep dive: [Prompt2Model v0.1.0](05_prompt2model_v010.md)
197
 
198
+ ## How the pieces compose on one edge box
199
+
200
+ The portfolio is not six disconnected experiments; the interfaces were designed so the products
201
+ stack on a single small computer, and the design constraints that make that possible are
202
+ measured properties, not aspirations. To be explicit about framing: what follows describes how
203
+ the components are built to fit together, verified at the interface level; it is not a claim
204
+ that this composed system is deployed anywhere.
205
+
206
+ Start with what every product above has in common: the decision layers are CPU only. E1 is
207
+ `numpy` plus stdlib `sqlite3`; A4 and A3 are `numpy` and `scipy`; E4 is `numpy` with no network
208
+ calls in its core. The only GPU consumers in the composed picture are the perception models that
209
+ feed them, a detector and tracker producing boxes and track IDs, which is precisely the workload
210
+ a Jetson class device's accelerator is for. That split matters on an 8 GB box: the reasoning
211
+ layer's footprint is measured in megabytes (E1's month of presence stays under 2 MB by asserted
212
+ test; its densest real ingest, 42,707 WILDTRACK events, produced a 7.4 MB store), so adding the
213
+ honesty machinery costs almost nothing next to the models it supervises.
214
+
215
+ The composition follows the data. A detector's boxes go two places at once. A4 consumes the
216
+ per frame box set and returns a corrected count with a calibrated interval and an extrapolation
217
+ flag, so a crowding dashboard reads "34 to 48, 90% calibrated" instead of a bare "39". The
218
+ tracker's track stream feeds E1 as JSONL events, exactly the contract its Frigate bridge already
219
+ implements for one real NVR; identity references arrive from whatever external identity exists
220
+ at the site, a plate reader, a badge system, or a face free embedding cluster, each gated by
221
+ confidence before it is trusted. A3 calibrates each fixed camera once from pedestrians already
222
+ in the scene and thereafter converts image tracks to metric ground positions, which is the
223
+ coordinate system E4's kinematic predictor needs; E4 then watches those metric trajectories,
224
+ fires ahead of incidents, and grades itself in its ledger. B1 sits beside the pipeline rather
225
+ than in it: it is the factory that produces the site specific classifier or detector variants
226
+ the other components consume, refusing to ship compressed models that fail its floor. Each
227
+ handoff carries the upstream component's honesty signal with it: an extrapolation flagged count,
228
+ a refused link that becomes a new entity rather than a guess, a sensitivity number that says one
229
+ camera's geometry cannot support far field metric claims, a falsified prediction that stays in
230
+ the ledger.
231
+
232
+ The open integration work is stated as plainly as the finished parts: E1's identity references
233
+ from the face free re identification line are an interface today, not a validated joint run;
234
+ per camera clock offset estimation (which would tighten E1's transit priors) is unbuilt; A3's
235
+ learned depth adapters and TensorRT path are future work; and no composed end to end benchmark
236
+ of the full stack exists yet. When one does, it will be published with the same rules as
237
+ everything else here: synthetic ground truth first, real data second, negative results included.
238
+
239
  ## The pattern across all six
240
 
241
+ Four mechanisms recur across these products: calibrated intervals (A4), refusal gates (E1, B1),
242
+ provenance (E1), and falsification ledgers (E4), with A3 and A5 applying the same instinct to
243
+ reporting itself, disclosing the hard case and the unfinished step instead of smoothing over
244
+ them. None of these are free, and the price is always published next to the benefit: recall in
245
+ E1 (0.0476 to 0.6788 across the grid, 0.0 without references on WILDTRACK), interval width in A4
246
+ (6.7x to 14.5x), false positives in E4 (8.0%, itemized), answer rate and size headroom in B1. It
247
+ also shows up in how the program handles its own mistakes: stale prose corrected against fresh
248
+ runs (E1's memory size and journey range, A3's test count), a real data regression published
249
+ before its fix existed (A4), and a degenerate published artifact diagnosed in public (B1). That
250
+ is the whole thesis from post 1, applied six times.
 
 
 
 
251
 
252
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 2, E1 deep dive](02_e1_precision_first_linking.md), [post 3, A4 deep dive](03_a4_calibration_over_accuracy.md), [post 5, Prompt2Model v0.1.0](05_prompt2model_v010.md)
253
  - Collection: [Dhi Labs, honest edge vision AI](https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7)
254
  - Org: [Dhi-Technologies](https://huggingface.co/Dhi-Technologies)
255
+ - Code: proprietary, closed source across the portfolio; Prompt2Model additionally has one
256
+ tagged, MIT licensed v0.1.0 release as a deliberate exception (post 5). The open surface for
257
+ everything is the evidence: benchmark datasets with exact ground truth, demo Spaces, committed
258
+ evidence logs, and the verbatim reproduction output quoted throughout this series. Partnership
259
+ or access inquiries: [dhi-tech.com](https://dhi-tech.com).
05_prompt2model_v010.md CHANGED
@@ -1,133 +1,227 @@
1
- # Prompt2Model v0.1.0: a language guided vision model factory's first release
2
 
3
  *Dhi Labs, post 5 of 5: Prompt2Model (B1) ships its first tagged release*
4
 
5
- Today we tagged v0.1.0 of Prompt2Model, publicly and under the MIT license. It is the newest
6
- product in the Dhi Technologies research program (internal label B1) and the first of the six
7
- products covered in posts 1 through 4 to cross from private research code into a public GitHub
8
- release with its own version number, its own test count, and its own numbered list of open
9
- issues. This post covers what shipped, what is measured, and what is honestly still open, in the
10
- same style as the rest of this series: real numbers with their source, and a limitations section
11
- that is not an afterthought.
 
 
12
 
13
  ## What it does
14
 
15
  Prompt2Model takes a plain English task description, for example "classify red square, blue
16
  circle, and green triangle images under low light, prioritize speed," and compiles it into a
17
- typed pipeline configuration that runs dataset loading, training, evaluation, ONNX export, and
18
- reporting end to end. Concretely:
19
 
20
  - A deterministic regex prompt parser is the default (dependency free), with an optional LLM
21
- planner overlay (`planner.py`, offline first, works against any OpenAI compatible
22
- `/v1/chat/completions` endpoint) that only overwrites the fields it actually extracts from the
23
- prompt, rather than replacing the deterministic parse wholesale.
24
  - Classification and COCO style detection dataset loaders, a lightweight model registry, and
25
- training loops with augmentation injection.
26
- - ONNX export with metadata injection and verification, so an exported model is checked to
27
- actually run, not just checked to exist on disk.
28
- - An opt-in compression step: knowledge distillation and INT8 quantization, gated by an accuracy
29
- floor. If the compressed artifact cannot hold the floor, the factory refuses to ship it and
30
- keeps the uncompressed model instead of silently shipping a degraded one.
31
- - Opt-in calibration (temperature scaling and a split conformal abstain threshold) and a
32
- flywheel hard case store for the classification path, so inputs the model is unsure about get
33
- surfaced rather than guessed at and forgotten.
34
- - Pluggable deployment targets: ONNX Runtime by default, plus TensorRT, which builds locally when
35
- `trtexec` is present on the machine, and otherwise emits a reproducible on device build recipe
36
- instead of silently failing or pretending the export happened.
37
-
38
- ## The refusal gate this pipeline is really about
39
-
40
- The same honesty mechanism named in posts 1 and 4 is the centerpiece here, not a footnote. At
41
- inference time, a split conformal abstention check compares each prediction's nonconformity (1
42
- minus the predicted probability) against a validation calibrated threshold, and abstains rather
43
- than guessing when that threshold is exceeded. The threshold is fit from held out data, not
44
- chosen by hand: on the repository's own toy classification smoke test, fit at `alpha=0.1` (a 90%
45
- target coverage) from 7 held out samples, it came out to `conformal_threshold=0.491826`. That
46
- smoke test's own card also discloses, rather than smooths over, that calibrating from only 7
47
- samples is noisy: `ece_before` was 0.065 and `ece_after` was 0.272 on that tiny sample.
48
-
49
- Separately, at the factory level, the compression step refuses to ship a distilled or quantized
50
- model that falls below 98% of the uncompressed model's accuracy, the default retention floor,
51
- hard coded rather than merely documented. If the compressed candidate fails that floor, the
52
- pipeline ships the uncompressed model instead and logs the refusal in the run report, rather than
53
- silently shipping a smaller but worse model to hit a size target.
54
-
55
- ## What the toy smoke test actually measured
56
-
57
- The `prompt2model-examples` dataset on this org ships the fixtures and the real output of running
58
- `prompt2model.cli smoke-test` against them, generated by the repository's own
59
- `generate-toy-data` command. Read these as a **pipeline smoke test, not a model quality
60
- benchmark**: the toy sets are a few dozen procedurally drawn shape images per class, by design.
61
-
62
- - **Classification**: ONNX export built and verified runnable; 1.52M parameters; about 150 ms
63
- per image, roughly 6.6 fps, on CPU for the exported model.
64
- - **Detection**: mAP@0.5 = 0.053, mAP@[0.5:0.95] = 0.014 on the toy set, numbers we expect to be
65
- low given a handful of synthetic training images, not a real detection benchmark; ONNX export
66
- built and verified runnable; 2.22M parameters; about 36 ms per image, roughly 27.5 fps, on CPU.
67
-
68
- The point of this artifact is that the typed pipeline runs end to end and the exported ONNX
69
- models are verified runnable, not that these are competitive vision models trained on a few dozen
70
- images. No trained checkpoint from this toy run is presented as a usable vision model; when the
71
- pipeline is run on a real task, that model would be published separately, labeled with its actual
72
- training data and metrics.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
73
 
74
  ## The measured test suite
75
 
76
- Before tagging v0.1.0, the full test suite was run in the release environment. Verbatim from the
77
- release notes: **117 passed, 0 failed, full suite, no skips, in about 106 seconds.** That is the
78
- number we are attaching to this release, sourced from the GitHub release page itself
79
- (`v0.1.0`, tagged and published 2026-07-09), not re-run independently for this post.
80
 
81
- ## What is validated versus what is not
 
 
82
 
83
- Stated as plainly as the release notes state it, because a release note is exactly the kind of
84
- place this kind of claim quietly gets softened elsewhere:
85
 
86
  - **Validated end to end:** the classification path, prompt to config to training to metrics to
87
- ONNX export to report, on synthetic data.
88
- - **Integrated but not fully measured:** the detection path is wired through export and a smoke
89
- test, but detection accuracy (mAP) for the emitted, deployment-ready artifact is not yet
90
- measured on a real detection benchmark (tracked as GitHub issue #10).
91
- - **Not yet measured at all:** on-device latency for the emitted TensorRT recipe on a Jetson class
92
- device. The TensorRT deployment path builds locally or emits a reproducible build recipe, but
93
- no Jetson has actually run that recipe and timed it yet (tracked as GitHub issue #12).
 
94
 
95
- ## Known gaps, tracked as open issues, not swept under the rug
96
 
97
- The release ships with a numbered list of its own known limitations, several of which are more
98
- interesting than a typical "future work" paragraph because they name a specific, already
99
- observed failure:
100
 
101
  - **#7:** dynamic versus static INT8 post training quantization needs a real data sweep; dynamic
102
  quantization has already been observed to collapse accuracy on one dataset.
103
  - **#8:** the compression gate's evaluator needs guards against degenerate or tiny validation
104
- splits, since a floor computed from too few samples can be misleading.
105
- - **#9:** there is no zero-shot VLM or CLIP baseline yet to check the augmentation transfer
106
- claim against.
107
- - **#10:** no measured detection mAP yet for the emitted SSDLite artifact (export verified only,
108
- as above).
109
- - **#11:** no fixed RNG seeds or dataset checksums yet, which is reproducibility hardening still
110
- to be done.
111
- - **#12:** no on-Jetson TensorRT latency measurement yet for the emitted artifact, as above.
112
  - **#13:** README and report claims need reconciliation with what is actually measured and on
113
- which hardware, plus authorship and venue framing, an internal honesty pass still in progress.
114
- - **#14:** the compression gate's hard coded 0.98 relative retention floor can currently override
115
- a more permissive, explicitly stated user accuracy floor, a real edge case in the gate's own
116
- precedence logic.
117
-
118
- We are listing all eight by number rather than picking the flattering three, for the same reason
119
- the rest of this series names crowd buildup as the weakest alert kind and the CrowdHuman
120
- regression as a real regression: an open issue tracker that only shows the easy ones is not
121
- actually open.
122
-
123
- ## License, and where to look
124
 
125
- The repository is MIT licensed, `LICENSE` in the repo root. Everything in this post traces back
126
- to a source you can check yourself:
127
 
128
- - Code (public, MIT licensed): [Prompt2Model-Language-Guided-Vision-Model-Factory](https://github.com/DHI-Technologies-Inc/Prompt2Model-Language-Guided-Vision-Model-Factory)
129
- - Release: [v0.1.0](https://github.com/DHI-Technologies-Inc/Prompt2Model-Language-Guided-Vision-Model-Factory/releases/tag/v0.1.0)
130
- - Examples dataset (toy fixtures plus real smoke test output): [Dhi-Technologies/prompt2model-examples](https://huggingface.co/datasets/Dhi-Technologies/prompt2model-examples)
131
- - Live demo Space (the refusal-gate mechanism plus a worked abstain/predict example): [prompt2model-demo](https://huggingface.co/spaces/Dhi-Technologies/prompt2model-demo)
132
  - Collection: [Dhi Labs, honest edge vision AI](https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7)
 
 
 
133
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 2, E1 deep dive](02_e1_precision_first_linking.md), [post 3, A4 deep dive](03_a4_calibration_over_accuracy.md), [post 4, portfolio overview](04_portfolio_overview.md)
 
1
+ # Prompt2Model v0.1.0: a model factory's first release, bugs and all
2
 
3
  *Dhi Labs, post 5 of 5: Prompt2Model (B1) ships its first tagged release*
4
 
5
+ Prompt2Model is the newest product in the Dhi Technologies research program (internal label B1)
6
+ and the first to cross from private research code into a tagged public release: v0.1.0, tagged
7
+ and published 2026-07-09 under the MIT license, as a deliberate exception to the closed source
8
+ posture of the rest of the portfolio. This post covers what shipped, how its two refusal gates
9
+ actually work at the mechanical level, and then the part that makes it belong in this series:
10
+ the story of the degenerate artifact this pipeline published before its first release, the
11
+ three real bugs behind it, and the corrections that fix forced to numbers we had already put in
12
+ public. Real numbers with their source throughout, and the limitations section is the longest
13
+ one in the series, because this is the youngest product in it.
14
 
15
  ## What it does
16
 
17
  Prompt2Model takes a plain English task description, for example "classify red square, blue
18
  circle, and green triangle images under low light, prioritize speed," and compiles it into a
19
+ typed pipeline configuration that runs dataset loading, training, evaluation, calibration, ONNX
20
+ export, and reporting end to end. Concretely:
21
 
22
  - A deterministic regex prompt parser is the default (dependency free), with an optional LLM
23
+ planner overlay that is offline first, works against any OpenAI compatible chat completions
24
+ endpoint, and only overwrites the fields it actually extracts from the prompt rather than
25
+ replacing the deterministic parse wholesale.
26
  - Classification and COCO style detection dataset loaders, a lightweight model registry, and
27
+ training loops with augmentation injection derived from the prompt's environment tags ("low
28
+ light" becomes a low light augmentation policy).
29
+ - ONNX export with metadata injection and verification: an exported model is checked to actually
30
+ run under ONNX Runtime, not just to exist on disk, and the calibration block travels inside
31
+ the artifact's metadata so the deployed model carries its own abstention threshold.
32
+ - An opt in compression step (knowledge distillation and INT8 quantization) gated by an accuracy
33
+ floor, described below.
34
+ - Opt in calibration (temperature scaling plus a split conformal abstain threshold) and a
35
+ flywheel hard case store, so inputs the model abstains on can be captured for the retrain loop
36
+ instead of being guessed at and forgotten.
37
+ - Pluggable deployment targets: ONNX Runtime by default, TensorRT when `trtexec` is present on
38
+ the machine, and otherwise a reproducible on device build recipe rather than a silent failure
39
+ or a pretended export.
40
+
41
+ ## The refusal gates, mechanically
42
+
43
+ Posts 1 and 4 name the mechanism; this section shows its gears, because "calibrated abstention"
44
+ is the kind of phrase that deserves to be checked against actual arithmetic.
45
+
46
+ **The inference gate.** After training, the factory temperature scales the model's logits on a
47
+ held out validation split, then computes each validation prediction's *nonconformity*, defined
48
+ as 1 minus the calibrated confidence of the predicted class. The abstention threshold is the
49
+ split conformal quantile of those scores with the standard finite sample correction: sort the n
50
+ validation scores, take the score at rank ceiling of (n + 1)(1 - alpha), clamped into range, at
51
+ the default alpha of 0.1 (a 90% target). At deployment, the exported model abstains whenever a
52
+ prediction's nonconformity exceeds that threshold. With no calibration data at all, the
53
+ threshold is positive infinity, never abstain until calibrated, which is itself a documented
54
+ choice: an uncalibrated model does not pretend to know its own limits.
55
+
56
+ The finite sample correction matters at small n, and the toy smoke test is honest about being
57
+ small. With n = 7 validation samples and alpha = 0.1, the required rank is the ceiling of 8
58
+ times 0.9, which is 8, clamped to 7: the threshold is simply the *largest* nonconformity seen in
59
+ validation. That is the weakest form of the guarantee, and it is what a 7 sample calibration can
60
+ legitimately give you; more validation data tightens it, and the run report exposes
61
+ `val_samples: 7` precisely so a reader can see how much the threshold is resting on.
62
+
63
+ **The factory gate.** Separately, the compression step refuses to ship a distilled or quantized
64
+ model that falls below 98% of the uncompressed model's accuracy. The floor is a typed config
65
+ default (`accuracy_floor_relative = 0.98`), enforced in code; a failing candidate means the
66
+ pipeline ships the uncompressed model and logs the refusal in the run report. One known edge in
67
+ its precedence logic, where the hard coded relative floor can override a more permissive,
68
+ explicitly stated user floor, is tracked as a numbered issue rather than left undocumented (see
69
+ the gaps list at the end).
70
+
71
+ ## The engineering case study: a published 0.0, and the three bugs behind it
72
+
73
+ Here is the part of the release story a normal announcement would omit. The first published
74
+ smoke test artifact for this pipeline reported toy classification accuracy 0.0 and macro F1 0.0.
75
+ Not "low": zero, on a three class problem with a 0.33 chance floor, in a results file we had
76
+ already made public. The temptation with a number like that is to rerun until it looks better
77
+ and republish. What actually happened is that the rerun was refused until the zero was
78
+ *explained*, and the explanation turned out to be a chain of three real bugs, each of which is a
79
+ small classic. The diagnosis and fix landed as a single reviewed change on 2026-07-09, and the
80
+ commit message records all three mechanisms; the summaries below are drawn from that commit and
81
+ the code it changed.
82
+
83
+ **Bug one: the RNGs were never seeded.** The dataset split and the augmentation backend already
84
+ threaded a configured seed through, which made the pipeline *look* deterministic in review. But
85
+ the factory's run entry point never seeded torch's global RNG, so model weight initialization
86
+ and DataLoader shuffling changed on every run. On a severely undertrained toy run (a couple of
87
+ epochs, a few dozen images), an unlucky random init can land at or near 0.0 by chance alone. The
88
+ fix seeds Python's `random`, torch, and CUDA (when present) from the same configured seed at the
89
+ top of every run. The lesson is the gap between "the code accepts a seed" and "the run is
90
+ seeded": the former is an API property, the latter is a property of every RNG the run touches.
91
+
92
+ **Bug two: the data split could drop an entire class.** The splitter did a flat shuffle and
93
+ slice over the whole sample pool with no class balance protection. On the toy set, three classes
94
+ of twelve samples each, a single global shuffle can and, with the default seed, *did* leave an
95
+ entire class out of a validation or test slice. Evaluating a three way classifier on a split
96
+ that never contains one of the three classes produces meaningless, sometimes zero metrics that
97
+ look exactly like a training bug while actually being a sampling bug. The fix is stratified
98
+ splitting via largest remainder apportionment: each class gets the floor of its proportional
99
+ quota in each slice, and leftover slots go to the largest fractional remainders, which keeps the
100
+ overall split sizes identical to the flat split while guaranteeing every class is spread as
101
+ evenly as its size allows.
102
+
103
+ **Bug three: the smoke test trained a modern backbone from scratch.** The smoke test never set
104
+ `pretrained=True`, so it trained `mobilenet_v3_small` from random initialization with batch size
105
+ 8 on about 26 images. BatchNorm running statistics re estimated from batches of 8 over a couple
106
+ of epochs never stabilize, and the backbone collapses to an input independent constant output.
107
+ This was verified, not inferred: the logits were identical across all validation images
108
+ regardless of the true label. Combined with bug two, an unlucky run reports systematic wrong
109
+ answers and lands on exactly 0.0. The fix sets `pretrained=True` for both smoke test tasks,
110
+ matching the model registry's own documented recommendation.
111
+
112
+ Three observations make this a case study rather than a confession. First, the bugs *compounded*:
113
+ any one of them alone would have produced occasional weird numbers; together they produced a
114
+ stable looking catastrophe with a plausible innocent explanation ("toy set, few epochs") sitting
115
+ right next to it. Second, the degenerate artifact was load bearing for honesty elsewhere: the
116
+ previously published conformal threshold for this smoke test, 0.491826, and its strange
117
+ calibration trace (`ece_before` 0.065, `ece_after` 0.272, calibration making expected
118
+ calibration error *worse*) were measurements of a collapsed model, and we had quoted them in an
119
+ earlier revision of this very blog series as an example of disclosing noisy calibration. The
120
+ disclosure instinct was right; the numbers were describing a broken model. Both are now
121
+ corrected here, which is the third observation: publishing your artifacts means your bugs are
122
+ public, and fixing them means correcting the public record, not just the code.
123
+
124
+ ## The healthy model, re measured for this post
125
+
126
+ With the three fixes in, the smoke test is deterministic and healthy, and we re ran the whole
127
+ thing fresh for this post on a CPU only machine (macOS, Python 3.12.13, no GPU) rather than
128
+ quoting the repository's committed artifact:
129
+
130
+ - **Classification:** accuracy 1.0, macro F1 1.0, against a 0.33 chance floor (three classes,
131
+ 36 images). Calibration on the 7 held out validation samples: temperature 0.05, conformal
132
+ threshold **0.004888** at alpha 0.1, `ece_before` 0.3864, `ece_after` 0.0014. Exported ONNX
133
+ verified runnable; 1.52M parameters; about 100 ms per image on this machine's CPU.
134
+ - **Detection:** the pipeline runs end to end and exports a verified runnable ONNX artifact
135
+ (`ssdlite320_mobilenet_v3_large`, 3.73M parameters), with toy set mAP@0.5 of 0.034: a pipeline
136
+ smoke test on a few dozen synthetic images, not a detection benchmark, and labeled as such.
137
+ Earlier published toy detection figures (mAP 0.053, 2.22M parameters) predate the determinism
138
+ fix and no longer describe the current artifact; treat the numbers in this paragraph as the
139
+ ones that reproduce.
140
+
141
+ Then the demonstration the abstention gate exists for. The conformal threshold of 0.004888 means
142
+ the deployed model answers only when its calibrated confidence is at least about 0.9951, a very
143
+ sharp gate produced by a temperature of 0.05 on a cleanly separated toy problem. Running the
144
+ exported artifact over all **36** in distribution toy images: **36 of 36 classified correctly,
145
+ zero abstentions**, with every calibrated confidence at or above 0.9951. Then two inputs the
146
+ model has never seen anything like: a yellow star on a dark background scored a calibrated
147
+ confidence of 0.9845, below the gate, **abstained**; uniform random noise scored 0.9391,
148
+ **abstained**. The same artifact that never abstains on its own distribution refuses both out of
149
+ distribution probes instead of confidently naming a shape that is not there.
150
+
151
+ The plumbing that makes the demonstration meaningful is worth two sentences, because it is easy
152
+ to build an abstention gate that evaporates at deployment. The calibration block (temperature,
153
+ alpha, conformal threshold, validation sample count) is injected into the ONNX artifact's own
154
+ metadata at export, and the edge inference wrapper reads it back from the artifact, applies the
155
+ temperature to the raw logits, and computes `abstained` as nonconformity exceeding the stored
156
+ threshold; the model file and its abstention policy cannot drift apart, because they are one
157
+ file. An artifact exported without calibration reports `calibrated: false` and never abstains,
158
+ rather than pretending to a policy it does not carry, and the abstain path is pinned by its own
159
+ unit test (force the threshold to zero and assert that a model that cannot be perfectly certain
160
+ abstains). The same wrapper accepts an optional hard case store, so abstained frames can be
161
+ captured for the retraining flywheel instead of being dropped on the floor. For the toy runs,
162
+ the whole pipeline configuration is typed and committed alongside the artifact: image size 96,
163
+ validation split 0.2, test split 0.1, seed 42, which is what "deterministic under its seed"
164
+ means concretely.
165
+
166
+ An honest boundary on that demonstration, so it is not overread: two crafted probes are a
167
+ demonstration of the mechanism working as designed, not a measured out of distribution detection
168
+ rate, and split conformal calibration guarantees coverage on data drawn from the calibration
169
+ distribution; it makes no formal promise about arbitrary OOD inputs. A 7 sample calibration also
170
+ means the threshold itself is only as stable as those 7 points. The right reading is mechanical,
171
+ not statistical: the gate is real, it is fit from data rather than hand set, it travels inside
172
+ the exported artifact, and it fires in the right direction on the obvious probes.
173
 
174
  ## The measured test suite
175
 
176
+ The v0.1.0 release notes record the release gate: **117 passed, 0 failed, full suite, no skips,
177
+ in about 106 seconds**, sourced from the release itself. Current main, which includes the three
178
+ bug fix and one test it added, re run fresh for this post; verbatim final line:
 
179
 
180
+ ```
181
+ 118 passed in 87.73s (0:01:27)
182
+ ```
183
 
184
+ ## What is validated versus what is not
 
185
 
186
  - **Validated end to end:** the classification path, prompt to config to training to metrics to
187
+ calibrated ONNX export to report, on synthetic data, deterministic under its seed, with the
188
+ healthy numbers above reproduced from scratch for this post.
189
+ - **Integrated but not benchmark measured:** the detection path is wired through training,
190
+ export, and a smoke test, but detection accuracy for the emitted, deployment ready artifact
191
+ has not been measured on any real detection benchmark.
192
+ - **Not measured at all:** on device latency for the emitted TensorRT recipe on a Jetson class
193
+ device. The deployment path builds locally when `trtexec` exists and otherwise emits a
194
+ reproducible build recipe, but no Jetson has run and timed that recipe yet.
195
 
196
+ ## Known gaps, tracked as numbered issues
197
 
198
+ The release ships with a numbered list of its own limitations in the project tracker, several of
199
+ which name an already observed failure rather than generic future work. All eight, not a
200
+ flattering subset:
201
 
202
  - **#7:** dynamic versus static INT8 post training quantization needs a real data sweep; dynamic
203
  quantization has already been observed to collapse accuracy on one dataset.
204
  - **#8:** the compression gate's evaluator needs guards against degenerate or tiny validation
205
+ splits, since a floor computed from too few samples can be misleading (the same small n
206
+ caveat the conformal gate discloses).
207
+ - **#9:** no zero shot VLM or CLIP baseline yet to check the augmentation transfer claim
208
+ against.
209
+ - **#10:** no measured detection mAP for the emitted SSDLite artifact (export verified only).
210
+ - **#11:** reproducibility hardening beyond the RNG fix: dataset checksums and pinned fixture
211
+ hashes are still to be done.
212
+ - **#12:** no on Jetson TensorRT latency measurement for the emitted artifact.
213
  - **#13:** README and report claims need reconciliation with what is actually measured and on
214
+ which hardware; this post is part of that reconciliation, and the degenerate artifact
215
+ corrections above came out of it.
216
+ - **#14:** the compression gate's hard coded 0.98 relative floor can override a more permissive,
217
+ explicitly stated user accuracy floor, a real precedence edge case in the gate's own logic.
 
 
 
 
 
 
 
218
 
219
+ ## Where to look
 
220
 
221
+ - Examples dataset (toy fixtures plus smoke test output): [Dhi-Technologies/prompt2model-examples](https://huggingface.co/datasets/Dhi-Technologies/prompt2model-examples)
222
+ - Live demo Space (the refusal gate plus a worked abstain and predict example): [prompt2model-demo](https://huggingface.co/spaces/Dhi-Technologies/prompt2model-demo)
 
 
223
  - Collection: [Dhi Labs, honest edge vision AI](https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7)
224
+ - Code: the rest of the portfolio is proprietary and closed source; Prompt2Model's v0.1.0 is a
225
+ tagged, MIT licensed public release, the program's deliberate exception. Access and
226
+ partnership inquiries: [dhi-tech.com](https://dhi-tech.com).
227
  - Series: [post 1, the thesis](01_ai_that_refuses_to_guess.md), [post 2, E1 deep dive](02_e1_precision_first_linking.md), [post 3, A4 deep dive](03_a4_calibration_over_accuracy.md), [post 4, portfolio overview](04_portfolio_overview.md)
README.md CHANGED
@@ -17,49 +17,65 @@ dataset card, and the [Dhi Labs collection](https://huggingface.co/collections/D
17
 
18
  ## Posts
19
 
20
- 1. **[AI that refuses to guess](01_ai_that_refuses_to_guess.md)** (2026-07-09 update): the
21
- thesis. Calibrated intervals, refusal gates, provenance, and falsification ledgers as product
22
- features, each measured rather than asserted, across all six products, with the code paths
23
- and a real-data regression behind each claim.
24
- 2. **[Precision first cross camera linking (E1)](02_e1_precision_first_linking.md)** (2026-07-09
25
- update): a deep dive into multicam reasoning memory. How a uniqueness guard lifted synthetic
26
- site precision from 0.918 to 1.0 (recall traded deliberately), how weeks-scale memory stays
27
- under 2 megabytes, and two small discrepancies this session found between prior prose and a
28
- fresh reproduction.
29
- 3. **[When the error bar is the product (A4)](03_a4_calibration_over_accuracy.md)** (2026-07-09
30
- update): a deep dive into amodal counting's calibration honesty. The analytic interval
31
- undercovered (0.50 to 0.63 actual versus a claimed 0.90); conformal calibration widened it 6.7x
32
- to 14.5x; a real CrowdHuman re-test made the correction *worse* before a two-sided estimator
33
- fixed it, and both results are published.
34
- 4. **[Six products, one honesty thesis](04_portfolio_overview.md)** (2026-07-09 update): a
35
- portfolio overview tying all six products (A4, E1, A3, E4, A5, B1) back to the thesis in post
36
- 1, with each product's honesty mechanism, clearest verified number, and test suite count.
37
- 5. **[Prompt2Model v0.1.0](05_prompt2model_v010.md)** (new, 2026-07-09): the seventh piece of the
38
- program crosses into a public, MIT-licensed release. What shipped, a measured 117-test suite,
39
- and what is explicitly not yet validated (detection mAP, on-Jetson latency), tracked as
40
- numbered GitHub issues rather than smoothed over.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
 
42
  ## License
43
 
44
  This blog is released under **CC BY-NC 4.0** (non-commercial). It stays public and freely
45
  readable: this dataset is prose meant to be read, and gating it would hide the posts from
46
- everyone. Reading and citing individual posts is welcome; do not redistribute or re-host the text
47
- elsewhere without permission. Any use in a publication or downstream work should cite Dhi
48
  Technologies. Commercial use requires a separate agreement; contact
49
  [dhi-tech.com](https://dhi-tech.com).
50
 
51
  ## Honesty note
52
 
53
- Every number in these posts is measured on **synthetic** benchmarks with exact ground truth,
54
- except where a post explicitly attributes a number to a real-data evidence log or a public
55
- release note and says so; real world validation is otherwise in progress and marked as such
 
56
  throughout. No state of the art claims, no customer or deployment claims.
57
 
58
  - Org: https://huggingface.co/Dhi-Technologies
59
  - Collection: https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7
60
  - Company site: https://dhi-tech.com/labs
61
- - Code: proprietary, closed source permanently. Prompt2Model already shipped one public,
62
- MIT-licensed release (post 5) as a deliberate exception; the other five products are not public
63
- and have no release planned. The GitHub org [github.com/DHI-Technologies-Inc](https://github.com/DHI-Technologies-Inc)
64
- is an identity link, not a browsable code destination for those five. Partnership or access
65
  inquiries: [dhi-tech.com](https://dhi-tech.com).
 
17
 
18
  ## Posts
19
 
20
+ 1. **[AI that refuses to guess](01_ai_that_refuses_to_guess.md)** (2026-07-10 update, ~17 min
21
+ read): the thesis. A full taxonomy of the four honesty mechanisms (calibrated intervals,
22
+ refusal gates, provenance, falsification ledgers) with a worked, real numbered micro example
23
+ of each; why the industry default is overclaiming and what it costs operators; and the
24
+ measurement philosophy: synthetic ground truth first, real data second, negative results
25
+ published.
26
+ 2. **[Precision first cross camera linking (E1)](02_e1_precision_first_linking.md)** (2026-07-10
27
+ update, ~19 min read): the full method walkthrough (episodes versus events, three gates with
28
+ their actual thresholds, transit priors learned only from ref confirmed links), the 0.918 to
29
+ 1.0 uniqueness guard story with the failure case that motivated it, the 24 site grid, the
30
+ under 2 MB month test, the Frigate bridge's confidence gated identity mapping, and the first
31
+ real data campaign: WILDTRACK two ways (ground truth replay and a real YOLO11n + ByteTrack
32
+ pipeline), precision 1.0 with zero wrong links in every condition, recall 0.4087 and 0.3502
33
+ at 40% reference coverage, and an honest recall 0.0 without references, diagnosed rather
34
+ than hidden.
35
+ 3. **[When the error bar is the product (A4)](03_a4_calibration_over_accuracy.md)** (2026-07-10
36
+ update, ~14 min read): the flagship honesty story, told in four acts from the committed
37
+ evidence log. Synthetic wins first (analytic interval 0.50 to 0.63 actual coverage against a
38
+ 0.90 claim, conformal multiplier 6.7x to 14.5x); then the first real CrowdHuman test fails
39
+ (flat detectability curve, one directional correction against two sided error, 28.204 versus
40
+ naive 14.08); a richer curve fails better; a detector fix improves naive to 11.767 and the
41
+ correction still loses; and the two sided estimator finally wins (11.031, 90.67% coverage),
42
+ with the dense scene boundary where naive still wins disclosed.
43
+ 4. **[Six products, one honesty thesis](04_portfolio_overview.md)** (2026-07-10 update, ~14 min
44
+ read): the portfolio tour. Each product in a full paragraph with its headline number and its
45
+ stated limitation in the same breath (A4, E1, A3, E4, A5, B1), the combined 340 test count
46
+ with its arithmetic shown, and a new section on how the pieces are designed to compose on a
47
+ single edge box, CPU only decision layers over GPU perception, stated as design properties
48
+ rather than deployment claims.
49
+ 5. **[Prompt2Model v0.1.0](05_prompt2model_v010.md)** (2026-07-10 update, ~12 min read): the
50
+ program's public release exception, MIT licensed and tagged. The refusal gate mechanics
51
+ (conformal threshold with the finite sample correction, the 0.98 relative accuracy floor),
52
+ the three bug engineering case study behind a published 0.0 accuracy artifact (unseeded
53
+ RNGs, class dropping splits, from scratch BatchNorm collapse), the healthy re measured
54
+ result (36 of 36 correct, zero abstentions in distribution, both OOD probes abstained), the
55
+ corrections that fix forced to earlier published numbers, and all eight numbered known
56
+ limitation issues.
57
 
58
  ## License
59
 
60
  This blog is released under **CC BY-NC 4.0** (non-commercial). It stays public and freely
61
  readable: this dataset is prose meant to be read, and gating it would hide the posts from
62
+ everyone. Reading and citing individual posts is welcome; do not redistribute or re-host the
63
+ text elsewhere without permission. Any use in a publication or downstream work should cite Dhi
64
  Technologies. Commercial use requires a separate agreement; contact
65
  [dhi-tech.com](https://dhi-tech.com).
66
 
67
  ## Honesty note
68
 
69
+ Numbers in these posts are measured on **synthetic** benchmarks with exact ground truth, except
70
+ where a post explicitly attributes a number to a real data evidence log (CrowdHuman for A4,
71
+ WILDTRACK for E1), a fresh reproduction run described in the post, or a public release note,
72
+ and says so inline. Remaining real world validation is in progress and marked as such
73
  throughout. No state of the art claims, no customer or deployment claims.
74
 
75
  - Org: https://huggingface.co/Dhi-Technologies
76
  - Collection: https://huggingface.co/collections/Dhi-Technologies/dhi-labs-honest-edge-vision-ai-6a4eb297cbd60f5f673cc2d7
77
  - Company site: https://dhi-tech.com/labs
78
+ - Code: proprietary, closed source; the open surface is the evidence these posts quote and link.
79
+ Prompt2Model shipped one public, MIT licensed release (post 5) as a deliberate exception; the
80
+ other five products are not public and have no release planned. Partnership or access
 
81
  inquiries: [dhi-tech.com](https://dhi-tech.com).