Blog post

The World Is All Abuzz About TinyML

Projects
By Nick Bild
The World Is All Abuzz About TinyML

In many regions of the world, mosquitos are little more than annoying summertime pests that maddeningly buzz around our faces and leave behind itchy red bumps if they manage to bite before getting swatted. But in other areas, especially in the developing world, these tiny insects are quite literally killers. They can act as vectors for the transmission of malaria, yellow fever, dengue fever, chikungunya, and dozens of other serious illnesses. Each year, over one billion people are infected by vector-borne diseases such as these. With mosquitoes living in virtually every land region on the planet, they present a very serious threat to human health and wellbeing globally.

The most effective method of limiting the negative impacts brought about by mosquitoes is controlling their populations. In order to do that, one needs to know where mosquitoes are, and when. A particularly innovative means for tracking mosquitoes that has been developed in recent years leverages machine learning to detect them by the sound of their wingbeats. Not only can these techniques detect mosquitoes, but they can also determine which species are present. This is useful in understanding if the more harmful varieties like Aedes aegypti or Aedes albopictus are present.

High-level overview of the method

While these techniques are quite accurate and effective, unfortunately, they can be expensive to implement and require a high degree of technical expertise to operate and maintain. These considerations tend to prevent machine learning-powered tools from being rolled out in the developing world, which happens to be where they are most needed. That may all soon change, however, due to recent advancements in microcontroller technology and the availability of new software tools. The team of Moez Altayeb, Marco Zennaro, and Marcelo Rovai demonstrated that an effective mosquito detection device can be built using low-cost, off-the-shelf hardware and the Edge Impulse machine learning development platform. Their prototype can operate in resource-constrained areas without human intervention, and is inexpensive enough to be deployed even in the poorer regions of the world.

To demonstrate the adaptability of their methods to many hardware platforms, the Arduino Nano 33 Tiny Machine Learning Kit, Arduino Portenta H7, and the Seeed Studio Wio Terminal were all included in the demonstrations. Each of these low-power boards has sufficient processing power to run an optimized machine learning algorithm, and with onboard microphones, nearly all of the required components are already accounted for. The team only needed to add in a long-range LoRaWAN radio to allow for transmission of the mosquito detector’s results to a remote location. Where no power source is available, the device can run on a 2,000 mAh rechargeable LiPo battery for several days. With the addition of a solar panel, the unit could be totally self-sufficient.

A spectrogram of a training sample

In order to train a machine learning model to recognize the wingbeat sound of various mosquitoes, example audio data would be needed. The researchers tracked down a public dataset consisting of the wingbeat sounds from 20 different mosquitoes, recorded by different people around the world, and with a variety of microphones. They then divided the samples into four classes — one each for the especially dangerous Aedes aegypti and Aedes albopictus, another class for the 18 other types of mosquitoes in the dataset, and finally a normal background noise class. These audio files were then uploaded to Edge Impulse Studio using the data acquisition tool.

To process this data, an impulse was created. This impulse began with a preprocessing step that turns the audio data into a spectrogram, which is ideal for exploring the audio’s frequency intensity range over time. A convolutional neural network classifier was then added to do the work of distinguishing between the wingbeats of various mosquito types. eHyperparameters for the model were tuned with the help of Edge Impulse’s EON Tuner, then the training process was kicked off.

Model accuracy increased with more training

A test dataset that had been held back from the training process was used to validate the accuracy of the model. It was found that a very impressive 94% average classification accuracy rate had been achieved. Since the result was quite acceptable, the team deployed the same data analysis pipeline to each hardware platform. Edge Impulse’s deployment tool makes this simple by providing options to prepare the model to run on dozens of different platforms. In this case, all of the hardware was compatible with the Arduino IDE, so the “Arduino library” option was selected.

We have come a long way in the past decade. Machine learning-based solutions had been quite difficult to implement in the past, and generally required substantial compute resources. With tools like Edge Impulse, production-ready solutions can now be developed quickly, inexpensively, and with no special skills required. By deploying these solutions to low-cost development boards, large-scale problems can be solved quickly, as was demonstrated by the researchers’ mosquito detector.

Find out how you can put machine learning to work on your own problems by reading more about the team’s methods.


Want to see Edge Impulse in action? Schedule a demo today.

Comments

Subscribe

Are you interested in bringing machine learning intelligence to your devices? We're happy to help.

Subscribe to our newsletter