File Exchange

image thumbnail

Face Detection System

version 7.1 (202 KB) by

Face Detection using Gabor feature extraction and Neural Network

3.58065
107 Ratings

268 Downloads

Updated

View License

Editor's Note: Popular File 2010 2011 2012

Version 7.1
    Added an empty folder "data" to fix a bug.
Version 7.0
    Adds the implementation of a neural network.
Please visit the official website for this program at the address:

http://www.facedetectioncode.com

You will find instructions on how to run the program, some basic diagrams of the algorithm and also a forum and a contact page to discuss about it.

To run the program:

    1- copy all files and directories to the MATLAB's work folder
     * In order to run the program you must have Image Processing Toolbox

    2- find the file named "main.m"

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

    4- a menu will be shown . click on "Train Network" and wait until the program is done with the training

    5- click on "Test on Photos". A dialog box will be appeared. Select a .jpg photo

    6- Wait until the program detects some faces

Comments and Ratings (174)

Tousif Ahmed

Thank you for the information, can you please tel how can i add more hidden layers in the neural network, as your code has one hidden layer. Thank You

rizang xin

nasri aladin

can anyone help me please . when i train the networks there's error:
Error using feval
Undefined function or variable 'msereg.normalize'.

Error in nncalc.setup1>setupImpl (line 133)
  calcHints.perfNorm = feval([net.performFcn,'.normalize']);

Error in nncalc.setup1 (line 17)
[calcMode,calcNet,calcData,calcHints,net,resourceText] = setupImpl(calcMode,net,data);

Error in nncalc.setup (line 7)
[calcMode,calcNet,calcData,calcHints,net,resourceText] = nncalc.setup1(calcMode,net,data);

Error in network/train (line 337)
  [calcLib,calcNet,net,resourceText] = nncalc.setup(calcMode,net,data);

Error in trainnet (line 18)
net = train(net,P,T);

Error in main (line 38)
        net = trainnet(net,IMGDB);

Sikandar Shah

Beautiful code. I have one question that in the method im2vec (W27x18),we presently send an image of dimensions 27 X 18. what if an image of 200 X 200 pixels is used. What are the changes that need to be done to the code. And why has Features135x144 been used as opposed to mapping it any other way.

anju kundu

can you send me the code for face detection system based on neural network on
anjukundu806@gmail.com

Hi Omid,

A file apperars with small images.
even saving it, error comes up.

save ('../data/gabor.mat','G');
How to save it?

please reply.

Monika

Hi Omid,

Still Data folder is not there, even if after creation, it is not taking that? where to create it.

Latest version does not have empty data folder.

please reply.

Monika

Hi Omid,

When I am running main, this error comes

Error in main (line 19)
    run ('include/createGabor.m');
Is there some other files, that will be executed first before main in some manner.

please reply.

Monika

Hi Omid,

Which neural network is used to implement this face recognition application?

Please reply asap.

Thanks,
Monika

pouya ranjbar

Hello, please, the name of the data set, the program will tell me
Thanks

chinnurocks

Where will I find that menu which shows train network? Please assist me.

Omar Khader

Hi Omid
I want to use this code in car detection ,so can you help me?
and thank you

This code really helped alot.. can you suggest me how to crop the detected faces from the image and then perform face recognition.

Omid Sakhi

Omid Sakhi (view profile)

If you are getting errors regarding the "data" folder, please create an empty folder called "data" in the main directory. Fix will be updated soon.

Manoj Kumar

Hi Omid, iam running the same code in R2015a, but iam getting errors. 'run('include\createGabor.m')' . will u please help me with the necessary steps to be taken to run this code after it s downloaded. should i mention any directory paths or any changes to be made in the code etc.
Thanking You.
pls mail me : manojmuthu19@gmail.com

Manoj Kumar

Dear Ofir Goldshtok, iam running the same code in R2015a, but iam getting errors. 'run('include\createGabor.m')' . will u please help me with the necessary steps to be taken to run this code after it s downloaded. should i mention any directory paths or any changes to be made in the code etc.
Thanking You.

