Inspiration
Across 46 US ecological sites in NEON, PhenoCam towers capture daily canopy greenness images (gcc_90) used to track leaf-out, senescence, and ecosystem health. When a camera stalls or snow covers a lens, a full week of field data can be lost before maintenance notices.
Checking sites manually—or flagging every camera that missed a day last week—buries staff in noise. Over 2024–2026, a simple recent-missingness rule triggers 193 alerts, and 145 of them turn out to be false alarms (24.9% precision). I wanted a lightweight forecasting tool that gives field teams early warning ahead of an outage without crying wolf, and runs reliably anywhere—even as a single offline HTML file on a field laptop.
What It Does
PhenoWatch forecasts weekly PhenoCam dropout risk (< 4 valid days over the next 7 days among currently healthy sites) under a strict 2-day data-availability lag, matching real operational conditions.
Inside a single self-contained index.html (0 external network requests):
- Weekly Triage Queue: Browse all
150out-of-sample Thursdays (2024-01-04to2026-11-12), compare GBDT scores againstpast_weekandsite_monthbaselines, inspect 12-week site history timelines, toggle ground-truth reveal (0–7valid days), inspect real case studies (BONA 2026-11-05hit at65.6%vs0/7valid days;UNDE 2026-07-30honest false alert at14.0%vs7/7), and export triage CSV files. - Threshold & Holdout Benchmark: Sweep the alert cutoff interactively (
0.05–0.40) on5,158holdout site-weeks (129real dropouts) to inspect precision-recall curves, false alert counts, and year-by-year results (2024,2025,2026). - Live Risk Checker: Adjust the 9 pre-issue features (
days_since,missing7,missing14,missing28,missing90,prior_week_missing,repeat_gap, seasonal month) or trigger presets to execute the exact exported 90-treeHistGradientBoostingClassifierdirectly in browser JavaScript.
How I Built It
- Data & Strict Split (
camera_gap_backtest.py): Packaged the frozen EFIneon4castdaily phenology snapshot (phenology-targets.csv.gz, SHA-256a18320ce2b62976eca922781a9295df056d776534a65ed4501eadf7fc5663601). Split chronologically into Train (2018–2022,10,983rows), Threshold Calibration (2023,2,239rows, picking threshold0.1168), and Untouched Holdout (2024–2026,5,158rows across46sites). - Exact Tree Export (
build_app.py): Trained a regularized 90-treeHistGradientBoostingClassifierinscikit-learnand extracted every internal split threshold, missing-value branch rule, and leaf logit at fullfloat64precision straight into client-side JavaScript insideindex.html. - UI & Verification (
app.template.html,test_app.py): Built a dependency-free SVG + HTML dashboard and wrote an automated Playwright test suite checking tree inference parity, UI flows, CSV export,0external requests, and mobile layout (390pxviewport).
Challenges I Ran Into
- Floating-point tree threshold drift: Rounding exported split thresholds to 10 decimal places initially caused slight divergence on one edge case (
NIWO 2025-02-20) where seasonal cosine fell right on a split boundary. Exporting exactfloat64thresholds fixed parity to1.110e-16across all5,158rows. - Honest evaluation against simple baselines: Under a fixed top-3-picks-per-week rule (
450picks), the GBDT gets56hits vs54forpast_week(95%bootstrap interval[-1.1, +2.0]pp)—virtually tied because healthy weeks force low-risk picks. Calibrating alerts cleanly against 2023 F1 makes the real operational difference: cutting false alerts from145down to27(-81.4%).
Accomplishments That I'm Proud Of
- Doubled Average Precision:
0.292AP (0.0213Brier) vs0.139forpast_weekand0.120forsite_monthon unseen 2024–2026 data, outperforming baselines in all three test years (2024:0.268 vs 0.114,2025:0.263 vs 0.129,2026:0.391 vs 0.193). - True zero-server parity: Full 90-tree gradient-boosted inference in a static browser file matching Python
scikit-learnwithin1.110e-16(4.94e-09against rounded CSV targets across 100 checked samples).
What I Learned
- Probability calibration beats forced rankings: In sparse outage forecasting (
129 / 5,158 = 2.5%positive base rate), calibrating alert cutoffs on an out-of-time validation year (2023) yields far larger operational gains (24.9% -> 55.0%precision) than forcing fixed weekly triage quotas. - Exact model portability pays off: Compiling tree nodes straight to vanilla JS eliminates server spin-up and makes scientific ML tools genuinely portable to field teams.
What's Next for PhenoWatch
- Ingest upstream battery voltage and tower air-temperature anomalies where available alongside missingness history.
- Automate weekly Thursday score generation on GitHub Actions straight from live
neon4castS3 targets.
Personal & AI Contribution Disclosure (Hackathon Requirement)
- My work: Problem framing, 2-day data lag audit, 9 leakage-free temporal features, chronological
2018–2022 / 2023 / 2024–2026backtest design, baseline comparisons, and error/case analysis (BONA,UNDE). - AI coding assistance: Used to scaffold the
build_app.pytree serializer, author the dependency-freeapp.template.htmlfrontend, write Playwright regression checks (test_app.py), draft/clean documentation, and automate demo video synthesis (make_movie.py), with every number and model parity assertion re-verified locally.
Built With
- css3
- html5
- javascript
- neon-phenocam
- playwright
- python
- scikit-learn
- svg