← Back to project catalogue
GP-DA-0IQOMRWData and AIReady

Explainable multispectral crop-stress detection

An offline engineering laboratory that triages controlled crop-stress patterns from Sentinel-2-like bands and spectral indices while exposing model uncertainty and shift sensitivity.

Explainable multispectral crop-stress detection project visual
GP-DA-0IQOMRW · Data and AI
  • Python 3.11
  • scikit-learn 1.9
  • NumPy
  • pandas
  • Matplotlib
  • Docker

Project definition

Problem statement

Pigments, leaf water, canopy structure, soil background, crop stage, atmosphere, and sensor processing can change the same broad multispectral bands.

The engineering problem is to separate prepared spectral responses without leaking field-specific patterns, then show confidence and controlled failure instead of presenting a class label as an agronomic diagnosis.

Project objectives

  • Define and validate ten Sentinel-2-like surface-reflectance bands.
  • Calculate ten interpretable greenness, red-edge, moisture, soil, and senescence indices.
  • Generate deterministic wheat and maize observations in independent field groups.
  • Compare regularised logistic regression with a random forest on common features.
  • Select the model and abstention threshold only on separate calibration fields.
  • Measure class performance, probability quality, shift robustness, coverage, and accepted accuracy.

Project structure

Project components

01

Band schema

Validates B2 through B12 reflectance values, crop, season, growth stage, field group, and latent class.

02

Spectral engine

Calculates NDVI, NDRE, GNDVI, NDMI, MSI, SAVI, EVI2, CI_RE, PSRI, and VARI with bounded formulas.

03

Observation generator

Creates structured field, crop, stage, season, canopy, severity, soil, and sensor variation with a fixed seed.

04

Experiment runner

Keeps complete fields in train, calibration, or test partitions and evaluates both candidate models.

05

Uncertainty evaluation

Measures calibration, coverage, abstention, and accepted accuracy at a calibration-selected threshold.

06

Evidence outputs

Writes observations, partitions, metrics, predictions, feature importance, sample explanations, nine figures, and a static dashboard.

Methodology

Project workflow

  1. 01
    Generate observations

    Create the fixed 5,184-row controlled corpus from 12 independent synthetic fields.

  2. 02
    Build spectral evidence

    Validate reflectance and calculate all ten indices for every observation.

  3. 03
    Separate fields

    Assign eight fields to training, two to calibration, and two to final testing without overlap.

  4. 04
    Compare models

    Fit logistic and random-forest classifiers and select the final model on calibration evidence.

  5. 05
    Test uncertainty and shift

    Apply reference, sensor-noise, soil-background, red-edge-loss, and combined conditions.

  6. 06
    Review retained evidence

    Trace headline results to CSV rows, prediction records, explanations, figures, and the offline dashboard.

Demonstration scenario

The command-line experiment rebuilds the 12 synthetic field groups, calculates all 20 features, fits both models, selects the logistic model and 0.92 threshold on calibration fields, then evaluates two unseen fields under five conditions. The student traces one accepted and one abstained prediction to its bands, indices, confidence, feature importance, and retained result row.

Engineering

Tools and method

Runtime
Python 3.11 with an installable command-line package and pinned dependencies.
Numerical work
NumPy and pandas for deterministic observations, transformations, and retained tables.
Models
scikit-learn logistic regression, random forest, metrics, calibration summaries, and permutation importance.
Visual evidence
Matplotlib figures and a self-contained local HTML dashboard.
Documentation
An 84-page report with labelled figures, tables, literature images, and 50 annotated references.
Quality controls
Ruff, 42 tests, 99.36 percent coverage, dependency audit, delivery validator, and a non-root read-only container.

Testing

Evaluation

Evaluation measures

  • Reference accuracy: 83.68 percent
  • Reference macro F1: 83.41 percent
  • Accepted accuracy: 96.54 percent at 56.94 percent coverage
  • Combined-shift accuracy: 67.36 percent
  • Condition and class recall, log loss, Brier score, and calibration error
  • Forty-two automated tests with 99.36 percent statement coverage

Project boundaries

  • All retained observations and labels are synthetic and controlled.
  • The four classes describe prepared spectral responses and are not confirmed field causes.
  • The result does not measure performance on real Sentinel-2 scenes, farms, crops, locations, or years.
  • No irrigation, fertiliser, pesticide, disease, yield, or other treatment recommendation is produced.
  • A real extension requires official product metadata, quality masks, field measurements, agronomic review, and independent spatial and temporal validation.
  • No buyer, student, university, payment, farmer, or field-owner information is collected.

Included

  1. 01Complete Python source code
  2. 025,184 controlled observations across 12 field groups
  3. 03Ten Sentinel-2-like bands and ten documented spectral indices
  4. 04Logistic and random-forest model comparison
  5. 05Five controlled conditions with uncertainty-based abstention
  6. 06CSV and JSON evidence, nine result figures, and offline dashboard
  7. 0742 automated tests with 99.36 percent statement coverage
  8. 08Complete source code in a private GitHub repository
  9. 0984-page project documentation in PDF and editable Word formats
  10. 1021-page setup and usage guide in PDF and editable Word formats
  11. 1150 annotated references

Project record

No information is collected on this page.

Permanent project ID
GP-DA-0IQOMRW
Catalogued
21 Aug 2026
Completed
25 Aug 2026
Verified
25 Aug 2026
Demonstration
Included in repository

Handover

After purchase

  1. 01
    Payment is confirmed

    The project is marked unavailable and cannot be purchased again.

  2. 02
    Repository access is granted

    The buyer's submitted GitHub account receives access to the private repository.

  3. 03
    The purchase record is delivered

    The certification sheet is prepared from the reviewed buyer details and sent privately by email.