OeslleLucena / FASNet

CNN archictecture for face anti-spoofing
MIT License
175 stars 56 forks source link

My results always return 1. #14

Open superxi opened 6 years ago

superxi commented 6 years ago

I just use the FASNet.py,run on Keras(Using TensorFlow backend) using the weights REPLAY-ftweights18.h5.I Pre-processing the input data ( find the face and cropped to a window sized 96 pixels ).But the result always return 1.Does anyone know why?

cvtower commented 6 years ago

I do have found the fact that the uploaded model pretrained from replay/3dmad database will kill too much live faces(dont remember the ratio but quite high) on other databases, though they do work well on single database. To verify this, you can change the inference code and just get predicted prob instead of the the class. And than, print the value. I believe you will find the reason.

Cross-database validation still a big problem here so far as i know.

Personally, i choose other approaches to detect attack, since i dont think a cropped and resized face contain sufficient info to tell difference here. what is worse, in practical scene, you could not handle the uploaded image quality, and this has never been considered in most available database.

Jason-xin commented 6 years ago

@cvtower return 1 means live face, or attack face? and I found that it returns 1 when prob > 0.5 and it returns 0 when prob < 0.5.

Jason-xin commented 6 years ago

@cvtower In NUAA dataset, all test images return 1. In all real face images, 2735 images with prob=1, and the remaining 627 images with prob>0.9. In all attack images, 1903 images with prob=1, and the remaining 3858 images with prob>0.9.

What's a terrible performance!

nihilityworld commented 6 years ago

@Jason-xin 1 is attack.0 is real. I suggest you train your own model.I trained on replay-attack and the acc is 0.96.

amit2319 commented 6 years ago

@cvtower So what other approaches you apply. Can you please specify?

wang5566 commented 5 years ago

@cvtower I find predict_class always outputs 1 whatever the predict_proba's output is (0, 1).