R package for deep learning image segmentation using the U-Net model architecture by Ronneberger (2015), implemented in Keras and TensorFlow. It provides pre-trained models for forest structural metrics (canopy density and understory vegetation density) and a workflow to apply these on custom images.

In addition, it provides a workflow for easily creating model input and model architectures for general-purpose image segmentation based on the U-net architecture. Model can be trained on grayscale or color images, and can provide binary or multi-class image segmentation as output.

The package can be found on CRAN:

The preprint of the paper describing the package is available on bioRxiv:


First, install the R package “R.rsp” which enables the static vignettes.


Install the imageseg package from CRAN via:


Alternatively you can install from GitHub (requires remotes package and R.rsp):

install_github("EcoDynIZW/imageseg", build_vignettes = TRUE)

Using imageseg requires Keras and TensorFlow. See the vignette for information about installation and initial setup:


See the vignette for an introduction and tutorial to imageseg.


The vignette covers:

Forest structure model download

The pre-trained models for forest canopy density and understory vegetation density are available for download:

Canopy model:

Understory model:

Please see the vignette for further information.

Example classifications to give you an impression of model performance:

Canopy model examples

Understory model examples

Training data download

Canopy training data

Understory training data