ABSTRACT
This application note describes a method to execute the facial recognition application for the MAX78000/MAX78002 artificial intelligence (AI) microcontrollers. This application is comprised of three separate models— the Face Detection CNN model, the Face Identification CNN model, and the Dot Product model.
INTRODUCTION
The MAX78000 [1] and MAX78002 [2] are AI microcontrollers that include an ultra-low-power convolutional neural network (CNN) inference engine to run AI edge applications on a battery-powered internet of things (IoT) device. The microcontrollers can execute many complex CNN networks to achieve critical performance.
This document describes an approach to use a single facial recognition application to utilize the following three CNN models, each invoked in a different task:
- The Face Detection CNN model detects faces in the captured image and extracts a rectangular sub-image containing only one face.
- The Face Identification CNN model identifies a person from their facial images by generating the embedding for a given face image.
- The Dot Product model outputs the dot product representing the similarity between the embedding from the given image and embeddings in the database.
Using the dot product similarity as a distance metric, the image is identified as either one of the known subjects or ‘Unknown’ depending on the embedding distances.
MAX78000 FACIAL RECOGNITION APPLICATION
The Facial Recognition application [4] can only run on MAX78000 Feather Board [3] because of the SD card support.
The Face Detection, Face Identification, and Dot Product models are executed sequentially. The challenge of this application is to utilize all models when they are exceeding 432KB of 8-bit weight capacity of the MAX78000 CNN engine and MAX78000 internal flash memory storage. In this example, the Face Detection and Dot Product model’s weights are stored in the MAX78000 internal flash memory, while the Face Identification CNN model weights are stored in the external SD memory card and reloaded as soon as a face is detected.
The SDHC_weights sub-project can be used to store the Face Identification CNN weights (weights_2.h) in the SD card in binary format.
Face Detection
The Face Detection CNN model has 16 layers and uses 168×224 RGB images as input.















