This is a code repository for the paper "Bayesian hierarchical models can infer interpretable predictions of leaf area index from heterogeneous datasets". The developed model is a Bayesian hierarchical model that predicts the leaf area index (of white winter wheat) from measurements of reflectance spectra, collected at different locations and growth stages.
The model is implemented in Python and relies on the PyMC3 and Theano packages for computationally efficient sampling.
Key features of the model:
- it uses Bayesian hierarchical model and Monte Carlo sampling techniques in order to incorporate prior domain knowledge and capture the association between leaf area index and the spectral reflectance at various wavelengths by spline-based kernel functions
- we compare models with three different levels of hierarchy
- it is extensible and requires only readily available data, it can be easily adapted to measurements from different locations.
The results shown in our publication can be produced by running the following scripts in this order:
- the
preprocessing.py
script parses and re-structures the raw data for further use. - the
modeling.py
script fits the different models to the available data. - the
feature_importance.py
script estimates the feature importance of each parameter. - the
summarize_results.py
script generates the tables in the tables subfolder summarizing the various models' results. - the
plot_<name>.py
scripts each generate the corresponding figure from the figures subfolder.
(The files spline_utils.py
and utils.py
contain utility functions for spline fitting, theming and plotting.)
The code is licensed under an MIT license.
The data is included in the data subfolder.
The dataset was collected by the Working Group Remote Sensing and Digital Image Analysis, from the Institute of Computer Science at the University of Osnabrück, Germany. It consist of measurements of reflectance spectra and accompanying leaf area index, collected on four different locations in Germany at different growth stages. The data is provided here under a creative commons CC BY-NC-ND license and original copyright resides with the owners. If you are interested in the dataset or wish to use it under conditions not permitted by this license, please contact the Working Group Remote Sensing and Digital Image Analysis.