Transfer Learning

Transfer Learning

Humans are known to be the most intelligent and powerful creatures on this planet. They have the control over everything be it development or technology. Humans have been working with technology very closely and have developed techniques, which works exactly like the human mind. The reason being the smartness of the human brain and its high capability to recognise images or things and make predictions based on past experiences or calculations.

The human brain is so powerful that the experience and knowledge for a particular event can be reused for recognising some new set of objects or making new predictions, not much of exhaustive new training is required. The brain has the power to perceive everything very quickly and efficiently that the training needs not to be done from very zero for every new task that comes up. It has the capability of transferring the knowledge gained from one task to resolve the problems being faced in some completely different task using similar kind of knowledge.

Transfer Learning is a subset of Deep Learning in which the knowledge from the previous task can be further used to predict the results for a new task. The traditional models very completely isolated and the knowledge gained through them was restricted only to the models they were meant for but due to limitations of dataset and resources, some well-defined pre-trained models can be easily used by other users for predicting results of their models without any barriers.

No alt text provided for this image

MobileNet-V2 is one such architecture, which consists of a number of convolutional and pooling layers followed by a dense neural network and flattening layer, trained over a very large dataset and is capable enough to yield excellent results. All you need is to import the model, freeze the layers of the model, add a few dense layers, train the newly added layers, change hyperparameters and fetch the best results and you are ready to predict excellent results making use of a well-defined DeepNet network without any extra cost of resources and time.

No alt text provided for this image

Here, I have made a face-recognition system using the MobileNet Architecture for my family members with a very small dataset of 1200 images and added 3 new layers to the model, to be trained and fetched the results.

  1. The very first job was to click pictures of every member, which was accomplished using CV2 library of the OpenCV module of Python for the dataset comprising of training as well as testing data.
No alt text provided for this image

2. The second part was to use the pre-trained model MobileNet, add layers to it after freezing all the layers of the model and add new layers and a dataset of our own to predict the results if the face is of the person specified or not. The use of transfer learning enabled to make use of a smaller dataset and there was no requirement of high power resources and time to get better results.

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

Once the entire training code runs successfully, the model is ready to be saved and loaded to test and predict the faces.

And here is the output of the code.

No alt text provided for this image

GitHub repo link: https://github.com/tanuj5/transfer-learning.git

Happy Learning!

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

Tanuj Mathur的更多文章

  • Build Pipeline

    Build Pipeline

    Would you believe me if I tell you that your hard work to create a website is successful and you can run your website…

  • Hybrid Cloud

    Hybrid Cloud

    In this era of Artificial Intelligence and robots, we humans tend to relax and let these artificial human beings…

  • Hybrid Cloud

    Hybrid Cloud

    A tool like Terraform, which makes the process of maintaining multiple clouds easier also provides a document or the…

  • Hybrid Cloud

    Hybrid Cloud

    With the ever-changing technology, companies requirements keep on changing as well. Companies who shifted to the Cloud…

  • Hybrid Cloud

    Hybrid Cloud

    Would you believe me if I tell you that you can launch a new Operating Systems within a few seconds or you can run a…

  • Hybrid Cloud

    Hybrid Cloud

    Every time we think of hosting a website, speed and security are the two most important factors we need to take into…

  • Hybrid Cloud

    Hybrid Cloud

    Still thinking behind the mystery of almost no latency or delay in responding to your requests while working on the AWS…

  • Hybrid Cloud Day-4

    Hybrid Cloud Day-4

    Are you using your AWS account with friends or are you worried if someone tries to sneak into your account and use it…

    2 条评论
  • Hybrid Cloud

    Hybrid Cloud

    What if you are working on a project in a team using the same account and worried if the settings might get changed by…

  • MLOPS

    MLOPS

    As a developer how would you feel if your only job is to write and upload the code and the accuracy of the model that…

社区洞察

其他会员也浏览了