Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Read by thought-leaders and decision-makers around the world. Phone Number: +1-650-246-9381 Email: [email protected]
228 Park Avenue South New York, NY 10003 United States
Website: Publisher: https://towardsai.net/#publisher Diversity Policy: https://towardsai.net/about Ethics Policy: https://towardsai.net/about Masthead: https://towardsai.net/about
Name: Towards AI Legal Name: Towards AI, Inc. Description: Towards AI is the world's leading artificial intelligence (AI) and technology publication. Founders: Roberto Iriondo, , Job Title: Co-founder and Advisor Works for: Towards AI, Inc. Follow Roberto: X, LinkedIn, GitHub, Google Scholar, Towards AI Profile, Medium, ML@CMU, FreeCodeCamp, Crunchbase, Bloomberg, Roberto Iriondo, Generative AI Lab, Generative AI Lab Denis Piffaretti, Job Title: Co-founder Works for: Towards AI, Inc. Louie Peters, Job Title: Co-founder Works for: Towards AI, Inc. Louis-François Bouchard, Job Title: Co-founder Works for: Towards AI, Inc. Cover:
Towards AI Cover
Logo:
Towards AI Logo
Areas Served: Worldwide Alternate Name: Towards AI, Inc. Alternate Name: Towards AI Co. Alternate Name: towards ai Alternate Name: towardsai Alternate Name: towards.ai Alternate Name: tai Alternate Name: toward ai Alternate Name: toward.ai Alternate Name: Towards AI, Inc. Alternate Name: towardsai.net Alternate Name: pub.towardsai.net
5 stars – based on 497 reviews

Frequently Used, Contextual References

TODO: Remember to copy unique IDs whenever it needs used. i.e., URL: 304b2e42315e

Resources

Take our 85+ lesson From Beginner to Advanced LLM Developer Certification: From choosing a project to deploying a working product this is the most comprehensive and practical LLM course out there!

Publication

The Role of Dataset Classes in Transfer Learning
Latest   Machine Learning

The Role of Dataset Classes in Transfer Learning

Last Updated on July 24, 2023 by Editorial Team

Author(s): Akula Hemanth Kumar

Originally published on Towards AI.

Making computer vision easy with Monk, low code Deep Learning tool and a unified wrapper for Computer Vision

Photo by Josh Applegate on Unsplash

What do you do with a deep learning model in transfer learning?

These are the steps already done by contributors in pytorch, keras and mxnet

  • You take a deep learning architecture, such as resnet, densenet, or even custom network.
  • Train the architecture on large datasets such as Imagenet, coco, etc.
  • The trained weights become your starting point for transfer learning.

The final layer of this pre-trained model has a number of neurons = number of classes in the large dataset

In transfer learning

  • You take the network and load the pre-trained weights on the network.
  • Then remove the final layer that has the extra(or less) number of neurons.
  • You add a new layer with a number of neurons = number of classes in your custom dataset.
  • Optionally you can add more layers in between this newly added final layer and the old network.

Now you have two parts in your network

  • One that already existed( the pre-trained one, the base network).
  • The new sub-network or a single layer you added.

The hyper-parameter we can see here: Freeze base network

  • Freezing base network makes the base network untrainable.
  • The base network now acts as a feature extractor and only the next half is trained.
  • If you do not freeze the base network the entire network is trained.

Here we have 2 datasets

  • Cats-Dogs dataset having 2 classes.
  • Logo classification having 16 classes.

Creating and managing experiments

  • Provide project name
  • Provide experiment name

This creates files and directories as per the following structure

workspace 
U+007C--Project
U+007C--study-num-classes U+007C U+007C--experiment-state.json U+007C U+007C--output U+007C U+007C--logs (All training logs and graphs saved here) U+007C U+007C--models (all trained models saved here)

Setup Default Params with Cats-Dogs dataset

gtf.Default(dataset_path="study_classes/dogs_vs_cats", 
model_name="resnet18",
num_epochs=5)

Visualize network

gtf.Visualize_With_Netron(data_shape=(3, 224, 224), port=8081)

The final layer

Reset Default Params with a new dataset β€” Logo classification

gtf.Default(dataset_path="study_classes/logos", 
model_name="resnet18",
num_epochs=5)

Visualize network

gtf.Visualize_With_Netron(data_shape=(3, 224, 224), port=8082)

The final layer

You can find the complete jupyter notebook on Github.

If you have any questions, you can reach Abhishek and Akash. Feel free to reach out to them.

I am extremely passionate about computer vision and deep learning in general. I am an open-source contributor to Monk Libraries.

You can also see my other writings at:

Akula Hemanth Kumar – Medium

Read writing from Akula Hemanth Kumar on Medium. Computer vision enthusiast. Every day, Akula Hemanth Kumar and…

medium.com

Join thousands of data leaders on the AI newsletter. Join over 80,000 subscribers and keep up to date with the latest developments in AI. From research to projects and ideas. If you are building an AI startup, an AI-related product, or a service, we invite you to consider becoming aΒ sponsor.

Published via Towards AI

Feedback ↓