Image annotation: label taxonomies, annotator agreement, and label noise
How to write a labeling guideline that annotators apply the same way, pick a class list that is neither too coarse nor too fine, measure agreement with Cohen's kappa and IoU, and see what wrong labels do to a test score.
Image annotation is the work of adding labels to images, such as a class name for each photo or a box drawn around each car. A model learns from those labels and is scored against them. So the way the labels were made decides what the model can learn and what its test score means.
Where label quality comes from
Label quality has two sources. One is the tool the annotator draws with. The other is the written guideline that says what a correct label is. A good tool with vague instructions still produces labels that disagree with each other, because each annotator fills the gaps in their own way.
A guideline defines each class and its edge cases. It also fixes conventions such as how tight a box should be and what to do when an object is partly hidden.

How to write a guideline rule
Compare two versions of one rule for boxing cars.
Vague: "Draw a tight box around each car."
Specific: "Draw the box to the outermost visible pixels of the car body, including mirrors and excluding shadow. If the image edge cuts the car off, box only the visible part. If another object hides more than 80 percent of it, do not label it. The smallest allowed box is 12 by 12 pixels."
Under the vague rule, three annotators can draw three different boxes around the same car and each of them followed the rule. One includes the mirrors and another cuts them off. The specific rule answers the questions annotators keep running into: what to include, what to do with a car cut off by the image edge, when a car is too hidden to label and how small is too small. Each question the guideline leaves open becomes a place where annotators disagree. Good guidelines also show examples of correct and incorrect labels next to each rule.

Reviewing labels while they are made
A guideline is rarely right on the first try. Quality also depends on a review step: someone checks a sample of the labels, the team discusses the disagreements and the guideline gets updated. Then annotation continues under the new version. Without that loop, a misunderstanding from the first day spreads through the whole dataset.

Annotation tools
CVAT is a common open-source tool for labeling images and video. It handles boxes, polygons and masks. It also handles keypoints, which are single marked points such as the tip of a person's nose, and it can follow one object across the frames of a video. Label Studio is a flexible platform that also covers text and audio, which suits projects that label text or form fields next to the images.
The tool affects how fast people label and how consistent they are. It also decides which export formats you get. If your training code cannot read the export format, someone has to write a converter before training starts.

Labels come from design choices
Labels are often called ground truth. They come out of four things people chose: a class list, a guideline, a tool and a review process. A different set of choices would have produced different labels, so treating labels as truth without knowing how they were made is a mistake.

What a label taxonomy is
A label taxonomy is the fixed list of classes a dataset uses, with a precise definition for each one. Every label is drawn from it. So the taxonomy sets how many classes the model outputs and what the evaluation can measure. More classes also make labeling slower, because annotators have more options to choose from.

Too coarse or too fine
A taxonomy with one vehicle class cannot tell a bicycle from a truck. Distinctions the task needs are lost, and getting them back means relabeling the images.
A taxonomy split into 200 fine classes has the opposite problem. Many classes end up with a handful of examples each. Some become impossible to tell apart, even for annotators, and a model cannot learn a class it barely sees.

Fixing a taxonomy with real counts
There are four common fixes:
- Merge classes that annotators confuse all the time.
- Split a class that hides a difference the task needs.
- Use a hierarchy, such as
vehiclefirst and thencar,truckorbus. - Add an "other" class so annotators are not forced to guess.
For example, start with six vehicle classes and these counts of training images:
| Class | Training images |
|---|---|
| car | 9000 |
| van | 4200 |
| truck | 3100 |
| bus | 900 |
| motorcycle | 40 |
| moped | 25 |
Motorcycle and moped have almost no examples and annotators confuse them often. So they merge into one two_wheeler class with 65 images. Van and truck are easy to tell apart and the task needs both, so both stay. A new other_vehicle class takes the tractors and forklifts that were being forced into truck, which leaves truck with fewer than 3,100 images.

Definitions need examples
Each class needs a written definition, examples that belong and examples that do not. It also needs rules for the borderline cases. "Is a stroller a vehicle?" should be answered in the taxonomy. If each annotator decides alone, some will say yes and some will say no.

Inter-annotator agreement
Inter-annotator agreement measures whether different people produce the same labels when they get the same images and the same guideline. To measure it, several annotators label an overlapping set of images.
Why raw agreement is not enough
Say two annotators each label the same 100 images as damaged or intact, and they agree on 90 of them. Their raw agreement is 0.90. That sounds high, but about 85 of the 100 images are intact. Two people who answer "intact" most of the time would agree often by chance alone.

Cohen's kappa
Cohen's kappa rescales agreement so that agreement at chance level scores 0 and perfect agreement scores 1. It uses two numbers. $p_o$ is the observed agreement, the share of images both annotators labeled the same. $p_e$ is the agreement expected by chance if each annotator kept their own label frequencies but labeled each image independently of the other.
Kappa is written as the Greek letter $\kappa$:
$$\kappa = \frac{p_o - p_e}{1 - p_e}$$
The top of the fraction is how far the annotators got above chance. The bottom is how far above chance they could have gotten. A kappa below 0 means they agree less often than chance would predict.

