linking entities

How to Choose The Best Ontology Structure for Your Model

When training a model you need labeled data which is the input for your model. Just like there are multiple ways to phrase a sentence there are multiple ways to define the language structure of your model and that’s – ontology. In this blog post, I will introduce you to three recommended approaches to developing an ontology structure. Let’s just take a moment and define what an ontology is.

Ontology is a part of the recipe. It’s the building block of your model and it will help you define the object detection that your model is fed. Labels, like classes, are the signs used to classify a dataset. Understanding the ontology structure is important for defining the labeling instructions and the desired output format. Additionally, it also has a major impact on the time spent during the labeling phase.

4 Steps to Developing Your Ontology Structure

Step #1: Define the purpose of your labeling project.

For example: labeling fruits and vegetables.

Step #2: Define the entities you would like to have and their relation.

For example: Potato is a type of vegetable.

Step #3: Understand what is the best ontology structure for your projects. 

When the data scientist wants to train the model using the exported data labels, they need to have the ability to understand the simple structure of the data which is built from the ontology. This can only be achieved if the data output is structured wisely.

Step #4: Decide on the ontology structure. 

Ontology Structure Options

So let’s get started. I’d like to share three approaches for ontology structures. All approaches have the identical output, but the ontology structures are different and the major discrepancy will be in the time spent during the labeling phase.

Ontology Structure # 1: Sub-Labels

Main LabelSub-LabelJSONTool
fruitsstrawberrylabel: “fruits.strawberry”bounding box
applelabel: “”bounding box
cherrylabel:”fruits.cherry”bounding box
vegetablespotatolabel:”vegetables.potato”bounding box
cabbagelabel:”vegetables.cabbage”bounding box
carrotlabel: “vegetables.carrot”bounding box

This ontology structure allows a connection between labels and sub-labels. In this case – between the fruits/vegetables and their subs. The advantage of this ontology is that the annotator is given the ability to easily speed up their annotations and productivity by adding a few values to one bounding box. This is accomplished by simply selecting the sub-label on the Dataloop platform which decreases the annotation time immensely.
For example: When selecting the sub-label of potato, naturally it’s related to the main label of vegetables.

JSON output:

Ontology Structure# 2: Combination of Labels & Attributes

LabelToolAttributes Options
fruitsbounding boxvegetablespotato
vegetablesbounding boxcabbage

This ontology structure allows a relation to specific labels and attributes.The disadvantage of this structure is that it takes longer in the labeling phase, because instead of just clicking the mouse once, the annotator is also required to select attributes from the attributes list.

JSON output:

Ontology Structure #3: Advanced Sub-Labels 

In case you’d like to label objects and have a structure of their relation, you can simply do so by defining a recipe with sub-labels.

For example:

Potato is a root vegetable and will be reflected this way on the JSON: “vegetables.root.potato”. Once the annotator selects the “potato” label, the entire path of the potato will be reflected and this way it is more beneficial for granting a few entities to an object by only one click of the mouse. 

The alternative for achieving such a relation, is to have one label for the potato, with 2 attributes, but this will take 3X longer, and will increase the labeling costs.

Summed Up

Defining the model’s ontology is the building block for the entire ML process. Building it wisely, will allow you to save time later in the labeling phase and simplify the model’s training phase. Each data project has its own requirements and therefore a different ontology structure is needed. It is important to ensure that you set up the structure wisley in order to ensure a smooth labeling process. It is also important to explain to your annotation team the structure and its purpose in order to ensure everything is clearly outlined for them and they know exactly what labels they need to select.

With this information in hand you can move onto the next stage which is the labeling instructions. To get you started check out this blog post “All You Need to Know About Labeling Instructions”.

Share this post

Share on facebook
Share on twitter
Share on linkedin

Related Articles