Sub topic 14
Scoring Panoptic Results with PQ, SQ, and RQ
Assume you know semantic and instance segmentation, intersection over union (IoU), and object-detection matching. Panoptic quality (PQ) evaluates one panoptic prediction that contains a class label and an instance identity for each pixel.
What PQ measures
PQ separates two questions:
- Did the model find the correct segments?
- How accurately do the predicted segments cover their matched regions?
For each class, predicted and ground-truth segments are matched one to one when their IoU is greater than 0.5. A matched pair is a true positive (TP). An unmatched prediction is a false positive (FP). An unmatched ground-truth segment is a false negative (FN).
For the matched pairs, let the IoU values be \(IoU_i\). The three metrics are:
| Metric | Formula | Meaning |
|---|---|---|
| SQ | \(\frac{\sum_i IoU_i}{TP}\) | Quality of matched masks |
| RQ | \(\frac{TP}{TP + 0.5FP + 0.5FN}\) | Recognition quality |
| PQ | \(\frac{\sum_i IoU_i}{TP + 0.5FP + 0.5FN}\) | Combined panoptic quality |
Because of these definitions:
PQ = SQ \times RQSQ measures mask accuracy after a segment has been recognized. RQ penalizes missed segments and extra segments. PQ reflects both effects.
Worked example
Suppose one class has two matched segments with IoUs of 0.8 and 0.6. There is one unmatched prediction and one missed ground-truth segment.
- \(TP=2\), \(FP=1\), \(FN=1\)
- \(SQ=(0.8+0.6)/2=0.7\)
- \(RQ=2/(2+0.5+0.5)=0.667\)
- \(PQ=1.4/(2+0.5+0.5)=0.467\)
The model recognizes some objects, but its extra and missed segments lower RQ and therefore PQ.
Practical details and common errors
Compute metrics per class, then average them according to the dataset’s protocol. Do not treat every pixel as an independent detection. PQ matches complete segments, so a large segment and a small segment each contribute one match.
Things classes, such as people and cars, usually require separate instances. Stuff classes, such as sky and road, generally have no individual instances. Dataset rules determine how stuff regions are represented and how void or ignored pixels affect matching.
Check these details before comparing scores:
- Use the evaluation script’s exact class IDs and ignored-region rules.
- Confirm that instance IDs are unique within each image.
- Do not count a low-IoU overlap as a true positive.
- Report PQ with SQ and RQ so you can distinguish poor masks from poor recognition.
Exercise
A class has TP = 3, FP = 1, FN = 2, and matched IoUs of 0.9, 0.7, and 0.5. What are SQ, RQ, and PQ?
Show answer
SQ = 0.7, RQ = 3 / (3 + 0.5 + 1) = 0.667, and PQ = 2.1 / 4.5 = 0.467.