Fingerprint Authenticator

This application uses machine learning to generate a unique “signature” from a grayscale image of a person’s fingerprint captured by the R503 Fingerprint Module. The generated signature is then compared against previously generated signatures saved to flash memory. If a saved signature is similar to the generated signature then the user is considered authenticated.

NOTE: This application only supports running on supported embedded targets (Windows/Linux is not supported).

Video

A demo video of this application may be found here:
Fingerprint Authenticator Video

Behavior

This application has the following behavior:

  • Click button 2 to iterate through users
    The LED will be solid red, blue, or purple to signify the current user:

    • RED -> user 0

    • BLUE -> user 1

    • PURPLE -> user 2

  • Press button 2 for 10s then release to erase the current user’s signatures.
    The LED will pulse purple while the erase sequence initializes, and flash purple when the signatures are erased.
    Release button 2 before 10s have elapsed to abort the sequence.

  • Click button 1 to save the fingerprints for the current user.
    The LED will flash blue when you should place your finger on the reader.
    If the LED flashes red then there was a reading error, wait for the LED to flash blue to try again.
    This sequence will repeat 3 times. i.e. The SAME finger will be captured 3 times.
    If there is no activity on the reader after 7s, then this sequence will be aborted.

  • In normal operation, the LED pulses blue.
    Place your finger on the reader to authenticate.
    The LED will pulse purple while your finger is processed.
    The LED will be solid red, blue, or purple for the authenticated user.
    The LED will flash purple for an unknown fingerprint

HINT: Run the following command to view the captured fingerprints:

mltk fingerprint_reader

State Diagram

A state diagram of this application is as follows:

Signature Generation Model

The application is designed to run with a model similar to fingerprint_signature_generator

This model receives a pre-processed grayscale image of the fingerprint and generates its corresponding unique signature.

Refer to Fingerprint Authentication Tutorial for more details on how to create this model.

Updating the model

The application will run any quantized .tflite model file. A default model comes with the application, however, this model may be updated using several different methods:

via Simplicity Studio

To replace the default model, rename your .tflite file to 1_<your model named>.tflite and copy it into the config/tflite folder of Simplicity Studio project. (Simplicity Studio sorts the models alphabetically in ascending order, adding 1_ forces the model to come first). After a new .tflite file is added to the project Simplicity Studio will automatically use the flatbuffer converter tool to convert a .tflite file into a c file which is added to the project.

Refer to the online documentation for more details.

via fingeprint_reader Command

Alternatively, using the command:

mltk fingeprint_reader <model path> --app none

will program the .tflite model to the end of the device’s flash. On startup, the application will detect the new model and use that instead of the model built into the firmware.

NOTE: The --app none option tells the command to not update the fingeprint_authenticator application and only program the model file.

via CMake

The model can also be updated when building this application from Visual Studio Code or the CMake Command Line.

To update the model, create/modify the file: <mltk repo root>/user_options.cmake and add:

mltk_set(FINGERPRINT_AUTHENTICATOR_MODEL <model name or path>)

where <model name or path> is the file path to your model’s .tflite or the MLTK model name.

With this variable set, when the fingeprint_authenticator application is built the specified model will be built into the application.

Hardware Setup

To run this application, an R503 Fingerprint Module is required. This module must be connected to the USART peripheral of the embedded target.

The following default pin mappings are used by:

  • BRD2601

R503 Pin Board Expansion Header Pin
GND (black) 1
Power Supply (red) 20
3.3VT (white) 20
TXD (yellow) 6
RXD (green) 4
Wakeup (blue) 10

Build, Run, Debug

See the online documentation for how to build and run this application:

Simplicity Studio

If using Simplicity Studio select the MLTK - Fingerprint Authenticator Project.

Visual Studio Code

If using Visual Studio Code select the mltk_fingerprint_authenticator CMake target.

Command-line

If using the Command Line select the mltk_fingerprint_authenticator CMake target.

Dumping images to PC

This application works with the MLTK command:

mltk fingerprint_reader --help

Using this command, you can dump images to the local PC.

For example:

mltk classify_image fingerprint_reader --dump-images

which will display the images from the fingerprint reader and save them to the local PC

Build Settings

When building this application using Visual Studio Code or the Command Line several options may be configured to control how the app is built.

To specify the settings, create/modify the file:
<mltk repo root>/user_options.cmake

The following settings are supported:

FINGERPRINT_AUTHENTICATOR_MODEL

Optionally, configure the .tflite model to profile:

# Specify the path to the .tflite model file to use
# by the mltk_fingerprint_authenticator application
mltk_set(FINGERPRINT_AUTHENTICATOR_MODEL ~/my_models/my_model.tflite)

HINT:
You can also specify the path to the .mltk.zip model archive or just specify the MLTK model name, e.g.:

# Specify the path to the model archive
mltk_set(FINGERPRINT_AUTHENTICATOR_MODEL ~/my_models/my_model.mltk.zip)

# Specify the MLTK model name
# NOTE: The model specification must be on the model search path, see:
#       https://siliconlabs.github.io/mltk/docs/guides/model_search_path.html
mltk_set(FINGERPRINT_AUTHENTICATOR_MODEL fingerprint_signature_generator)

TFLITE_MICRO_ACCELERATOR

Optionally, configure the target hardware accelerator:

# Use the Gecko SDK MVP TFLM kernels
mltk_set(TFLITE_MICRO_ACCELERATOR mvp)