Inspiration

India's MSV-2035 Instrument Crisis was a wake-up call. Government auditors found that uncalibrated, imported scientific instruments had corrupted climate readings across research institutions and that data had already made it into national journals and policy reports. Nobody caught it because there was no checkpoint between a sensor reading and a published number.

The problem is not that sensors break. It is that nobody validates them before the data moves downstream. Universities doing field research, NGOs running air quality monitors, citizen scientists filling coverage gaps all of them upload raw readings with no way to know if the instrument is drifting, spiking, or systematically biased.

That is the gap ClimateTrust AI is built to close.


What We Built

ClimateTrust AI is an automated validation and calibration pipeline for environmental sensor data. Upload a CSV of temperature readings. Within seconds you get:

  • A Trust Score (0–100) and letter grade (A through F) computed from a fully transparent, auditable formula
  • Anomaly detection using a three-layer hybrid approach: rolling Z-Score for spikes, cumulative deviation analysis for drift, and Isolation Forest for multivariate pattern faults
  • Cross-validation against Open-Meteo's free satellite-reanalysis reference data no API key required
  • Affine calibration that corrects drift and scale bias, then shows you the corrected readings overlaid on the original chart
  • Plain-English diagnostic explanations generated by Gemini 2.0 Flash, grounded in the actual numbers so the model cannot hallucinate the key claims

The trust formula is printed in the README, the docs, and directly in the dashboard UI. Nothing is hidden.


How We Built It

The backend is a FastAPI service written in Python. The pipeline runs in five sequential stages:

  1. Reference fetch — pull hourly ambient temperature from Open-Meteo for the sensor's coordinates and date range
  2. Anomaly detection — Z-Score flags sudden spikes; cumulative deviation catches slow drift; Isolation Forest handles correlated multivariate faults
  3. Calibration — detrend linear drift, then fit an affine correction (scale + bias) by minimising error against the reference signal
  4. Trust scoring — deterministic formula penalises anomaly rate, drift magnitude, and correlation gap; rewards successful calibration
  5. Explanation — sensor stats are injected into a structured prompt so Gemini fills in the narrative, not the numbers

The frontend is Next.js 16 with Recharts for the interactive time-series visualisations. Everything ships as two Docker containers via Docker Compose.

Three demo sensors are pre-loaded to show the full range of failure modes: Sensor A (clean reference, Grade A ~90), Sensor B (linear drift, Grade D ~45), and Sensor C (scale bias plus random spikes, Grade C ~55).


Challenges

Reference alignment was harder than expected. Open-Meteo returns hourly data but sensor uploads can be at any interval. Getting the timestamp merge to behave correctly especially at day boundaries and for sensors in non-UTC timezones took significant iteration.

Graceful degradation for sparse reference data was a genuine design problem. For remote or off-grid locations, Open-Meteo reanalysis coverage is thinner. The system now skips calibration entirely if reference overlap is below 50%, and bounds the trust score conservatively rather than assigning a false grade.

LLM grounding — we wanted the AI explanation to be useful, not decorative. The solution was to inject every quantitative claim (drift magnitude, anomaly rate, correlation delta) into the prompt as hard numbers. The model writes the narrative; it does not make up the facts.

Ethical scoring — low-cost sensors used by citizen scientists will structurally score lower than expensive research-grade instruments because they drift more. We addressed this by making the calibration engine the centrepiece: the goal is to bring those sensors up, not to mark them as bad and move on.


What We Learned

  • Satellite reanalysis data is more useful than expected as a free validation layer Open-Meteo covers the entire globe at hourly resolution with no authentication
  • Isolation Forest fits fast enough on 168-row datasets to run per-request without any caching
  • Documenting the ethical implications of an automated scoring system before shipping it (not after) changed several design decisions, especially around how we handle sensors that cannot be validated

Built With

Share this project:

Updates