serengil / deepface

A Lightweight Face Recognition and Facial Attribute Analysis (Age, Gender, Emotion and Race) Library for Python
https://www.youtube.com/watch?v=WnUVYQP4h44&list=PLsS_1RYmYQQFdWqxQggXHynP1rqaYXv_E&index=1
MIT License
11.87k stars 2.02k forks source link

kid's gender and age detection is not accurate #64

Closed pengKiina closed 4 years ago

pengKiina commented 4 years ago

running many images, every times comes to kids faces, the gender and age's detection is far from accuracy.

Is there some way can get better accuracy?

Thanks!

image link https://unsplash.com/photos/oWDRVgk04EA


from deepface import DeepFace
DeepFace.analyze((images[1]))
{'emotion': {'angry': 0.04058407163003514,
  'disgust': 5.642185721868631e-06,
  'fear': 58.03913820023168,
  'happy': 0.0008088882650657082,
  'sad': 0.0009563027221449876,
  'surprise': 41.91847991457462,
  'neutral': 3.256737296336301e-05},
 'dominant_emotion': 'fear',
 **'age': 29**.03933189735305,
 **'gender': 'Man',**
 'race': {'asian': 2.548585238968446,
  'indian': 1.3059119540996524,
  'black': 0.28957356096497544,
  'white': 57.22050411823417,
  'middle eastern': 14.436330761690781,
  'latino hispanic': 24.19909234041526},
 'dominant_race': 'white'}
serengil commented 4 years ago

Overall, age prediction has almost ±4 year error. This is acceptable because you predict someone in which decade group.

Besides, predicting children underperform because the source data set (imdb + wiki) has limited children images. Here you can find the distributions: https://sefiks.com/wp-content/uploads/2019/02/age-gender-distribution.png

We can find a larger data set in the future and re-train the model.

This is not a bug, that's why, I'm going to close this issue.

Tutorial: https://sefiks.com/2019/02/13/apparent-age-and-gender-prediction-in-keras/

pengKiina commented 4 years ago

I see, thanks a lot.