> 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/evaluating-performance.md).

# Evaluating performance

*What you'll get: how to judge a trained model by eye and by its scores, what AP and IoU mean, and what to do when a score is low.*

Open a model version (see [Training a model](https://docs.biodock.ai/projects-and-models/training-a-model.md#check-the-new-version)). Two sections under **Performance** grade it:

* **Predictions**: the model's outlines next to your own labels. This is the best check.
* **Training statistics**: the scores.

## Look first: Predictions

1. Click **Predictions** and pick an image. Under its name you see how many of its tiles were used for training and for testing, and how many objects were predicted and labeled.
2. Compare the two panes: **AI predictions** and **Your labels**. Hover a tile to see whether it was used for training or testing; a test tile reads "Used in testing".
3. Zoom into a test tile on both sides and look for missed objects, extra objects, and loose borders.

**Show objects** turns the outlines off so you can see the cells underneath. The prediction threshold at the top of this section is explained in [Configuring your model](https://docs.biodock.ai/projects-and-models/configuring-your-model.md#prediction-threshold).

## Then read the scores: Training statistics

<figure><img src="https://3806122466-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk3DfNQKoMy1JXdaDLvpG%2Fuploads%2Fgit-blob-ab5adc0e9316ea71f09ce06c4d561e36ecd7cd75%2Fdocs-model-training-statistics.png?alt=media" alt="The Quantitative metrics table with Test and Training columns and the Mean over IoU 0.5-0.95 row highlighted, and the class confusion counts below it"><figcaption><p><strong>Training statistics</strong>: the <strong>Quantitative metrics</strong> table and the confusion counts.</p></figcaption></figure>

The **Quantitative metrics** table shows each score for the **Test** tiles (held back from training) and the **Training** tiles. Scores run from 0 to 100: higher is better, and 100 means the model matched your labels exactly. A dash means there was nothing to measure, for example no large objects.

**Trust the Test columns.** The model has already seen its training tiles. If you held no tiles back, there are no Test columns; see [Test tiles](https://docs.biodock.ai/projects-and-models/training-a-model.md#test-tiles).

### IoU

Intersection over union (IoU) measures how much a predicted outline overlaps your label:

IoU = area of overlap ÷ area of union (the area covered by the prediction, the label or both, with the overlap counted once)

Complete overlap gives the top score; no overlap gives 0.

### Object classes

For object classes the scores are average precision (AP): the share of predicted objects that match one of your labels at a given IoU, averaged over the classes in the size group.

* **Mean over IoU 0.5-0.95** is the headline score: AP averaged over IoU thresholds from 0.5 to 0.95.
* **0.5 IoU** and **0.75 IoU** are AP at one threshold. At 0.5, a prediction counts as a match when it overlaps the label by half; at 0.75 it needs much more.
* **Small objects (< 32x32 px)**, **Medium objects (< 96x96 px)** and **Large objects (> 96x96 px)** are AP by object size.
* The table also has one row per class.

**AP (bbox)** compares a box drawn tightly around each object: did the model find it in the right place? **AP (mask)** compares the outlines themselves.

Below the table, the confusion counts show, for the labeled objects:

* **correct**: found and given the right class
* **confused**: found but given another class
* **missed**: not found
* **spurious**: detections that match no labeled object

An object cut by a tile edge can count as both missed and spurious. Switch between **Chart** and **Table**, and between **Test set** and **Training set**.

### Region classes

For region classes, performance is measured per pixel:

* **Mean intersection-over-union averaged across classes** is the headline score.
* **Frequency weighted IoU** weights each class by how many pixels it covers.
* **Mean pixel accuracy averaged across classes** and **Pixel accuracy** give the share of pixels the model got right.
* The table also has the **Intersection-over-union** and **Pixel accuracy** of each class.

## Is it good enough?

{% hint style="info" %}
There is no single pass mark. Judge by your eyes first and the numbers second.

* **Test and Training scores close together**: the model learned rather than memorised.
* **Training much higher than Test**: it memorised its tiles. Label more varied tiles.
* **Many missed**: label more examples like the ones it misses.
* **Many spurious**: raise the prediction threshold, or label tiles that contain the things it makes up.
* **A small test set** (a few tiles) gives a rough score. Treat it as a hint.
  {% endhint %}

To improve a model, prelabel new tiles with it, correct them and train again. See [Labeling tools](https://docs.biodock.ai/projects-and-models/labeling-tools.md#ai-prelabel) and [Correcting results to improve your model](https://docs.biodock.ai/analysis-and-results/correcting-results-to-improve-your-model.md). Each training makes a new version, so you can compare versions side by side.


---

# 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/evaluating-performance.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.
