Guide · Introductory to intermediate · 14 min read
How to design a useful label taxonomy
Turn a kick-off wish list into classes annotators can actually apply: two tests for granularity, mutually exclusive versus multi-label rules, a hierarchy, separate rules for other, ignore and uncertain, a class dictionary and version numbers, worked on a synthetic surface-defect case.
anastig editorial teamPublished
A useful label taxonomy is a short, versioned list of classes that annotators can tell apart from the image alone, where every class maps to something you will do with the result. Give each class a written definition, what it includes and excludes, examples and look-alike counter-examples. Decide in advance how to handle "other", "ignore" and "uncertain", because they are three different things. Store properties such as size or severity as attributes, not as extra classes. Then test the list on a small double-labelled pilot before anyone labels at scale.
This guide covers the class list itself. Choosing the task type comes first (classification, detection or segmentation), and the written instructions, calibration and quality checks around the list come after (a reproducible annotation protocol).
Start from decisions, not from vocabulary
A class list written in a kick-off meeting usually mixes three kinds of words: what things look like ("scratch"), what caused them ("dirt") and what to do about them ("reject"). Only the first kind can be labelled from an image. Start by listing the decisions the model's output will feed, then ask which visual distinctions each decision needs.
The LVIS dataset team called this "evaluation-first" design: before collecting any data, they defined the task and how it would be scored [1]. Their reason applies to small projects too. If one object can carry two correct labels, such as a toy that is also a deer, a car that is also a vehicle, or a backpack that someone calls a rucksack, then a correct prediction can be scored as wrong. That happens unless the class list says how those relationships are handled [1].
A worked case: cosmetic defects on brushed panels
A small manufacturer photographs brushed-aluminium cover panels under fixed lighting and wants a model to find cosmetic defects. The case is synthetic, but its problems are typical. The kick-off meeting produced this draft list, version 0:
| Draft label (v0) | Problem | Fate in v1.0 |
|---|---|---|
| scratch | Fine, but "how long is a scratch?" is not defined | Kept, with a minimum length |
| crack | Rare; easily confused with a scratch | Kept as a separate class because missing one is costly; reported at parent level until there are enough examples |
| dent | Fine | Kept |
| stain, dirt | "Dirt wipes off, a stain does not" cannot be seen in a photo | Merged into contamination |
| defect | Overlaps every other class | Becomes the parent node; never used as a label |
| minor, major | Severity, not appearance | Attribute (measured size) plus a downstream rule |
| bad part | A decision about the whole panel, not a mark | Removed; computed from the labels |
| other | No rule for when to use it | Kept as "other defect" with a mandatory comment and a weekly review |
Choose the granularity with two tests
Labels can be broad or fine. The COCO authors gave the example of a dog that could be labelled "mammal", "dog" or "German shepherd". They chose entry-level categories, the words people commonly use when describing objects [2]. Cityscapes chose its classes by frequency, relevance to applications, annotation effort and compatibility with other datasets. It defined 30 classes but scored only 19, leaving out those too rare to evaluate [3].
For your own list, apply two tests to every class and to every pair of similar classes:
- Can a trained annotator decide it from the image alone? "Dirt wipes off" fails this test. "Branched dark line starting at an edge or hole" passes it.
- Does the distinction change a decision? If a scratch and a crack lead to different actions, keep them apart even if telling them apart is hard. If two classes always lead to the same action and are hard to tell apart, merge them. If they are easy to tell apart, keep both as leaves under one parent and report at the parent: a merge cannot be undone without relabelling.
Then check the first test with data. In a synthetic pilot, two annotators labelled the same 60 marks independently using the v0 list. For each class, the table counts the marks that both annotators gave that class ("both") and the marks that at least one of them gave it ("either"). With 60 marks the counts for rare classes are tiny, so read them as counts, not as rates.
| Class (v0) | Both | Either |
|---|---|---|
| scratch | 14 | 19 |
| crack | 2 | 5 |
| dent | 8 | 12 |
| stain | 5 | 19 |
| dirt | 6 | 19 |
| other | 2 | 9 |
Do not argue for a merge from the rise in overall agreement. Merging two classes always raises raw agreement, by exactly the number of marks on which the two were swapped. Merging crack into scratch, which v1.0 rightly refuses, would also raise it, from 37 to 40 of 60. The evidence for a merge is the confusion pattern between the two classes. Here it is the stain/dirt corner of the pilot:
| B: stain | B: dirt | |
|---|---|---|
| A: stain | 5 | 6 |
| A: dirt | 5 | 6 |
On the 22 marks that both annotators saw as stain or dirt, they agreed on 11 and swapped 11. That is a coin flip, and it matches the first test: "wipes off" cannot be seen. Test 2 adds that both lead to the same action (clean and re-inspect), so v1.0 merges them into contamination. For the record, Cohen's kappa over all classes moves from 0.52 to 0.72. Kappa corrects for chance agreement and is explained in inter-annotator reliability.
Crack is a different case: 3 of the 5 marks that either annotator called a crack were called a scratch by the other. But a crack leads to a different action, so it fails only test 1, and only partly. v1.0 keeps crack as a class and fixes the definition instead: branched, or starting at an edge, hole or corner. It also adds examples and collects more crack images until there are enough to measure.
Mutually exclusive or multi-label
Decide this separately for each level at which you label.
- Per mark (box, mask or point): one class. A mark is a scratch or a dent, not both. Mutually exclusive classes are what single-label classification assumes: each sample gets exactly one class [4]. When a mark fits two definitions, a written precedence rule decides. v1.0 uses crack, then dent, then scratch, then contamination: the costlier miss wins.
- Per image: often several. A panel can have a scratch and a dent. Image-level labels are then multi-label: each class is a separate yes or no, and zero or several can be "yes" [4].
- Separate defects that overlap get separate labels. A scratch that runs through a dent is two marks, and their masks may overlap. Write this down; otherwise one annotator draws one region and another draws two.
Use a hierarchy, but label only the leaves
Group classes under parents (here: material cut or split, shape changed, material added). Annotators label only the leaves, and parents are derived. The hierarchy pays off in three ways. You can report at parent level when a leaf is too rare to score on its own. You can collapse two leaves later without relabelling. And you can map your classes onto another dataset's.
Do not ask annotators to label both a parent and its child on the same object. Open Images collected image-level labels at several levels of its hierarchy. For its training set, before drawing boxes, it removed every label that was the parent of another label on the same image. An image labelled animal, zebra and car got boxes for zebra and car only [5].
"Other", "ignore" and "uncertain" are three different things
| Option | What it means | Effect on training and scoring | Precedent |
|---|---|---|---|
| Other defect (id 4) | A real defect that fits no class | Labelled like any class, with a mandatory comment. Review them weekly; a recurring pattern becomes a candidate class in the next version | — |
| Ignore region | Part of the image nobody can or should judge: glare that hides the surface, stickers, areas outside the inspection zone | Excluded from training loss and from evaluation | Cityscapes "void" [3]; COCO "crowd" regions [2] |
| Uncertain flag | The annotator cannot decide between classes, or whether a mark is a defect at all | Best-guess class plus the flag; every flagged mark goes to adjudication. Afterwards the decided class is used, or the mark becomes an ignore region if it is still undecidable | Related: PASCAL VOC kept hard objects with their class but marked them "difficult" and left them out of scoring [6] |
Without these options, annotators who meet an unclear case guess silently, and nobody can find those guesses afterwards. With them, unclear cases become a queue that someone can review.
Adjudication works that queue. Name one person or role who decides, such as the quality engineer. Record each decision as a numbered boundary rule with the example image, for example "B7: a dark line that starts at a rivet is a crack". A rule that only clarifies, without changing what any existing label should be, is a patch. A rule that changes existing labels is a major version, as defined in the versioning table below. The full procedure, with calibration and agreement checks, is in build a reproducible annotation protocol.
Store properties as attributes, not classes
Size, severity, visibility and position describe a mark; they are not different kinds of mark. Turning them into classes (scratch-minor, scratch-major) multiplies the list and forces annotators to make judgement calls that a ruler could make. Open Images stores properties such as occluded, truncated, group-of, depiction (a drawing or statue of the object) and inside (the view from inside a car or aeroplane) as attributes on the box, not as classes [5]. The PASCAL VOC guidelines make such flags measurable: an object is marked truncated if more than 15 to 20 % of it lies outside its bounding box, and occluded if more than 5 % of it is hidden inside the box [7]. In the panel case, annotators record length in millimetres. Severity and the accept or reject decision are computed later from length and the drawing's zone, so the rule can change without relabelling. For how to handle hidden and cut-off objects, see how to label occluded and truncated objects.
Write the class dictionary
Each class gets one row in a dictionary that annotators keep open while they work. The PASCAL VOC guidelines are a compact model. Each class has an include and an exclude list. The entry for chair, for example, reads "Includes armchairs, deckchairs but not stools or benches" [7]. LVIS resolved synonyms by making each category a WordNet synset, a word sense with its set of synonyms and a definition [1]. A plain synonym column does the same job in a small project.
| ID | Class | Definition (what is visible) | Includes / synonyms | Excludes and boundary rules | Minimum size |
|---|---|---|---|---|---|
| 0 | scratch | Straight or curved line that cuts across the brushing direction or differs clearly from the grain in brightness | Scuff line, score mark | Lines parallel to the brushing and within normal grain contrast are grain. A line that branches or starts at an edge, hole or corner is a crack | 1.0 mm long |
| 1 | crack | Dark line that branches or starts at an edge, a hole or a corner | Split, fracture line | A straight unbranched line in open surface is a scratch; if unsure, keep the best guess and set the uncertain flag | Any visible length |
| 2 | dent | Local light-to-dark shading change with no material removed and grain still continuous | Ding, impression | Shading caused by the lighting across the whole panel. A scratch inside a dent is labelled separately | 2.0 mm across |
| 3 | contamination | Foreign material on the surface: patch, spot or particle that hides the grain | Dirt, stain, smudge, particle, residue | Bright areas without texture are reflections: draw an ignore region | 1.0 mm across |
| 4 | other defect | A defect that fits none of the above | — | Comment required: describe it in five words or more | 1.0 mm |
| 255 | ignore region | Area that cannot be judged | Glare, sticker, out-of-zone, motion blur | Never used for a mark you can see clearly | — |
Add at least three example crops and three look-alike counter-examples to every row. Use the same image IDs in every version of the guideline, so changes stay visible.
Worked example: labelling the eight swatches
Three of the eight, worked through:
- Swatch 1: a 14.2 mm dark line across the grain, unbranched and in open surface. Scratch, length 14.2 mm.
- Swatch 2: a faint 20.0 mm line parallel to the brushing, inside normal grain contrast. Not labelled: it is grain. This is exactly the look-alike the dictionary's exclude column is for. Two annotators without that rule would likely disagree here.
- Swatch 6: a bright area with no grain visible. The surface under it cannot be judged, so draw an ignore region, not a defect and not "no defect". If glare is frequent, change the lighting; a taxonomy rule cannot recover hidden pixels.
The other five are in the worksheet.
Version the taxonomy like an interface
Models, datasets and reports all depend on the class list, so treat changes to it like changes to an interface. Semantic Versioning numbers releases MAJOR.MINOR.PATCH: the major number changes for incompatible changes, the minor for backward-compatible additions, the patch for backward-compatible fixes [8]. For a taxonomy, "compatible" has a specific meaning: every existing label stays correct and complete.
| Change | Example | Version step | What existing labels need |
|---|---|---|---|
| Clarify wording, add examples | Add three crack photos | 1.0.0 → 1.0.1 | Nothing |
| Add an optional attribute | Add "near weld: yes/no", default unknown | 1.0.1 → 1.1.0 | Nothing; the attribute is unknown on old labels |
| New class carved out of "other defect" | "pit" after 30 commented "other" marks | 1.1.0 → 1.2.0 only if a check shows pits were labelled only as "other" (re-review every "other" mark, plus a sample of contamination, dent and unlabelled areas); otherwise 2.0.0 | Re-review "other" marks; note in the change log that "other" now means less |
| Merge, split or redefine a class; any new class whose instances may sit unlabelled in old images | Split contamination into stain and particle | 1.2.0 → 2.0.0 | Map or relabel affected images; old data is incomplete until then |
Store the taxonomy version with every label, keep a mapping table between versions (v0 stain and v0 dirt both map to v1.0 contamination), and never edit a released version in place.
Printable checklist
| # | Check | Done when |
|---|---|---|
| 1 | Every class serves a decision | Each class names the action or report it feeds |
| 2 | Every class can be decided from the image | A definition refers only to visible evidence |
| 3 | Similar pairs have boundary rules | Each confusable pair has an "if … then …" rule and look-alike examples |
| 4 | Mutually exclusive per mark, multi-label per image (or justified otherwise) | Written in the guideline, with a precedence order |
| 5 | Hierarchy defined; only leaves labelled | Parent of every leaf listed; reporting level stated for rare leaves |
| 6 | Other, ignore and uncertain defined separately | Each has a rule, and what happens next is written down |
| 7 | Properties are attributes | No class name contains a size, severity or decision |
| 8 | Synonyms listed | Every common alternative word maps to one class |
| 9 | Minimum sizes set | Stated in pixels or millimetres for each class |
| 10 | Examples and counter-examples | At least three of each per class, with fixed image IDs |
| 11 | Pilot run | At least two annotators double-labelled a sample; low-agreement pairs reviewed |
| 12 | Versioned | Version number on the document and on every label record; mapping table kept |
Worksheet
Use the v1.0 dictionary and the swatch figure.
- Label swatches 3, 4, 5, 7 and 8. Give the class (or "not labelled" or "ignore region"), any attribute and the rule you applied.
- A new annotator labels swatch 7 as one dent with a 18.6 mm length. What is wrong, and which rule fixes it?
- The quality team wants to split "contamination" into "oil stain" and "metal particle". Which version step is this, and what must happen to the existing labelled images?
- You add the attribute "near weld: yes/no" with default "unknown". Which version step is it?
- After a month, 34 "other defect" comments describe small round pits. What do you do?
- A manager asks for classes "scratch-cosmetic" and "scratch-functional". What do you propose instead?
Show the answers
- Swatch 3: crack. The line branches and starts at a hole; total length 20.6 mm. Swatch 4: dent, 9.0 mm across. The shading is local and the grain is continuous. Swatch 5: contamination, 8.0 mm wide. Whether it would wipe off cannot be seen, and that is why stain and dirt were merged. Swatch 7: two marks, a scratch (18.6 mm) and a dent (8.0 mm). Per-mark classes are mutually exclusive, and overlapping defects get separate labels. Swatch 8: not labelled. At 0.9 mm it is below the 1.0 mm minimum for scratches. If short marks matter, lower the minimum in a new version, and only after checking in a pilot that annotators see them consistently.
- It merges two defects into one mark and gives the dent the scratch's length. The rule "a scratch inside a dent is labelled separately" (dent row) fixes it: one scratch of 18.6 mm and one dent of 8.0 mm.
- Major (2.0.0). Every existing contamination label is now ambiguous. Re-review all contamination marks and map each to one of the new classes. Until that is done, do not mix old and new labels when training or scoring.
- Minor (1.1.0). Existing labels stay correct; the attribute is simply unknown on them.
- Draft a "pit" class with a definition, examples and look-alikes. Re-review every "other defect" mark (not only the 34), and check a sample of contamination, dent and unlabelled areas for pits labelled differently or missed. If pits appear only under "other", release a minor version and note that "other" has narrowed; if they also hide elsewhere, it is a major version. Run a short pilot first to check that annotators agree on pits.
- Keep one class, scratch, and record measured attributes (length, and zone from the drawing). Compute "functional" or "cosmetic" with a written rule. The rule can then change without relabelling, and annotators do not have to guess at consequences.
When the list is stable, write the full annotation guideline around it, with instructions, a calibration round and quality checks: build a reproducible annotation protocol. For a research study, the sampling and split decisions around the list are covered in plan a computer vision dataset for a research study.
References
- [1] A. Gupta, P. Dollár and R. Girshick. LVIS: A Dataset for Large Vocabulary Instance Segmentation. CVPR 2019; arXiv:1908.03195. arxiv.org/abs/1908.03195
- [2] T.-Y. Lin, M. Maire, S. Belongie, L. Bourdev, R. Girshick, J. Hays, P. Perona, D. Ramanan, C. L. Zitnick and P. Dollár. Microsoft COCO: Common Objects in Context. ECCV 2014; arXiv:1405.0312. arxiv.org/abs/1405.0312
- [3] M. Cordts, M. Omran, S. Ramos, T. Rehfeld, M. Enzweiler, R. Benenson, U. Franke, S. Roth and B. Schiele. The Cityscapes Dataset for Semantic Urban Scene Understanding. CVPR 2016, 3213–3223; arXiv:1604.01685. arxiv.org/abs/1604.01685 doi:10.1109/CVPR.2016.350
- [4] scikit-learn user guide: Multiclass and multioutput algorithms (multiclass vs multilabel classification), version 1.9 documentation. Accessed 2026-11-28. scikit-learn.org/stable/modules/multiclass.html
- [5] A. Kuznetsova, H. Rom, N. Alldrin, J. Uijlings, I. Krasin, J. Pont-Tuset, S. Kamali, S. Popov, M. Malloci, A. Kolesnikov, T. Duerig and V. Ferrari. The Open Images Dataset V4. International Journal of Computer Vision 128, 1956–1981, 2020; arXiv:1811.00982. arxiv.org/abs/1811.00982 doi:10.1007/s11263-020-01316-z
- [6] M. Everingham, L. Van Gool, C. K. I. Williams, J. Winn and A. Zisserman. The PASCAL Visual Object Classes (VOC) Challenge. International Journal of Computer Vision 88(2), 303–338, 2010. doi.org/10.1007/s11263-009-0275-4 doi:10.1007/s11263-009-0275-4
- [7] PASCAL VOC2011 Annotation Guidelines (linked from the VOC2012 challenge pages), Visual Geometry Group, University of Oxford. Accessed 2026-11-28. www.robots.ox.ac.uk/~vgg/projects/pascal/VOC/voc2012/guidelines.html
- [8] T. Preston-Werner. Semantic Versioning 2.0.0. Accessed 2026-11-28. semver.org/