Pixel Accuracy
When a model segments an image, it assigns a class label to every pixel: road, car, background, tumor, text, and so on. Pixel accuracy asks a simple question: out of all pixels in the image, what fraction received the correct label?
How it is calculated
For each pixel, the model’s predicted class is compared with the ground-truth mask created by human annotators or another trusted source. Pixel accuracy is:
pixel accuracy = number of correctly labelled pixels / total number of pixels
For example, if a 1,000-pixel image has 920 correctly classified pixels, its pixel accuracy is 92%. In a multiclass segmentation task, a prediction counts as correct only when the predicted class exactly matches the true class. It does not matter whether the error is a small boundary shift or a completely wrong object label: each incorrect pixel contributes one error.
Why a high score can be misleading
Pixel accuracy is easy to understand, but it can hide poor performance when one class dominates the image. Consider a medical scan where 99% of pixels are healthy tissue and only 1% belong to a small lesion. A model that labels every pixel as healthy reaches 99% pixel accuracy—yet fails at the task that matters. The same problem appears in autonomous-driving scenes dominated by sky, road, or background.
Its role in evaluation
Pixel accuracy gives a quick broad view of how closely a predicted mask matches its reference mask, especially when classes are reasonably balanced. It is commonly reported alongside stronger region-focused measures:
- Mean pixel accuracy, which averages accuracy separately across classes so large classes do not dominate as strongly.
- Intersection over Union (IoU), which measures overlap between predicted and true regions.
- Dice score, widely used for medical-image segmentation and small structures.
Used with these complementary metrics, pixel accuracy remains a clear baseline: it reveals how many individual visual decisions the segmentation model got right.
Pixel accuracy is the proportion of image pixels whose predicted segmentation label exactly matches the ground-truth label: correct pixels divided by total pixels. It measures overall per-pixel classification agreement across a segmentation mask. Pixel accuracy is simple and intuitive, but can overstate performance when background or other large classes dominate the image, so it is commonly paired with mean Intersection over Union (mIoU).
Imagine checking a giant paint-by-numbers picture: for every tiny square, you ask, “Did the AI choose the same color as the answer sheet?” Pixel accuracy is simply the percentage of squares it got right.
In image segmentation, an AI labels every pixel—for example, marking pixels as road, car, sky, or person. If it labels 90 out of 100 pixels correctly, its pixel accuracy is 90%.
This makes the score easy to understand, but it can be misleading when one thing dominates an image. A model could label almost everything as “sky” and still score well, while missing a small but important pedestrian. So pixel accuracy is useful, but usually not the only score considered.