Knowledge Hub

EmotionSense: Real-Time Emotion Detection on Device

Engineering articleBy Naveed Sohail Gung2025-06-15FlutterDartTensorFlowML Kit

Building a Flutter app that detects facial emotions, age, and gender in real time using Google ML Kit and TensorFlow Lite — with all processing on-device for privacy.

Article summary

Building a Flutter app that detects facial emotions, age, and gender in real time using Google ML Kit and TensorFlow Lite — with all processing on-device for privacy.

What this article covers

Why On-Device? Cloud-based facial analysis sends your face to a server. For an app that runs continuously, that's a non-starter for privacy. EmotionSense runs 100% on-device — no network requests, no data leaves your phone.

What this article covers (2)

ML Pipeline Face Detection — Google ML Kit detects faces at 30+ FPS with bounding boxes and landmark positions. Emotion Classification — a custom TFLite model (MobileNetV2 fine-tuned on FER-2013) classifies 7 emotions: happy, sad, angry, surprised, disgusted, fearful, neutral. Age & Gender Estimation — a second TFLite model predicts age range and gender from the cropped face region.

What this article covers (3)

Flutter Camera Integration The camera preview uses Flutter's camera plugin with image streaming mode. Each frame is passed to ML Kit's face detector, then the detected face region is cropped and fed to the TFLite models. All processing happens on a background isolate to keep the UI at 60 FPS.

Topics and technologies

  • Flutter
    Browse related articles in the knowledge hub.
  • Dart
    Browse related articles in the knowledge hub.
  • TensorFlow
    Browse related articles in the knowledge hub.
  • ML Kit
    Browse related articles in the knowledge hub.
  • Mobile
    Browse related articles in the knowledge hub.
  • AI
    Browse related articles in the knowledge hub.

Related navigation