Pretraining initializes a model with weights learned on a source dataset before adapting it to a downstream task. In image classification, pretrained convolutional filters provide a stronger starting point than random weights, while a replacement output layer is learned for the new labels. section 13.2.1
A practical pretraining workflow is:
- Load a model trained on a large source dataset such as ImageNet. section 13.2.1
- Replace the final fully connected layer so its output matches the downstream classes; the new layer starts with random weights. section 13.2.1
- Train the adapted model with warm or frozen pretrained weights, depending on the available target data. section 13.2.3 section 13.6
Adapting ResNet-18
Load a pretrained ResNet-18, then replace its output layer with a two-class linear layer for cat-versus-dog classification. Earlier convolutional filters retain features such as edges and color changes, while training adapts the network to the target data. section 13.2.1













