TUC-ProAut / libRSF

A robust sensor fusion library for online localization.
https://mytuc.org/libRSF
GNU General Public License v3.0
304 stars 65 forks source link

How the DCS loss function is derived. #10

Closed bpoebiapl closed 2 years ago

bpoebiapl commented 3 years ago

According to the dynamic covariance scaling paper, DCS can be applied by scaling the residuals with the scale parameter or scaling the information matrix with its square. In the code on the g2o library, which is written by the authors (https://github.com/RainerKuemmerle/g2o/blob/master/g2o/core/robust_kernel_impl.cpp), it is implemented in the form of multiplying the square of the scale parameter with the squared error. However, the DCS loss function of libRSF has a very different form. Can you explain how this is derived?

tipf commented 3 years ago

Hi, our implementation of DCS is based on equation (5.20) on page 89 of Pratiks Agarwal's thesis: http://www2.informatik.uni-freiburg.de/~agarwal/resources/agarwal-thesis.pdf

As far as I understand, is the g2o implementation an Iteratively Reweighted Least Squares (IRLS) version of DCS while ours is a direct M-estimator. The loss function interface of ceres expects a M-estimator, so we follow this convention.

In the paper "Robust Map Optimization using Dynamic Covariance Scaling", you can also see -- e.g. in equation (2) -- that the scale "s" occurs not only in the scaled constraint, but also in the prior ||1 - s||^2. Therefore, a simple multiplication with s is usually not sufficient, unless you use the IRLS approach.

Don't hesitate to ask if this explanation was unclear. :-)

tipf commented 2 years ago

If you don't have further questions, I'm closing this.