happynear / FaceVerification

An Experimental Implementation of Face Verification, 96.8% on LFW.
447 stars 234 forks source link

Is PCA helpful? #47

Open GuitarYourself opened 7 years ago

GuitarYourself commented 7 years ago

I recently reproduced your result with your 99.3% model in your matlab code. There is a interesting thing: in the lfwPCA.m, if you replace thresh1 by thresh2 when training the SVM, the result accuracy is as well as thresh1, about 99.25%. In my test, i changed [U,mu,vars] = pca( [F1_mu(train_idx,:); F2_mu(train_idx,:)]' ); with [U,mu,vars] = pca( [F1_mu(train_idx,:); F2_mu(train_idx,:)] ); , with the matlab version 2015b. And, i downloaded a applyPCA.m because i didn't find the function in your code. i‘m not sure if these changes matter.

Anyway, i trained a SVM model using the 6000 pairs in LFW with opencv, and used it to test the whole possible pairs formed by total images in LFW. Unfortunately, the acc in same subject pairs is about 82% with the acc in different subject pairs 45%. Do you have some light on this phenomenon?

happynear commented 7 years ago

I'm using Matlab 2016b, maybe the applyPCA is in the new version. PCA does help a lot just as you experimented.

I don't know much about the SVM in LFW. I guess you choose the wrong kernel (linear kernel is enough)?

xiaoxiongli commented 7 years ago

i wonder that why we need use SVM since we already get the face feature before and after PCA.

Why we need trainsvm in applyPCA.m ?