vLAR-group/GrowSP

how to compute cost matrix in Hungarian algorithm?

Pixie8888 opened this issue · 2 comments

Hi,

Could you explain why the cost matrix is computed in this way? I have difficulty in understanding this cost matrix.
image

Hi, @Pixie412
The confusion matrix is widely used in semantic segmentation tasks.
In our case, the confusion matrix has the shape of num_classes-by-num_classes. Each element in the matrix represents the number of points that were predicted as the category corresponding to the current row, while their ground truth category corresponds to the current column. For example, the element at the i-th row and j-th column represents the number of points that were predicted as category i, while their actual ground truth category is category j.

And the cost matrix computation follows PICIE, https://github.com/janghyuncho/PiCIE/blob/09194c709fa29219d11312f5776f56492646409a/commons.py#L217
which means if the points of one predicted category are mainly overlapped with one GT category, they should be matched. The larger the element in the confusion matrix position (i, j), the smaller the matching cost between the predicted category i and the ground truth category j. This indicates that the predicted category i is more likely to match the actual category j.

regards,
zihui

Thanks!