# rStaple: A Robust Complementary Learning Method for Real-Time Object Tracking
## 4 Proposed rStaple Tracking Method
### Adaptive Model Update  
Most existing correlation filter algorithms update their models at each frame using the estimated tracking result to fit the gradual change of the target appearance. The target position in the next frame is detected by the updated model. However, when the target is occluded or out of view, even for a short time, the accumulation of errors may cause the tracking model to drift. As a result, the model is corrupted and even if the tracking target reappears, the object cannot be redetected by the tracker. [PERSON] [18] proposed a peak to sidelobe ratio (PSR) criterion to determine the confidence of the current tracking result. However, this method is not highly effective since a fixed empirical threshold is necessary to guide the selection of updating the model. In fact, the response map in object tracking can reveal the confidence of tracking to a certain extent. When the peak value is large and fluctuation of the response map is slight, the confidence of the tracking result is considered to be high. If the response map fluctuates intensely and multiple peaks are detected, it indicates that there is background clutter or target occlusion. To solve this problem, two criteria, namely the peak value of the translation filter response map \(F_{\text{max}}\) and average peak-to correlation energy (\(\mathit{APCE}\)) [44], are adopted to detect the confidence of the tracking result. Specifically, \(\mathit{APCE}\) is defined as:  
\[\mathit{APCE}=\frac{\left|F_{\text{max}}-F_{\text{min}}\right|^{2}}{\mathit{ mean}\!\left(\sum\limits_{w\
eq h}\left(F_{w,h}-F_{\text{min}}\right)^{2} \right)} \tag{20}\]  
where \(F_{\text{max}}\), \(F_{\text{min}}\), and \(F_{w,h}\) denote the maximum, minimum, and the value of the coordinate \((w,h)\) in the translation filter response map, respectively. \(\mathit{APCE}\) can effectively indicate the confidence of the response map. If the \(\mathit{APCE}\) of the response map is large, the peak value is sharp and the fluctuation is slight. Otherwise, the fluctuation is intense and the peak is moderate. In this way, the occlusion or missing state can be determined. As demonstrated in Figure 2(a), the target is not occluded in the 281\({}^{th}\) frame. It can be observed that there is only one sharp peak in the response map and the remaining area is relatively flat, wherein the \(\mathit{APCE}\) is 67.67. In Figure 2(b), the target is severely occluded in the 341\({}^{th}\) frame. As a result, there are many local peaks with relatively low values in the response map, among which the highest peak is not obvious and the \(\mathit{APCE}\) is 10.29. To summarize, the \(\mathit{APCE}\) of the response map can effectively reflect the confidence of the tracking result. Therefore, in order to improve the tracking robustness, those two criteria are introduced to determine whether to update the model. When the \(\mathit{APCE}\) and \(F_{\text{max}}\) of the translation filter response map are both greater than their historical average values with certain ratios \(\beta_{1}\), \(\beta_{2}\), the tracker updates both models of the translation filter \(F_{T}\) and scale filter \(F_{S}\). The filter model corresponds to \(\alpha\) in Equation (10), which is used to maximize the response in Equation (12) at the target position. Then the filter model \(\alpha\) would be updated as:  
\[\hat{y}_{t} =\left\{ \begin{array}{cc}(1-\eta)\hat{y}_{t-1}+\eta\hat{y}_{t},&\mathit{APCE}\geq\beta_{1}\cdot\mathit{APCE}_{avg}\&\&F_{\text{max}}^{t} \geq\beta_{2}\cdot F_{\text{max}}^{avg}\\ \hat{y}_{t-1},&\text{else}\\ \hat{k}_{t}^{xx}=\left\{\begin{array}{cc}(1-\eta)\hat{k}_{j-1}^{xx}+\eta \hat{k}_{t}^{xx},&\mathit{APCE}\geq\beta_{1}\cdot\mathit{APCE}_{avg}\&\&F_{ \text{max}}^{t}\geq\beta_{2}\cdot F_{\text{max}}^{avg}\\ \hat{k}_{t-1}^{xx},&\text{else}\\ \end{array}\right.\end{array} \right.