~/d4nnyX

← Projects

Age & Gender Face Recognition

Machine Learning · 2024-02-19

  • Python
  • OpenCV
  • Deep Learning

A facial recognition system that identifies the age and gender of people in an image or video stream using deep learning. The pipeline runs in three stages: detect the face, estimate the age, then classify the gender.

Age and gender detection drawing a labelled box around a detected face

Face detection

I use OpenCV to locate and crop the facial region from the frame. Isolating the face first is what makes the age and gender predictions reliable, since both models expect a clean, centred face.

Age and gender prediction

Each cropped face is passed through pre-trained models: one estimates an age range, the other classifies gender from the facial features. The result is drawn back onto the original image as a labelled box.

Multiple faces in a frame each labelled with an estimated age range and gender