projects madhuca

Madhuca

Shipped

A free, open-source fire and smoke radar for India, from uncoalesced. Open the page, see where the fires are, and see which way their smoke is heading.

React · MapLibre · Cloudflare Workers · MIT · Google’s Build with AI: Code for Communities, Track 2

Overview

A short tour of Madhuca: pick a region, see the fires, follow the smoke. The map in it shows demo data, not real fires.

01 · what it does

Pick a region, get the fires, see where the smoke goes

You choose North, South, West or East India, or the whole country. Madhuca then pulls the latest satellite fire detections from NASA, looks up the current wind at each fire, and draws the result on a map of India with its official boundary. For every fire it shows:

Where it is

The position, and about how far it is from the nearest town.

Where the smoke goes

A compass badge points downwind. A dotted plume on the map shows the direction, rough reach and spread.

What kind of fire

Each detection is tagged likely crop-residue burning or likely wildfire, with a plain-language reason.

How strong

On a simple low, moderate and high scale.

An alert in your language

Hindi, Kannada, Telugu or English, written for someone who is not a specialist. It can be read aloud.

Possible spread

A rough estimate for the next three hours, labelled as a rule of thumb.

Two optional layers sit behind toggles: farmland, and an experimental 14-day fire-risk layer. Madhuca is on demand. Nothing runs in the background, nothing watches the sky around the clock, and nothing sends alerts to officials. It does its work when someone opens it.

02 · why we made it

It started with a fire nobody saw coming

John Reddy, a friend of ours, had property in Telangana damaged by a forest fire that started in broad daylight. There was no warning. A fire like that shows up from space within hours, but the information never reaches the person standing downwind of it.

The gap is not a lack of satellites. India already has Van Agni, the national forest-fire alert system run by the Forest Survey of India, and it is good at what it does. It covers forest fires only. It does not tell crop burning apart from wildfire, it does not estimate where the smoke is going, and it has no public map in Indic languages. Those three things are what a farmer, a hiker or a family in a smoky town actually needs, so Madhuca is built around them.

Every autumn, stubble burning across North India sends smoke over cities hundreds of kilometres away. Knowing where the fires are is half of it. Knowing who is downwind is the other half.

03 · who it is for

People who are downwind, and people who want to read the code

Farmers and rural residents

Who want to hear about a fire near their land before they can see or smell it.

Hikers and forest-edge communities

A wildfire reaches them first.

Anyone in a smoky town or city

Who wants to know whether the smoke they are breathing has a source, and where.

Developers, researchers, civic groups

They can read, fork and adapt all of it.

It is built mobile-first for the phones these people actually carry, including low-end Android devices. No machine-learning model runs on the phone, and the page does as little work as it can.

04 · using it

Nothing to install, no account, nothing left running

  1. Open the site. A short human check (Cloudflare Turnstile) keeps bots from draining the free data quota.
  2. Pick North, South, West, East or All India.
  3. The radar scans, and fires appear as markers on the map.
  4. Tap a fire. The panel shows the smoke compass, the type and intensity, the nearest town and the alert in your language. Tap the speaker to hear it.
  5. Close the tab and it stops.

A failed scan is an error, not an all-clear

If NASA is down, the key is missing or the request times out, Madhuca says so. It only shows “no fires detected” when NASA actually answered with zero fires. This is the most important rule in the project.

05 · how it works

One request, five steps, no database

Visitor opens the site
        |
        v
Cloudflare Worker   GET /api/radar?region=north|south|west|east|india
  1. NASA FIRMS      active fire detections (VIIRS and MODIS) in the region
  2. State grid      keep only fires inside India and the chosen zone
  3. Open-Meteo      wind at each fire, batched into half-degree cells
  4. Dispersion      smoke bearing, reach and spread from wind and fire power
  5. Classification  land cover + season + state + power -> crop burning or wildfire
        |
        v
Browser (React + MapLibre GL)
  markers, smoke plume, detail panel, compass badge, alerts and voice

The heavy geographic work happens once, offline, and ships as small static files: India’s state and country boundaries, a grid saying which state every point is in (about 110 m resolution), and a national land-cover grid from ESA WorldCover (about 550 m). Looking a fire up in either grid is one array read, so the live request only fetches data and does cheap arithmetic.

That is why it does not need scaling. There is no database, no accounts and no background jobs, so idle cost is zero. Each request is independent. A benchmark of 3,000 fires across all of India took about 4 ms of CPU against the 10 ms free-tier budget on Cloudflare.

