Skip to main content

What are model weights?

If you have trained a model — a classifier, a segmentation network, a regression — you have already produced weights, whether or not that is the word you used. This page explains what they are, why BranchKey cares about them, and why they, and not your data, are the thing that travels.

A model is a big pile of numbers

Think about what a trained model actually is once training finishes. It is not your data. It is a set of numbers — often millions of them — that the training process tuned so that the model turns an input into the right output.

Those numbers are the weights (also called parameters). Training is the process of searching for good values for them. When people say "the model learned", they mean "the numbers changed to values that make better predictions".

Concretely, for an image segmentation network:

  • The input is an image (a grid of pixel values).
  • The output is a mask (for each pixel, is it tumour or not).
  • The weights are the numbers in between that transform one into the other.

A useful mental picture: a model is a very elaborate set of dials. The architecture (how many dials, how they're wired) is fixed by you. Training turns the dials. The final dial settings are the weights.

Why weights, and not data?

This is the whole idea of federated learning, and the reason BranchKey exists.

Your raw data — patient scans, say — is sensitive and cannot leave your institution. But the weights your model learned are just numbers. They carry the pattern your data taught the model, not the data itself.

So the deal is:

  1. You train locally, on data that never moves.
  2. You send BranchKey only the weights.
  3. BranchKey combines your weights with everyone else's into a shared, better set of weights.
  4. You load those shared weights back into your model and carry on.

The result is a model informed by everyone's data, where no raw data was ever shared. (See How federated learning works for the full picture.)

Do weights leak the data?

Weights are a summary, not a copy — they are far less sensitive than raw records. BranchKey's design keeps raw data on-site by construction. Whether additional protections (such as differential privacy) are needed depends on your threat model; if that is a concern for your project, contact us to discuss it.

A tiny, concrete example

Forget neural networks for a second. Here is one of the simplest possible models — a straight line, y = a·x + b. It has exactly two weights: the slope a and the intercept b.

Training finds good values for a and b. Once you have them, the "model" is just those two numbers. If you wanted to share this model with a colleague, you would send them a and b — not your table of x and y measurements.

A neural network is the same idea, just with far more numbers, organised into groups called layers. A segmentation network might have millions of weights across dozens of layers — but it is still, fundamentally, a pile of numbers produced by training.

Weights come in groups: layers

Real models organise their weights into layers. Each layer is one block of numbers that does one step of the transformation from input to output. A convolutional layer that detects edges, then one that combines edges into shapes, and so on.

For BranchKey this matters for one practical reason: when you extract your weights, you get a list — one entry per layer — not a single number. BranchKey stores them as layer_0, layer_1, layer_2, … in order. The next page, Shapes, layers & the NPZ format, explains exactly what each entry looks like and how they are packaged for upload.

What BranchKey never sees

To be completely clear about the boundary:

Stays on your machineSent to BranchKey
Your images / scans / recordsThe model weights (numbers)
Your labels / masksA single weighting number (how much your update counts)
Your training codeOptional performance metrics you choose to report

Key terms

  • Weights / parameters — the numbers inside a trained model. The thing BranchKey aggregates.
  • Layer — one group of weights doing one step of the model's work.
  • Aggregation — combining many participants' weights into one shared set (BranchKey does this).
  • Weighting — a single number you attach to your upload saying how much influence it should have in the average (usually your number of training samples). Don't confuse it with weights.