Inspiration

In a UK Financial Ombudsman case, a driver's own CCTV showed his car parked at home when it was supposedly in a collision somewhere else. The insurer decided his CCTV clock might be wrong and recorded a fault claim against him. Timestamps on footage are easy to doubt and hard to prove.

There is a clock nobody can edit: the electricity grid. Great Britain's grid runs at a nominal $50\,\text{Hz}$, but the real frequency $f(t)$ drifts by a few hundredths of a hertz second by second, in a pattern that never repeats. Mains lighting flickers at $2f(t) \approx 100\,\text{Hz}$, and cameras record that flicker without meaning to.

What it does

GhostClock is an autonomous agent for claims handlers, fraud investigators and solicitors. Give it footage and the claim, and it:

  • tests which sensor carries the grid's signal (light flicker or audio hum);
  • extracts the frequency trace from the camera's rolling-shutter rows;
  • decides which national grid record to use and fetches it;
  • searches for the one moment where the recording fits;
  • cross-examines its own answer: rival days, each half of the clip separately, and whether the fit pins a single moment;
  • asks for more evidence when the footage can't settle the question;
  • writes a plain-English report with the recovered time, its confidence and what to check next.

In the demo case it finds the recorder's clock was 2 minutes 9 seconds fast, confirms the car was in its bay at the time of the alleged collision, and tells the handler to check for a cloned plate.

How we built it

  • Agent: Claude Opus 5.5 in a tool-use loop (Anthropic Python SDK). It keeps a case board of competing explanations and picks its next action from ten tools. Every decision is logged with its reason and can be replayed.
  • Signal engine (NumPy, SciPy, OpenCV, PyAV, ffmpeg): a rolling-shutter camera reads its sensor row by row, so each frame samples the flicker at hundreds of moments rather than one. From those we rebuild the trace $x(t)$, then search the grid record $g$ for the offset that fits best: $$\hat{\tau} = \arg\max_{\tau}\ \rho\big(x(t),\, g(t+\tau)\big)$$ using quality-weighted correlation, plus multi-harmonic extraction for audio hum.
  • Reference data: Great Britain's grid frequency from NESO (1-second archive) and Elexon (15-second live feed), fetched on demand and cleaned.
  • Product: a FastAPI server and a single-page investigator UI that streams the agent's decisions, charts and verdict live.
  • Safeguards: per-run turn and cost limits, stop on API error, one live run at a time.

Challenges

  • The best match lies. A recording searched against the wrong day can still score highly, so $\max_\tau \rho$ is never trusted on its own. The agent has to beat rival days and agree with itself across both halves of the clip.
  • Coarse recent data. Recent grid data is only published every 15 seconds, which makes short clips impossible to date. The agent recognises this and asks for more footage instead of guessing.
  • Explaining an invisible signal to a non-technical judge in two minutes.

What we learned

  • Declining is a feature. In 15 live investigations the agent dated 11 correctly (all within 2 seconds), declined 4 and got 0 wrong. Across 43 blind excerpts of our real 18-minute phone recording it answered 8, all correct, and declined 35. For evidence, a confident wrong answer is far worse than "I need more footage".
  • The agent earns its keep in the decisions around the maths: choosing the sensor, choosing the reference, and choosing when to doubt itself. Open-source grid-frequency matchers return a best match. GhostClock is the investigator around that technique.
  • Be honest about the demo. The car-park footage is licensed stock, and its flicker is simulated from the real grid record for 17 September 2026. The agent is not told the time and recovers it blind. Our real phone recordings, and the agent's runs on them, are in the repo.

What's next

  • Multi-camera cases: date one camera, then line up the others on the same recorder.
  • Grid records for other countries.
  • A pilot with a claims team on real disputed footage.

Built With

  • linkup
Share this project:

Updates