DEV Community

Cover image for Simplify Image Labelling For ML Using Roboflow
MusabShakil
MusabShakil

Posted on

Simplify Image Labelling For ML Using Roboflow

While building a machine learning project you probably came across a point in time where you need to decide which tool should I use to annotate my raw images for training and testing purposes. You may ask, why not just go with any one of the available data labelling tools?

Let's understand the problem 🧐

Labelling and annotating images can be a time-consuming process, especially for large datasets. Humans can make mistakes while labelling and annotating images, which can lead to errors in the final dataset. Different image labelling and annotation tools may use different standards and conventions, which can make it difficult to compare and integrate datasets from different sources. Many image labelling and annotation tools are not designed to handle large datasets, which can limit their usefulness for certain applications. Some image labelling and annotation tools can be expensive to use, which can be a barrier for smaller organizations or individuals. Some may not be robust enough to handle complex or noisy images, which can lead to incorrect or incomplete annotations. And some may have a steep learning curve or may be difficult for users to understand and use effectively.

How big is this problem? 🤔

If we take the example of the world's biggest autonomous vehicle manufacturer, Tesla. Their head of AI and computer vision, Andrej Karpathy, revealed that Tesla only has a "few dozen engineers" working on neural networks, but they have a "huge" team working on labelling.

According to Pinterest, they use Amazon Mechanical Turk, which is a distributed workforce who can perform image labelling and similar tasks virtually. At Pinterest, they have a growing dataset of billions of ideas, and they are tasked with showing the right idea to the right user at the right time. Taking advantage of Amazon Mechanical Turk’s powerful crowdsourcing platform, they built a high-quality human evaluation system that could scale with their needs.

Overall big organizations are handling more than a million of images each year and spending a lot of their developer hours into the object annotation process. So this task is a big part of their Machine Learning workflow.

What is Image Labelling? 🏞

Image labelling is exactly what it sounds like — it's the process of assigning labels or tags to images based on their content. The labels can be used to categorize and organize images, as well as to describe their content in a machine-readable format.

For example, image labelling might involve assigning labels such as "cat," "dog," "car," or "flower" to images of those objects. Image labelling can be done manually by humans, or it can be automated using machine learning algorithms.

Image labelling is an important step in many applications of computer vision, such as object recognition, image classification, and image search.

Processes involved in Image Labelling 🛠

Image labelling operates on a rather simple basis. Suppose we have 2 NFTs of different collections, one is Bored Ape Yacht Club and another one is Pancake Squad.

  • Our first step would be to select the images that need to be labelled. This may involve selecting a specific subset of images from a larger dataset, or it may involve selecting images from various sources if we are trying to take NFT derivatives in consideration.
  • The next step is to define the labels or tags that will be used to classify the images. This may involve defining a set of predefined labels, or it may involve creating a custom set of labels for a specific application. We'll use ape and pancake as our labels.
  • The third step is to label the images based on their content. This can be done manually by humans, or it can be automated using machine learning algorithms. We'll go the manual way.
  • Once the images have been labelled, it is important to verify that the labels are accurate and complete. This may involve manually reviewing the labels, or it may involve using ML algorithms to check for errors or omissions. Again we'll choose the manual path.
  • In some cases, it may be necessary to add additional metadata or context to the images. This process is known as image annotation, and it can involve adding additional labels, text, or other information to the images. We'll skip this one.
  • The final step in the image labelling process is to store and manage the labelled images in a way that allows them to be easily accessed and used for further analysis or processing. This may involve storing the images in a database or file system, or it may involve using a specialized image management tool. We'll use an image management tool and file system, but why? Let's discuss it.

Which products are solving this problem? 🤝

Heartex LabelImg created by Tzutalin is one of the popular choices of labellers but is no longer actively being developed. But, but it's now a part of the Label Studio community. Their cloud platform has just 14 days of free trial, you can use their cloud or open source product. But if you want to use it in your side projects and prefer browser softwares instead of local installation then 14 days might not be enough for you.

