Target detection performance evaluation (IOU mAP)

Detecting evaluation function Intersection-over-Union (IOU)

1, the concept of
the evaluation system of target detection, there is a parameter called the IOU, simply, is the overlap of the target window generated by the model and the original mark of the window. Specifically, we can simply be understood as: the detection result DetectionResultof Ground Truththe intersection than their union, that is, the detection accuracy IOU:

I O The = G T D R G T D R IOU = \frac{GT\bigcap DR}{GT\bigcup DR}

GT = GroundTruth, DR = DetectionResult;

2, Python code to achieve

def bb_intersection_over_union(boxA, boxB):
	# determine the (x, y)-coordinates of the intersection rectangle
	xA = max(boxA[0], boxB[0])
	yA = max(boxA[1], boxB[1])
	xB = min(boxA[2], boxB[2])
	yB = min(boxA[3], boxB[3])
 
	# compute the area of intersection rectangle
	interArea = (xB - xA + 1) * (yB - yA + 1)
 
	# compute the area of both the prediction and ground-truth
	# rectangles
	boxAArea = (boxA[2] - boxA[0] + 1) * (boxA[3] - boxA[1] + 1)
	boxBArea = (boxB[2] - boxB[0] + 1) * (boxB[3] - boxB[1] + 1)
 
	# compute the intersection over union by taking the intersection
	# area and dividing it by the sum of prediction + ground-truth
	# areas - the interesection area
	iou = interArea / float(boxAArea + boxBArea - interArea)
 
	# return the intersection over union value
	return iou

mAP

First, here are a few common term evaluation model, we now assume that only two types of target classification, counted as positive examples (positive) and negative patients (negtive) are:

1、TP(True Positives)

Is the real cases, we need to calculate the IOU to determine a detection result is correct or wrong. Generally speaking, if the IOU> 0.5, we think that the test result is true cases. PASCAL VOC indicator data set used was 0.5.

2, FP (False Positives)
is the false positive cases, the same token, if the IOU <0.5, or excess detection frame is detected with a GT (meaning the real tag detected frame has two blocks or more blocks, confidence the highest one, as the TP, then the rest for FP, even if the detection frame IOU greater than 0.5). We believe that the test results were false positive cases.

3, FN (False Negatives)
is the false counter-example, by definition, could have been a real box, but not detected. The number is not detected in the GT (real frame) of

4, TN (True negatives)
is correctly classified as a negative number embodiment, i.e., negative real embodiment is classified and is divided into a number of examples of the negative cases.

5, precision (precision or accuracy rate)

p r e c i s i o n = T P T P + F P = precision = \ frac {TP} {TP + FP} = \ frac {positive actual number of samples in prediction samples {}} number of all positive samples

6, Recall (recall or recall)

r e c a l l = T P T P + F N = recall = \ frac {TP} {TP + FN} = \ frac {positive actual number of samples in prediction samples predicted sample number} {}

In general, precision and recall is the relationship between fish and bear's paw, often higher recall rate, the lower the accuracy rate

7, of

AP i.e. Average Precision i.e. average precision.
PR curve area. PR i.e. precision and recall curve as a longitudinal, horizontal axis of the two-dimensional curve.

8、mAP

Mean Average Precision AP i.e. average value, it is a set of a plurality of individual authentication AP averaged value as a measure of the object dection detection accuracy.

Summary: Overall trend, higher precision, lower recall, when the recall up to 1, corresponding to the lowest probability score of positive samples, divided by the number of positive samples all this time is greater than the number of samples equal to the threshold value is the lowest accuracy. Detecting moving objects, each of which can draw curve for PR and recall Precision, AP就是该曲线下的面积, mAP就是所有类AP的平均值.

Reference:
https://blog.csdn.net/qq_29893385/article/details/81213377
https://blog.csdn.net/fendoubasaonian/article/details/78981636

Guess you like

Origin blog.csdn.net/qq_23320955/article/details/94729750