Training Data Ideal Approach for Transfer Learning

Can we use both our new data and data which pretrained model is trained on for transfer learning? Will it be a good approach or should we just train the model on our data?

If the classes you are working on overlap with the images the model was trained on, you can add pre-trained data to the mix. Do measure if this needs to be done since the pre-trained model might already perform well on classes it was trained on.

If you are classifying images of you and your friend, odds are good that the pre-trained dataset doesn’t have either of your images. Adding irrelevent images won’t do any good.

Please read this topic as well.

Hi @Prachi_Chaudhary

You can use both your new data and the data that the pre-trained model was trained on for transfer learning. This is known as fine-tuning and it can be a good approach in some cases.

Fine-tuning a pre-trained model involves using the pre-trained model as a starting point and then training it further on your new data. This can be beneficial because the pre-trained model has already learned useful features from the data it was trained on, and these features can be used as a starting point for your new task. This can help to speed up training and improve performance, especially when you have a small amount of data for your new task.

However, it’s important to note that fine-tuning a pre-trained model may not always be the best approach. If your new data is very different from the data the pre-trained model was trained on, the pre-trained model’s features may not be useful for your new task. In this case, training the model from scratch on your new data may be more appropriate.

Another approach is to use only a subset of the layers of the pre-trained model, the ones closer to the input, and then add your own layers on top of them, this is known as feature extraction. This can be useful when the features learned by the pre-trained model are useful for your new task, but the final layers are not.

In summary, whether to use fine-tuning or feature extraction or training from scratch depends on the similarity between the new task and the task the pre-trained model was trained on, the size of the new dataset, and the computational resources available.

Muhammad John Abbas