Skip to content

Repository files navigation

Edge Face Analyzer

Android application for on-device age-group, gender-label, and facial-expression classification from a camera capture or gallery image. Built with Kotlin, Jetpack Compose, ML Kit face detection, and TensorFlow Lite.

Build and run

The four trained models are included in app/src/main/assets/. No training dataset or Python installation is needed to run the Android app.

  1. Clone this repository and open its root folder in Android Studio.
  2. Install Android SDK Platform 35 and the SDK build tools requested by Gradle.
  3. Select JDK 21 as the Gradle JDK. The project uses Gradle 9.3.0, Android Gradle Plugin 8.7.3, and Kotlin 2.0.21.
  4. Let Gradle sync. Internet access is needed to download build dependencies.
  5. Connect an Android 6.0 (API 23) or newer device, enable USB debugging, and run the app configuration. Native libraries are packaged for ARMv7 and ARM64; use an ARM device or compatible emulator.
  6. Leave the GPU toggle off for CPU inference, then choose Gallery or Camera.

For a command-line build, set JAVA_HOME to your JDK and ANDROID_HOME to your Android SDK. Run from the repository root:

.\gradlew.bat :app:assembleDebug :app:lintDebug

On macOS/Linux use sh ./gradlew :app:assembleDebug :app:lintDebug. The APK is generated at app/build/outputs/apk/debug/app-debug.apk. Android Studio can alternatively configure the SDK in local.properties; that machine-specific file is excluded from Git.

Build verification: a clean copy of the Git-selected source passed assembleDebug and lintDebug with JDK 21.0.10. Lint reported no errors; remaining warnings concern dependency updates and ChromeOS x86 ABI support.

Models and behavior

Asset Output
age_group.tflite Six age groups
gender.tflite Male/Female dataset labels
expression.tflite Eight expression classes
ethnicity.tflite Seven optional dataset-defined categories

All four assets are required by the current implementation. Generation is calculated from age group and the calendar year; it is not a separate model. The asset README specifies tensor shapes, preprocessing, and label order. Face selection favors a large central face. Predictions and confidence scores are estimates, not verified personal attributes. The optional GPU delegate depends on device support.

Evaluate with your own images

For individual images, select reference labels under Evaluation Labels and choose Record CSV Row. The app displays the output CSV location.

For batch evaluation, open the app once and place labelled images in Android/data/com.edgeai.faceanalyzer/files/EvaluationImages/. Tap Run Batch. Use filenames such as 25_male_happy.jpg: numeric age, gender, and expression, separated by underscores. Output is edge_face_phone_batch_evaluation.csv in the app's external files directory. Android device-file tools or ADB may be needed to access this directory.

Personal evaluation images and exported results are not distributed. Use your own appropriately labelled images. The desktop evaluator uses a different face detector; see training instructions.

Optional retraining

Training instructions cover dataset sources, Python setup, preparation, training, and model replacement. Raw data, generated manifests, checkpoints, build products, local settings, and the separately submitted written report are excluded from this repository.

Technical sources

About

Android application for on-device facial attribute recognition using TensorFlow Lite.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages