A sophisticated Android application that provides real-time face detection, anti-spoofing liveness checks, and accurate face recognition capabilities using advanced computer vision algorithms.
- Real-time Face Detection: Identifies human faces in both images and live camera feed
- Anti-spoofing Technology: Performs liveness detection to prevent photo/video attacks
- Face Recognition: Accurate matching against enrolled face templates
- Multiple Liveness Levels: Configurable security thresholds for different use cases
- Pose Estimation: Detects face orientation (yaw, pitch, roll)
- Camera Options: Support for both front and rear cameras
- User Management: Enroll, identify and delete face templates with persistent storage
- Configurable Parameters: Adjustable thresholds for liveness and recognition confidence
- Android Studio Arctic Fox (2021.3.1) or higher
- Android API level 21+ (Android 5.0 Lollipop or higher)
- Camera hardware with autofocus capability
- Minimum 2GB RAM on device for optimal performance
The application follows the MVVM (Model-View-ViewModel) architecture with these main components:
- UI Layer: Activities for enrollment, identification, and settings management
- Camera: Uses CameraX API for modern camera operation
- Face Processing: Leverages native SDK for face detection and template extraction
- Database: SQLite for storing face templates and metadata
- Settings: SharedPreferences-based configuration management
- Clone the repository:
git clone https://github.com/NabarupDev/Face-Detection.git
-
Open the project in Android Studio
-
Set up the license key in MainActivity.kt:
FaceSDK.setActivation("YOUR_LICENSE_KEY")
- Sync Gradle and run the application on a physical device (emulators may lack proper camera support)
- Launch the application and tap "Enroll"
- Select or capture a photo containing a face
- The system will extract facial features and store them in the database
- Tap "Identify" to launch the camera
- Position a face in the frame
- If the person is enrolled and passes the liveness check, the application will display their identity and match confidence
Tap "Settings" to access configurable parameters:
- Camera lens (front/back)
- Liveness detection threshold
- Identification confidence threshold
- Liveness security level
- Frame acquisition from camera or gallery
- YUV to bitmap conversion
- Face detection with bounding box extraction
- Liveness analysis
- Template extraction for recognized faces
- Template comparison with database
- All core detection and recognition operations run on the device
- Optimized for real-time processing on mid-range devices
- Camera resolution set to optimal values for face detection (720x1280)
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Implement your changes and add tests where possible
- Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- The application stores biometric templates locally, not raw facial images
- Consider implementing additional encryption for the SQLite database in production environments
- Review and comply with local regulations regarding biometric data collection and storage
For commercial licensing and support, please contact:
- Email: nabaruproy.dev@gmail.com
- GitHub: NabarupDev