About Labelbox ontology

Alex Cota Updated by Alex Cota

A clean, thoughtful ontology is critical for creating high-quality labeled data with minimal errors and inconsistencies. An ontology provides the necessary structure for labeling a dataset. This document describes what is included in the Labelbox ontology and how to create an ontology.

First, open the API explorer and run the following query to get the ontology for one of your projects.

query { 
project (where: {id: "<PROJECT_ID>"}) {
ontology {
normalized
}
}
}

After you run this query, the result will contain the following values.

tools

Top-level JSON key designated for vector and mask Features. Objects under tools can contain subclassifications.

classifications

Top-level JSON key designated for global classifications.

schemaNodeId

A schema node gives structure to an ontology and points to a Feature schema. These are considered to be at the root level.

featureSchemaId

A feature schema contains all of the necessary information for rendering a Feature of its kind.

name

Name of the object or classification as defined in the ontology.

color

Color of the mask or vector feature on the asset.

tool

Tool used to create the vector feature or mask.

instructions

Text that appears as the classification question to the labeler.

type

Classification type (radio, checklist, text, or dropdown)

options

Possible classification answers the labeler can choose from.

label

Text that appears to the labeler as a possible answer to the classification question.

value

Value of the classification answer.

required

Indicates whether the object requires use or the classification question requires an answer.

Legacy editor vs new editor

Take a look at the ontology structures below to notice the difference between the Legacy editor and the new Image editor.

Legacy editor example

{ 
"tools": [
{
"name": "Dog",
"color": "#FF00FF",
"tool": "rectangle"
}
],
"classifications": [
{
"name": "this_is_a_question.",
"instructions": "This is a question.",
"type": "radio",
"options": [
{
"value": "yes",
"label": "Yes"
},
{
"value": "no",
"label": "No"
}
],
"required": false
}
]
}

New Image editor example

{ 
"tools": [
{
"schemaNodeId": "ck5cxrgenqzi00899gfrggvr4",
"featureSchemaId": "ck5cxrgdxjepy0952ttth9a96",
"required": false,
"name": "Dog",
"color": "#FF0000",
"tool": "rectangle",
"classifications": []
}
],
"classifications": [
{
"schemaNodeId": "ck62vcr24s79h08337bijdab3",
"featureSchemaId": "ck62vcr1es78x0833r1uxg6jz",
"required": true,
"instructions": "This is a question.",
"name": "this_is_a_question.",
"type": "radio",
"options": [
{
"schemaNodeId": "ck62vcr0d0be30876ojpf3qwf",
"featureSchemaId": "ck62vcqzo0go60700u048bzqv",
"label": "Yes",
"value": "yes"
},
{
"schemaNodeId": "ck62vcr0d0be40876uya7zei2",
"featureSchemaId": "ck62vcqzo0go70700v16eg61d",
"label": "No",
"value": "no"
}
]
}
]
}

Create a new ontology

Configure in the app

Configure the ontology in the “Configure editor” step when setting up a project in the app. At the very minimum, you must specify at least one value for Objects or Classifications.

To create a nested classification under an object, click on the right arrow icon next to the object name.

To create a nested classification under a global classification, click on the arrow icon next to the object name.

Labelbox provides you with the following set of customizable entities for you to create your ontology. To create your ontologies in the app click on one any of the links below for setup instructions.

Configure programmatically

All project ontologies are structured in JSON format with two top level keys: “tools” and “classifications”. When you configure your project’s ontology, you must provide values for at least one of the top level keys. The associated values for the top level keys “tools” and “classifications” will be lists, even if the list only includes one item.

For an example of configuring the ontology with the Python SDK, see Creating your first project end-to-end example.

Was this page helpful?

How to create a project

Contact