InfiniTAM icon indicating copy to clipboard operation
InfiniTAM copied to clipboard

[KillingFusion] how to calculate killing term gradient?

Open jinjiwu opened this issue 1 year ago • 2 comments

The method you employed to calculate the gradient of the killing term in 'SmoothingTermSharedRoutines.h' appears to differ from the approach described in the original paper. Could you please provide a more detailed explanation?

image

Thanks you very much.

jinjiwu avatar Jul 15 '23 09:07 jinjiwu

The math in the paper is "incorrect", if I understood Slavcheva's email correctly. Their implementation has the "correct" math, and so does mine. In the bottom is the math for one spatial dimension (you can extend it to the other dimensions): image

Below is the related correspondence with Mira Slavcheva on the subject, so you can judge the validity for yourself. I don't know why she to this date didn't retract her supplementary and submit the corrected math to the journal, or why she used the old math in her published dissertation.

November 19, 2017, I wrote:

he derivatives given in supplementary material in (14), (15), and (16) appear to actually be ∂L/∂x, ∂L/∂y, and ∂L/∂z respectively. The ∂E/du derivation using Euler-Lagrange equation is given in the attached PDF [contents of which are in the above image here, @jinjiwu ]. The other two members of ∂E/dΨ are derived in a similar fashion and have 5 terms each. ∂L/du and the like are zero, as you pointed out for the 1D case.

The paper by Tao et. al seems to confirm our result, i.e. the P*P(V) part in equation 7 looks exactly the same as our combined expression for ∂E/dΨ. Also, plugging this formula into the Killing regularizer gradient descent step and using exactly the same weights as you mention in the KillingFusion article produces a gradual decrease in overall energy and visually appropriate warp adjustments. I am now resolving some corner cases which seem to arise from noise in the data and, possibly, (3) below, and working on the CUDA implementation.

  1. It's still unclear to us whether and how using ∂L/∂x, ∂L/∂y, and ∂L/∂z worked for your implementation.

Here is her response from November 29, 2017:

Precisely, there are these 5 terms missing in the supplementary (I need to correct that). So now I will answer both this and question 1). The reason is that in the original derivation we did the smoothness term and the AKVF term separately. And for the AKVF term we used a technique with normal equations, which gives additionally the terms from the attached picture - which I believe are the same as what you have (disregard the factor of 2 we have, since it's a version without the (1+gamma) from the combined energy). Our implementation is with those terms, but when writing the paper we came up with the combined energy. So when putting things in the paper/ supplementary with the reformulated energy, terms went missing - thank you so much for pointing the errors out! So the answer to 1) is that we first had the implementation and then wrote the paper o.O

Here's the picture she provided with her email: image

You now know as much as I know about this specific aspect of KillingFusion.

Algomorph avatar Jul 16 '23 19:07 Algomorph

Thank you for your thorough explanation. I will need more time to fully comprehend it.

jinjiwu avatar Jul 17 '23 03:07 jinjiwu