of two losses: one over the estimated motion $\hat{m}$ and one over the visibility value $\hat{v}$: $$\ell_{track} = 
        \begin{cases} 
             \ell_{cls}(\hat{v}, v^{gt}) +  \mathbbm{1}[v^{gt}] \ell_{motion}(\hat{m}, m^{gt}) & \text{if } target^t\in \mathcal{P}^+ \\ \\
             \ell_{cls}(\hat{v}, 0) & \text{if } target^t\in \mathcal{N}^-\\
        \end{cases}$$ where $\mathbbm{1}$ is the indicator function ($m^{gt}$ is not defined if the target is not visibile at time $t+\delta$), $\ell_{cls}$ denotes the binary cross entropy loss, $\ell_{motion}$ denotes the commonly used smooth $\ell_1$ loss for regression, $ \mathcal{P}^+$ is the set of positive samples and $ \mathcal{N}^-$ the set of negative ones. Note how in this formulation the ground truth visibly value $v^{gt}$ operates slightly differently depending on the type of sample considered: if $target^t$ is a positive bounding box containing a person, then it indicates whether that person is ($v^{gt}=1$) or is not ($v^{gt} = 0$) visible in frame $t+\delta$; on the other hand, if $target^t$ is a negative bounding box (e.g., a false positive from the detection branch), it is always 0 and the loss encourages the network to immediately stop tracking. In this latter case we also avoid computing any motion estimation, as $m^{gt}$ is not defined for negatives.

In addition to training on ground truth people 