I'm working on face recognition system where I'm facing issue in detecting unknown faces. The issue is system always returns nearest matching face from the database for the unknown face.

I have used a combination of three algorithms(EIGEN, FISHER & LBPH) to get better accuracy in face recognition. It gives 80-90% accuracy for the faces which are already present in the database, but for the unknown face which not present in the database, it always returns the best match face from the database.

eigenFaceRecognizer = new EigenFaceRecognizer(4,5000);
FisheigenFaceRecognizer = new FisherFaceRecognizer(4, 5000);  
LBPeigenFaceRecognizer = new LBPHFaceRecognizer(4, 8, 8, 8, 5000)                   
var result = eigenFaceRecognizer.Predict(_grayFrame);
var resultFish = FisheigenFaceRecognizer.Predict(_grayFrame);
var LBPresult = LBPeigenFaceRecognizer.Predict(_grayFrame);

if (result.Label != -1 && resultFish.Label != -1 && LBPresult.Label != -1)
{
    if ( result.Label == resultFish.Label == LBPresult.Label)
    {
     return Label;
    }
}
else
{
return "Unknown"
}

1 Answers

0
Hafsa Elif Özçiftci On

I use bellowing code. It's quite useful for me. By the way I'm using EMGU.CV library. "Image Input_image" this format is Emgu.CV format. When I check your code I think these threshold values is so high. With changing these threshold values, you can find most suitable values for your data. Actually there is no ideal threshold values such as system. It's always depend your data whatever training or test sets images.

And I read some article and I develop it. I recomend you this article.

https://www.codeproject.com/Articles/261550/EMGU-Multiple-Face-Recognition-using-PCA-and-Paral

Good luck and success.

public string Recognise(Image<Gray, byte> Input_image, int Eigen_Thresh = -1)
    {
        if (_IsTrained)
        {

            FaceRecognizer.PredictionResult ER = recognizer.Predict(Input_image);

            if (ER.Label == -1)
            {
                Eigen_label = "Unknown";
                Eigen_Distance = 0;
                return Eigen_label;
            }
            else
            {
                Eigen_label = Names_List[ER.Label];
                Eigen_Distance = (float)ER.Distance;
                if (Eigen_Thresh > -1) Eigen_threshold = Eigen_Thresh;
                Console.WriteLine("-Recognise Distance-" + Eigen_Distance + "--" + "Possible Label- " + "--" + Eigen_label);
                //Only use the post threshold rule if we are using an Eigen Recognizer 
                //since Fisher and LBHP threshold set during the constructor will work correctly 
                switch (Recognizer_Type)
                {
                    case ("EMGU.CV.EigenFaceRecognizer"):
                        Console.WriteLine("I'm in");
                        if (Eigen_Distance >= Eigen_threshold)
                        {
                            return Eigen_label; //işareti değiştiridim.z
                        }
                        else return "";
                    case ("EMGU.CV.LBPHFaceRecognizer"):
                        if (Eigen_Distance < 100)
                        {
                            return Eigen_label;
                        }
                        else return "Noise";
                    case ("EMGU.CV.FisherFaceRecognizer"):
                    default:
                        return Eigen_label; //the threshold set in training controls unknowns
                }
            }
        }
        else return "";

    }