Face Recognization Using VGG16
VGG-16 is a convolutional neural network architecture . There are 13 convolutional layers, 5 Max Pooling layers and 3 Dense layers which sums up to 21 layers but only 16 weight layers.
IMAGENET DATASET:-
Imagenet is an image database organized according to the WordNet hierarchy (currently only the nouns), in which each node of the hierarchy is depicted by hundreds and thousands of images. Currently we have an average of over five hundred images per node. Each meaningful concept in WordNet, possibly described by multiple words or word phrases, is called a "synonym set" or "synset"
In my model , there were three datasets or classes which i used is :
- Akansh (myself)
- Arpit Pathak (friend)
- Amitabh Bachhan
Getting started with:-
Importing the required modules from keras and then implementing them in our model.
Initializing the weights and geting all the necessary information about the pretrained model vgg16 like about the convulation and the pooling layers.
Freezing of the Layers of the vgg16 dataset:-
As the pretrained vgg16 model already at its best trained status so there is no need to train it again as it costs us much time and the cpu power . So we can freeze it and will train our rest of the layer and adding our fully connected layer on top of the vgg16 layers.
Lets go to model building by importing the VGG16 model , freezing its layers and then adding our fully connected layers on the top of it.
DEFINING THE MODEL:-
As already the vgg16 model has its layers which we set them to freeze but now we need to add more layers which were fully connected to train our model and bring it out the best accuracy.
Here i used a dense layer and a relu activation function. On top i used softmax activation function.
MODEL SUMMARY:-
It tells us about the no of classes , layers , shape and parameters used in the model.
TRAINING THE MODEL:-
Here i used only 5 epochs because the data is not much and we get proper accuracy after 5 epochs only and save it .