File Exchange

image thumbnail

Face Recognition Software

version 1.3 (4 MB) by

Face recognition software using Hidden Markov Models (HMM) and SVD features for education and study.



View License

Version : 1.0

Please visit the official website for this program at the address:

To run the program:

    1- copy all files and directories to the MATLAB's work folder

    2- find the file named "mainmenu.m"

    3- Double click on this file or type "main" in the command window

    4- The system is already trained for ORL database and loaded. You do not need to load or generate anything.

    5- click on "Recognize a Face" to guess the person name.

Currently the recognition rate is about 96% in less than 0.22 sec per person.

Based on:
H. Miar-Naimi and P. Davari, "A New Fast and Efficient HMM-Based Face Recognition System Using a 7-State HMM Along With SVD Coefficients"

Comments and Ratings (18)

Sonia Mittal

Sir Omid,

do you have any basis why did you used 7 state HMM?

sir may I just know why did you used 7state HMM?

Dear Mr Omid,

I know it difficult for you now as the code was written long back but can you please please please update the MATLAB files with comments so code is little easy to understand. Personally speaking I have been trying to understand the code for last one week and I could only understand 20% of it.

Comments will be really helpful.

And one question: when I am applying illumination normalization techniques instead of 2D static filter recognition rate goes for a toss. Any specific reason behind it??

Thank you in advance.


Adnan (view profile)

Thank you so much

Hau Le Hanh

Thanks you!

AOA sir.. sir can u please tell me why wo use ORL database in the form of s1 to s40 formate and each folder contain 10 images in pgm formate..

my 2nd question is how we recognize a face through ORL Data base,,, and what is output of this project..

plzz help me/...


Anry (view profile)


Mubeen (view profile)

Sir, I am get the following error while generating a new database. I have tried the ORL database which was provided with the code.

Loading Faces ...
Reference to non-existent element of a cell array.

Error in gendata (line 55)
            blk_coeffs = myDatabase{2,person_index}{block_index,image_index};

Please could you point out what is going wrong.

Can someone explain or comment this code?
From where i can download or buy guide "Face Recognition Guide + Code for MATLAB"?
 Thank's in advance.

Can someone explain or comment this code? Thank's in advance.


Rachid (view profile)

with the variant:
vid = videoinput('winvideo', 1, 'RAW8_1280x1024');
it hasn't worked either, what i still can change so that the webcam option works?

Dear Omid Sakhi;

Thank you for interested.


The specific for what I need help is about how I can use the output data from SVM as input to HMM. My project is about ( ISOLATED WORD speech RECOGNITION Using Hybrid SVM /HMM).


The data base consists 25 speakers ,male ,female, young and child each speaker the same utter the same 20 words .

The file is saved as (*.wav);

The preprocessing includes sampling, segmentation, framing and windowing.

Sampling frequency=11025Hz

16 – Bit A/D Converter.

Framing the continuous speech signal is blocked into frames of N samples N=256(which is equivalent to23msec) .

Overlaps between frames =128;

Using Hamming window for windowing each frame.

My question is this procedure right or not???


Feature extraction

The Discrete wavelet transform(DTW) daubechies filter and pitchdetection used In order to evaluate feature vectors . Used this feature vectors as input to Hybrid SVM/HMM for training and testing system .

I will do all this pre-processing and processing steps and I have a table of feature vector for each word.

My question is this procedure right or not???

Hybrid model of SVM/HMM

The hybrid model includes two parts: training and classification. Firstly , parameters of model can be obtained by training. Secondly, it can be calculated the probability estimate by Viterbi.

But the output of SVM is numerical value. For combined with HMM easily, it should transform the value into probability .

My question how can Ido that when I used this feature vector as input to Hybrid SVM/HMM for training and testing system to recognize each word (so I needed algorithm and program to do that using matlab).

       With Best Regards

Ahmed Alhamdani

warsaw -poland


Omid, now it's clear, just a question
about your constant setting inside the code example TRGUESS and so on ..
If i have different type of face images can i use your settings or is possible to improved the recognition during the generation data ?
Thank's in advance


Omid Sakhi

Omid Sakhi (view profile)

Hey Nicola. The reason is that we have many labels that can be used in each state. When you decrease the number of training images per person from 5 to 1, the HMM model does not have enough sequence/data to work with. The transition and emission probabilities become dangerously sparse with lots of zeros (or do not change much from the initial probabilities). That is why the recognition accuracy declines.

Mr Omid, if you try with one persone for each the system not work so well, why ?


robin (view profile)

C'est Magnifique!!!



The last update didn't go through.




In this update, I have just corrected some typos and I also changed the name from face recognition system to face recognition software.

MATLAB Release
MATLAB 7.11 (R2010b)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video