For the 100 images above, $p_o = 0.90$. Annotator A said damaged 17 times and annotator B said it 15 times. They can match by luck in two ways, both saying damaged or both saying intact, so chance agreement adds the two:
$$p_e = (0.17)(0.15) + (0.83)(0.85)$$
$$= 0.0255 + 0.7055 = 0.731$$
$$\kappa = \frac{0.90 - 0.731}{1 - 0.731}$$
$$= \frac{0.169}{0.269} \approx 0.63$$
So 0.90 raw agreement is about 0.63 once chance is taken out. A kappa near 1 means the annotators apply the guideline the same way. A kappa near 0 means they agree no more than chance would. A low kappa is a reason to look at the cases they split on before labeling more data.

In code, with pa and pb the share of images each annotator labeled damaged:
def cohen_kappa(p_o, pa, pb):
p_e = pa * pb + (1 - pa) * (1 - pb)
kappa = (p_o - p_e) / (1 - p_e)
return kappa
print(round(cohen_kappa(0.90, 0.17, 0.15), 2)) # 0.63The first line inside the function is the chance agreement $p_e$, and the second is the kappa formula. If kappa comes out low on your own data, read the images the annotators split on before changing anything else.
Agreement for boxes and masks
Two annotators rarely draw exactly the same box or mask, so a plain match or mismatch says little. Agreement is measured with IoU instead, short for intersection over union. IoU is the area where two shapes overlap divided by the total area they cover together. An IoU of 1 means identical shapes and 0 means no overlap.

In code, this version compares one box against many boxes at once. Each box is given by its corners as (x1, y1, x2, y2):
import torch
def iou(box, boxes):
x1 = torch.maximum(box[0], boxes[:, 0])
y1 = torch.maximum(box[1], boxes[:, 1])
x2 = torch.minimum(box[2], boxes[:, 2])
y2 = torch.minimum(box[3], boxes[:, 3])
inter = (torch.clamp(x2 - x1, min=0)
* torch.clamp(y2 - y1, min=0))
area = (box[2] - box[0]) * (box[3] - box[1])
areas = ((boxes[:, 2] - boxes[:, 0])
* (boxes[:, 3] - boxes[:, 1]))
return inter / (area + areas - inter)
box_a = torch.tensor([150., 150., 790., 470.]) # annotator A
boxes = torch.tensor([[210., 110., 870., 500.], # annotator B
[150., 150., 790., 470.]]) # A's box again
print(iou(box_a, boxes)) # tensor([0.6710, 1.0000])torch.clamp(..., min=0) sets the overlap width or height to 0 when two boxes do not touch. Annotator B's box gives 0.67, and A's box compared with itself gives 1.
Averaged over a few hundred objects, a mean IoU of 0.9 means two annotators draw nearly the same boxes. A mean IoU of 0.6 means they disagree noticeably about where objects end. That usually points to an unclear rule for boundaries or for hidden parts.
What low agreement tells you
Low agreement usually means the class definitions are unclear, the guideline is weak or the images are ambiguous. Annotators often split on fuzzy object edges and on exact keypoint positions. They also split on judgment calls such as whether a package counts as damaged.
The disagreements show what to fix. Add an example for the case people split on, tighten a definition or add an "ambiguous" option. Then measure again on a fresh overlapping set. High agreement still does not prove the labels are right, since annotators can agree with each other and all be wrong.

What label noise is
Label noise is any label that is wrong, inconsistent, incomplete or out of date. With one label per image it looks like a cat labeled "dog" or a tag nobody checked. It also looks like a busy scene that got only one label. With boxes and masks it looks like loose boxes, ragged mask edges or objects nobody labeled. Keypoints placed in different spots by different annotators count too.

How label noise affects training
During training the model tries to fit the wrong labels along with the right ones. Random noise, where mistakes are scattered with no pattern, slows learning and lowers how well the model can do. Systematic noise teaches the model the mistake itself. For example, if one annotator always draws loose boxes, the model learns to draw loose boxes.

How label noise affects the test score
In the test set, noise punishes a correct model. If the label says there is no object where one clearly is, the model's correct detection counts as a false alarm and the reported score goes down.
Noise also caps the score. Say 8 percent of the test labels are wrong. A perfect model that always predicts the true class still disagrees with the test labels on those 8 percent, so its reported accuracy tops out near 92 percent. Two models at 90 and 91 percent on this test set are within the noise, and the gap between them may not be real. Cleaning the test set is often the most valuable fix available.

Common mistakes
- A guideline that says "tight box" and stops there. Say what happens at the image edge, behind other objects and below the minimum size.
- Labeling everything before reviewing anything. Check a sample early, while the guideline is still cheap to change.
- A class list that is too coarse or too fine. Count the examples per class, then merge or split before labeling more.
- Reporting raw agreement alone. When one class makes up most of the images, report kappa next to it.
- Comparing models on a noisy test set. A one-point gap can come from wrong labels rather than from the models.
- Treating labels as ground truth. Read the guideline and the review process behind a dataset before trusting its labels.
Related concepts
The label type, such as one label per image or a box per object, is chosen before any annotation starts. Vision tasks and label types covers that choice. Labels that cost less and say less, or that come from a model instead of a person, are covered in pseudo-labeling and weak labels.
QuiddityML teaches annotation, taxonomies and label noise in the vision data unit of its Computer Vision track. The exercises on Cohen's kappa include turning the formula into code and putting the lines of a kappa function in order (QuiddityML).