The Problem 🤔
In the midst of an ecological crisis, one of Canada's largest environmental problems is being caused by one of its smallest critters - the dreaded Mountain Pine Beetle. Between 1990 and 2012, the Beetle ate its way through approximately 723 million cubic metres (53%) of all the merchantable pine in BC, and it's on the rise again today.
Technology provides an obvious solution to this problem - drones and satellites can be used to scope out large areas of forest without needing to send forest rangers out, saving timber managers time and money. The beetle can then be eradicated via targeted bursts of insecticide sprayed from drones. Yet, existing insecticide spraying drones are expensive ($18000+ CAD) and can only spray on a predefined route, which is laborious to find and program.
The Solution 💡
Hence, we present an all in one system for combatting this epidemic, comprising:
- Convolutional Neural Network model for detecting standing dead pines from satellite imagery, to enable automatic targeting of regions suffering from the beetle.
- Drone attachment for available hobby drones (cheap and could be "borrowed" by national park service when not in use by local citizens) to enable spraying of trees on the periphery of an affected area with insecticide to create a "firebreak".
- Web server with 3D globe for viewing the drone's progress in eradicating the beetle
The satellite imagery dataset could easily be replaced with data collected from the drone camera itself when moving to production, and the model retrained in a few minutes, though we weren't able to create this dataset ourselves due to not living in Canada.
How we built it 🤖
A BBC micro:bit is mounted to the drone and attached to a servo motor used to release the insecticide. The micro:bit uses standard 2.4GHz radio to communicate with another micro:bit on the ground, using protocol buffers as the communication medium. We use protocol buffers as they enable us to send a large amount of data efficiently, in the small amount of bytes available over the radio.
The second micro:bit uses serial to communicate with the computer running the web server that displays the status of the project. A WebGL Earth 3D globe with Mapbox satellite tiles is used to depict where the drone is and the area it needs to cover. We use an API request to feed this data into the JS, after the server decodes it from protobuf.

We tested several machine learning models on satellite imagery and found that a CNN was the most effective model.
Challenges we ran into 😬
- Trying to get protobufs to work on the micro:bit which has only 16 KiB of usable RAM. To solve this problem we developed a custom protocol buffer implementation for just the fields we need to send to load onto the micro:bit, and interface with standard protocol buffers code running on the server computer.
- Learning about different architectures in Tensorflow and fine tuning them.
- Building a hardware project remotely with only one team member having access to the hardware, and getting effective drone footage for the video!
Accomplishments that we're proud of 🏆
- Having the confidence to try a challenging project using technology we hadn't used before in a hackathon, given that we weren't sure it was going to work.
- Integrating protocol buffers into the micro:bit via a custom library!
- Achieving 89% accuracy on the binary classifier model used to detect standing dead trees.
What we learned 📚
- Protocol Buffers serialisation format, use of proto files, use of
buf lintandprotoc.
The buf CLI was invaluable in ensuring that our proto schema was correct, efficient and designed with backwards compatibility in mind. - How to collect a good dataset for machine learning and tune hyperparameters to get good results (full pipeline for a real world scenario, when you haven't been given a pre-built dataset).
- Controlling a servo motor with a micro:bit.
What's next for Pine Protection 🔮
To be scaled up the project would need to be supported by forest owners. The model could easily be retrained to deal with drone photos to ensure that the precision is better than you would get from satellites, then the product would need to be mass-manufactured as a small PCB which could be added onto commercially available hobby drones.
Built With
- css3
- html5
- javascript
- microbit
- protobuf
- python
- serial
- webgl-earth

Log in or sign up for Devpost to join the conversation.