Pollinator Pollster (Powered by Pi)
Welcome to the fourth blog post of this project. This week some big decisions have had to be made about the direction of the project following the discovery that support has been pulled for the machine learning package on which the audio classification aspect of this project was based. In better news, I've finished the 3D design of the printed parts, and have started to make those.
3D Design Demonstration Video
Please see the below video for a walkthrough of the 3D design of this project.
Project Plan
Some more green boxes this week, on the 3D design of course, and also posting live sensor data to the pi-hosted website (but more on that in a future post).
Audio Classification Challenges
Since the beginning of this project, the pollinator detection method was to be based on audio classifiers trained using TensorFlow Lite Model Maker, which is a library designed to simplify the training of a classifier based on TensorFlow Lite, a lightweight version of the well-known TensorFlow machine learning library. TensorFlow Lite is ideally suited for running on a sophisticated microcontroller such as the Raspberry Pi Pico and all of the initial research I did for this project pointed towards this as clearly the best choice for this project.
When starting to use TensorFlow Lite Model Maker, I would run into a strange bug during installation, where one installation step would loop constantly and even if left for hours - not complete. I tried a few potential workarounds, including trying an install on multiple different OS's; Ubuntu, Linux Mint, and also on Google Colab, which in theory is the best environment, but no luck!
Looking through the issues list on github against the library, I found this issue which explains the origin of the bug. Effectively, this is due to incompatibility of the library with Python 3.10, which for a time was fixable by rolling back Colab to use Python 3.9, however support for that version ended in mid-May. Like me, there are many concerned users expressing similar frustrations on github, although it has now come to light that support is being pulled generally for TensorFlow Lite Model Maker, with users being pointed towards the new 'MediaPipe Model Maker'.
This is a bit of a roadbump for the project as there was plenty of precedent of TensorFlow Lite Model Maker being deployed on Pi Pico-based projects, but this is not yet the case for MediaPipe. As my machine learning knowledge is fairly beginner, I am hesitant to pathfind this route, given that there are only ~3 weeks remaining until the competition deadline.
What is the alternative?
There are some other machine learning libraries which can be used with Pi Pico, although mainly suited for speech recognition, and none as well documented as TensorFlow Lite. For this reason I am currently exploring a more 'traditional' audio analysis approach, using libraries designed to apply methods such as the 'Fast Fourier Transform' to audio samples in order to conduct frequency analysis. I am relatively confident that the attributes of pollinators such as bumblebees which made them suitable candidates for machine learning recognition (ie a very recognisable acoustic fingerprint due to very different wing taxonomy to other insects) will mean that it will be possible to design a classifier based on frequency analysis in this way.
With all other major aspects of this project currently on track, this will be my main focus for now and I look forward to sharing the experiementation with you soon.
Until Next Time
In passing, a Raspberry Pi pro-tip I learned the hard way this week is make sure you use a good quality micro SD card! I decided to be cheap and re-use an old unbranded card with the Raspberry Pi 4 and it became corrupted this week and with it went my new pi-hosted website. Thankfully I had backed up all the website files, but it took me a few days to resurrect it as it wasn't as simple as just copying the site directory onto the new card.
Hope you have a nice week and your projects are going smoothly!