Asked about Fine-tuning a pretrained network, in code
You have 2,000 labelled images for a new classification task. What is your approach?
An answer that works
Start from a pretrained model with the matching preprocessing. First a linear probe on frozen features as a baseline. Then train a new head, and if needed unfreeze the last blocks with a lower learning rate and strong augmentation. Compare everything on the same held-out set.
Then they push further
Fine-tuning barely beats the linear probe. What does that tell you?
The pretrained features already capture what the task needs, and the extra complexity is not earning much. Ship the probe, or check whether more data or better labels would help more than more fine-tuning.
Your images are X-rays, very unlike the photos the model was trained on. Does transfer still work?
Usually it still helps, since low-level features transfer, but less. Unfreeze more layers, consider a model pretrained on medical images if one exists, and compare against training from scratch if you have enough data.
What gets marked up
Marked up for a cheap baseline first, staged unfreezing with lower learning rates, and awareness of domain distance.
Reading an answer is not being able to give one. The section that teaches this is Fine-tuning a pretrained network, in code, 5 hours of Transfer learning.
Learn this properly