Task 4 : Face Recognition using Transfer Learning

Task 4 : Face Recognition using Transfer Learning

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.


No alt text provided for this image
No alt text provided for this image

Importing MobileNet model

Here I used MobileNet pre-trained model for Transfer Learning , we can use VGG , ResNet , Inception etc.


No alt text provided for this image

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.

No alt text provided for this image
No alt text provided for this image

I'm adding new 3 Dense layers on the top of previously available layers.

No alt text provided for this image

Loading and Generating Dataset

No alt text provided for this image

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.

No alt text provided for this image


Muskan Agarwal

Business Technology Solutions Associate Consultant @ ZS Pune

4 年

Excellent Work ??

要查看或添加评论,请登录

Sandeep Singh Rajawat的更多文章

社区洞察

其他会员也浏览了