# What is the difference between feature extraction and fine-tuning in transfer learning?

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?

• 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.
– nbro
Jun 7 at 22:39
• 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. Jun 7 at 22:53

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$$