Dear Omid Sakhi,

I'm running your program on Matlab R2015a-
The file is compiled and everything is working with the built-in pictures--
but when I run this algorithm on my own pictures it doesn't detect any face at all.
How do I make my system to successfully detect new faces? Should I add files to the 'face' / 'non-face' folders? Where can I find more information?

Thank you very much- Ofir.

laura reyes

Sorry I made a typo. The error says :
" Error using imread (line 362)
Unable to determine the file format"

Thank you.

laura reyes

Hi Omid,

I am getting an error in line 362 it says"Error using mired(line 362)
Unable to determine the file format.

 I read through the comments and did't encounter anyone with this problem. Please help me! I really want to figure this out.

Thank you.

Mahmood Ali

Error using run (line 70)
include\createGabor.m not found.

Error in main (line 19)
    run ('include/createGabor.m');

Error in run (line 74)
    evalin('caller',[script ';']);
 

kevine099

hi omid sakhi,
using "im4.jpg" you have given,in the result,some rectangles are close,but some are open,and several are mistakes.why?
by the way,the program cannot run with color images?Can your code be modified without modifing a lot(algorithms,models,and etc)?
thank you for your answer!

thank you....on your information

thank you....on your information

Omid Sakhi

Omid Sakhi (view profile)

Hi Tayashan,

Seems like you are running the main script in the incorrect folder. You should navigate to the correct folder before running the main script.

Thanks.

hi omid sakhi,
I have used 2014b version when i run main it will error,
Error in main (line 19)
    run ('include/createGabor.m');
plz help me

Omid Sakhi

Omid Sakhi (view profile)

Hi MASN,

You only have to create an empty folder called "data" there. That would probably solve the problem. I will update the program again to make sure that this empty folder exists.

Thank you

masn

masn (view profile)

hi omid sakhi,
i've try run the updated one by using matlab2013, and the error come out

Error using save
Cannot create 'gabor.mat' because '../data' does not exist.

Error in createGabor (line 39)
save ('../data/gabor.mat','G');
Error in run (line 64)
evalin('caller', [script ';']);

Error in main (line 19)
    run ('include/createGabor.m');

can you suggestion any solution to fix the error?
**********
thanks in advance

Omid Sakhi

Omid Sakhi (view profile)

Hi MASN,

The program is updated. Please download the updated program version 7.0 and see if it helps the problem or not.

Thanks

masn

masn (view profile)

Hi,
Please i want your help because i realy need this program. after all of the step when i click on "Train Network" i have this error :

********
Out of memory. Type HELP MEMORY for your options.

Error in nnMex2.codeHints (line 117)
hints.TEMP = zeros(1,ceil(tempSize/8),'double');

Error in nncalc.setup2 (line 13)
calcHints = calcMode.codeHints(calcHints);

Error in network/train (line 306)
[calcLib,calcNet] =
nncalc.setup2(calcMode,calcNet,calcData,calcHints);

Error in train_net (line 35)
net = train(net,P{1,1},T{1,1});

Error in run (line 64)
evalin('caller', [script ';']);

Error in main (line 40)
run ('include/train_net.m');
********

thanks for any suggestions

i want code

shivam asati

awesome output of code.thanks a lot!!!

Adilmar

Very good congratulations, as I change the hidden layers, wanted to increase

KALYAN KUMAR

Can any one send the source code for face detection system that works well in matlab 2013

OUMAYMA

Hi,
Please i want your help because i realy need this program. after all of the step when i click on "Train Network" i have this error :

********
Out of memory. Type HELP MEMORY for your options.

Error in nnMex2.codeHints (line 117)
hints.TEMP = zeros(1,ceil(tempSize/8),'double');

Error in nncalc.setup2 (line 13)
  calcHints = calcMode.codeHints(calcHints);

