The Role of Image Annotation in Machine Learning Engineering
What is ML Engineering?
Machine learning engineers (ML engineers) are IT professionals who design, build, and operate artificial intelligence (AI) systems. ML engineers typically work as part of a large team, together with data scientists, data analysts, data engineers, and data architects. ML engineers serve as a bridge between data scientists, who focus on statistics and model building, and the operational AI systems that make it possible to train models and deliver them to end users effectively.
The role of a machine learning engineer is to evaluate, analyze, and organize large amounts of data while running tests and optimizing machine learning models and algorithms. ML engineers are also responsible for ensuring that AI systems can run effectively in production and meet the required service level agreements (SLAs).
What is Image Annotation?
Annotating an image is a manual operation that assigns a meaningful, textual label to the image as a whole and individual objects within it. An important part of image annotations is delineating specific areas within the image, which may be rectangles (bounding boxes) or complex polygonal shapes. The set of labels is typically pre-determined by data scientists and used to inform computer vision models about the information displayed in the image.
Want More Tech News? Subscribe to ComputingEdge Newsletter Today!
When annotating images, each image can be assigned one or more labels. For simple image classification algorithms, one label per image might be sufficient, but object detection algorithms require annotations of objects within the image. If there are multiple labels, the annotator must indicate the area of the image that corresponds to each label using a bounding box or pixel map.
Why is Image Annotation so Important in Machine Learning?
Image annotations are a foundation of computer vision algorithms because they create the training data that is the input for supervised learning algorithms. High-quality annotations will allow a computer vision model to see the world and derive accurate insights. Low-quality annotations result in models that do not have a good sense of the relevant real-world objects and thus perform poorly.
Annotated data is specifically needed if a model solves a relatively new domain. Standard datasets exist for common tasks like image segmentation and classification. These pre-trained models can be adapted to specific uses with only a small amount of training data, using transfer learning techniques.
Training a new model from scratch typically requires a large amount of annotated image data, which must have sufficient images in the training, validation, and test sets. Creating such a dataset can be a major effort for any organization.
Image Annotation Tasks
Image classification refers to the assignment of labels or tags to entire images. Supervised deep learning algorithms are typically used for image classification tasks and are trained on images annotated with labels selected from a fixed set of predefined labels.
Annotations required for image classification are provided as simple text labels, class numbers, or one-hot encodings. One-hot encoding refers to a list containing multiple possible unique IDs, with a binary value for each element and the element matching the class label set to 1.
Other forms of annotations are usually converted to one-hot or class ID form before the label is used in a neural network algorithm.
Object Detection and Recognition
Object detection is the task of finding an object in an image. Object recognition identifies the object once it is delineated from the rest of the image.
Annotations that enable these tasks are in the form of bounding boxes and class names. Each bounding box has a set of coordinates and a class ID, which define the ground truth for the image.
Object detection involves correctly identifying the bounding box coordinates for each object, while object recognition involves correctly identifying the class label for each bounding box.
Image segmentation refers to segmenting an area of an image into specific categories or labels. This is a more advanced form of object detection that specifies the exact boundaries and surfaces of an object, which may have complex polygonal shapes.
Image segmentation annotations are segment masks, also known as binary masks. These masks are identical to the original image, with specific pixels mapped to the binary mask marked with a class ID, and the remaining pixels marked as zero. Image segmentation annotations require high precision, and because they are time-consuming to perform manually, the process is often semi-automated.
Instance segmentation is a form of segmentation that identifies specific instances of an object in an image. For example, image segmentation can discover all the cars in an image, and instance segmentation can identify a specific car and its type.
Panoptic segmentation is a combination of semantic segmentation and instance segmentation. The algorithm must partition the image into object categories while paying attention to instance-level partitioning. This way, each class and object instance has its segment map. This is considered the most complex of the three types of segmentation.
Image Annotation Requirements
Several requirements will ensure your image annotation project results in a usable, high-quality dataset.
To create a successful model, you must have a good selection of images that are as similar as possible to real-world images the model will encounter and are as diverse as possible. Most computer vision architectures need at least hundreds, typically thousands or more, of images to train effectively.
For example, if your model needs to detect cars, you’ll need to collect images of as many makes and models as possible, with different colors, poses, lighting conditions, etc. The more variations you can capture in your sample images, the more accurate the model will be.
Most image annotation projects require a team of trained annotators. Often, these are outsourced to an image annotations service provider. But image annotation can also be done in-house with careful planning and management. In some cases, part of the image annotation task can be automated (for example, in many face datasets, faces are initially detected automatically, and then further classification is done by humans).
However, you manage the manual labor, it is critical to have clear guidelines for annotators and effective quality assurance. An important best practice is to have more than one annotator review the same image. This way, you can compare the annotations created by different workers and use a “majority vote” process to select the annotation most likely to be accurate.
Annotation projects rely on image annotation software, which stores the images, creates a labeling structure, and provides UI tools that allow annotators to draw shapes on the image and assign labels. A common open-source tool is LabelMe.
In this article, I explained the basics of image annotation and described five image annotation tasks that rely on annotated image data:
- Image classification
- Object detection and recognition
- Image segmentation
- Instance segmentation
- Panoptic segmentation
In addition, I showed the basic requirements for a successful image annotation project, including image diversity, training and quality assurance for human annotators, and the use of annotation software.
I hope this will be useful as you plan your next ML data project.