QueleaGuard
QueleaGuard is an applied machine learning research project investigating the environmental, spatial, temporal, and agricultural factors associated with red-billed quelea occurrence around Ahero Rice Irrigation Scheme in Kisumu County, Kenya.
The project brings together geospatial and environmental data to investigate a research question with agricultural relevance. Its data sources include CHIRPS precipitation, ERA5-Land environmental variables, MODIS vegetation information, SRTM elevation, and hydrological data.
The work emphasizes research design, data integration, spatial reasoning, predictor selection, and the need for careful evaluation when modeling ecological observations.
- Applied Machine Learning Research
- GBIF occurrence records · Africa rice distribution map (Jiang et al. 2025) · CHIRPS precipitation · ERA5-Land · MODIS NDVI · SRTM elevation · HydroRIVERS · Python
- Occurrence records
- Rainfall
- Meteorology
- Vegetation
- Elevation
- Rivers & lake
The question
Red-billed quelea are a major pest of cereal crops across sub-Saharan Africa. Around Ahero Rice Irrigation Scheme, control is largely reactive: action is taken after the birds arrive.
The research question is whether historical occurrence records, combined with environmental and agricultural data, can explain where and when quelea occur around the scheme. The project models occurrence, not crop damage: the records describe where birds were observed, not where damage happened, and that distinction is kept throughout.
Technical approach
The analysis covers an extent of roughly 50 km around the scheme, divided into a grid of about 5.5 km cells. Occurrence records come from GBIF. Because the data contains presences only, background points are sampled using a target-group approach and treated explicitly as an approximation of absence, not as confirmed absence.
Each record is joined to environmental features: rainfall from CHIRPS, meteorology from ERA5-Land, vegetation from MODIS NDVI, terrain from SRTM, and distance to rivers and the lake from hydrological data.
The research is organised in three levels: environmental drivers of occurrence; whether the rice-agricultural landscape adds information beyond the environment; and whether combining the two improves occurrence estimation. Rice availability is represented continuously — the proportion of rice within 500 m, 1 km, and 2 km of each record, and the distance to the nearest rice — rather than as inside or outside a scheme boundary, because the mapped scheme polygons turned out to cover only a fraction of the surrounding rice landscape.
Evaluation is designed before any training: records are grouped into five spatially separated cross-validation folds, and a compact baseline set of ten predictors plus season was chosen after checking correlations between candidate features.
Components and their status
Study area & analysis grid
Scheme boundary, analysis extent, and grid definition.
Occurrence data
GBIF records spatially matched to the grid; 133 feature-complete presence records.
Background sampling
Target-group background, month-stratified and checked against presence conflicts.
Environmental features
Rainfall, meteorology, vegetation, terrain, and hydrology extracted for every record.
Rice-landscape features (Level 2)
Rice proportion at three scales and distance to nearest rice, with a cropland cross-check of temporal stability.
Spatial cross-validation folds
Five folds from presence-anchored k-means clustering, verified for coverage and reproducibility.
Baseline predictor set
Ten predictors plus season, chosen after correlation and redundancy checks.
Exploratory analysis (Level 1)
Spatial, temporal, and environmental patterns in the assembled dataset.
Model training & validation
Including spatial cross-validation, treated as mandatory given clustered records.
My contribution
I own the project end to end. On the research side, that means framing the question, defining the study area and analysis grid, choosing a presence-background design, and keeping a numbered decision log that records each methodological choice and the evidence behind it.
On the engineering side, it means acquiring and integrating the geospatial and environmental data, building the extraction and validation pipeline, and diagnosing data problems — including a temporal sampling bias in an earlier background pool and a fill-value filtering bug in vegetation extraction, each documented rather than silently patched.
Engineering decisions
Model occurrence, not damage
Observation records say where birds were seen. Treating them as evidence of crop damage would make any result mean something it does not. The framing is kept as a hard constraint.
Presence-background, stated as an approximation
Without confirmed absences, background points are a modelling device. Documenting that limitation up front shapes how any later result can be interpreted.
Spatial validation is mandatory
Occurrence records are spatially clustered. Random train–test splits would leak information between nearby points and overstate performance, so spatial cross-validation is part of the design before any model is trained.
Log problems instead of patching them silently
Every non-trivial finding is recorded with its evidence before it is acted on. Bugs found in the data pipeline are written up, which makes the dataset auditable.
Current state
The modelling dataset is assembled and quality-checked, including the rice-landscape features, and the evaluation design is fixed: spatially blocked cross-validation folds and a compact baseline predictor set. Model training and validation have not yet started, so there are no model results to report. QueleaGuard is not a prediction service or an early-warning system.
- The project began as a capstone for the Ngao Labs Data Science & AI Bootcamp. A snapshot model built for that presentation is not the research dataset or model described here.
- The rice features come from a single 2023 rice-extent map. A cropland cross-check suggests the landscape was broadly stable across earlier observation years, but does not prove it.
- One cross-validation fold is small, so per-fold results will be noisy; that will be reported alongside any metric.
Next questions
- Which environmental predictors still carry information about occurrence once spatial autocorrelation is accounted for?
- Does the rice-agricultural landscape add explanatory value beyond general environmental conditions?
- How strongly does sampling bias in citizen-science records shape what any model can learn?
- How well does a baseline model transfer across spatially separated folds, and what does its weakest fold reveal about where the data runs out?