Error in network/train (line 306)
    [calcLib,calcNet] =
    nncalc.setup2(calcMode,calcNet,calcData,calcHints);

Error in train_net (line 35)
net = train(net,P{1,1},T{1,1});

Error in run (line 64)
evalin('caller', [script ';']);

Error in main (line 40)
        run ('include/train_net.m');
********

thanks for any suggestions

Kun

Kun (view profile)

gitanjali

Sir please send me 3D face detection code..m using matlab 2013b...please..my id is singhgitanjali11@gmail.com

haem

haem (view profile)

Akshay Gore

Akshay Gore (view profile)

Code not working in matlab 2013a
Akshay

blast 461

Can you send the face detection code to
"blast0461@gmail.com"
plzz...

sara na

Thanks a lot !
It's great , really great!!!!

George

George (view profile)

andri

andri (view profile)

ıt's wonderful..

how to make database after test on photos

javed patel

pls sent face detectin coding
pls
ID-javedp3@gmail.com
 pls imeditly

philanik

Hi

Can any one help me I need to buy face detection code guide. when I click down load I get this message ''This product combination does not exist''.

someone

good work

someone

I want the code for face recognition using neural network in matlab
thank you

betül

betül (view profile)

ıt's wonderful..

good

Need a MATLAB code for 'online face recognition using fuzzy ART'

C N N

C N N (view profile)

its great work.. but i would like to change it according to my database. When i train with my database of image, the accuracy is bad. It doesn't detect that well. why is that so?

mary

mary (view profile)

Its a good work. do you have any idea about retrieving face image from database using neural network and svm and comparing their results?

k.v.swamy

excellent sir,great work.thank u for giving us the code.

Ali Tayeh

I wanna the documentation its greaat :)

SS

SS (view profile)

Need a MATLAB code for Caricature Generation/ Facial Feature Extraction.
Kindly help.

donny jason

very well written code. The gabor that sir use is the gabor filter?
Regards

Fox

Fox (view profile)

scholars

sir can u give code for lip reading thru neural network, i wan2 work in dat field.

waiting for ur reply at
tomeshverma86@gmail.com

hakim kadhim

It is very good job I hope to see more such that Good Luck

Hakim Adil

vidit

vidit (view profile)

nice to see it work, thanks

Said BOUREZG

Hi sir,
good work, thanks

Suzzie

Suzzie (view profile)

A good work done. works on all Matlab platforms, ie. Windows, Linux, Mac and it gives a 100% detection rate.

kundan

kundan (view profile)

hello sir,
i am doing my B.Tech project in Image processing.i have to compare the image captured from webcam or camera to images stored in data base.please help me,i undergone with the code,but i don;t understand how to connect with WebCam.

hema

hema (view profile)

Hello sir,
I'm interested to do project on 'face and eye detection'. I have downloaded the code and i tried to execute the code but it showed the errors because i don't know anything about programming part & even i don't know commands & functions in matlab. I have tried to execute the code without any manipulations.im a quick learner i can learn all about matlab in a short period of time but i have no time to finalize the project topic name.i have to finalize the topic name by 08-feb-2011.so kindly explain the code with an example or in detail.if u help me in executing the code then i will do project on this topic.so kindly help me.i will be very thankful to you.Forgive me if u find any mistakes in my english.I hope to receive your reply as soon as possible.Thank you.

can you give me the algorithm for the code.

raghav kowtha

awesome work!!!!
it worked for me very well!!
i'll be glad to see if u could also give any flow chart or algorithm which u used to implement your ideas!!!
thank u !

Albin

Albin (view profile)

Excellent! I like your approach with gabor filtering and neural network.

victoria

great job !
but i received the foll error when i press the train network button.

what's the solution?

??? Error using ==> svmtrain at 172
Group must be a vector.

Error in ==> trainnet at 18
net =
svmtrain(P',T','Kernel_Function','linear','Polyorder',2,'quadprog_opts',options);

Error in ==> main at 32
        net = trainnet(IMGDB);

