Task 4 : Face Recognition using Transfer Learning
Sandeep Singh Rajawat
Former Business Technology Solutions Associate @ ZS Associate
In the Deep Learning world , while training of CNN model with the large datasets like Big-data consist of millions of features we face so many problems such as , high computational cost , lot of training data , and also if we don't have a good RAM/GPU they are quite slow to train etc.
To overcome these problems , Here we go with the model of Face-Recognition using Transfer Learning
Transfer Learning It is a technique where we use architecture / weights of pre-trained model (e.g. VGG , MobileNet , Inception ) as a starting point and then develope a new model by adding new fully connected layers and freezing the older layers
Required Libraries and Software
- Tensorflow
- Keras
- Anaconda
- Opencv
- Pillow
- Haarcascade_frontalface.xml
Collecting Dataset
Here, I'll show you how to collect dataset i.e Images from python program using opencv library and Haarcascade model. Below program will click 100 images and crop the image which contain only your face with the help of Haarcascade model very easily , So we can use these images as dataset to train a model.
Importing MobileNet model
Here I used MobileNet pre-trained model for Transfer Learning , we can use VGG , ResNet , Inception etc.
loading pre-trained MobileNet model without fully connected layer , and also freezing the layers . I'm gonna use 224*224 pixel image as input because MobileNet was designed to work on 224*224 pixel input images sizes.
I'm adding new 3 Dense layers on the top of previously available layers.
Loading and Generating Dataset
Here , I'm giving the location of training dataset and testing datase and also expanding the dataset by data augmentation. Image data augmentation is used to create more dataset by shifting , flipping , increasing / decreasing brightness , zooming images.
Business Technology Solutions Associate Consultant @ ZS Pune
4 年Excellent Work ??