> For the complete documentation index, see [llms.txt](https://docs.biodock.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.biodock.ai/projects-and-models/configuring-your-model.md).

# Configuring your model

*What you'll get: how to change what an active model reports without retraining: the prediction threshold, the measurements it takes, parent-child hierarchies, and grown, shrunk or ring-shaped classes.*

{% hint style="info" %}
These settings can only be changed on an **Active** version, and only by a project owner. They apply to **new** analyses. For an analysis you already ran, open its **⋯** menu in **Analysis** and choose **Recompute metrics**. That option appears when the model's settings have changed since the analysis ran.
{% endhint %}

## Open the settings

1. Go to **Projects** and open your project.
2. On the **Active models** tab, click the version you want to change.
3. Use the sidebar on the left of the version page. **Predictions** is under **Performance**; **Metrics**, **Class hierarchy**, **Size group hierarchy** and **Class transforms** are under **Configuration**.

## Prediction threshold

Every object the model finds has a confidence score from 0 to 1. The prediction threshold is the lowest score an object needs to be kept. A higher threshold gives fewer, surer objects; a lower one gives more objects, and more junk. It applies to object classes.

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-8dc8b936fff28b060e736a948f68db894f3b47c3%2Fv2-model-predictions-threshold.png?alt=media" alt="Predictions section with the prediction threshold for each size group"><figcaption><p>In <strong>Predictions</strong>, each size group has its own threshold.</p></figcaption></figure>

1. Click **Predictions**.
2. Open an image and zoom in on a spot with small specks or faint objects.
3. Under **thresholds by size group**, drag the **Change threshold** slider for the size group and watch the outlines appear and disappear.
4. When the junk is gone and the real objects stay, click **Save** on that row.

Older models without size groups have a single **prediction threshold** slider instead. Click **Save as analysis default** to keep it.

If good objects disappear before the junk does, the threshold can't fix it. Label more tiles and train again.

## Measurements (metrics)

Metrics are what Biodock measures for every object. A new model reports **X and Y Positions** and **Area**. When you train a new version, it starts with the previous version's selection.

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-cd9b8a1f1c37772bad1c86403a1a4b5197019bbc%2Fv2-model-metrics.png?alt=media" alt="The Analysis metrics section of a model version"><figcaption><p><strong>Metrics</strong>: tick where each metric is computed with <strong>Include</strong>, then <strong>Save selection</strong>.</p></figcaption></figure>

1. Click **Metrics**. The **Analysis metrics** list opens.
2. Type in **Filter metric names** to find a metric, for example `intensity`.
3. Click **Include** on the metric and tick the size groups to compute it for. A chip appears for each one. Click the **×** on a chip to remove it.
4. If the **Parameters** column shows **Configure**, set it up (see below).
5. Click **Save selection**.

Add only what you need: fewer metrics mean smaller result files and faster downloads. What each metric means is in the [Measurement reference](https://docs.biodock.ai/projects-and-models/measurement-reference.md).

### Metrics with parameters

Two kinds of metric need settings before they can be computed. Click **Configure** in the **Parameters** column:

* **Colocalization: Pearson** and **Colocalization: Manders**: choose the pairs of channels to compare (channel **A** and channel **B**). Offered for images with 2 or more channels.
* **Area threshold**: measures how much of each object is above (or below) a brightness threshold in one channel. In the **Channel thresholds** window, choose **Percentage** or **Pixels**, the **Channel**, **Above** or **Below**, the threshold, the **Brightness** and **Contrast** to apply first, and a **Display name**. Then click **Done**.

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-4d49412a8dc6de4ac171d585281f4b2917124472%2Fdocs-model-channel-thresholds.png?alt=media" alt="The Channel thresholds window with Percentage selected, a Channel, Above, a threshold value, Brightness and Contrast sliders and a Display name"><figcaption><p>The <strong>Channel thresholds</strong> window for the <strong>Area threshold</strong> metric.</p></figcaption></figure>

Measurements such as area are in pixels, unless the image file carried a pixel size when it was uploaded. See [Supported image types](https://docs.biodock.ai/files/supported-image-types.md).

## Class hierarchy

A class hierarchy links each child object to the parent object it sits in. It lets you answer questions like:

* **Organoid → cell**: how many cells are in each organoid?
* **Cell → puncta**: how many puncta are in each cell?
* **Tissue region → positive cell**: how many positive cells are in a region?
* **Tumor → immune cell**: how far have immune cells infiltrated?

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-805ce43f476017b973af70bf85fab96842fadd58%2Fv2-class-hierarchy.png?alt=media" alt="The Class hierarchy section with two hierarchies"><figcaption><p>The <strong>Class hierarchy</strong> section.</p></figcaption></figure>

You need at least 2 classes.

1. Click **Class hierarchy**, then **Add hierarchy**.
2. Choose the **Parent class** and the **Child class**.
3. Set the **Overlap threshold**: how much of a child must fall inside a parent to count as its child.
4. Click **Create hierarchy**.

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-a5311ee5c35f47c9f7ffeec08ea15036c1441b33%2Fv2-create-class-hierarchy.png?alt=media" alt="The Create class hierarchy window" width="563"><figcaption><p>The <strong>Create class hierarchy</strong> window.</p></figcaption></figure>

Once a hierarchy exists, the **Aggregations** table below it chooses what the hierarchy adds to your results:

* **Parent ID**: adds the parent's object ID to each child. Keep it on if you want **Inside a parent object** populations on the results page: without it, that option is not offered.
* **Number of children**: adds "Number of *child* within *parent*" to each parent.
* **Area overlap fraction of children (0–1)**: adds the share of each parent's area covered by its children.

Click **Save selection** after you change it.

## Size group hierarchy

If your project has more than one size group, a size group hierarchy makes Biodock look for the child group's objects only inside the parent group's objects. For example:

* **Tissue region → positive cell**: positive cells are only looked for inside the tissue.
* **Organoid → cell**: cells are only looked for inside organoids.

This avoids false objects in empty background and saves time and credits, because the child model skips everything outside the parent.

You can set it up when you train (see [Training a model](https://docs.biodock.ai/projects-and-models/training-a-model.md#size-group-hierarchy-and-channels)), or later under **Size group hierarchy** on the version page:

1. Set **Parent size group** to the large container (for example the tissue group).
2. Set **Child size group** to the small objects (for example the nucleus group).
3. Click **Add**.

## Class transforms

A class transform draws a new class from an existing one, with no extra labeling. The new class is measured like any other, intensity included.

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-3258a7903d8acd9c27dde2e1b68ffb3de4731c9f%2Fv2-new-class-transform.png?alt=media" alt="The New class transform window" width="563"><figcaption><p>The <strong>New class transform</strong> window.</p></figcaption></figure>

1. Click **Class transforms**, then **New transform**.
2. Under **Transform type**, choose:
   * **Grow**: expand an object class by a number of pixels, for example to reach from a nucleus into the cytoplasm, or to connect puncta to the nearest cell.
   * **Shrink**: contract an object class, for example to drop autofluorescence or edge effects at a boundary.
   * **Ring**: wrap a band around any class. Set **Inward (pixels)** and **Outward (pixels)**.
3. Choose the class to transform (for a ring, under **Wrap a ring around**).
4. For **Grow** or **Shrink**, choose the **Transformed shape**: **Hollow** (only the ring outside the original object) or **Filled** (the whole new shape).
5. Give it a **Transformed class name** and a **Display color**.
6. Click **Create transform**.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.biodock.ai/projects-and-models/configuring-your-model.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
