What the House Heard: a ghost story told by your smart home's sensor logs, offline with TabPFN and Gemma
Описание и применение
Система использует TabPFN для определения присутствия людей в комнатах по данным датчиков и Gemma 4 для генерации короткой истории о ночных событиях, при этом все данные остаются локальными.
Задача
Determine who was in which room minute‑by‑minute from smart‑home sensor logs and flag unexplained events without sending data to the cloud.
Результат
TabPFN correctly flagged all three injected Halloween events and none of the decoys; Gemma produced a short ghost story that passed the fact‑check.
Рабочий процесс
- 1. Run simulate.py to generate synthetic sensor data for seven ordinary nights and one Halloween night.
- 2. Convert each room‑minute into a feature row with 12 features (CO₂, light, sound, motion, temperature, humidity, door contact, time, room).
- 3. Fit TabPFN on six labelled nights (fit() stores context).
- 4. Predict probabilities for all 2,160 room‑minutes of the Halloween night (predict_proba()).
- 5. Mark a room as occupied if probability >0.5 for at least two minutes.
- 6. Flag an event as unexplained when no hallway crossing in the preceding three minutes and the bedroom remains occupied.
- 7. Assemble evidence (flagged events and their readings) into a prompt for Gemma 4 running locally via llama.cpp.
- 8. Generate a 150–220 word second‑person story quoting at least three readings exactly.
- 9. Run a fact‑check that pairs every number with its unit and every clock time with an event window; retry up to four times if the story fails.
- 10. Output the final report (occupancy, flagged events, story, fact‑check result).
Доказательства
TabPFN flagged exactly the three injected events and none of the decoys:
Gemma 4, running locally through llama.cpp, then tells the night back as a short ghost story, and a fact check makes sure the story quotes only times and readings that are really in the logs.
The report ends with: Fact check passed: 3 clock times and 6 readings in the story all appear in the evidence (attempt 1).
- Дата записи: 2026-11-01T23:58:56.966Z