Pest & Disease Forecasting is a web application that shows next-week pest and disease risk across Maharashtra. Weather data feeds trained Random Forest models, and the dashboard turns their output into a map. You pick a crop, see which of its pests and diseases are expected in each subdistrict, and click any place to read the forecast.
Forecasts are prepared once a day, so the map opens quickly for everyone. Each result shows whether a pest is predicted present or absent, the model's probability, and notes on what the pest is, which symptoms to look for and how to manage it.
359sub-districts covered
10pest-specific Random Forests
15years of CROPSAP maps (2010–2025)
How to use it
1
Open the dashboard: Launch the app in your browser. It opens on a map of Maharashtra, and the header shows the week the forecast covers.
2
Choose crops and pests: Tick the crops you grow. The pests and diseases for those crops are listed below and are ticked by default. Untick any you don't want to see, then press Load Forecast Map.
3
Click a place: Zoom in with the + and − buttons, then click anywhere in Maharashtra. A panel opens with the subdistrict name and how many pests are predicted present and absent.
4
Read the advice: Each pest has its own card with its prediction, probability and risk. Open "About, symptoms & management" on a card to see what the pest looks like and how to manage it. Close the panel with ✕ to check another place.
Watch it in action
Pipeline walkthrough
▷Tutorial coming soon
The walkthrough will appear here when it is available.
Pest attack forecasting in Maharashtra.
A walkthrough of Pest & Disease Forecasting, from choosing a crop to reading the advice for your place.
The video could not be loaded. Check your connection and try again.
ERA5 + IFS weather · Random Forest · Google Earth Engine · Airflow · FastAPI + Leaflet
1Gather weatherERA5 history and IFS forecast
2Build featuresHourly to weekly, per pest
3Predict10 pest-specific Random Forests
4PublishSubdistrict forecasts in Earth Engine
5ExplorePick a crop, load the map, click a place to read its forecast and advice
System architecture
The worker computes, Google Earth Engine stores, and the dashboard only reads.
Weather sources: ERA5 supplies observed weather and IFS supplies the forecast. Both are read from weather collections in Earth Engine.
Forecast worker: a daily batch pipeline turns weather into model features, runs the models and publishes the results.
Scheduling: an external time trigger starts an Airflow job at 03:00 IST. Airflow calls a refresh endpoint on the FastAPI service and checks its JSON reply, and FastAPI runs the forecast scheduler.
Google Earth Engine: holds the weather collections, the deployed model assets, the subdistrict boundary and the published forecast FeatureCollections.
Web dashboard: a FastAPI JSON API reads the published forecasts and serves map tile layers and location lookups. A browser front end built on Leaflet.js draws the map, handles clicks and builds the farmer-facing panel.
The dashboard is standalone. It never calls the refresh endpoint, and its only link to the forecasting system is the published forecast asset.
The top row is the daily forecast run. The bottom row is what happens when someone uses the dashboard. Earth Engine sits between them.
Training data: CROPSAP pest maps
Weekly pest and disease maps from the ICAR-CRIDA Crop Pest DSS, 15 years (2010 to 2025), chosen by crop, pest, year and week.
Step
What happens
1 · Download
Pest and disease maps from the ICAR-CRIDA portal, as JPEG images.
2 · Georeference
One map is georeferenced by hand against the Maharashtra boundary. Its CRS, transform, size and extent are reused for the rest, then saved as GeoTIFF.
3 · Extract
Over each of the 359 sub-district polygons, the most common (mode) pixel colour inside it.
4 · Classify
White = class 0 (no pest). Green, yellow and red = class 1 (pest present).
Each record holds crop, pest, year, week, latitude and longitude (polygon centroid) and class. Positives are rare: 0.8% to 15% per pest, about 7.5% overall.
Weather inputs
ERA5 (history): hourly reanalysis at each sub-district, aligned to the end date of the pest report. 15, 43 or 77 days are used, depending on the pest.
IFS (recent and ahead): 6 recent days plus 7 days ahead, from the near-real-time forecast collection.
Hourly data become daily statistics, then weekly periods: w1 is the most recent, w13 the most distant.
Eight variables: dew point, surface pressure, rainfall, soil temperature, solar radiation, and maximum, mean and minimum temperature. Processed at 28 km in Earth Engine.
Window
Inputs
13 weeks
w1 … w13 (104 inputs)
8 weeks
w1 … w8 (64 inputs)
4 weeks
w1 … w4 (32 inputs)
Model development
A Random Forest takes antecedent weather features in and gives pest occurrence out, one model per pest.
Negative-class sampling: because positives are rare, meaningful negatives are kept using one of three policies, then K-means keeps them diverse and classes are balanced 1:1 for training.
Policy
A negative is kept if…
SYW
Sub-district × Year × Week: the sub-district had any pest-positive record that week.
SYP
Sub-district × Year × Pest: the sub-district had that pest at any week that year.
SWCP
Sub-district × Week × Crop × Pest: that exact combination was positive elsewhere. Strictest, smallest, most balanced.
9 configurations per pest (3 negative policies × 3 windows of 4, 8 and 13 weeks). Per pest, the policy and window with the highest mean validation performance is selected.
Validation
Temporal (leave one year out): train on four years, test on the fifth, repeated for each year from 2021 to 2025. Tests generalisation to an unseen year.
Spatial (rainfall-stratified folds): the 359 sub-districts fall into 7 normal-rainfall categories (0–650 up to over 2200 mm). Each is split into 5 folds. Train on four folds, test on the held-out fifth.
Every spatial fold spans the same range of rainfall regimes, so it tests unseen but climatically representative sub-districts. This is the more relevant test for a system deployed state-wide.
Model integration in Earth Engine
Convert: the final Random Forest models are converted to Earth Engine tree representations.
Publish: exported as a FeatureCollection asset, so models run on image pixels inside Earth Engine.
Classification: one representation gives the binary class, 0 = absent, 1 = present.
Probability: a second representation of the same model gives a class-1 probability from 0 to 1.
Inputs follow each pest's selected window: 32, 64 or 104 features, in a fixed order checked at start-up.
Coverage at a glance
359sub-districts covered
10pest-specific Random Forests
15years of CROPSAP maps (2010–2025)
Outputs
Risk map: one layer that combines every ticked pest. With a single pest selected, red marks subdistricts where it is predicted present and green where it is predicted absent.
Place names: subdistrict names appear on the map from zoom level 8.
Location forecast: after a click, the subdistrict name, its code and the clicked coordinates, with counts of pests predicted present and absent.
Pest cards: each pest's status, probability, risk and relevant crops.
Advice: an "About, symptoms & management" section on every card, with what the pest is, the symptoms to look for and how to manage it.
Always current: the map uses the latest date for which every needed pest has a forecast.