[How to understand mAP easily and understandably]——mAP understanding

[How to understand mAP easily and understandably]——mAP understanding

Clarify the problem:

The main background is object detection. I will take the RetinaNet application background that I am learning as an example. Each box identified has N+1 scores, corresponding to N classes and 1 background. We will choose the one with the highest score as The basic definition of the final judgment: the meaning of precision and recall, preicision is what percentage of the positive samples you think is really positive, and recall is how many of the real positive samples you found.

The core of the problem:

We need a threshold for the score. Why? For example, in a bounding box, I identified a duck with the highest score, but it is only 0.1. Is it really a duck? It is likely that he is still a negative sample. So we need a threshold. If a duck is identified and the score is greater than this threshold, it is really said that it is a positive sample, otherwise it is a negative sample. So how does threshold affect precision and recall?
We still use the duck example

  • If the threshold is too high, the prediction is very strict, so we think that ducks are basically ducks, and the precision is high;
  • But because the screening is too strict, we also let go of some ducks with low scores, so the recall is low. If the threshold is too low, everything will be treated as a duck, the precision will be very low, and the recall will be high;

In this way, we have made it clear that the threshold does affect and change the duck's precision and recall, which also brings thinking. Precision is not an absolute thing, but something that changes relative to the threshold. Recall is the same , so it is used individually. Precision is not appropriate as a standard judgment. This is a trade off between precision and recall. It is not comprehensive enough to express with a set of fixed values, because we can get different (or possibly the same) precision recall values ​​according to different thresholds. If you think about it this way, for each threshold, we have a pair of (precision, recall), and we have a curve relationship between precision and recall.

With such a precision-recall curve, he measures two valuable criteria, the relationship between precision and recall. Then it is better to consider the two dynamically together, and there is the Average Precision of the duck class, that is, the area under the curve. He can fully express the overall pros and cons of precision and recall in this model.

Finally, we calculate the Average Precision of each class, and get the mean Average Precision

Guess you like

Origin blog.csdn.net/m0_45388819/article/details/111824669