Inspiration

Industrial emissions leaks often go unchecked or take days to trace manually. While modern smart cities are full of IoT air quality sensors, they only tell us when the air is bad—not who caused it. We wanted to build a municipal forensics tool that bridges mathematical physics and autonomous workflows, turning raw telemetry alarms into immediate source attribution.

What it does

PlumeTrace intercepts air quality spikes (SO2, PM2.5) from municipal IoT sensors via MQTT. It passes wind vectors and sensor coordinates through a Physics-Informed Neural Network (PINN) that models the transport equations backwards in space and time to estimate the candidate leak coordinate. The coordinate is snapped to registered factories and cross-referenced with a RAG (Retrieval-Augmented Generation) database of infraction histories to draft a legally sound enforcement warning report for verification.

How we built it

  • The Physics Solver: Written in PyTorch, solving the 2D advection-diffusion PDE: $$\frac{\partial C}{\partial t} + \mathbf{u} \cdot \nabla C - D \nabla^2 C = 0$$
  • The Orchestrator: Built as an asynchronous state machine using LangGraph and LangChain to coordinate weather mesonet lookups, mathematical inversion bridges, SQLite factory database searches, and RAG document queries.
  • The Core Stack: Python, FastAPI, SQLAlchemy (async), gmqtt, Next.js, Tailwind CSS, and MapLibre GL for hardware-accelerated 3D heatmaps and interactive human-in-the-loop review panels.

Challenges we ran into

  • Dimensionality Surgery (3D to 4D): Migrating from a 3D (x, y, t) spatial-temporal model to a 4D (x, y, z, t) model that accounts for sensor altitude meant the pretrained checkpoint weights didn't align. We performed network tensor surgery to pad input layer weight matrices dynamically to upgrade the model without losing pre-trained parameters.
  • Telemetry Race Conditions: Ingesting high-frequency MQTT signals while managing slow-running LLM and RAG graph steps required building custom asynchronous task boundaries.

Accomplishments that we're proud of

  • Bridging custom deep-learning PDE solvers with autonomous LLM legal drafting agents.
  • Building a highly robust SSE connection manager that detaches slow clients to protect backend DB write cycles.
  • Designing a gorgeous, responsive 3D dashboard featuring real-time heatmaps and simulated scenarios.

What we learned

  • Quasi-random Sobol sequence bounds significantly accelerate training convergence for physics collocation points.
  • Managing complex runtime variables across graph nodes is fragile; strict Pydantic schema validation is key.

What's next for PlumeTrace

  • Multi-Pollutant Attributions: Fingerprinting factories by combining multiple telemetry datasets (e.g. VOCs & SO2).
  • Live Mesonet API: Replacing simulated weather lookups with live NOAA meteorological feeds.
  • Edge Compilation: Porting the PINN solver to ONNX/TensorRT to run directly on localized sensor hardware.

Built With

  • amqtt
  • docker
  • fastapi
  • langchain
  • langgraph
  • maplibre
  • next.js
  • optuna
  • pydantic
  • pytorch
  • uvicorn
Share this project:

Updates

Submission history