Training from scratch vs fine-tuning

Almost every custom detector should start from pretrained weights. Here is why, and the few cases where scratch makes sense.

4 min read

Fine-tuning

A model trained on COCO has already learned edges, textures, shapes and the look of everyday objects. Fine-tuning keeps all of that and adjusts it to your classes. It converges in tens of epochs instead of hundreds, and works with a few hundred images per class.

From scratch

Training from scratch starts from random weights. The model learns everything from your data alone, which takes a large dataset and a long schedule. fotonet's own models are trained this way on COCO, with no pretrained backbone and no teacher, so that everything they know comes from one documented recipe.

When to use which

  • Your own project: fine-tune. It is faster and almost always more accurate.
  • Images very unlike photos (radar, some medical or scientific imagery) with a large dataset: try both and measure.
  • Research on training itself: scratch, so the result depends only on your recipe.

With fotonet

# fine-tune from the released COCO weights (the default)
fotonet train model=fotonetn data=data.yaml epochs=100

# from scratch: random weights
fotonet train model=fotonetn data=data.yaml epochs=300 pretrained=False

Pass pretrained=False explicitly for a scratch run: a model name on its own loads the released weights.