PruneTruong / DenseMatching

Dense matching library based on PyTorch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The maximum of the confidence is always 0.573

woquyuna opened this issue · comments

commented

Hi,I test the PDCNet and visualize the confidence map with several images.I find the maximum of the confidence is always 0.573 even the query and reference are the same.Does the confidence map mean the uncertaincy of each pixel mapping to [0,1]?
Warped_query_image_PDCNet_megadepth_test_piazza_san_marco
confidence_map

Hi, yes this is due to the parametrization of the constrained mixture of Laplacians, with sigma_1 =1. It means that the most confident will get at most alpha_1 = 1, sigma^2_1 = 1 and alpha_2 = 0.
If you replace those values in the confidence estimation P_R with R=1, it gives you P_R = 1[1-exp(-sqrt(2))]^2=0.573.
As a result, P_R cannot get higher for this mixture parametrization. If you want a confidence that is between [0, 1], you could of course normalize the results with the maximum it can get, i.e. 0.573 but I wanted the general formula to accommodate any parametrization of the mixture.

commented

Thanks for your replying. So it`s the constrain for Laplacians resulting in such predicted probability which is "not high enough".I just curious whether the uncontrained Laplacians can give higher predicted probability to the well aligned pixels.That is to say whether a more precise confidence map can be achieved without normalization for maximum.

So we bounded the smallest variance sigma^2_1 because in practice, it allows for the network to focus on getting more correspondences to such accuracy. If you constraint as for example 0 <= sigma^2_1 <= 1 instead, the negative log likelihood loss is unbounded. So the network will focus on getting very very accurate correspondences to reduce the loss, at the expense of other regions. Since in most of the case, we do not need correspondences with accuracy smaller than one pixel, we fixed sigma^2_1 =1. We have such experiment in the supplementary material of the paper, Tab. 8, where we compare a parametrization as sigma^2=1 or 0 < sigma^2_1 < 1. The later gives slightly better results on optical flow, where it is beneficial to model very small error but results in worse error on MegaDepth or for pose estimation, where more robust matches are preferable instead.
I think i only put the final model of PDC-Net here, but it would be relatively easy to train a version where the first constraint is not fixed instead.