decision-treedeepface

How to set decision-tree distance threshold in Deepface library? Regarding "LightFace: A Hybrid Deep Face Recognition Framework" paper


I am reading deep face library paper,"LightFace: A Hybrid Deep Face Recognition Framework".

Q1. Is there code to explain how to determine the distance threshold?

The decision tree(C4.5) algorithm sets the distance threshold to distinguish two human faces. I have tried to find it on the GitHub page, but I have not been able to.

Q2. Does the deepface library resize images depending on the backbone model?

I have read that black padding increases the inference image size before putting it to the backbone. If the image size is bigger than the backbone, does the Deepface library resize an image to a specific size?

Thank you


Solution

  • Q1: When you feed a set of same person and different persons, you will get distances for that set from deepface and also label for that pair as same person or different persons. To find the best split point between same person and different persons classes, ChefBoost library was used externally to build C4.5 decision trees. This is explained deeply in its corresponding tutorial. Finally, best thresholds are set in the deepface code hard-coded.

    Q2: each backbone in deepface expects different size of inputs. For instance, VGG-Face expects (224, 224, 3) shaped inputs whereas FaceNet models expect (160, 160, 3) shaped inputs. When you feed an image to deepface, then it firstly extracts facial area, then align the extracted face according to its eye locations, and finally resize it to the input shape of the target model. This is handled in its representation module.