Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Improving face recognition accuracy

I'm working on a Face Recognition program using Opencv 3.1 with Python 3 on Linux and I'm trying to increase recognition accuracy as much as I can.

My issue: The confidence values between Person A (myself) and Person B (a friend) are a bit too close. There is a "fair" amount of difference, but not enough to set a threshold without getting false positives/negatives. I wrote a script to recognize Person A over a set of images for Person B and calculate the average confidence so I could see how much they differ by, and I noticed that as the face size in Step 3 of Preprocessing (see below) increased, the difference decreased. My expectation was that by increasing the face size, there would be more detail and thus the difference would increase. Detected face sizes in this case were roughly 1500x1500.

My question: How can I improve face recognition accuracy?

Below is some information about my project. Thanks.


Files used:

  • OpenCV's Haar Cascade (haarcascade_frontalface_default.xml) with a scaleFactor of 1.1 and minNeighbors of 10 for detecting faces.
  • Local Binary Patterns Histograms algorithm (createLBPHFaceRecognizer) for recognizing faces.

Image information:

  • Each 4928x3264
  • Same lighting conditions
  • Different facial expressions
  • Different angles (heads tilting / facing different directions)

Preprocessing Steps:

  1. Cropping the face out of the whole image
  2. Converting it to grayscale
  3. Resizing it to a "standard" size
  4. Histogram Equalization to smooth out lighting differences
  5. Applying a Bilateral Filter to smooth out small details

Training Steps:

  1. Preprocess raw images for a given person
  2. Train recognizer using preprocessed faces
  3. Save trained recognizer model to a file

Recognition Steps:

  1. Load recognizer model from file
  2. Take in image from either file or webcam
  3. Detect face
  4. Preprocess face (see above)
  5. Attempt recognition