I'm building a model for facial expression recognition, and I want to use transfer learning. From what I understand, there are different steps to do it. The first is the feature extraction and the second is fine-tuning. I want to understand more about these two stages, and the difference between them. Must we use them simultaneously in the same training?

  • $\begingroup$ Hello. Welcome to AI SE. Could you please provide the link the resource where you were reading that claims that "feature extraction" and "fine-tuning" are two different approaches to transfer learning? Because I don't think that's the case. I think these are just 2 stages of transfer learning, and maybe this would be the start of an answer to your question in the title, but I could be wrong. $\endgroup$
    – nbro
    Jun 7 at 22:39
  • $\begingroup$ Hello. Yeah I just realized that I was totaly wrong. Yes there are 2 stages in transfer leraning but should we use them in the same training or there is a difference ? Thank you for your reply. $\endgroup$ Jun 7 at 22:53

Typically, in transfer learning, you have two stages/steps (as you realized)

  1. pre-train some base model $M_\text{base}$ (i.e. the feature extraction part, where this pre-trained model is supposed to learn representations of the data, which can later be exploited to solve another task) on some "general" dataset $A$; note that you may not necessarily need to train $M_\text{base}$, but it may already be available e.g. on the web.

  2. fine-tune the pre-trained model $M_\text{base}$ with your specific dataset $B$, which is assumed to be at least vaguely related to $A$; in this stage, basically, you replace the last layers of your neural network with new layers to solve your task, then you freeze the initial layers (e.g. the convolutional layers) that are assumed to contain the extracted features: let's call this model $M_\text{main}$; at this point, you train this partially frozen model $M_\text{main}$ with your dataset $A$

You can find more information about this topic here. Note that there may be other more sophisticated or simply different approaches to transfer learning, but this is the most common one.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.