ImgLab is a free and a web based platform, but it lacks various computer vision annotation formats, which are essential if you need to train and experiment with distinct ML libraries and services.

Roboflow provides an image labelling feature that is easy to use and configure to our needs. It's free-forever for open-source projects and comes with a pay-as-you-go plan for private projects.

A technical deep dive 🚀

To understand the technical nuances in depth let's get our hands dirty and witness some of the features of Roboflow.

In a big organization labelling images is not the only problem we have. We must assign each image to the right person, make sure it is reviewed before moving on to the next stage, set labels, structure projects and the list can go on and on. You can use Roboflow to solve all these problems. The amount of features Roboflow provides, it is hard to fit in this one blog, so let's try out some of them. In this hands-on we'll be:

  • assigning images to a team member
  • annotating these images
  • exporting images to a specific format for a machine learning model

Let's now start by creating an account in Roboflow.

https://app.roboflow.com/login
Enter fullscreen mode Exit fullscreen mode

Connect with a third-party provider or use your email and password to sign up.
Roboflow Authentication

The best part of Roboflow is that it provides an interactive user onboarding tour, you can follow that or continue along with me.

I've created a project and named it as NFT Detection, you can choose a name according to your project.
Roboflow Project Setup

We landed on our project page. Roboflow has displayed numerous features on the left sidebar, we'll cover a few of them which are related to image labelling.
Roboflow Project

Once we have our Roboflow project up and running, we can upload images, I've added 3 ape and 3 pancake images, I'll just click on Save and Continue.
Roboflow Upload Image

It shows a dialog to assign images to the teammates, as I'm the only person in this Roboflow project, I'll assign these images to myself.

On the Annotate page click on one of the Unannotated images, it'll open a canvas to annotate your image.
Roboflow Canvas

Choose the Bounding Box Tool from the right hand side panel (if it's not already selected), click and drag the mouse to create as perfect box as you can around your object, and name the label accordingly, I'll name mine one as ape.
Roboflow Annotate

Follow the same procedure as of the above two paragraphs for the other Unannotated images and label them according to the image, I'll label remaining 2 of Bored Ape Yacht Club as ape and other 3 as pancake.

Once we have all the images annotated, we'll click on the Add 6 images to Dataset button (the number 6 might be different according to your data).
Roboflow Annotated

Adjust Train-Valid-Test split or leave it as it is, and proceed to the Generate tab. You can edit preprocessing depending on your use case. I'll remove the Resize preprocessing.
Roboflow Generate

Click on Generate > Export > Format YOLO v7 Pytorch (choose according to your needs) > download zip to computer > Continue.
Roboflow Export

Conclusion 🥁

There is no limit to Roboflow's features. This blog was created with the intention of piquing interest in this incredible tool that can help you save a ton of time and effort. Check the docs to see all the features. Create an account as soon as possible to begin using Roboflow. In case you have some questions regarding the article  or would like to talk about anything feel free to connect with me on LinkedIn ✌️

Special thanks to Neurala, @aniket762 and owaiskhan

If you run an organization, and want me to write for you or you are hiring for a software engineer position please do connect with me 🦄

Top comments (2)

Collapse
 
aniket762 profile image
Aniket Pal

Hey, @musabshakil it was a great read indeed. Was just curious why did you tag me?

Collapse
 
musabshakil profile image
MusabShakil

Hi @aniket762, thanks for stopping by, I really appreciate it. I came across your recent video with Kunal Kushwaha, and found out your article about Merging Pull Requests. It was well written and the structure of the title stuck with me, as how you effortlessly transition a reader from one section to the other by astoundingly leveraging coherent words in your headings. So I tried to embrace your style of writing in this article and gave you the credit of showing me the beauty of sharing thoughts through alphabets, images and emojis ❤️