Qualeams / Android-Face-Recognition-with-Deep-Learning-Library

Face Recognition library for Android devices is an Android library (module) which includes several face recognition methods.
Apache License 2.0
373 stars 134 forks source link

Recognition dependent on lighting conditions used during training #22

Open ashokbugude opened 6 years ago

ashokbugude commented 6 years ago

I find the following things

  1. The recognition is working fine in the same lighting conditions as that used during training images
  2. Recognition is not working fine if the training lighting conditions is even slightly different from the lighting conditions of training images. ( Assuming all training images are taken at 1 location)

After going through the code I find that RGB values of each pixel of the cropped face is given as input to tensorflow for feature extraction, which explains why the recognition is highly dependent on training images.

Can I please know how the training and recognition be made independent of Lighting conditions. I am thinking of

  1. Find out x,y coordinates of all the 68 facial Landmark Points (https://www.pyimagesearch.com/wp-content/uploads/2017/04/facial_landmarks_68markup.jpg).

Src : https://www.pyimagesearch.com/2017/04/03/facial-landmarks-dlib-opencv-python

https://hackernoon.com/building-a-facial-recognition-pipeline-with-deep-learning-in-tensorflow-66e7645015b8

  1. Calculate the distance between adjacent points and store in a 1d array of size 68 For eg Arr[0]= distance between x0,y0 and x1,y1 Arr[1]= distance between x1,y1 and x2,y2 Arr[2]= distance between x2,y2 and x3,y3 . . . Arr[67]= distance between x67,y67 and x68,y68

  2. Pass the Array Arr as input to TensorFlow for feature extraction and generate 128 bit feature vector.

The above method would

  1. Be independent of Light as its independent of RGB values of each pixel.
  2. The time taken by tensorflow would reduce as the input to tensorflow for 128 bit feature extraction would be reduced from 160 160 3 to 1*68

Could you please share your thoughts on it OR is there any other way to make face recognition independent of RGB values of each pixel

Zumbalamambo commented 6 years ago

@ashokbugude when i faced this issue, i varied the gamma values of the frame randomly while training to make it more robust to lightning. and it works fine for me.