What is inside a model?

BADBOB / IN DEPTH · 8 min

Architecture, weights, and an image that becomes numbers.

Reading draft · Svenska and English

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

A structure. Many learned numbers.

An image model is a computational structure with parameters, often called weights. The architecture determines how operations connect. The weights influence their outputs. Training adjusts these numbers using examples.

Consider a picture of two apples and a cup. The model receives pixel values, not the words “apple” and “cup”. It computes representations from which it can predict the classes and shapes it was trained for.

  1. Image
  2. Layers
  3. Prediction
Teaching illustration — not a model run or measured activations.
Go deeper

A layer receives a tensor, performs an operation and produces another tensor. A tensor is an array of numbers with a shape, such as channels × height × width. Some layers have trainable parameters; others, such as a fixed resize, may have none.

Parameters differ from training settings. Learning rate, batch size and the number of steps configure training. Filter weights and biases are values learned through optimization.

What is a weight?

A weight is a number a model uses in its calculations. Multiplying an incoming value by a weight changes how much it contributes to the next calculation.

If the value is 2 and the weight is 0.5, the contribution is 1. With a weight of 2, it becomes 4. Training adjusts many such numbers together to reduce errors in the model’s predictions.

Go deeper

A layer can add several weighted values and a bias, a separate learned number. Weights can be positive, negative or zero. They work together across many layers, so a single weight rarely has a simple meaning such as “apple”.

Four questions for the same image

Classification describes image content. Object detection also locates individual objects. Segmentation goes further, to the pixels.

Semantic segmentation groups pixels by class. Instance segmentation separates individual objects, including objects of the same class. Explore the different views of one illustrated scene.

AppleAppleCup
Apple
Cup

Which objects are present, and where? A class and a box for each detection.

Teaching illustration — not a model run or measured activations.
Go deeper

A box describes a bounding region, not the exact object shape. An instance mask describes pixel membership for one specific object. A prediction can have a reasonable box but a poor mask; review and measure these outputs separately.

Layers transform information

A convolutional filter processes small local regions using shared weights. Multiple filters produce feature maps. Later layers can combine these responses across larger parts of the image.

Saying one layer sees edges and another sees apples can be a useful first picture. Real networks use distributed representations: an individual channel does not always have a simple human-readable name.

Go deeper

A 3×3 convolution with 64 input channels and 128 output channels has 3×3×64×128 = 73,728 filter weights, plus an optional bias. The count depends on kernel size and channels, not directly on image width.

Stride controls the sampling interval. Padding affects boundaries and output size. Nonlinear activations allow stacked layers to represent more than a single linear transformation.

Using a model is different from training it

At inference time, a new image is processed using learned weights. The application may then filter scores, boxes or masks and draw the result. Changing a display threshold changes what you see; it does not retrain the model.

In BadBob, human annotations are ground truth and AI predictions are suggestions to review. A saved correction becomes training material only when you take it through the dataset and training workflow.

Go deeper

A model score does not guarantee a correct detection. The result also depends on preprocessing, image data, class order and postprocessing. The same weights with the wrong image scaling can produce very different results.

What about ChatGPT?

There is shared ground: learned parameters and computation over inputs. But an object detector and a language model have different tasks, representations and training objectives. A language model is not simply a larger apple detector.

Text models process tokens, which may represent words, word fragments or other text units, and generate a continuation token by token using context. An assistant can also have tools and a conversation interface around its model.

Go deeper

The exact internals of the current OpenAI model are not fully public. This comparison explains general principles, not the model’s precise layer count, parameter count or internal reasoning. Adding text to a conversation is also different from running a training step in BadBob.

Sources and further reading