Eigenface algorithm for face recognition. How to recognise if face not cone in any category i.e, face is new?
you can set a threshold value in the constructor, such that whenever the distance to the trained image is too large (unknown face) the prediction will return -1.
you will have to experiment a bit, like trying images of non-faces, then looking at the 'confidence' value from the prediction, to estimate a good one, this all depends on your existing data.