City street with pixel-level segmentation masks colouring road, cars, people and buildings

What Is Semantic Segmentation in Computer Vision?

A photo holds far more than a list of objects. It holds shapes, edges, and areas. A car is not just a box on a road. It has a body, windows, wheels, and a clear outline. A road is not just a line. It is a surface with lanes and kerbs. Pixel-level labelling captures all of that detail. It marks every single pixel in an image with a class. Each pixel gets a label. Each label belongs to a class. The result is a full mask of the scene.

City street with pixel-level segmentation masks colouring road, cars, people and buildings
Semantic segmentation labels every pixel by class, so each part of the scene is marked.

November 30, 2026

Annotation

by Iqra Riaz

This guide explains the technique in plain terms. It covers per-pixel masks, class lists, boundary rules, and when masks beat boxes or polygons. It also covers the hard cases. For a short comparison first, read our guide to the main annotation types. This post goes deeper into one method only.

The Short Answer: Every Pixel Gets a Class

Semantic segmentation gives every pixel in an image a class label. Nothing is left blank. The sky gets one label. The road gets another. Each car gets the same car label. Two cars share one class. The method does not tell them apart. That is the key difference from other methods. A bounding box draws a rectangle around an object. A polygon traces its outline. A pixel mask colours every pixel that belongs to it.

Think of a street scene. A mask paints the buildings one colour and the trees another. It paints each car the same colour. The paint follows the true edges. The output is a full picture of labels. A model learns from that picture. It learns where one class ends and the next begins.

This matters because many tasks need shape, not just location. A self-driving system must know where the road ends. A medical tool must know where a tumour ends. A box cannot give that detail. It includes background pixels. A mask keeps only the pixels that belong. That precision is the whole point.

How a Per-Pixel Mask Works

A mask is a second image. It sits on top of the first image. Each pixel in the mask holds a class code. The code stands for one class. A common set might be road, car, person, tree, and building. The mask uses one colour per class. A viewer reads it at a glance. A model reads numbers.

The work starts with a class list. The list names every class the model must learn. It gives each class a clear definition and a colour. A good list is short. It covers only what the model needs. Too many classes cause confusion. Too few miss detail. The list is agreed before labelling starts.

The Class List Comes First

A class list is a contract. It tells every annotator what to mark and how to mark it. A class called “vehicle” might cover cars, vans, and trucks. A class called “car” covers cars only. The choice changes the data. The choice must match the model’s job. If the model must spot trucks, trucks need their own class. If the model only needs vehicles, one class is enough.

Each class needs a written rule. The rule says what counts as part of the class and what does not. A window on a car is part of the car. A shadow under a car is not part of the car. These rules stop guesswork. They keep the data steady across many annotators.

A finished mask looks like a flat colour map. Edges follow real shapes. A tree canopy has a ragged edge. A building has a straight edge. The mask keeps those shapes.

What Good Boundary Discipline Looks Like

Boundaries are where this technique wins or fails. A mask is only as good as its edges. A loose edge adds wrong pixels. A tight edge cuts real pixels. Both errors teach the model the wrong thing. Good discipline means the edge follows the true shape. The annotator zooms in and checks each curve.

Take a car wheel. The tyre is round. The rim is round. The mask must follow that circle. A rough polygon would cut across the curve. The same care applies to a person’s hair. The mask must stop where the hair stops. It must not swallow the background.

Three rules keep edges clean. First, label at full zoom on small objects. Second, follow the visible edge, not the guessed edge. If a part is hidden, stop at the visible line. Third, stay steady across the whole set. One annotator’s car edge must match another’s. A three-stage QA check catches drift and sends weak masks back for repair.

Semantic Segmentation vs Bounding Boxes vs Polygons

The three methods answer different questions. A box asks where an object is. A polygon asks what shape it has. A pixel mask asks which pixels belong to it. The table below sums up the difference.

MethodWhat it marksBest for
Bounding boxA rectangle around the objectFast detection, counting, rough location
PolygonAn outline traced around the objectShape and size, clear object edges
Pixel-level maskEvery pixel that belongs to the classExact shape, area, and scene layout

A box is fast. It takes seconds to draw. It suits tasks that need location only. A traffic counter needs boxes. It counts cars as they pass. A polygon is slower. It suits tasks that need shape. A damage report needs a polygon. It traces a dent or a crack. A pixel mask is the slowest. It suits tasks that need exact area. A road surface check needs a mask.

Cost rises with detail. Boxes cost the least time. Polygons cost more. Masks cost the most. Do not pay for masks when boxes will do. Do not use boxes when the task needs exact area. For a full comparison, see our earlier post. This post stays focused on the pixel-level method itself.

When to Choose Pixel-Level Labelling

Choose semantic segmentation when shape and area matter. A model that must measure a surface needs masks. A model that must find a boundary needs masks. A model that must split a scene into parts needs masks. If the task is only “is there a car?”, a box is enough. If the task is “how much of the image is road?”, only a mask can answer.

Five signs point to masks. The output must be a map, not a list. The model must know the exact edge of each class. The area of each class matters. Classes touch and share borders. The background inside a box would confuse the model. If two or more of these signs apply, masks are the right call.

There are also times to avoid masks. A simple count does not need them. A rough location check does not need them. A task with hundreds of tiny objects may not need them either. Our guide to the main annotation types covers the other methods. The right method is the cheapest one that still answers the question.

