Face Recognition Using Transfer Learning

In this article I am going to create a face-recognition model using the concept of Transfer learning and VGG16 over a pre-trained model. Here I am using MobileNet. Before we start let us understand what is Transfer Learning and VGG16.

Transfer Learning :-

Transfer learning is a machine learning method where a model developed for a task is reused as the starting point for a model on a second task.

The main advantage of transfer learning is that it decreases the time that take to develop and train a model by reusing the existing model as starting point.

VGG-16 :-

VGG16 is a convolutional neural network model proposed by K. Simonyan and A. Zisserman from the University of Oxford in the paper “Very Deep Convolutional Networks for Large-Scale Image Recognition”. The model achieves 92.7% top-5 test accuracy in ImageNet, which is a dataset of over 14 million images belonging to 1000 classes.

Now let’s create the code.

Step 1: First we need to collect the dataset. Here I am using a python code to collect the image, crop it and then will resize it as per the need and also store it inside a folder.

Step 2: In this step we will create the for transfer learning. Let’s do step by step.

  1. First import required Modules.

2. In this step we will create the model using the weight of VGG16.

3. Freezing the top layer.

4. Loading the dataset.

5. Compile the model.

Step 3: Code to detect the face.

Final Output:

Github Link:

Thank you!!




I'm passionate learner diving into the concepts of computing 💻

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Learn to Learn like A Child — A Few Shots Learning for Image Classification

My first ML-Deep Learning model for predicting hand written digits

Unlocking the full potential of data

Detecting Fires using Tensorflow

Error Analysis to Your Rescue!

Super easy Python stock price forecasting(using Bernoulli Naive Bayes) Machine learning

Sidewalk Riding Detection at Lime

Kalman Filters

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Aditya Raj

Aditya Raj

I'm passionate learner diving into the concepts of computing 💻

More from Medium

Music Recommendation System based on User Facial Emotional Expression using Nvidia Jetson Nano AI

What is Object Detection? An Overview and An Introduction

Image Segmentation — An Overview On How Its Algorithms Identify Objects In An Image

Using Convolutional Neural Networks to detect fake images