Aims of the project
Detectree2 is a remote sensing project using computer vision tools to segment trees from aerial photographs. The team behind Detectree2 is based at the Coomes Lab, founded by Professor David Coomes of the Department of Plant Sciences at the University of Cambridge. The project was devised by James Ball, a PhD in the Department of Plant Sciences.
The aim of the project is to produce a self-contained, open-source and easy to implement software tool for applying to a pre-existing pipeline for automatic species recognition from drones.
The background to the research
Southeast Asia has lost most of its primary lowland rainforest over the past 40 years, but extensive areas of heavily logged forest remain. These degraded forests retain much of their original biodiversity and international attention is focused on protecting and restoring them. Large-scale monitoring is vital for restoring endangered tree species, allowing changes to be tracked and the effectiveness of management to be assessed. Monitoring needs to be scalable and affordable whilst also offering sufficient resolution to track individual tree species. The emerging technology of low cost, commercially available unmanned aerial vehicles (drones) has enabled the collection of data at higher temporal and spatial resolution in forest ecosystems and offers the most promise for monitoring individual trees.
It is critical that algorithms are made available to the managers of conservation projects in these degraded forests. Drones are an easy-to-use technology and effective code for processing the imagery could have a rapid impact on conservation practice. This information can help to understand the best conditions for species regeneration and establishment and drone surveying can then be used to identify sites offering the best chances of long-term sustainable regeneration of threatened tree species, allowing much more targeted protection, conservation and interventions.
Initial work
The team behind Detectree2 produced algorithms to map trees and identify common species using aerial photographs collected from consumer-grade drones. These algorithms required the attention of computer scientists to refine them. In collaboration with Research Computing Services, these algorithms were turned into a valuable tool for conservationists on the ground who are working closely with partners managing a 1000 km2 rainforest recovery concession in Indonesia.
The application works by detecting individual tree crowns using detectron2's RCNN algorithm which must be trained offline on rainforest imagery.
The full pipeline involves:
Stitching of UAV imagery
Performing automatic tree crown extraction
Automatic species labelling of crowns
How Research Computing Services was able to help
In this project, Research Computing Services’ Research Software Engineering team focused on improving the software around the second stage of the pipeline. This stage does both the offline training and in the field (online) prediction steps on new drone captured photography. The application was trained it on several different datasets (i.e. suburban datasets and rainforests).
To train the model (RCNN), the team manually labelled data to essentially create a line around a tree’s crown and a bounding box. Many of the training sets are very diverse; transferability is still a challenge that is actively being worked on.
The main developments included improving various aspects of the code:
Introducing a new Conda build system that enables deployment in the field (online) and training (offline) on different HPC systems.
Packaged software using Conda
Continuous integration whereby GitHub workflows are used to execute the following when pushing to the repository:
Documentation using Sphinx automatically built
Testing of several example unit tests and integration tests
- Incorporating good programming style
- Test building of Detectree2
- Creating a knowledge transfer and best practices guide on Git / GitHub. This was delivered to team throughout the project
- Testing the pipeline to highlight robustness issues on different datasets
You can view the project in greater detail here.