AssafSinger94 / dino-tracker

Official Pytorch Implementation for “DINO-Tracker: Taming DINO for Self-Supervised Point Tracking in a Single Video”
MIT License
394 stars 40 forks source link

Cycle-Consistency Loss #26

Closed chichengfengxue closed 2 months ago

chichengfengxue commented 2 months ago

Thanks for your great works. image

Because $\mathbf{x}^{j}=\Pi(\mathbf{x}^{i},j)$, Will lead to $L_H(\Pi(\mathbf{x}^i,j),\mathbf{x}^j) = L_H(\Pi(\mathbf{x}^i,j),\Pi(\mathbf{x}^i,j)) = 0$?

Looking forward to your reply.

tnarek commented 2 months ago

hi @chichengfengxue, in the iteration where the cycle-consistent pair is extracted, the parameters of the model at that iteration indeed minimize the left-hand-side of the loss term. But the parameters are also affected by other loss terms, which can drive them out from the local minima for the above objective, and that is why we apply this loss for maintaining the cycle-consistent pairs throughout the training.

chichengfengxue commented 2 months ago

hi @chichengfengxue, in the iteration where the cycle-consistent pair is extracted, the parameters of the model at that iteration indeed minimize the left-hand-side of the loss term. But the parameters are also affected by other loss terms, which can drive them out from the local minima for the above objective, and that is why we apply this loss for maintaining the cycle-consistent pairs throughout the training.

First of all, thanks for your reply! I mean, since $\mathbf{x}^{j}=\Pi(\mathbf{x}^{i},j)$, so what is the significance between $\mathbf{x}^{j}$ and $\Pi(\mathbf{x}^{i},j)$ loss?

tnarek commented 2 months ago

$x^j = \Pi(x^i, j)$ at the time of the extraction of the pair. Once the weights get affected by other loss terms, you're not guaranteed that $x^j = \Pi(x^i, j)$ anymore. So if the pair is kept in the set of cycle-consistent points, the loss will be meaningful in later iterations.

chichengfengxue commented 2 months ago

xj=Π(xi,j) at the time of the extraction of the pair. Once the weights get affected by other loss terms, you're not guaranteed that xj=Π(xi,j) anymore. So if the pair is kept in the set of cycle-consistent points, the loss will be meaningful in later iterations.

But you do not seem to save the point set to the next step in the code implementation, in other words, you recompute the cyclically consistent point set at each step.

tnarek commented 2 months ago

yes, you are actually right, the implementation extracts the cycle-consistent pairs on each iteration, meaning the left-hand-size of the loss does not influence the weights. Thanks for noticing this 👍

chichengfengxue commented 2 months ago

yes, you are actually right, the implementation extracts the cycle-consistent pairs on each iteration, meaning the left-hand-size of the loss does not influence the weights. Thanks for noticing this 👍

Thank you very much for your reply! Progress together!