top-k accuracy
/ TOP-kay AK-yur-uh-see /
Ordinary accuracy is all-or-nothing: the model's single top guess is either right or wrong. Top-k accuracy is more forgiving. It lets the model offer its k best guesses, and counts the prediction as correct if the true answer is anywhere in that short list. Top-5 accuracy, the most common version, asks: was the right answer among the model's five most likely picks?
This makes sense for tasks with many fine-grained, easily-confused categories. A photo of a husky might genuinely be hard to distinguish from a malamute or a wolf; demanding the model nail the exact breed as its number-one guess can be unfairly strict. Top-5 accuracy rewards a model for at least putting the truth in serious contention, which often matches how the prediction will actually be used — for example, showing a person a short menu of candidates to choose from.
It's a useful lens, but be candid about what it hides. A top-5 accuracy of 95 percent sounds dazzling, yet the top-1 figure on the same model might be a far humbler 75 percent — and if your application acts on a single automatic answer, top-1 is what you live with. Quoting only the flattering top-5 number is a classic way to make a model sound better than it performs in practice. Always ask which k, and whether k matches how the system is really used.
An image classifier sees a photo whose true label is "red panda." Its ranked guesses: cat, fox, red panda, raccoon, dog. Top-1 accuracy: wrong (it led with "cat"). Top-5 accuracy: correct ("red panda" is in the list). Same prediction, two very different verdicts.
Top-5 forgives near-misses that top-1 marks as outright wrong.
Top-5 accuracy was popularized by the ImageNet benchmark, where 1,000 fine-grained classes made strict top-1 scoring brutal. Just remember: top-k is only meaningful if your real system actually surfaces k candidates. If it must commit to one automatic answer, top-1 is the number that matters.