Iwatake's Raspberry Pi Pico Has Number Recognition TinyML Powers Thanks to MNIST and TensorFlow Lite

Taking advantage of Google's RP2040 TensorFlow Lite port, Iwataka has built a number-recognizing touchscreen system powered by the Pico.

Embedded software engineer Iwatake has published the source code for a handwritten character recognition system, based on the MNIST database, running on the Raspberry Pi Pico using TensorFlow Lite.

Since its launch late last month, the Raspberry Pi Pico — the first board to feature the RP2040 microcontroller, Raspberry Pi's first-ever in-house silicon — has found a home in a variety of projects. The news that Google was providing a port of TensorFlow Lite for the board raised the possibility of a range of TinyML workloads — and Iwatake's latest project takes advantage of just that possibility.

Using a Raspberry Pi Pico, an ILI93451 2.8" 240.320 SPI LCD screen, and a TSC2046 SPI touch panel on top, Iwatake has been able to demonstrate high-speed high-accuracy handwritten number recognition: Simply draw the number in the bounding box on the screen, tap the RUN button, and the microcontroller prints the digits 0 through 9 with its confidence value for each.

The project is built on the Modified National Institute of Standards and Technology (MNIST) database, which offers a rich corpus of handwritten digits. "It looks uint8 quantization is not supported," Iwatake notes. "You need to use int8 quantization, or use FP32 model."

The source code, published under the Apache 2.0 license, can be found on Iwatake's GitHub repository, along with instructions for building the project under Microsoft Visual Studio 2019 or MSYS2.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Related articles
Sponsored articles
Related articles