A Face Recognition System Based on BPNN(Back Propagation Neural Network) Developed by Qt.
Parallel Version:Github . PAC-P2P/BPNN-Face-Recognition-For-Parallel
Serial Version:Github . PAC-P2P/BPNN-Face-Recognition
Qt Version:Github . PAC-P2P/BPNN-Face-Recognition-For-Qt
BPNN-Face-Recognition-For-Qt / releases
-
git clone https://github.com/PAC-P2P/BPNN-Face-Recognition-For-Qt.git
-
Use Qt to open
BPNN-Face-Recognition-For-Qt.pro
-
Generate / Run
-
Menu Bar - Net - Training
-
Enter Training times (Default 100 times)
-
OK (Start training)
-
Qt console prints training information, evaluation results, such as:
Iteration number: 100 Accuracy rate of: 74.359% Average error: 0.125675
-
Save to data/facenet.net
-
Successful train
- Input
- Enter User ID (Unique)
- Enter Train times (Default 100 times)
- Take photo 20 times (Save to data/images/imagesTrain)
- Train
- Successful input
- Enter name (Optional)
- Take Photo (Save to data/images/imagesRec/rec_01.pgm)
- Train (if no facenet.net)
- Recognition
- Recognition result
-
facenet.net
is a three-layer neural network with only one hidden layer- Input Layer : The size of the images
- Hidden Layer : Number of training sets
- Output Layer : Number of training sets
-
Neural network structure file:
data/facenet.net
. It is a15360 * 6 * 6
neural network
-
Images Size
Make sure that the training set image has the same image size as the test set (including recognition).
There are three sizes of images in
data/images
.- UserID_*_1.pgm : 128 * 120
- UserID_*_2.pgm : 64 * 60
- UserID_*_3.pgm : 32 * 30
If your camera is not of these sizes please delete it(Including modifying data/*.list) and enter your own photo.
-
User ID
User ID
must be Unique, otherwise it will overwrite user data. -
Directory tree
Please keep the following directory structure so that the program can run normally.
. ├── BPNN-Face-Recognition.pro ├── Release │ └── BPNN-Face-Recognition.exe ├── data │ ├── facenet.net │ ├── images │ │ ├── imagesRec │ │ │ └── rec_01.pgm │ │ └── imagesTrain │ │ ├── an2i_1_1.pgm │ │ ├── ...(images) │ │ └── cheyer_8_3.pgm │ ├── imagesSet_rec.list │ ├── imagesSet_testAll.list │ └── straightrnd_train.list └── src ├── backprop.cpp ├── backprop.h ├── camera.cpp ├── camera.h ├── camera.ui ├── dir.cpp ├── dir.h ├── facetrain.cpp ├── facetrain.h ├── imagenet.cpp ├── imagenet.h ├── imagesettings.cpp ├── imagesettings.h ├── imagesettings.ui ├── main.cpp ├── mainwindow.cpp ├── mainwindow.h ├── mainwindow.ui ├── pgmimage.cpp ├── pgmimage.h ├── src.pro ├── trainingsetting.cpp ├── trainingsetting.h └── trainingsetting.ui
SEED
: Seed of a random generator (Default102194
)SAVEDELTA
: Save the network every SAVEDELTA times (Default100
)LEARNRATE
: Learning rate (Default0.3
)IMPULSE
: Impulse (Default0.3
)INPUTTIMES
: Maximum number of photos inputed (Default20
)MAXTRAINTIMES
: Maximum training times (Default100000
)
Modify these in facetrain.cpp
or camera.cpp