Handwritten Digit Recognition on MNIST dataset using eIQ

Document created by Fabian Ramirez Employee on Jun 17, 2020Last modified by David Piskula on Jul 2, 2020
Version 2Show Document
  • View in full screen mode

About this demo

This demo shows the usage of a Neural Network (NN) applied for handwritten digit recognition, the NN model runs on the i.MX RT1060 MCU. The main idea of the demonstration is to show the i.MX RT capability to manage a graphical user interface while applying a NN model to recognize handwritten numbers to determine whether a password is correct or wrong. The demonstration is tested by setting a 4-digit password to a 4.3" LCD Panel, then the user must enter the correct password to unlock device; when the password is provided, the digits recognized by the NN are displayed on the screen. A 'Clear' button will erase the previous numbers for the user to try a new password to unlock the device.


Technical Introduction and Acknowledgment

The demo is available using two different approaches for the model creation and inference engines: TensorFlow Lite and CMSIS-NN using Caffe Framework.

 

TensorFlow Lite

The application note AN12603 describes handwritten digit recognition on embedded systems through deep learning. The digit recognition is performed by a TensorFlow Lite model trained with the MINST dataset containing 60,000 handwritten grayscale images and 10,000 testing examples. This application note, deep dives into every step to achieve the application using Tensorflow Lite and build a GUI using Embedded Wizard.

 

CMSIS-NN using Caffee Framework

The application note AN12781 explores the usage of Deep Neural Networks created in Caffe Framework, this framework allows creating a model and convert it to CMSIS-NN functions to be exported to the i.MX RT platform as source files. The model is also trained for the digit recognition using the MNIST dataset. The document describes the procedure to create, train and deploy the model; in the final step the model is exported a C source files using CMSIS-NN functions and weights that are exported to the i.MX RT1060 project.


Video

 


Hardware setup

 


Further Information                                          

The NXP eIQ software environment enables the use of ML algorithms on NXP MCUs, i.MX RT crossover MCUs, and i.MX family SoCs. eIQ software includes inference engines, neural network compilers and optimized libraries.

Additionally,  the models can be optimized through techniques like quantization and pruning, AN12781 explores the possibility of optimization by creating a new model using Caffe with a quantization to simplify the floating-point data. By reducing the 32-bit floating-point data to an 8-bit and fixed-point format, the memory allocation got reduced and this resulted in a lower-processing power.


Transfer Learning

Transfer learning gives machine learning models the ability to apply past experience to quickly and more accurately learn to solve new problems. This technique has become very important in deep learning. AN12892 describes how to perform transfer learning in TensorFlow and a use case example, which aims to improve the performance of the application from AN12603. 

 

 

1 person found this helpful

Attachments

    Outcomes