

While the model accuracy could be improved (possibly by expanding the dataset), the model already worked very well in most situations when I tested it on the road the main problem seems to be false positives of trash in parking garages.

The process of making the ML model-from dataset to model inference-was made easily using Edge Impulse Studio, especially with tools like EON Tuner and the Linux Python SDK. It would be possible to run this system on a wider scale and collect data that could save resources in litter pickup and help make smarter cities. I’m delighted with how the project came out-the device is a pretty decent prototype of a litter mapping system. The mode is set to periodic with a 30-minute outbound and 720-minute inbound, meaning that the Notecard periodically syncs outbound data with Notehub every 30 minutes and inbound data every 720 minutes. For now, keys.py will be left empty as we don’t have the ProductUID yet.įirst, we need to connect the Notecard to Notehub using the note-python library. On the Raspberry Pi, I created two files, classifytrash.py and keys.py.
#THE NOTECARD CODE#
We’ll go over the highlights of the code here, but you can see all of it on GitHub here. Now we have a trained model installed, but still have to write the inference for it. $ edge-impulse-linux-runner -quantized -download model.eim
#THE NOTECARD INSTALL#
Then install the quantized model to “model.eim” using edge-impulse-linux runner using the command below. $ sudo apt-get install libatlas-base-dev libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev $ pip3 install edge_impulse_linux -i First, install the SDK on the RPi using the following commands. The setup can be found on Edge Impulse’s documentation for the SDK, but I’ll go over it here. To do this, I used Edge Impulse’s Linux Python SDK. With the model completed, you now have to install it on the Raspberry Pi.

The training of the model and dataset can be seen on Edge Impulse here. Using Edge Impulse Studio made the process of data to model deployment and inference super convenient and straightforward, as well as providing the tools to make the best model for the dataset. I then found and trained the best model using Edge Impulse’s EON Tuner, ending with a pretty good test accuracy of around 87%-much better than without using EON Tuner.
