Embedded Face Recognition Access Control System

Edge AI access control system with on-device face recognition on STM32

Overview

This project implements a lightweight edge AI access control system on an STM32 microcontroller, enabling real-time face recognition directly on-device.

The system is designed as a complete perception–decision–communication pipeline, integrating:

  • on-device face recognition (Edge AI)
  • embedded control logic
  • wireless communication (IoT)
  • mobile-based remote management

Unlike traditional cloud-based solutions, this system performs local inference and decision-making, reducing latency and improving privacy.


System Architecture

The system consists of three core components:

  1. Edge AI Inference Module (STM32)
  2. Wireless Communication Module (ESP8266)
  3. Android Remote Management Application

Runtime pipeline:

  1. Capture face image at access terminal
  2. Perform on-device face recognition inference
  3. Trigger access control (unlock/deny)
  4. Upload logs and status to cloud
  5. Support remote monitoring via mobile app

This forms a complete edge perception–decision–communication loop.


Edge AI Face Recognition

Lightweight Model Design

  • Based on MobileFaceNet for efficient feature extraction
  • Outputs compact face embeddings
  • Identity verification via cosine similarity matching

Pipeline:

  • face detection
  • feature embedding extraction
  • similarity-based identity matching

TinyML Optimization

To deploy on resource-constrained STM32 hardware:

  • Model pruning to reduce redundant parameters
  • INT8 quantization to compress model size
  • TensorFlow Lite Micro for microcontroller inference
  • fixed-point optimization for efficient computation

These optimizations enabled:

  • real-time inference
  • low memory footprint
  • stable embedded deployment

Edge–Cloud Communication

The system integrates an ESP8266 Wi-Fi module for IoT connectivity.

Key features:

  • real-time upload of recognition events
  • remote synchronization of user data
  • device status monitoring

Communication is implemented using:

  • MQTT protocol for lightweight messaging
  • Baidu Cloud IoT platform for device management

Mobile Application

An Android application was developed for remote system control.

Features include:

  • user registration and face enrollment
  • remote door control
  • real-time device monitoring
  • event logging and history tracking

This enables a full edge–cloud–mobile interaction loop.


Key Engineering Challenges

Resource Constraints

  • limited RAM and compute on STM32
  • required aggressive model compression

Real-Time Inference

  • optimized inference pipeline for low latency
  • ensured stable performance under embedded constraints

System Integration

  • integrated embedded firmware, AI inference, networking, and mobile app
  • built a complete end-to-end intelligent system

Technical Stack

Hardware

  • STM32 microcontroller
  • ESP8266 Wi-Fi module

AI / Embedded

  • MobileFaceNet
  • TensorFlow Lite Micro
  • model pruning & INT8 quantization

Communication

  • MQTT protocol
  • Baidu Cloud IoT

Mobile

  • Android application

Outcome

The system demonstrates a complete edge AI deployment pipeline, achieving:

  • real-time face recognition on microcontroller
  • low-latency and privacy-preserving inference
  • reliable remote monitoring via IoT

Key Takeaways

  • Hands-on experience with TinyML and embedded AI deployment
  • Built a full edge AI system (AI + embedded + IoT + mobile)
  • Developed understanding of efficient AI under resource constraints

This project laid the foundation for my later research in efficient perception systems and communication-constrained multi-agent learning.