What does a model learn?

BADBOB / IN DEPTH · 10 min

Follow an example from its target to updated weights.

Reading draft · Svenska and English

We review the writing and illustrations in Swedish and English before adding more languages.

You supply examples and targets

For detection, annotations give a class and a box for each labelled object. Instance segmentation also needs a mask for each object. The class says what; the geometry says where.

Objects missing from the annotations can teach the wrong lesson. If every red apple appears on the same white table, the background may become a shortcut. Training examples need to represent variation in the actual task.

  1. Example + target
  2. Compute
  3. Measure error
  4. Update weights
Teaching illustration — not a model run or measured activations.
Go deeper

Negative images can help when they represent situations without the target objects. Difficult examples help when their annotations are reliable. More inconsistently labelled images can weaken a dataset even as it grows.

One training step, visible in numbers

First the model makes a prediction. A loss function measures its mismatch with the target. Backpropagation computes how parameters affect that loss, and the optimizer uses this information to update them.

Here there is only one weight, w. The input is 2, the target is 6, and the prediction is 2 × w. Press the button and watch w approach 3.

2 × 0.5 = 1 → 6

Weight
0.5
Loss
12.5
Steps
0
A calculation with one trainable weight. It does not train a BadBob model.
Go deeper

This example uses L = ½(2w − 6)², gradient dL/dw = 2(2w − 6), and update w ← w − 0.1 × dL/dw. This is gradient descent in a tiny convex problem.

A vision network has many interacting parameters and a much harder optimization landscape. Real minibatch loss need not fall at every step. The calculation illustrates the mechanism, not the expected trajectory of a real training run.

Starting with previous learning

In BadBob’s experimental recipe · Recipe reviewed 29 October 2026

Transfer learning reuses parameters from a previously trained model. This can provide a useful starting point when your own dataset is smaller. New classes and the new task still need learning and evaluation.

BadBob’s experimental YOLACT recipe loads ImageNet-trained ResNet-50 weights into the backbone and initializes its segmentation heads locally. The optimizer receives model parameters; the recipe freezes batch-normalization behaviour. That is different from freezing the entire backbone.

Go deeper

Pretrained filters provide initialization, not a guarantee. Image type, scale and appearance affect transfer. “ResNet-50” names an architecture family; the weight file’s provenance and training determine the starting point you actually get.

Train, choose, then test

Train data supplies parameter updates. Validation data helps compare settings and choose a run. Test data supports a final assessment after those decisions are made.

Keep closely related images in the same split. Almost identical camera frames on both sides make evaluation too easy. Also assess images from different sessions, environments and lighting conditions relevant to use.

Go deeper

Low training loss shows that the model fits its objective on data it has seen. It does not, by itself, establish generalization. Repeatedly selecting a model using the same test set makes that test set part of the selection process.

What gets saved?

In BadBob’s experimental recipe · Recipe reviewed 29 October 2026

Trained weights are what you use for inference. A checkpoint may also contain optimizer state and other information needed to resume a run. These are different kinds of artefacts.

BadBob’s experimental segmentation checkpoint stores the model, optimizer, random-generator state, step and dataset identity, among other information. Their presence in a file does not mean every training mode offers a resume button.

Go deeper

Compare runs using the same dataset version and evaluation rules. Record preprocessing, seed, image size and software version too. Two runs of equal duration are not automatically the same experiment.

Sources and further reading