Mark

Mark (view profile)

Great stuff! However when it comes to place the rectangles over the faces I get the following error:

??? Undefined function or variable 'Threshold'.

Error in ==> imscan at 74
xy_ = Cell.net > Threshold;

(as the 'Threshold' variable is not defined anywhere). What should it be set to?

Omid Sakhi

Omid Sakhi (view profile)

Thank you for all your comments and questions. One of the most question that I get all the time is the bugs. This program only works with MATLAB version 7.1 and later. Also you need to have image processing and neural network toolbox installed.

Also recently I have heard that there is also a program with MATLAB x64. Please inform me if the program works on x64 or not. Thank you.

Omid
http://www.facedetectioncode.com

Yoav Feldman

Well I guess that the problem is with the Matlab that I used and not with the code.

I used Matlab 6.1 and it appears that it is not compatible
with this application.

Yoav Feldman

Your code has Bugs,

Maybe this is your intention in order to sell your reference (-;

XV22

XV22 (view profile)

Hi,
This is not working on Linux with matlab 2010a, I get the following when I click "Train Network":
??? Error using ==> network.train at 145
P: Element {1,1} has 0 rows instead of 2160.

Error in ==> trainnet at 17
net = train(net,P,T);

Error in ==> main at 38
        net = trainnet(net,IMGDB);

can you please help me?

Electron Ali

Sir , i m interested in Face detectioN of A particuLAr perSon, in a crowd.....

Example:.. i haVe daTa stored in my a Computer,,of a particular person or a grp...,,,.,.then my live camera detect a face frm a crowd ,who match with, a persons, in my list,,,

i get automatically its complete data and info,,.,.
 
i m electronic student,.plZ,.,help me,
u gUys help me tOO....
(electronx@ymail.com)

SALAM

Qiu dw

Qiu dw (view profile)

Thanks for sharing your code.

Nishant Jha

cui jianzhu

I have seen your Face Detection using Gabor feature extraction and neural network. Your Gabor feature extraction method is different from the papers. And I can not understand it. Can you introduce some materia about your code. Just like some Gabor formulas.

hira

hira (view profile)

helloo...
i neeed help in implementing NN for Face detection and recognition
please help me

Omid Sakhi

Omid Sakhi (view profile)

hala tbeel

hello .. I need to know how to extract features from facial images as mouth , noise and eyes .. please help me :(

Raymond Cheng

Thanks for your code.

Daniel N

nice

Daniel N

very nice work

fayaz fayaz

i am currently doing this project on face recognition,
so currently i want to extract face from an image using matlab, could you pls do me a favour that to give me some guidance about this topic? your help will be much appreciated. I would like to ask another favour that could i have the code so i can understand more about this topic. Thanks

Sivaraam

nice

Sahar Mirzaei

i am currently doing some survey on object recognition and neural network.
Your code is wonderful. Do you have some guidance or documentation about it. It would be very nice, if you could send me some documentation about this topic, so that I can undrestand your code more better. Thank in advance for your help.

sara

sara (view profile)

wonderful work , thank you, but it did not detect large image with high resolution

Ivelina Stefanova

User-friendly interface, nice.
The only drawback is that test images need to be re-sized as the algorithm may only recognise faces appr. 27 x 18 pixels.

r r

se df

chinmayananda mohapatra

good

M V

nice

asher peretz

fayth zed

Thanks for ur guidance, i have learned alot from it. I really appreciate ur help mr Omid Sakhi

a a

Alex Mugioiu

I'm working for my PhD in "Face Recognition". I have a number of databases of still faces. In order to reduce the computational level and to discard the background information i tried your algorithm for detection, but with little success. I'm confident that with your guidance (in training and using the network) i can obtain much better results.
Thank you in advance.

anila satish

is it advisable to carry out a research in face detection techniques using image rpocesisng and neural networks?

Srikrishna Bhat

With such a small data base a good classifier has been developed. Need to increase the speed.

nzg ningzhigang

AKROUT Belhassen

good application.
i encourage you to contenue in this project

nirjhar bhattacharjee

The codes can't detect face?
What can i do?
i followed the instruction too.
But....................

Mohan G

hey. do anyone have any paper or thesis for this code... please mail me if u have.. it s very urgent... thanks in advance..
my email id is mohanxpressions@gmail.com

Phyu Moe

matlab Files

sandip pandao

very helful for new comers

ravi kiran

a nibble slow

hasan sadikin

could you pls do me a favour that to give me some guidance about this topic? your help will be much appreciated. I would like to ask another favour that could i have the code so i can understand more about this topic. Thanks

fayth yap

i am currently doing some survey on this title, could you pls do me a favour that to give me some guidance about this topic? your help will be much appreciated. I would like to ask another favour that could i have the code so i can understand more about this topic. Thanks

ewan n/a

thanx for giving this.may god bless you.it really help me.

cs joshi

can i have a little favour,by having the code of this excellent subject so that i can work more on this topic

madhu jain

it is helpful in research work it is good

Abdallah Asrawi

Thanks Its Very nice But it need more work.
I wanna Ask can I use a part of the code in my Thesis Research.
My e-mail:asrwi@yahoo.com

kim Yeh

Very good.
This is an interesting subject.

jihong zhang

thank you !The result is very right.
But I don't know how to use the gaborfilter?

bb bbbbb

richal zhao

very interested in the subject

Ankur goyal

great work

muhammad ekbal ahmad

Tom Shih

Real face image can't be found with large face

om yadav

well done

Yaron M

got the following error after pressing train network button:

??? Error using ==> network.train
Inputs are incorrectly sized for network.
Matrices must all have 2160 rows.

Error in ==> trainnet at 17
net = train(net,P,T);

Error in ==> main at 36
        net = trainnet(net,IMGDB);

what to do?

vishal wankhede

Code has written by rich knoedge person

Josiah Yoder

Notes:
To run under linux (ubuntu) with Matlab 7.3 (R2006b), I made the following changes:

 * Use / instead of \ for paths in loadimages.m
 * Use mapminmax( x' )' instead of premnmx( x )
   in imscan.m and im2vec.m

kundan debnath

QI YF

THANKS

bakri mamun

matlab

VN Man

thanks u much

karan sadarangani

when i try to train the network , it gives an error. do i have to do something before training the n/w

Sahar M

Hi dear Mr. Sakhi.I'm a AI student.I run your code & found it very interesting & usefull so I decided to use it as a part of one of my projects.I have some questions about your project:what sort of images can be used for train & specially for test,do you have any database for it?do you have any document & refrences about it(maybe in farsi)?I will be very appriciating if you let me have those docs.I hope to receive your reply as soon as possible.Thanks in advance for your help.

teerawat kamnardsiri

Lee Jack

Useless

ihsan ihsan

Excelent Job, Sir.

swathi reddy

This is an excellent program i have ever seen in mathworks. Good job sir.

I am a student, working for my class project on "multi target tracking". it helped me a lot for the compleation of my project.Thanks a lot :)

anil gaikwad

good

fer hadaf

I need a fuzzy connectivity toolbox for image segmentation.I can't find anything.plz help me!

newgirl newgirl

a k

good

Suvad Selman

Hello,
I am Suvad Selman and I have one thing to ask (report). I have download this file, unzip it and when i run main.m i got some strange error messages. Here is the message that I get:
*WARNING* PREMNMX is an obsolete function.

Use MAPMINMAX instead, type HELP PREMNMX for bug warning.
Type NNTWARN OFF to suppress NNT warning messages.

Please help me so that I can run this program normally.
Thanks in advance.

Luigi Rosa

The recognition rate of last release has been improved.

siva kumar viswanadhuni

Very nice project sir,

Patrick Storer

crazy

lisheng XU

Where is the mfile named adapthisteq?

hossam mohammed

shrikant nangare

your program is awesome man.

jain varsha

find the DCT format

Avinash Pokhriyal

dear sakhi, the code is excellent but how it is implemented in MATLAB and how NN is used for it is not explained in detail. pl do some help on these areas.

m m

Leonid Doroshenkov

Ankit Nagpal

Help is insufficient on the role of nn in the project......

Ankit Nagpal

Excellent work done.
BUT
Can anyone tell me...
How nn is used in face detection ?? (Iam a beginner in nn)

pleassssseeee......
ankit.nagpal@yahoo.co.in

waqas hijazi

Hi i am student of BCS and doing my poject in matlab.So i need help thats why i am visiting this site/

Mamatha Reddy

good

Amirzeb Badshah

it was really interesting seeing people submitting their work.i hope to do so.it was a good experience.

bal krishna Kalidhar

I am in need of face recognition product for identification of few preselected faces out of crowd of 10000 moving on a railway plateform. product to be integrated to CCTV system of VEINT/ IngerSol Rand surveillance systems.
Please reply yes/no as i am serching such produc for presentation to High level security agency top brasses.
Col Kalidhar (retd)
91-011-9910045944

Greg Kirksey

gober good

excuse me sir,
my name is GoberGood.
I have been studying in Ahmad Dahlan University.
I have downloaded your program matlab about "face detection" at http://www.mathworks.com.
and I interest to develop your program
to finish the my master education. for that,
I hope to you to assist the me in collecting reference
of about " face detection" and problem any kind of which
you get when doing research. I very requiring of
your paper. forgiveness, if my english is bad.

klesk ch

leo mariaraj

hi like the project.But u should involve the final step of matching the rectangle marked face with image in database.which is actuall face recoginition

good good

Ngoc Hanh Dang

aysel saberi

very googd

haoxue wang

good example

Bharat Knight

thanqs

Omid Bonakdar Sakhi

This source is for educational purpose only and is tested under MATLAB 7.0 . not for distribution or creating .exe files . Most of the compiling problems and building exe files return to Matlab bugs . Please check Matlab Bugs and Solutions .

saba hafez

when I create the exe file recive this massage whats means?
The ntvdm cpu has encountered an illegal instruction
Cs:____ ip:____ op: _ _ _ _ _ choose close to terminate the aplication

Alfa Gatriono Kencana

this gonna be a good work today
but, i still didn't get the point after using some RGB image. thanks for the reply. it's mean a lot to me

Tzafrir Shlomo

Dear Omid,
when we run the Main under Matlab we received the following errors:
??? Error: File: C:\MATLAB6p1\work\loadimages.m Line: 6 Column: 6
Missing operator, comma, or semicolon.

Error in ==> C:\MATLAB6p1\work\main.m
On line 41 ==> IMGDB = loadimages;
We would appreciate it if you could help us solving the problem.
best wishes,
Dr. Tzafrir Shlomo

Tzafrir Shlomo

good work !!
thank you

Engin Kocaadam

Good work, but has some problems with exact detection.

Terry Duong

I have just download it and haven't check it yet. But iam sure it good. I am doing in face recognition using NN too. Hope i can learn a lot from yours

Updates

7.1

Added one empty folder "data" to fix a bug reported by the users.

1.14

Version 7.0 adds the implementation of a neural network.

1.12

Some fixes are applied for executing the program under Linux CentOS

1.10

replacing two functions with built-in functions, so that older versions of MATLAB can run the program correctly.

1.8

Two fixes are solved.
1- correcting path for linux systems
2- problem of mapminmax for older versions of MATLAB

1.4

I have only changed the description and added the address of the website for this program.

1.3

Fixing the FIle Format

1.1

one article ( in Persian ) and one user guide ( in English ) are added to the project.

Version 5.0 : Better Algorithm with a user's guide

I have Added comments to all files to make them easy and understandable.

MATLAB Release
MATLAB 8.6 (R2015b)

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

» Watch video