多目标分类的混淆矩阵
After training a machine learning classifier, the next step is to evaluate its performance using relevant metric(s). The confusion matrix is one of the evaluation metrics.
训练完机器学习分类器后,下一步就是使用相关指标评估其性能。 混淆矩阵是评估指标之一。
A confusion matrix is a table showing the performance of a classifier given some truth values/instances (supervised learning kind of).
混淆矩阵是一个表,显示在给定一些真值/实例(监督学习的情况)的情况下分类器的性能。
But calculating of confusion matrix for object detection and instance segmentation tasks is less intuitive. First, it is necessary to understand another supporting metric: Intersection over Union (IoU). A key role in calculating metrics for object detection and instance segmentation tasks is played by Intersection over Union (IoU).
但是,用于对象检测和实例分割任务的混淆矩阵的计算不太直观。 首先,有必要了解另一种支持指标:联盟交叉口(IoU)。 Intersection over Union(IoU)在计算对象检测和实例分割任务的度量标准中扮演着关键角色。
联合路口(IoU) (Intersection over Union (IoU))
IoU, also called Jaccard index, is a metric that evaluates the overlap between the ground-truth mask (gt) and the predicted mask (pd). In object detection, we can use IoU to determine if a given detection is valid or not.
IoU (也称为Jaccard索引 )是一种度量,用于评估地面真假蒙版( gt )与预测蒙版( pd )之间的重叠。 在对象检测中,我们可以使用IoU来确定给定的检测是否有效。
IoU is calculated as the area of overlap/intersection between gt and pd divided by the area of the union between the two, that is,
将IoU计算为gt和pd之间的重叠/交叉区域除以两者之间的并集区域,即
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/bd1db95a3875ad8f45b0baa3da03db94.png)
Diagrammatically, IoU is defined as shown below:
IoU的示意图如下所示:
![Image for post](https://i-blog.csdnimg.cn/blog_migrate/20049e3434ba9772e7b15478672840c1.png)
Note: IoU metric ranges from 0 and 1 with 0 signifying no overlap and 1 implying a perfect overlap between gt and pd.
注意: IoU度量值的范围是0和1,其中0表示没有重叠,而1表示gt和pd之间存在完美的重叠。
A confusion matrix is made up of 4 components, namely, True Positive (TP), True Negative (TN)