HOW IT WORKS

From Camera Capture to AI Prediction

FaceBMI combines computer vision and machine learning to estimate a user's BMI category from a facial image. The following workflow illustrates how the system processes an image from capture to prediction while maintaining a simple and user-friendly experience.

1. Webcam Capture

The process begins by requesting permission to access the user's webcam. Once permission is granted, FaceBMI captures a facial image for analysis. The image is processed temporarily and is never permanently stored.

2. OpenCV Face Detection

OpenCV detects and isolates the user's face from the camera frame. The system verifies that a clear, single face is present before continuing, improving the reliability of the prediction process.

3. MediaPipe FaceMesh

MediaPipe FaceMesh identifies hundreds of facial landmarks across the detected face. These landmarks provide a detailed geometric representation of facial structure that is used for further analysis.

4. Feature Extraction

The detected facial landmarks are converted into meaningful numerical features such as facial proportions, jaw width, face width, facial aspect ratio, and other geometric measurements. These extracted features become the input for the machine learning model.

5. Machine Learning Model

The extracted facial features are processed by a machine learning model trained to recognize patterns associated with different BMI categories. The model estimates the user's BMI category based on the learned relationships between facial geometry and BMI.

6. BMI Category Prediction

The trained model returns one BMI category such as Underweight, Normal, Overweight, or Obese. The predicted category is then prepared for display.

7. Health Recommendation

After the BMI category has been predicted, FaceBMI presents general health recommendations related to the predicted category. These recommendations are intended for educational purposes only and should not replace professional medical advice.

System Security & Privacy

Facial images are processed temporarily to detect facial landmarks required for prediction. Only the extracted facial features are analyzed by the machine learning model, and no facial images are permanently stored. Camera access is requested through the browser, and users retain full control over whether permission is granted. If permission is denied, the system gracefully informs the user and provides guidance to retry after enabling camera access.

Technologies Used

HTML5 Frontend structure
Bootstrap 5 Responsive user interface
CSS3 Styling and animations
JavaScript Frontend interaction
Python Backend programming language
Flask Backend API and communication
OpenCV Face detection
MediaPipe FaceMesh Facial landmark detection