My ML Hello World Project Part 1

It was one of my first machine learning course’s (Complete Keras and Tensorflow 2 Deep Learning Bootcamp) Python program that impressed me. So, I plan to run this classic hand written number recognition “party trick” using the 60,000 digit sample MNIST training database on our upcoming I.MX8PLUS industrial gateway device.


Edge Compute device : Our development IMX8PLUS gateway board with 2GB RAM

Another goal of the project is also to test Google’s Coral Edge TPU M.2 module to determine the performance gains. Since my USB camera is still on the way here via Aust Post, today, we will just do a benchmark on a CNN training and inference cycle using simulated user input.

In my Python script with Tensorflow and Keras, I setup a simple Sequential CNN model with early stopping based on minimum validation loss.


Next, we check the model summary and then run the training.


Then, we run the training on the I.MX8PLUS gateway itself, just for the fun of it.

CNN model training using 60000 images of digits MNIST
Training a sequential CNN model using the 60,000 digit MNIST database


Yes, with Tensorflow 2.0, the ARM Cortex-A53 4-Core does take a bit of hit to iterate thru all the sequential model to build the neural network. On my Intel i7-1260P laptop, each iteration took about 22-25s. or now, the model was able to predict our simulated digits pretty spot-on. We can’t wait to do a test with our external USB web cam next .. back soon.


So, we ran some inference using the MNIST trained model on some user sample images below. Prediction was pretty “spot on”, we are bunch of old EEE guys so lack the Data Science lingo




So, next we want to work on getting Tensorflow Lite integrated into our scripts and see how much faster we can improve prediction/inference before we try the Coral “Google” M.2 Edge TPU card (when it does arrive). Posting results soon ….

Related posts

Latest posts

Unknown's avatar

Author: stangeek71

51 year old Electrical/Electronics Engineer, background in industrial servo controls but been developing and pushing industrial gateways for past 15 years. Nowadays, working hard to catch up on machine learning knowledge to develop, test and deploy useful new features for customers of our next gen industrial gateways.

Leave a comment