DeepLLM Quiz
Neural Network Architectures

Bounding boxes and intersection-over-union: scoring object detection

10 questions on bounding boxes, how a network predicts them, why overlap area alone is a poor score, and how intersection-over-union is computed and used.

  • 10 questions
  • Stopwatch
  • Instant feedback

Shown publicly with your score. Don’t use your full real name.

Sample questions

Play now ↑

Answers stay hidden. Start the quiz to play them.

  1. Sample 1

    A true box and a predicted box are both 4 units wide and 4 units tall. They overlap in a region 2 units wide and 4 units tall. What is the intersection-over-union?

    • 0.5
    • About 0.33, one third
    • 0.25

How it works

  • One question per screen. An answer is final once sent.
  • You see right away whether you were right, with a short explanation.
  • The stopwatch runs: on equal scores, the faster player ranks first.
  • Only your best attempt counts, so replaying is never risky.

About this quiz

Telling a computer that a picture contains a pallet is only half of what a warehouse robot needs. It also has to know where the pallet is, so that it can decide where to steer its forks. Object detection adds that second half. The usual way to say where an object is draws a tight rectangle around it, a bounding box, and the network is trained to output such rectangles along with a class for each object. But as soon as a network can draw boxes, a new question arises: how do you score a box? This quiz is about the answer.

You will start with what a bounding box is and how it can be written down with four numbers: where its centre is, how wide it is and how tall. You will see how a network can be given extra outputs to predict them, alongside the usual class scores, and what kind of error function suits numbers of that kind. You will see an early idea of dividing the image into a grid and letting every cell report on the object it is responsible for.

Then comes the central idea. Overlap between a predicted box and the true one seems a natural score, but raw overlap area depends on how big the object is, and it forgives a prediction that spills far outside the true box. A better score divides the area they share by the area they cover together. That ratio, called intersection-over-union, always lies between zero and one, and detections are usually counted as correct when it passes a threshold. The questions include a small calculation with two rectangles so that you can see the number emerge.

A few common confusions are addressed. A high score on one box does not mean the box is tight. The ratio is not normally used as the training loss, even though it is the measure of success, because it is difficult to optimise directly. And a detection that misses the threshold is not necessarily useless, just not counted as a hit. The idea behind the ratio is worth remembering because it appears again and again in vision. Whenever two regions of an image, boxes or outlines, have to be compared, dividing what they share by what they cover together gives a fair, size-independent measure. The same ratio is used to judge whether two detections are really the same object, which is the topic of a later quiz on suppressing duplicate boxes, and it is used in the scoring of segmentation systems that outline objects pixel by pixel. Understanding it once therefore pays off in many places.

The quiz suits learners who know image classification and want to move on to detection, and practitioners who read detection papers and meet the term overlap score. There are 10 questions, each with an explanation, and it takes about four minutes.

Questions and answers

›How long does the quiz take?

About 3 to 4 minutes for 10 questions, at roughly 20 seconds each. An explanation follows every answer, with the arithmetic shown for the overlap calculation.

›Do I need to know about convolutional networks?

Only in outline. You should know that a network can take an image and produce outputs such as class probabilities. The quiz explains everything specific to bounding boxes, and the single calculation needs only multiplication and subtraction.

›What is a bounding box?

It is a rectangle that fits closely around an object in an image, used to say where the object is. It is commonly described by four numbers, the coordinates of its centre, its width and its height. The numbers can be given in pixels or as fractions of the image size, with the top left corner as the origin and the bottom right corner at the far end.

›How does a network predict a bounding box?

For an image that contains exactly one object from a fixed list of classes, the network can have one softmax output per class, plus four extra outputs with linear activation functions for the box coordinates. Because those four are continuous numbers, a sum-of-squares error is a suitable training loss for them.

›How can a network handle several objects?

One approach divides the image into a grid. For every cell, the network outputs the class and the box coordinates of any object associated with that cell, using features taken from the whole image. Other approaches, covered in later quizzes, scan windows over the image or first propose promising regions.

›What is intersection-over-union?

It is the area of the intersection of two boxes divided by the area of their union, the region covered by at least one of them. If the boxes coincide exactly, the ratio is one. If they do not overlap at all, it is zero. It gives a single number for how well a predicted box matches a ground-truth box.

›Why not just use the overlap area?

The overlap area depends on how large the object is, so the same quality of prediction would earn different scores for big and small objects. It also does not penalise a predicted box for covering a lot of space outside the true box. Dividing by the union deals with both problems at once.

›How is the ratio used?

A predicted box is typically counted as correct if its ratio with the true box exceeds a threshold, usually one half. The measure is mainly used to evaluate results. It is not generally used as the loss function for training, because it is hard to optimise by gradient descent.

More quizzes