Edge Cases That Test the Method

Real images are messy. Clean textbook scenes are rare. The hard cases below show where pixel-level work earns its keep. A good team plans for them in advance.

Thin Structures

Thin structures are the hardest test. A wire, a pole, or a fence rail may be only a few pixels wide. A mask must still follow it. A box would swallow the background around it. A polygon would cut across it. A mask can trace it pixel by pixel. That takes care, a zoomed view, and a clear rule. The rule says how thin a line must be to count. It says when to skip a line that is too faint. Without that rule, annotators guess. Guesses differ. The data becomes noisy.

Overlapping Classes

Classes often overlap in a photo. A person stands in front of a car. A branch crosses a building. A sign covers part of a wall. The mask must pick one class per pixel. It cannot pick two. The rule must say which class wins. A common rule gives the front object priority. The person wins over the car. The branch wins over the building. The sign wins over the wall.

Write the rule before work starts. Cover the common overlaps and give examples. A reviewer checks overlaps first. They are where errors cluster. A wrong pick teaches the model a false edge. Clear priority rules stop it.

Small Objects

Small objects test patience and eyesight. A distant sign may be twenty pixels wide. A faraway person may be thirty pixels tall. The mask must still mark them. The annotator must zoom in to see them. The class list must say what counts as too small to mark. Some projects skip objects below a set size. Others mark every object, no matter how small.

Small objects also test class balance. A set may hold thousands of road pixels and only a few sign pixels. The model may learn the road well and the sign poorly. The plan should watch this balance and add more images with small objects if needed.

Reflections, Shadows, and Glass

Reflections confuse the eye. A window shows the sky. A wet road shows a car. The mask must label what is really there. A window is part of a building, even if it reflects the sky. A wet road is still road, even if it reflects a car. The rule must say so and give examples with photos.

Shadows cause the same trouble. A shadow falls across a road, but the road is still road. The annotator marks the real object, not the shadow. Glass is the hardest case. A glass door is see-through. The mask must follow the glass edge, not the scene behind it.

How the Work Is Done at NextAI Pros

Pixel-level work needs a steady process. A single image can hold thousands of labelled pixels. At NextAI Pros, the work runs through a small, trained team. The team has 30+ annotators and 8 project managers. Each project has one manager. That manager owns the class list, the rules, and the checks.

The work starts with the class list and the boundary rules. The manager writes them with the client. They agree on each class and each edge case. The rules are written down. Every annotator reads them before they start. The rules do not change mid-project.

Labelling uses proven tools: CVAT, Roboflow, Label Studio, LabelMe, and Supervisely. The tool fits the project. The output is the same either way. Exports come in COCO JSON, YOLO, or Pascal VOC. The format matches the client’s model.

Quality runs in three stages: self-check, peer review, and a final check by the project manager. The target is 98%+ accuracy. A mask that fails any stage goes back for repair. It is not passed on. This loop keeps edges clean and class rules steady.

To see how a project moves from brief to delivery, read our How We Work page. For the full image service behind this work, see our image annotation service page.

Where Pixel-Level Masks Are Used

Pixel masks serve many fields, but the need is always the same. The model must know exact shape and area.

In medical imaging, masks outline scans. They mark organs, tissue, and growths. Scans are a hard case. Edges are soft and classes are close in tone. Our medical blog shows this in practice. Its section “Polygon and Semantic Segmentation for Scans” covers how masks and polygons split the work on scans. Our medical portfolio covers 30,000+ images. One single medical project covered 5,000+ images. The two figures are separate.

In self-driving, masks map the road. They mark lanes, kerbs, cars, people, signs, and signals. The model must read the scene in real time. It must know where the road ends. Our portfolio includes 40,000+ self-driving car images and 30,000+ annotated video frames. A mask must stay steady from frame to frame.

In construction, masks read plans and sites. They mark walls, beams, and zones. Our construction work covers 100,000+ blueprints on an ongoing basis. A mask must split each drawing into parts. In vehicle imaging, masks mark body parts and damage. Our vehicle portfolio covers 50,000+ vehicle images. Each class needs its own edge rule.

Common Mistakes to Avoid

Five mistakes show up again and again. Each one is easy to prevent and costly if missed.

The first mistake is a vague class list. Classes with no written rules get labelled in different ways. The model learns noise. Fix it by writing each rule down. Give examples and counter-examples. Agree the list before work starts.

The second mistake is loose edges. An annotator in a hurry draws a rough mask. The model learns the wrong edge. Fix it with zoom checks and a three-stage review. Send loose masks back.

The third mistake is class overlap with no priority rule. Two classes meet at one pixel. The annotator picks at random. Fix it with a written priority rule. The front object wins. Use the rule the same way every time.

The fourth mistake is ignoring small classes. A rare class gets few pixels. The model barely sees it. Fix it by watching the class balance. Add images that hold the rare class. Check the balance before delivery.

The fifth mistake is changing the rules mid-project. A new class appears halfway through. Old images use the old list. New images use the new list. Fix it by freezing the list at the start. If a change is truly needed, re-check the old images against the new list.

At NextAI Pros, our clients are not just customers — they’re valued partners in every project. We offer personalized support to help you navigate your AI data journey, from choosing the right annotation approach to understanding your project’s unique requirements. Whether it’s answering your queries or providing expert guidance on data strategy and implementation, NextAI Pros is with you every step of the way.

Categories

top