Precision and Recall, AP, mAP in deep learning

Precision and Recall are commonly used evaluation indicators for binary classification problems. The confusion matrix is ​​as follows:

T and F stand for True and False, which are adjectives and represent whether the prediction is correct.

P and N stand for Positive and Negative, which are the prediction results.

2. Precision

Accuracy calculation formula:

 

understanding:

TP+FP: That is all Positive, which is the number of positive pictures in the predicted picture

TP: That is, the number of pictures whose positive class is also predicted to be positive

In short: the ratio of the number of correct predictions to the total number of positive predictions (from the perspective of the prediction results, how many predictions are accurate)

3. Recall

Recall rate calculation formula:

 

 

understanding:

TP+FN: That is, the number of pictures that fully satisfy the picture annotation

TP: The number of pictures whose positive class is predicted to be positive

In short: Determine the number of positive images that are predicted to be positive images in all annotated images (from the perspective of annotation, how many are recalled)

3. AP calculation
PASCAL VOC CHALLENGE has changed a new calculation method since 2010. The new calculation method assumes that there are M positive examples in these N samples, then we will get M recall values ​​(1/M, 2/M, …, M/M), for each recall value r, we can calculate Find the maximum precision corresponding to (r'> r), and then average the M precision values ​​to get the final AP value. The calculation method is as follows:​ 

The part of the corresponding Precision-Recall curve used to calculate AP is as follows (each recall node is connected with the maximum value of precision): 

Write picture description here

4.mAP

AP measures the quality of the learned model in each category, and mAP measures the quality of the learned model in all categories. After obtaining the AP, the calculation of mAP becomes very simple, which is to take all APs. average of.

 

 

Guess you like

Origin blog.csdn.net/qq_16792139/article/details/114261520