Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INFERNIS

Wildfire risk modelling for British Columbia. A tested implementation of the Canadian Fire Weather Index System, a trained ignition-risk model with its weights, and the measurement harness that keeps both honest. Built entirely on open government data.

pip install xgboost numpy pandas scikit-learn
python predict.py --resolution 5000
5000 m bundle: 34 features, target base rate 5.00e-04
  raw model score : 0.139770
  calibrated rate : 5.751e-04 per cell per day
  danger level    : LOW

That runs today, from a clean checkout, against the real weights.


Take the fire weather on its own

infernis_fire/fwi.py is a clean, dependency-light implementation of the Canadian Forest Fire Weather Index System — FFMC, DMC, DC, ISI, BUI and FWI — regression-tested against the canonical cffdrs_py reference.

If you need Canadian fire weather indices in a pipeline, that file is useful by itself and owes nothing to the rest of the repository.

Or score wildfire danger across the province

A gradient-boosted ignition-risk model for British Columbia, with everything needed to run it: the trained booster, its feature contract, a prevalence-weighted calibrator built for rare events, and danger-level thresholds derived from out-of-fold predictions.

5 km model
AUC, spatially blocked 0.903
AUC, temporal walk-forward 0.918
top-1% recall 0.126
held-out ECE 0.00044
features used 27 of 34

Validated by temporal walk-forward with a checkerboard spatial holdout nested inside every fold, so the number is transfer to geography the model never trained on — not a random split that lets a neighbouring cell leak the answer.

Those AUCs are measured on the training cohort: an ignition-near case-control sample at 10.9% prevalence, against an operational base rate of 5.0e-04. A high AUC on a one-in-nine-positive cohort is a different quantity from performance on the live grid, and we would rather say so than let the number travel alone.

One model, at 5 km — and establishing that took real work

There was a 1 km model. We retired it, and the reasoning is probably the most useful thing here.

The only capability a finer model can add over a coarser one is telling apart cells inside a 5 km box. Measured over 1,580 days holding both a burned cell and an unburned neighbour, it scored 0.604 against 0.500 for a coin flip — after we repaired every defect we found on the way: terrain that disagreed with the serving grid, a road-distance column sitting at a sentinel value on 74% of cells, missing vegetation, missing fuel description, and a training design that almost never showed the model two neighbouring cells.

Inside a 5 km cell the weather is effectively constant, so a finer model can only be a function of static terrain and fuel — while where a fire starts is set by where a lightning strike or a roadside spark happened to land. Vegetation is the proof: the model wanted it, spending 58.6% of its gain on it, and it changed the answer by +0.0001.

So detail below 5 km comes from measuring what is on the ground — federal land cover at 30 m, national fuel typing at 250 m — rather than predicting at a resolution the physics will not carry.

Check us

Every claim lives in docs/CLAIMS.md with its status, the plan that governs it, and the number behind it. Every plan in docs/plans/ was committed before the analysis it governs was run, so a result could not be quietly reframed afterwards. Where a plan was amended, the amendment is dated and left in place.

That includes results that went against us. Our ranking has not been shown to beat a free map of historical ignition counts — at 5 km that map won — and a benchmark against CWFIS, the free federal fire-weather product, also went against us. Both are our own pre-registered measurements.

docs/SCORECARD.md lists every qualifying fire in a fixed window, hits and misses, with the rule committed before the analysis ran.

Most modelling repositories will never show you a number like that. We publish it because the alternative is asking you to trust a claim you cannot check.

What's here

infernis_fire/fwi.py           Canadian FWI System: FFMC, DMC, DC, ISI, BUI, FWI
infernis_fire/calibration.py   prevalence-weighted calibration for rare events
infernis_fire/risk_fuser.py    per-biogeoclimatic-zone bias correction
infernis_fire/levels.py        danger-level thresholds from out-of-fold predictions
models/                        trained weights, feature contract, calibrator, thresholds
predict.py                     worked example: weights in, danger level out
docs/CLAIMS.md                 every claim, its status, and the number behind it
docs/SCORECARD.md              every qualifying fire in a window — hits and misses
docs/plans/                    measurement plans, each frozen before its result existed
scripts/audit/                 the harness, so comparisons can be re-run rather than trusted

Before you quote a number

It ranks; it does not calibrate. Compare locations by rank and read the danger level. Do not read the value as a percentage chance of fire — held-out Brier skill over predicting the base rate everywhere is 0.35%.

Vegetation is deliberately constant in training. ndvi, lai and snow_cover are pinned: the archived composites are annual, and an annual composite for year Y contains imagery from after a fire, so burned ground's depressed greenness would "predict" the fire that caused it. The booster splits on 27 of its 34 declared features.

Weather resolution is not model resolution. The model is driven by a meteorological field on a ~0.45° lattice, roughly 50 km.

British Columbia only, and not an operational tool — a research and modelling artifact, not a substitute for official guidance. In an emergency follow the BC Wildfire Service and EmergencyInfoBC.

The live engine

This repository is the fire modelling core. The daily engine — ingestion, the API, the database, forecasting, flood, air quality, fuel exposure and the serving stack — is not open source. It scores 41,857 cells across British Columbia every day and serves them over an API at infernis.ca, with a free tier.

Attribution and licence

Contains information licensed under the Open Government Licence – British Columbia, with data from Environment and Climate Change Canada and Natural Resources Canada. See LICENSE.

About

Fire weather and wildfire-risk modelling components for British Columbia, built on open data. Reference implementation of the Canadian FWI System plus trained ignition-risk models at 5 km and 1 km.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages