15

Can any one suggest me an open source face recognition framework in Java?

Sinan Ünür
  • 113,391
  • 15
  • 187
  • 326
user189352
  • 825
  • 4
  • 18
  • 26
  • 1
    Have a look at this question: http://stackoverflow.com/questions/953714/face-recognition-library – Janusz Mar 05 '10 at 08:28

3 Answers3

17

There are a few open-source Face Recognition Java systems you can try, but don't expect much, because I am looking for the same thing but I'm still looking for a better option!

Note that finding any face within in image is called "Face Detection", following any face is called "Face Tracking", and determining the identity of a detected face is called "Face Recognition". I'm telling you this because you probably have to use different software and algorithms to do each one! The answer by Paul tells you that OpenCV can do Face Detection easily (Haar Cascade Detector), but not Face Recognition as easily (actually it does have a way to do Eigenface Recognition), which it sounds like you need Face Recognition, so OpenCV isn't necessarily your best option since you are using Java.

You can try FAINT which does both Face Detection and Face Recognition in Java, but it is pretty much undocumented. There is also "http://darnok.org/programming/face-recognition/", but I can't seem to get good results out of it. There is also "http://uni.johnsto.co.uk/faces/" for Face Recognition, and "Neuroph" for Face Recognition / Detection.

If you find a good solution, please tell me at "draw3d@shervinemami.co.cc" Good Luck! Shervin Emami

Shervin Emami
  • 2,555
  • 22
  • 17
  • 1
    update: OpenCV v2.4.1 now comes with a new FaceRecognizer class that is quite easy for Face Recognition using several possible algorithms (Eigenfaces, Fisherfaces and LBP-Histograms). So you should look for a way to use it from Java, such as OpenCV on Android (supports Java) or maybe JavaCV (might not have FaceRecognizer yet). – Shervin Emami Sep 12 '12 at 00:17
  • Don't use eigenfaces for accuracy. It is a direct pixel comparison based on averages. Comparing facial descriptors after scaling, rotating, and cropping found faces is better. It takes deep learning to train a model to find these descriptors. – Andrew Scott Evans Jul 27 '17 at 23:30
6

Check out OpenCV. A well-documented and acclaimed face detection technique by Viola & Jones has been implemented, known as Haar cascade.

A complete tutorial -- from training to experimentation -- is available here. Note that you don't actually need to do training; OpenCV comes bundled with several feature cascades, including a few for face detection.

Paul Lammertsma
  • 35,234
  • 14
  • 128
  • 182
  • 1
    The Viola & Jones paper, Rapid Object Detection using a Boosted Cascade of Simple Features , can be found on Google Scholar: http://scholar.google.com/scholar?cluster=6119571473300502765 – Paul Lammertsma Oct 20 '09 at 15:30
  • 1
    Thanks for replying.can i use it to make a commertial attendance system.My idea is to make a attendance system by which people are automatically marked as present when they pass throug a passage containing cameras. – user189352 Oct 20 '09 at 15:37
  • 1
    Well, technically, you could run the algorithm on a photo, tally the number of detected faces and take it as an answer. Realistically, though, it would be very unpredictable and prone to error. Firstly, it does not detect a specific face. That is, it does not distinguish between your face or mine. For that reason, determining whether a certain individual is present or not would require something more discriminating. – Paul Lammertsma Oct 20 '09 at 15:40
  • If you only wish to tally the number of people entering/exiting a passage, you could instead track a particular face from when it enters the frame to when it exits, and assume this to be one individual. Again, it would be prone to error. – Paul Lammertsma Oct 20 '09 at 15:42
  • can we have a chat on skype or msn? my skype id is akshayshetye and yahoo is chetankamat123 – user189352 Oct 20 '09 at 15:54
  • All the information I can give you, I've given already. Perhaps you'd want to look elsewhere for solutions. See this related question: http://stackoverflow.com/questions/953714/face-recognition-library – Paul Lammertsma Oct 20 '09 at 16:19
3

Accurate face recognition is a task that can be broken into several steps:

  1. Face detection
  2. Facial landmark point discovery
  3. Rotation, cropping, alignment, and scaling using your landmarks
  4. Facial descriptor point discovery (these are not human readable)
  5. Comparison to known faces to find the closest match

This can be done with several libraries but requires bytedeco wrappers for OpenCV and Caffe as well as a library such as ND4j for matrix comparison.

OpenCV has HAAR cascades for face detection and can use flandmark for facial point recognition. This will allow you to perform steps 1-3.

Facial descriptor discovery can be done using the bytedeco wrapper for Caffe and VGG Face Descriptor library (http://www.robots.ox.ac.uk/~vgg/software/vgg_face/)

Finally, Nd4j can be used for comparing images. If you have enough images classified by individual, perhaps you can use a neural network from the library for classification.

Andrew Scott Evans
  • 893
  • 11
  • 24