It runs on Cloudflare’s free tier, which is also an honest limit: 100,000 requests a day, NASA’s key allows 5,000 transactions per 10 minutes, and each visitor is limited to 20 requests a minute. “No scaling needed” means there is nothing for us to provision or babysit. It does not mean unlimited traffic.

There is also a fully local edition, where the code is fetched once and everything runs on your own device. It is a working prototype in internal testing and is not in the repository yet. The hosted edition is what is live and open today.

06 · what is machine learning, and what is not

One model. Everything else is rules you can read

We would rather be exact than impressive. For a safety tool, rules and simple formulas have an advantage: you can read them, test them and argue with them.

Fire-risk forecast (machine learning, offline)

A logistic regression model (scikit-learn) estimates, for every 0.1 degree cell (about 11 km), the probability of at least one satellite fire detection in the next 14 days. It learns from past NASA VIIRS detections and land cover: seasonal history, overall history, the last 30 days, the eight neighbouring cells, the forest and cropland share, and time of year.

It is trained on 2020 to 2023 and scored on 2024 to mid-2026, a period it never saw, next to two simple baselines so it only gets credit for what it adds. Known industrial heat sources such as steel works and power plants are filtered out. It is an experimental statistical estimate, and a low value is never an all-clear. The hosted edition publishes it for Telangana and Andhra Pradesh only, off by default.

Crop burning or wildfire (rules)

likely crop burninglikely wildfire

The classifier reads the land cover under the fire, the month, the state and the fire’s radiative power. Forest cover means wildfire. Cropland with power over 150 MW also means wildfire, because that is more intense than residue burning. Other cropland is crop burning, tied to the stubble season (October to November for paddy, April to May for wheat). Anything else defaults to wildfire, unless it is in a stubble-belt state (Punjab, Haryana, Delhi, Uttar Pradesh, Bihar) in October or November at moderate power.

When the evidence is ambiguous it leans toward wildfire, because grassland and scrub fires are the ones people are least ready for, and the fire that inspired this project was one of them. A fire tagged as crop burning is still shown. A learned classifier is planned but not built: the blocker is labels, since there is no ground truth for “this detection was a wildfire”, and training on the rules’ own output would only teach a model to copy them.

Smoke and spread (approximations)

Smoke direction is straight downwind. Reach grows with wind speed and with the square root of fire power, capped at 80 km, and the cone narrows as wind picks up. In calm or missing wind, smoke is drawn pooling near the fire. This is a simplified Gaussian-puff-style approximation, not NOAA HYSPLIT. It says which way smoke travels and roughly how far, not how much you will breathe.

Possible spread is ten percent of wind speed over three hours (Cruz and Alexander, 2019), labelled as exactly that. It is not a fire-spread model.

07 · limits

Madhuca is not an emergency service

It is an information tool built on satellite data. Satellites can miss small, short-lived or cloud-covered fires, and detections arrive with a delay. If you are in danger, call 112.

  • Land cover is resolved at about 550 m. Grassland, scrub and mangrove are grouped as “other”.
  • On a phone with no built-in voice for your language, the first alert read aloud downloads about 80 MB.
  • Kannada is read by the Telugu voice and has a Telugu accent.
  • Alerts exist in four languages, and fires in other states default to English.

Things we might do next, with no promises: opt-in alerts a person sets up for their own area, a learned crop-burning classifier if we can get trustworthy labels, a real fire-spread model, more languages and voices, village names on the map, and other regions. NASA FIRMS covers the whole world, and the India-specific parts (boundaries, state grid, land-cover grid, stubble-season rules) are replaceable data.

08 · open source

MIT licensed, including the ML scripts and CI

The frontend, the Worker, the science core, the offline pipeline, the machine-learning scripts, the CI workflows and the docs are all in the repository under the MIT license. You can run it, fork it for another country or change how it behaves. Data files under frontend/public/ keep their sources’ terms.

Running the public site does touch services that are not open source, such as Cloudflare Turnstile and the CARTO basemap tiles. The README lists every one and marks the closed ones. Replacing them with open alternatives is one of the most useful things a contributor can do.

Fire data from NASA FIRMS. Wind from Open-Meteo. Land cover: © ESA WorldCover project 2021 / contains modified Copernicus Sentinel data (CC-BY 4.0). Map data © OpenStreetMap contributors, basemap by CARTO. Boundaries from DataMeet (Survey of India outline) and Natural Earth. Voices from the Piper project.

contributors

Three people who have known each other since school

Madhuca was built by Joel, Aaron and Rahul. More detail on who did what is in the repository’s DOCUMENTATION.md.