DEV Community

Shubh V
Shubh V

Posted on AI-assisted

The Poltergeist Ledger

Hacktoberfest Open-Source AI Challenge: Ghost in the Machine Submission đŸ‘»đŸŒŒ

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine

What I Built

The Poltergeist Ledger is an offline-first anomaly detection and narrative synthesis engine that transforms real household IoT sensor telemetry into a Victorian ghost story and an interactive séance console.

What Inspired It?

Classic Gothic Literature: Shirley Jackson’s opening lines from The Haunting of Hill House ("Hill House, not sane, stood by itself against its hills, holding darkness within...") and Arthur Conan Doyle's Victorian domestic mysteries.

The Ghost in the IoT Machine: The uncanny feeling anyone experiences when checking smart home or IoT logs late at night and finding unexplained 3:00 AM power surges, phantom draws on dead circuits, or sudden temperature drops in uninhabited rooms.

Demo

How I Built It

Physical Anomaly Detection with TabPFN: We load 4.5 months of continuous household data (the UCI Appliances Energy dataset) and run a contiguous 5-fold out-of-fold (OOF) cross-validation using TabPFN Regression.

Robust Residual Clustering: The pipeline computes residuals (actual−predicted) and converts them into robust z-scores via median and Median Absolute Deviation (MAD). Rows exceeding ∣ 𝑧 ∣ ≄ 4.5
within 60 minutes are merged into distinct physical disturbance events, deliberately balancing daytime surges with 3:00 AM midnight spikes.

Local Victorian Stewardship via Ollama (Gemma 3): Each event's physical telemetry (power surges, sub-room temperatures
humidity, barometric pressure, wind speed) is passed as an isolated JSON fact block into a local Gemma model. Gemma writes a concise entry in the voice of an 1890s house steward inspecting needle deflections by candlelight.

Zero-Hallucination Number Grounding Validator: A regex parser extracts every numeric token from Gemma's response. Every single number must exist within the ground-truth physical fact block (accounting for time formats and decimals).

Interactive Séance & ElevenLabs Spooky Voice: A local Flask server allows users to "interrogate the dwelling" (POST /ask). Gemma translates natural language questions into time windows, Python computes the real sensor telemetry, Gemma responds in character, and ElevenLabs text-to-speech narrates the story and chat answers aloud using an ominous British voice (onwK4e9ZLuTAKqWW03F9 - Daniel).

Why Does Open Innovation Matter?

Open models also let me change how the system behaves, which a closed API wouldn’t have allowed. I ran the same pipeline with two Gemma sizes and measured the difference: [model A: X s per entry, Y% of entries failed number validation] vs. [model B: X s, Y%]. I could also hold Gemma to the real data by validating every number it wrote against the facts it was given, and I could inspect exactly what it was told. And there’s no per-token bill and no service that can change or shut down underneath the project, which suits a piece about old, forgotten things.

Prize Categories

  • TabPFN
  • Gemma
  • GitHub Copilot
  • ElevenLabs

Top comments (0)