Staple: Complementary Learners for Real-Time Tracking
Paper · 2016 · Luca Bertinetto, Jack Valmadre, Stuart Golodetz et al.
Summary
A tracker is given a rectangle around an object in the first frame of a video. Its job is to keep finding that object as it moves and changes appearance. A template can recognise the arrangement of edges and contours, which helps when the object and its surroundings have similar colours. Yet a change in shape can move those contours away from the positions the template expects. Colour offers a different clue. The distribution of colours inside an object can remain recognisable as its parts move, although changing light or a similarly coloured background can make that distribution a poor guide. Staple combines these cues to track an unfamiliar object as the video arrives.
The tracker evaluates both cues across a grid of possible positions near the last known location. A correlation filter gives each position a score based on the arrangement of local image gradients. A separate learner gives pixels scores according to how frequently their colours have occurred in the estimated object and its surroundings. It then averages those scores inside each candidate rectangle. Staple adds the resulting response maps with fixed weights and takes the position with the highest combined score. A separate template estimates scale at that position. The tracker then uses the estimated rectangle as evidence for updating both learners.
The combination is practical because each learner has a fast way to fit its weights and score many overlapping rectangles. The template uses circular shifts of a training patch and operates in the Fourier domain. The colour learner fits a separate weight for each colour bin, and a running sum across the search image makes it cheap to score a rectangle. In the configuration described, the authors’ MATLAB prototype processes about 80 frames per second. A smaller search representation takes it beyond 100 frames per second, with a small increase in failures in the authors’ efficiency experiment.
On VOT14, Staple achieved an average overlap accuracy of 0.644 and the best overall rank, 4.37, among the trackers in the comparison. Some trackers failed less often, with lower overlap accuracy. On VOT15, which the authors used to choose settings, Staple had higher overlap and fewer failures than DSST and DATs. The authors report that their tracker improved on Struck by 23% on average in relative terms on OTB-13, where Struck was the original benchmark’s strongest tracker. SRDCF scored higher than Staple on OTB and had a reported speed of 5 FPS. The authors also found that adding the dense response maps gave better results than combining the positions the two learners would have selected separately. The distinction matters because a position that receives good support from both cues can be missed when each cue supplies only its favourite.
Deep dive: Staple: Complementary Learners for Real-Time Tracking
Staple tracks objects in real time by combining a template for spatial detail with a colour histogram that tolerates changes in shape. · about 40 minutes to read
The problem and its context
Following an object from a single annotated frame
The paper studies short-term, single-object tracking. The initial rectangle tells the tracker which object to follow. From that point on, each new image poses a localisation problem. The tracker already has a recent estimate and can look nearby, taking advantage of the continuity between frames. It has to decide which candidate rectangle contains the same object when its current appearance may differ from the appearance inside the first rectangle. The short-term setting assumes that a separate procedure for finding the object again after losing it is unnecessary.
The initial rectangle gives the tracker a specific instance to follow. It also leaves uncertainty about which parts of the appearance will remain useful. Some of the pixels inside the box may belong to the background. A distinctive texture seen initially may become blurred, and a contour that distinguishes the object in one frame may move as the object deforms. Later frames offer evidence about these changes. A tracker that keeps adapting can follow a gradual change in appearance that would make a fixed first-frame template a poor description of the object.
This makes tracking an online machine learning problem with an unusual source of training labels. At the beginning, the rectangle comes from outside the tracker. Later, its own predictions generally supply the rectangles it learns from. An error in position can therefore influence the next prediction in two ways. It moves the point around which the search is centred, and it changes the image evidence that the learner treats as belonging to the target. If a slightly displaced box brings more background pixels into the estimated foreground, repeated updates can make those pixels look increasingly like part of the object. The paper calls this cumulative process drift.
The authors treat prediction quality as one means of reducing that problem. They want a tracker with enough information to localise an object through different kinds of appearance change and a learning procedure that can keep up with the input. Speed matters in the applications they describe because tracking may share computing time with other video processing, robotics or augmented reality tasks. The time spent learning from each frame is part of that cost, alongside the time spent searching the next frame.
What correlation filters made possible
One approach the paper discusses is to adapt an object detector while the video is running. Struck uses structured output learning, which lets it express the cost of estimating the wrong rectangle. This is a richer objective than classifying each candidate as object or background. A candidate box shifted slightly from the correct box and a candidate far from the object can incur different costs. The paper identifies computation as the obstacle to using this approach with many training examples and features.
A correlation filter takes a different route to the localisation problem. It learns from a patch at the target position and from versions of that patch shifted across its grid. The shifts wrap around the patch boundaries. A good filter gives a high response at the centred training position and a response that falls away as the displacement grows. All the shifts can be handled as a group because they come from the same patch. In the Fourier domain, the repeating shift structure makes the fitting problem much cheaper. A tracker can use dense training examples and an image representation with multiple feature channels while keeping learning and detection fast.
The paper traces this approach from grayscale features to multiple channels, including histograms of oriented gradients, or HOG. HOG describes the directions of local changes in image intensity. An individual cell pools gradient information within a small region, and the template preserves the grid of cells. That grid lets the tracker distinguish places with similar sets of local gradients arranged in different ways. The authors describe DSST, the VOT14 winner, as extending correlation-filter tracking with a separate template that searches over scale. They also discuss work addressing the restrictions of circular-shift training. Spatially Regularised Correlation Filters, or SRDCF, improved tracking results with a formulation that carried a higher computational cost.
The same spatial organisation that makes a template discriminative can make it brittle. The template has a weight for each part of the grid. When the object's shape changes quickly, a feature that used to be a good match at one grid location may appear at a different location. A search over translations can move the whole template to follow the object. A single translation still preserves the relative positions of the weights, so it offers limited help when different parts of the object move by different amounts.
What colour can contribute
A histogram pools information over a region. In the colour representation considered here, the learner counts pixels in discrete colour bins and discards their coordinates. Moving a pixel within the rectangle leaves its contribution to the histogram intact. This makes the representation useful when the arrangement of colours changes while the overall distribution remains fairly stable. For a tracker looking for a deforming object, the colour distribution can still favour the right neighbourhood after the original template has become a weak match.
This invariance comes with an ambiguity. If two candidate rectangles contain much the same colour distribution, a score based only on the histogram has little basis for choosing between them. The same problem can occur when the target colours are common in the background. Changes in illumination can also shift pixels between bins. The paper contrasts these weaknesses with the reported ability of correlation-filter trackers to handle challenges such as motion blur and changes in lighting. Its motivating examples illustrate the complementarity. In one case, the template provides useful evidence where colour distinguishes the target poorly. In the other, colour remains useful through rapid deformation.
The authors place this approach in a line of work that includes early colour-based trackers and DAT, the Distractor-Aware Tracker. DAT uses adaptive thresholds and explicitly suppresses nearby regions with similar colours. The paper also considers richer ways of tracking deformation. A parts-based description can represent an object whose components change their relative positions. Learning that representation during a single video is difficult when only the initial location is supplied. HoughTrack and PixelTrack instead collect votes from pixels and use the pixels supporting the winning location to estimate the object's extent. Staple keeps a rectangular output and uses pixel votes for a narrower purpose, scoring possible positions of that rectangle.
Where to combine evidence
Earlier work described in the paper attacked drift at different points in the tracking loop. TLD and PROST use additional supervision based on information such as optical flow and a conservative description of appearance. Multiple-instance learning can train on a bag of possible positives when the best location is uncertain. Self-paced tracking can alternate between estimating a trajectory and learning from frames with confident estimates. Semisupervised boosting can use a classifier from the first frame as an anchor for later labels. Co-tracking can train separate classifiers on different features and use their combined scores to find difficult negative examples.
Other approaches combine the estimates of several trackers. The paper describes methods that integrate trackers in a sampling procedure, estimate their reliability across time, or keep several earlier versions of a tracker and select a prediction according to an entropy criterion. Staple combines evidence at the level of candidate positions. Each learner supplies a score for the same candidate grid, and the peak is selected after addition. This preserves information about near misses and secondary peaks that would disappear if each learner first reduced its output to a single location.
The short-term scope also determines which earlier work provides the most direct comparison. LCT adds confidence estimation and a re-detection mechanism to a correlation-filter tracker. MUSTer keeps a separate memory of feature points for the object and background and uses matching to recover a location. The authors describe these as mechanisms built around a short-term tracker. Staple addresses the localisation and adaptation problem inside that short-term loop.
The method, step by step
From the previous rectangle to the next one
The first frame establishes the object location and supplies the first appearance evidence. In a subsequent frame, Staple starts near the position found in the preceding image. At each candidate translation, the template answers a question about spatial arrangement. It checks how well gradients in the current image match the pattern of weights learned at corresponding locations in the target patch. The colour learner answers a question about the contents of the rectangle. It checks how strongly the colours in the rectangle favour the target over its surroundings, irrespective of where an individual colour occurred inside the box.
Each calculation produces a response map. A response map is a grid whose entries are scores for candidate displacements. The maps have to refer to the same candidate locations so that adding their entries compares evidence for the same rectangle. Staple then selects the highest entry in the combined map and uses a separate search to determine the size of the rectangle. This order lets the location search benefit from colour while giving the scale estimate to the cue the authors consider better suited to it.
The chosen rectangle provides the training evidence for the next update. Staple extracts a patch at the estimated location for the template learner. It also counts colours in an object region and a background region defined relative to the estimate. Both learners retain running statistics, with a fresh contribution from the current frame and a weighted contribution from earlier frames. The evidence used for detection thus comes from frames preceding the one being searched.
How Staple tracks and learns across frames
The steps in order.
The paper's diagram follows this handoff from one frame to the next. On the template side, the training patch updates the numerator and denominator used to construct the filter. The next search patch is scored with that filter. On the colour side, the estimated object and background update the bin frequencies. The next search image is converted to pixel scores, which are pooled over candidate rectangles. The operations on either side can run separately until the scores are added. The selected rectangle then provides a common reference for another update.
The detection and learning objectives
The paper writes tracking by detection as a maximisation over candidate rectangles. A rectangle selects image evidence, and the appearance parameters learned up to the preceding frame determine how that evidence is scored.
pₜ = arg max p ∈ Sₜ f(T(xₜ, p); θₜ₋₁)
Here t is the frame index, xₜ is the current image, and Sₜ is its set of candidate rectangles. The symbol p denotes a candidate in that set, and pₜ is the chosen rectangle. The transformation T extracts the representation associated with a rectangle in an image. The function f scores that representation using θₜ₋₁, the appearance parameters available from the preceding frame. The operation arg max returns the candidate at which the score is largest.
The general learning problem uses the images and estimated rectangles available through the current frame. Regularisation adds a cost for complex parameter values. In the form used by Staple, a quadratic penalty favours smaller weights when the training evidence is weak.
θₜ = arg min θ ∈ Q {L(θ; Xₜ) + λR(θ)}
Here θₜ is the parameter estimate after frame t. The variable θ ranges over the parameter space Q. The function L is the loss on the history Xₜ, which consists of image–rectangle pairs (xᵢ, pᵢ) through frame t. The index i identifies a frame in that history. The first rectangle p₁ comes from the initial annotation. The function R penalises the parameters, and λ controls the strength of the penalty. The operation arg min returns the parameter value with the smallest regularised loss.
The authors describe the history loss as a weighted combination of contributions from individual frames.
L(θ; Xₜ) = Σᵢ₌₁ᵗ wᵢ ℓ(xᵢ, pᵢ, θ)
Here L is the accumulated loss, θ contains the appearance parameters, and Xₜ is the history through frame t. The summation visits frames i from 1 through t. The weight wᵢ controls the contribution of frame i. Its loss ℓ depends on the image xᵢ, the associated rectangle pᵢ, and the parameters θ.
A natural single-frame objective would measure the cost of the rectangle actually chosen. This would tie training directly to the localisation decision and could assign different costs to different errors.
ℓ(x, p, θ) = d(p, arg max q ∈ S f(T(x, q); θ))
Here ℓ is the single-frame loss. The image is x, p is the reference rectangle, and θ contains the parameters. The variable q ranges over the candidate set S. The function f scores the representation T(x, q) of each candidate, and arg max returns the winning q. The function d measures the cost of that choice when p is the reference rectangle.
This objective involves a discrete selection inside the loss and is non-convex. The structured learning approach discussed in the paper can optimise a bound on it, at a computational cost. Staple trains with squared response errors. For the template, those errors measure the difference between the filter response and a desired response over shifts. For the histogram, they measure the difference between a pixel's score and its region label. The two tasks have different examples because the representations require different kinds of variation to learn anything useful.
How the two scores represent a rectangle
Staple uses a linear combination of the scores. The same candidate patch is the argument of both functions, although each learner extracts its own features from it.
f(x) = γₜₘₚₗ fₜₘₚₗ(x) + γₕᵢₛₜ fₕᵢₛₜ(x)
Here x is the patch being scored, and f is its final score. The functions fₜₘₚₗ and fₕᵢₛₜ give the template and histogram scores. The coefficients γₜₘₚₗ and γₕᵢₛₜ set their relative contributions. The appearance parameters are implicit in the two score functions in this expression.
The template representation is an image with K feature channels at each point on a finite grid. With HOG, those channels contain information about local gradients. The template stores a corresponding set of weights at each point. The score adds the agreement with those weights across the grid.
fₜₘₚₗ(x; h) = Σᵤ ∈ 𝒯 h[u]ᵀ φₓ[u]
Here fₜₘₚₗ is the template score for image patch x with template h. The set 𝒯 is the finite grid of template locations, and u is a location on it. The vector φₓ[u] contains the K feature values at u, and h[u] contains the K matching template weights. The superscript ᵀ transposes the weight vector, so the product is a dot product. The sum collects those products across the grid.
A cue at one grid location can therefore contribute differently from the same cue somewhere else. During detection, shifting the template changes which part of the current feature image is compared with each set of weights. Good responses identify positions where the pattern as a whole agrees with what the tracker has learned.
The histogram learner also begins with a feature image. Its grid can differ from that of the template. An M-dimensional feature vector at a location identifies a colour bin in the implementation used by the paper.
fₕᵢₛₜ(x; β) = g(ψₓ; β)
Here fₕᵢₛₜ is the histogram score for a patch x. The feature image ψₓ represents the patch on the histogram grid, and β contains the weights for its M feature channels. The function g pools the colour information and scores it using those weights.
The pooling operation is a simple average over the feature image. With one active bin at each location, the average feature vector is the vector of relative bin frequencies.
g(ψ; β) = βᵀ ((1 / |ℋ|) Σᵤ ∈ ℋ ψ[u])
Here g is the histogram scoring function, ψ is the feature image, and β is the M-dimensional weight vector. The set ℋ is the feature grid for the patch, |ℋ| is the number of locations on it, and u ranges over those locations. The vector ψ[u] is the feature at u. The factor 1 / |ℋ| takes the average, and the superscript ᵀ makes βᵀ a row vector for the dot product.
Any permutation of the feature locations produces the same average. Each candidate can also be evaluated by giving every pixel a score first and averaging the resulting scalar field. Writing it this way exposes the efficient search procedure.
g(ψ; β) = (1 / |ℋ|) Σᵤ ∈ ℋ ζ₍ᵦ,ψ₎[u], ζ₍ᵦ,ψ₎[u] = βᵀψ[u]
Here ζ₍ᵦ,ψ₎[u] is the scalar pixel score at location u, obtained by taking the dot product of β with the feature ψ[u]. The subscript ᵦ denotes the dependence on β. The grid ℋ and its size |ℋ| specify which pixels are averaged. The function g returns that average for the candidate patch.
The feature calculations are chosen so that translation on the relevant grid can be applied before or after computing the features. This makes it possible to extract features for a search region and reuse them for overlapping candidates. On the template side, a spatial correlation across the shared feature grid gives the responses for successive translations. On the colour side, an integral image stores cumulative sums of the pixel scores. A rectangular sum can be recovered from the cumulative values at its corners. The rectangle's average then follows from its area, with no need to recount the bins for every offset.
Why the learners are fitted independently
A spatially uniform template over the histogram features would also pool the same evidence everywhere. This observation helps explain why a correlation filter trained on shifts does not automatically learn the useful colour cue. A circular shift preserves the pixel counts within the training patch. All its shifted copies would therefore give that uniform component the same response, even though the desired training response differs with displacement. To learn whether a colour belongs to the object or to the surroundings, the histogram learner needs examples whose colour frequencies differ, such as explicitly separated foreground and background regions.
The paper therefore uses independent ridge regressions. Ridge regression fits a linear score by minimising squared error with a quadratic penalty on the weights. Independence allows each learner to retain the shortcut that suits its training examples.
hₜ = arg min h {Lₜₘₚₗ(h; Xₜ) + (1 / 2) λₜₘₚₗ ‖h‖²}
Here hₜ is the template fitted through frame t, and h is a candidate template. The loss Lₜₘₚₗ measures template prediction error on the history Xₜ. The coefficient λₜₘₚₗ weights regularisation. The notation ‖h‖² is the squared norm of the template weights, and 1 / 2 is the quadratic scaling used in the objective. The minimisation chooses the template with the smallest combined cost.
βₜ = arg min β {Lₕᵢₛₜ(β; Xₜ) + (1 / 2) λₕᵢₛₜ ‖β‖²}
Here βₜ is the histogram weight vector fitted through frame t, and β is a candidate vector. The loss Lₕᵢₛₜ measures histogram prediction error from the history Xₜ. The coefficient λₕᵢₛₜ weights the penalty on the squared norm ‖β‖². The factor 1 / 2 scales that penalty, and arg min chooses the weight vector with the smallest objective.
Once fitted, the learners are combined by choosing a single merge factor. The authors expect the response magnitudes to be compatible because both training problems are oriented toward a target response of 1 and a background or off-target response of 0. The template uses a graded response across shifts, while the implemented histogram objective applies its targets at the pixel level.
γₜₘₚₗ = 1 − α, γₕᵢₛₜ = α
Here α is the merge factor chosen during validation. The coefficient γₕᵢₛₜ gives its weight to the histogram score, and γₜₘₚₗ gives the complementary weight to the template. The weights form a convex combination, so they are non-negative and sum to 1.
The weights remain fixed across the video. A learner's influence on the selected translation still depends on its current response map. An almost flat map contributes little to the choice between neighbours even if its absolute values are high. A response that varies substantially across candidate positions can change their ranking. This is the practical sense in which a cue can contribute more when it gives a clear result. The procedure does not require an additional estimate of reliability for each frame.
Learning online with fixed-size statistics
Least squares makes it possible to retain weighted statistics of the observations. To see what the tracker needs to keep, write the regularised objective as a quadratic. In the following sign convention, the vector bₜ is the feature–target term used on the right side of the normal equations.
Jₜ(θ) = (1 / 2) θᵀ(Aₜ + λI)θ − bₜᵀθ + c
Here Jₜ is the regularised objective at frame t and θ is the parameter vector. The matrix Aₜ collects weighted products of features, and bₜ collects weighted products of features and desired responses. The matrix I is the identity and λ is the regularisation strength in this quadratic form. The superscript ᵀ denotes transpose. The term c is constant with respect to θ, and 1 / 2 scales the quadratic part.
θₜ = (Aₜ + λI)⁻¹ bₜ
Here θₜ is the minimising parameter vector, Aₜ and bₜ are the accumulated statistics, and λI adds the regularisation contribution. The superscript ⁻¹ denotes the matrix inverse. The expression describes the solution through these statistics, regardless of how many frames contributed to them.
The relative influence of the previous history and the current frame is set by a learning rate. The same update pattern applies to the loss and to the statistics that determine its minimum.
L(θ; Xₜ) = (1 − η)L(θ; Xₜ₋₁) + ηℓ(xₜ, pₜ, θ)
Here L is the history loss evaluated at parameters θ. The histories Xₜ and Xₜ₋₁ end at the current and preceding frames. The single-frame term ℓ evaluates the current image xₜ and rectangle pₜ. The learning rate η gives the current frame its share of the loss. The factor 1 − η is the weight retained on the previous history.
ℓ(xₜ, pₜ, θ) = (1 / 2) θᵀAₜ⁰θ − (bₜ⁰)ᵀθ + cₜ
Here ℓ is the current frame's loss for image xₜ and rectangle pₜ, and θ is the parameter vector. The matrix Aₜ⁰ and vector bₜ⁰ are computed from that frame alone, with the same sign convention as in the accumulated objective. The superscript ⁰ marks a current-frame contribution. The superscript ᵀ denotes transpose, 1 / 2 is the quadratic factor, and cₜ is independent of θ.
Aₜ = (1 − η)Aₜ₋₁ + ηAₜ⁰
Here Aₜ is the accumulated feature matrix through frame t, Aₜ₋₁ is its value through the preceding frame, and Aₜ⁰ is the current frame's matrix. The rate η weights the new evidence and 1 − η weights the older statistic.
bₜ = (1 − η)bₜ₋₁ + ηbₜ⁰
Here bₜ is the accumulated feature–target vector, bₜ₋₁ is its previous value, and bₜ⁰ is the current frame's contribution. The learning rate η and its complement 1 − η have the same roles as in the matrix update.
The recursion changes how much influence an example retains as it ages. A small rate carries forward more of the earlier statistics, so a change in a single frame has a smaller effect. The memory required for those statistics stays fixed as the video grows. A general matrix can still be too expensive to store or solve repeatedly when the feature dimension is large. Staple's template and colour learners avoid that cost in different ways.
Fitting the template with circular shifts
For the template update, a patch centred at the estimated target position is represented by a multi-channel HOG image. Each circular shift of that image is treated as a training example. The target response is typically Gaussian over displacement, with a maximum of 1 at the origin. Thus a shift close to the origin receives a higher desired score than a large shift. Training fits the response pattern across the entire displacement grid.
ℓₜₘₚₗ(x, p, h) = ‖Σₖ₌₁ᴷ hᵏ ⋆ φᵏ − y‖²
Here ℓₜₘₚₗ is the template loss for image x, estimated rectangle p and template h. The image φ is the feature representation of the patch at p in x. The index k ranges over its K channels, and hᵏ and φᵏ are the corresponding template and image channels. The symbol ⋆ means periodic cross-correlation, so each channel produces a response over circular displacements. The array y contains the desired response at each displacement, and ‖·‖² sums the squared response errors.
Circular shifts let the computation use the discrete Fourier transform. A hat marks the transform of a signal. In this domain the training problem separates by frequency, leaving a system in the feature channels at each frequency. The needed statistics can be described in terms of correlations among the channels and between those channels and the desired response.
sⁱʲ = φʲ ⋆ φⁱ
Here sⁱʲ is the correlation signal for feature channels j and i. The superscripts identify channels of φ, and ⋆ is periodic cross-correlation over the patch grid. This statistic records how the feature channels vary together under shifts.
rⁱ = y ⋆ φⁱ
Here rⁱ is the correlation signal for channel i and the desired response. The symbol y denotes the desired array over shifts, φⁱ is channel i of the feature image, and ⋆ is periodic cross-correlation.
ŝⁱʲ = (φ̂ʲ)⁎ ⊙ φ̂ⁱ
Here ŝⁱʲ is the Fourier transform of the feature-channel correlation. The terms φ̂ʲ and φ̂ⁱ are the transforms of channels j and i. The superscript ⁎ denotes complex conjugation, and ⊙ denotes elementwise multiplication of the transformed arrays.
r̂ⁱ = (ŷ)⁎ ⊙ φ̂ⁱ
Here r̂ⁱ is the transformed feature–target statistic for channel i. The signal ŷ is the transform of the desired response y, and φ̂ⁱ is the transform of the corresponding feature channel. The superscript ⁎ denotes complex conjugation, and ⊙ is elementwise multiplication.
In the full solution, the channel correlations at a frequency form a matrix. The regularised system uses that matrix to account for relationships among the channels when fitting the weights.
ĥ[u] = (ŝ[u] + λI)⁻¹ r̂[u]
Here u indexes a frequency on the transformed grid. The vector ĥ[u] contains the fitted filter coefficients for the K channels at that frequency. The matrix ŝ[u] contains their K × K channel correlations, and r̂[u] contains the K feature–target values. The regularisation weight λ multiplies the identity matrix I. The inverse ⁻¹ represents the solution of the regularised system.
Staple adopts an approximation used in the DSST code. It collects the diagonal energy in the channel correlation matrix into a scalar and uses a shared denominator at each frequency. This avoids a separate matrix factorisation at each position in the frequency grid.
d̂[u] = tr(ŝ[u]) = Σᵢ₌₁ᴷ (φ̂ⁱ[u])⁎ φ̂ⁱ[u]
Here d̂[u] is the scalar denominator statistic before regularisation at frequency u. The trace operator tr sums the diagonal of ŝ[u]. The index i visits the K channels. Each φ̂ⁱ[u] is that channel's transformed feature value at u, and multiplication by its conjugate, marked ⁎, supplies its squared magnitude.
ĥ[u] = (1 / (d̂[u] + λ)) r̂[u]
Here ĥ[u] is the approximate vector of template coefficients at frequency u. The statistic d̂[u] is the sum of channel energies there, λ is the regularisation weight, and r̂[u] is the vector of feature–target statistics. The reciprocal with numerator 1 rescales all entries of r̂[u] by the same denominator.
As new frames arrive, the tracker updates the denominator and numerator statistics separately. This carries evidence from previous frames into the approximate solution without keeping their feature patches.
d̂ₜ = (1 − ηₜₘₚₗ)d̂ₜ₋₁ + ηₜₘₚₗd̂ₜ⁰
Here d̂ₜ is the accumulated denominator array through frame t, d̂ₜ₋₁ is the previous array, and d̂ₜ⁰ is the channel energy computed from the current patch. The template learning rate ηₜₘₚₗ weights that patch, and 1 − ηₜₘₚₗ weights the previous array.
r̂ₜ = (1 − ηₜₘₚₗ)r̂ₜ₋₁ + ηₜₘₚₗr̂ₜ⁰
Here r̂ₜ is the accumulated numerator, r̂ₜ₋₁ is its previous value, and r̂ₜ⁰ is the current patch's feature–target statistic. The index t identifies the current frame, and ηₜₘₚₗ is again the rate for the template update.
The authors apply a Hann window during training to soften the boundaries of the patch. A feature near an edge would otherwise meet features from the opposite side under wraparound shifts. Windowing attenuates those edge contributions. For a template grid with m locations and K channels, the paper gives O(Km log m) time for the update and O(Km) memory for its statistics. Here m is the number of template locations, log m is the logarithmic factor from the transform, and the big-O expressions describe how the cost grows with the grid and the channel count.
Fitting colour weights from foreground and background
The paper first considers fitting the histogram learner at the level of whole windows. In that formulation, the training set would include the correct rectangle as a positive example and other rectangles with assigned target values. Each example would constrain the score of an entire window.
ℓₕᵢₛₜ(x, p, β) = Σ₍q,y₎ ∈ W (βᵀ Σᵤ ∈ ℋ ψ₍T(x,q)₎[u] − y)²
Here ℓₕᵢₛₜ is the proposed window-level loss for image x, reference rectangle p, and histogram weight vector β. The set W contains candidate rectangle and response pairs (q, y), including (p, 1). The transformation T(x, q) selects the patch for q, and ψ₍T(x,q)₎[u] is its feature vector at location u on grid ℋ. The inner sum pools those vectors, βᵀ gives their scalar score, and the outer sum accumulates squared errors against the assigned responses y.
A window can contain contributions from many different bins, so this objective can couple the weights for different colours. The paper gives O(M²) memory and O(M³) time for the general system, with M feature channels. Separately fitting every frame at that cost would work against the speed goal. The implemented learner changes the unit of training from a window to a pixel and uses features that activate a single channel per pixel.
ψ[u] = eₖ₍ᵤ₎
Here ψ[u] is the feature vector at pixel location u. The index k(u) identifies its quantised colour bin, and eₖ₍ᵤ₎ is the unit vector with a 1 in that bin and 0 elsewhere. This is the one-hot representation. The dot product with β simply retrieves the weight for the active bin.
The per-pixel training problem then sets a target of 1 in an object region and 0 in a background region. It averages the two groups' squared errors separately, so each group's total contribution is set by its own normalisation. This gives the foreground and background frequency distributions separate roles even when the regions have different areas.
ℓₕᵢₛₜ(x, p, β) = (1 / |𝒪|) Σᵤ ∈ 𝒪 (βᵀψ[u] − 1)²
+ (1 / |ℬ|) Σᵤ ∈ ℬ (βᵀψ[u])²
Here ℓₕᵢₛₜ is the loss for the feature image ψ associated with rectangle p in image x. The region 𝒪 provides object examples and ℬ provides background examples. Their sizes |𝒪| and |ℬ| are their pixel counts. The variable u indexes pixels within each region. The product βᵀψ[u] is the predicted pixel score. Subtracting 1 in the first term measures error against the object target. In the background term the target is 0, so the loss squares the score itself.
Grouping pixels by their active bins gives the loss in terms of counts. Each group has a single weight to fit, which is the reason this version avoids a coupled system over all bins.
ℓₕᵢₛₜ(x, p, β) = Σⱼ₌₁ᴹ [(Nⱼ(𝒪) / |𝒪|)(βʲ − 1)²
+ (Nⱼ(ℬ) / |ℬ|)(βʲ)²]
Here j indexes the M bins, and βʲ is the weight for bin j. The counts Nⱼ(𝒪) and Nⱼ(ℬ) give the numbers of pixels assigned to bin j in the object and background regions. The divisors |𝒪| and |ℬ| convert those counts to proportions. The values 1 and 0 remain the desired object and background scores, respectively, with the zero implicit in the second squared term. The image x and rectangle p specify the training patch and thereby the counts in the loss.
ρʲ(A) = Nⱼ(A) / |A|, Nⱼ(A) = |{u ∈ A : k(u) = j}|
Here A stands for either training region, |A| is its pixel count, and u is a location within it. The function k(u) gives the active bin at that pixel. The count Nⱼ(A) is the size of the set of pixels in A assigned to bin j. The proportion ρʲ(A) is that count divided by the region size.
The ridge-regression solution is a separate expression for each bin. The numerator reflects the bin's frequency in the foreground. The denominator includes evidence from both regions as well as the regularisation term.
βₜʲ = ρₜʲ(𝒪) / (ρₜʲ(𝒪) + ρₜʲ(ℬ) + λ)
Here βₜʲ is the weight of bin j through frame t. The quantities ρₜʲ(𝒪) and ρₜʲ(ℬ) are its maintained proportions for the object and background. The coefficient λ is the histogram regularisation term in this expression. A bin supported by object pixels receives a larger vote when its background frequency is low. Regularisation limits the weight assigned on the strength of very little evidence.
The authors note that the same bin-weight expression has appeared in probabilistically motivated work. In Staple it comes from the squared-error problem over pixels. The inputs that are updated over time are the regional proportions. As with the template, the maintained quantities represent evidence leading to the fitted weights.
ρₜ(A) = (1 − ηₕᵢₛₜ)ρₜ₋₁(A) + ηₕᵢₛₜρₜ⁰(A), A ∈ {𝒪, ℬ}
Here A is either the object region 𝒪 or background region ℬ. The vector ρₜ(A) contains the bin proportions maintained through frame t, ρₜ₋₁(A) is its previous value, and ρₜ⁰(A) contains the proportions measured in the current training region. The histogram learning rate ηₕᵢₛₜ weights the current proportions. The factor 1 − ηₕᵢₛₜ weights the retained history. The same rule is applied separately to the foreground and background vectors.
The experimental colour representation uses quantised RGB with 32 × 32 × 32 bins. Each pixel supplies a single lookup during detection, and each candidate rectangle reuses the resulting array of pixel scores. The paper names local binary patterns as another possible discrete feature. Its suitability would depend on the feature remaining stable under the local appearance changes for which the histogram is meant to compensate. The experiments use the colour representation, with one-dimensional histograms for grayscale sequences in OTB.
Searching position and scale in sequence
The candidates vary in position and scale. They share the same aspect ratio and orientation. Staple first searches translations near the previous position and then evaluates a set of scales at the position it finds. A separate correlation filter operating along the scale dimension estimates size. Its statistics are updated in the same way as those of the translation template.
This separation follows from the behaviour of the histogram score. The average pixel vote can rise as a candidate box shrinks to include a particularly distinctive part of the object. A small region containing largely high-scoring foreground colours can receive a higher average than a box covering the whole object and some mixed boundary pixels. The authors therefore use the histogram to help choose position and rely on a multi-scale template for the size decision.
The search is local in both translation and scale. A Hann window during search, together with the bounded search region, embodies a preference for continuity from the previous estimate. The translation template is resampled to a fixed area, which controls the amount of feature data the tracker processes. The reported configuration uses a fixed area of 150² and HOG cells of size 4 × 4. The template learning rate is 0.01, the histogram learning rate is 0.04, and the merge factor is 0.3. VOT15 supplies the validation sequences for these choices.
Experiments and results
VOT14 measures overlap and failure separately
The VOT14 evaluation uses 25 sequences selected from a set of 394. The sequences cover challenges including camera motion, occlusion, lighting changes, changes in object size, and changes in motion. The protocol reports an overlap measure and a failure measure. Overlap compares the predicted box with the annotated box at each frame.
Sₜ = |rₜ ∩ r_GT| / |rₜ ∪ r_GT|
Here Sₜ is the overlap at frame t, rₜ is the predicted rectangle, and r_GT is the ground-truth rectangle in that frame. The symbol ∩ denotes intersection and ∪ denotes union. The vertical bars give the area of each region. The resulting intersection over union rewards a rectangle that covers the object closely while including little area outside the annotation.
Accuracy is the average per-frame overlap used by the benchmark. Robustness is expressed through failures, each recorded when overlap becomes zero. After a failure, the benchmark reinitialises the tracker from the ground truth five frames later. This lets a sequence contribute observations after a loss. It also makes the two measures important to read together. A tracker that frequently loses the target receives more restarts, which can help its reported overlap. A tracker that continuously reports a very large box can maintain some intersection and avoid failures while localising the object poorly.
The paper uses the VOT toolkit available at submission and compares Staple with leading entries from the VOT14 competition and newer trackers that had results for the benchmark. DSST, KCF and SAMF represent competitive correlation-filter approaches. DATs is the variant of DAT with scale estimation. The comparison also includes trackers with richer appearance descriptions, such as DMA and DGT, and the spatially regularised SRDCF. The subsequent rankings apply to the systems included in the paper's evaluation.
Mean overlap accuracy for selected trackers on VOT14
Staple achieves the highest mean overlap in the comparison.
The numbers
| System or setting | mean intersection over union |
|---|---|
| SRDCF | 0.600 |
| DATs | 0.580 |
| KCF | 0.613 |
| DSST | 0.607 |
| SAMF | 0.603 |
| PLT 13 | 0.523 |
| DMA | 0.476 |
| Staple (this paper) | 0.644 |
Staple had the highest reported accuracy and placed fourth by number of failures. The VOT14 table gives it 9.38 failures over the benchmark sequences. DMA, PLT 13 and PLT 14 had lower reported failure counts, with values of 0.72, 1.66 and 3.41, respectively. Their accuracy scores were lower. This is precisely the kind of ordering the two-part evaluation exposes. The tracker with the strongest overlap did not lead by failure count, while the trackers that led by failure count had weaker box agreement.
Overall VOT14 rank for selected trackers
Combining accuracy and robustness ranks places Staple first among the compared trackers.
The numbers
| System or setting | overall rank |
|---|---|
| DATs | 5.39 |
| PLT 13 | 5.41 |
| DGT | 5.66 |
| SRDCF | 5.99 |
| DSST | 6.59 |
| SAMF | 6.79 |
| Staple (this paper) | 4.37 |
The authors report a 7% improvement in VOT14 accuracy and a 41% improvement in failure count for Staple relative to SRDCF. Against DATs, the corresponding reported improvements are 11% in accuracy and 13% in failure count. These are comparisons with the other tracker as the reference, using two different VOT14 metrics. Staple's result is strongest when both are considered. It places ahead of the selected competition entries and the more recent comparison trackers in the overall ranking.
VOT15 shows performance on the validation sequences
The VOT15 comparison covers 60 sequences and includes DSST, the VOT14 winner, and DATs, the closest competitor in the paper's VOT14 overall ranking. Staple's VOT15 accuracy is 0.538, compared with 0.491 for DSST and 0.442 for DATs. The table also reports fewer failures for Staple than for either comparator.
Reported failures across the VOT15 sequences
Staple has the fewest failures among the trackers in this comparison.
The numbers
| System or setting | failures |
|---|---|
| DSST | 152 |
| DATs | 124 |
| Staple (this paper) | 80 |
The paper reports accuracy improvements of +22% over DATs and +10% over DSST on VOT15. Its reported improvements in robustness to failures are +35% over DATs and +47% over DSST. The raw failure counts make the direction of improvement clear, since fewer losses are better. The accuracy and robustness comparisons both favour Staple within these runs.
The authors used VOT15 to choose Staple's settings and retained those settings when reporting its performance on the same sequences. The VOT15 results therefore describe the tracker on its validation benchmark. The results on VOT14 and OTB are the comparisons that show how the selected configuration travels to other benchmark settings. The authors retain the VOT results for context and explain that the benchmark convention assumes simple hyper-parameters and does not supply a separate validation set.
OTB-13 reports success across overlap thresholds
OTB-13 also uses intersection over union. It reports whether a prediction is successful at different overlap thresholds, so it can distinguish behaviour under a permissive definition of success from behaviour that requires a close box match. At each threshold, the success rate is the share of predictions whose overlap exceeds it. The area under the resulting success curve is the final score. A tracker can thus gain credit for maintaining good overlap across a range of thresholds.
The paper reports one-pass evaluation, spatial robustness evaluation and temporal robustness evaluation. The first measures the run through a sequence from its starting point. The other two probe sensitivity to the spatial and temporal conditions at the start of tracking. The three protocols matter because Staple learns from its current estimate. A change at the beginning of a run can affect the first search and the subsequent training history.
The authors use the same code and hyper-parameters as for VOT14 and VOT15, with one-dimensional colour histograms for the grayscale sequences. They report an average relative improvement of 23% over Struck, the best tracker in the original OTB comparison. Staple also scores above more recent trackers including MEEM, DSST, TGPR and EBT. The paper separately compares it with CNN-SVM and SO-DLT, which use convolutional networks, and reports higher tracking performance at a substantially higher frame rate.
ACT is the closest comparison in runtime according to the authors, and Staple has better results across the reported OTB evaluations. Since ACT uses colour in a correlation-filter template, the authors use this comparison to argue that the gain involves more than adding colour channels. Staple uses colour statistics with a different learning procedure and combines them with a spatial score. The comparison supports the relevance of that distinction, while the direct test of fusion in the paper offers a more focused check.
SRDCF is the exception to Staple's lead on OTB. It has the stronger OTB result and a reported speed of 5 FPS. Staple ranks ahead of it on VOT14. The change of ordering is important to the paper's practical claim. Staple puts substantial tracking accuracy and robustness together with high speed. The strongest overlap or success result on every benchmark is a different target.
Runtime and reproducibility
On a computer equipped with an Intel Core i7-4790K @4, the MATLAB prototype processes roughly 80 frames per second using the standard configuration.0GHz. The paper also reports SRDCF operating below 10 FPS in its VOT14 discussion. These speeds provide context for the cost of the compared approaches and belong to their reported implementations and conditions. The paper's efficiency study varies the representation inside Staple itself, allowing a more direct comparison of its speed and robustness tradeoff.
The authors made their source code and tracking results available to support reproduction of the experiments. For newer comparison systems, they used the original authors' results where available. The collection of comparators consequently varies across evaluations. This matters when reading claims about the highest score: each claim refers to the benchmark, protocol and set of reported comparison results in question.
What the ablations show
Combining maps preserves evidence about alternative positions
The merge-factor experiment varies how much weight the histogram receives in the dense combination. Giving it more weight makes the fused map more responsive to colour differences between candidate rectangles. Giving the template more weight makes it more responsive to agreement with the learned spatial pattern. The paper reports its best accuracy around α = 0.3 and says robustness follows a similar trend. An intermediate setting performing best supports the claim that both response maps contain information useful to the final decision in the tested setting.
The experiment also compares two ways of combining the cues. In the dense approach, every candidate has a template score and a histogram score. Both scores are retained until the tracker chooses the peak. In the alternative, each response first supplies its own position estimate, and the two estimates are then interpolated. The authors find the dense approach substantially better. This is a controlled comparison of the stage at which the cues are combined.
The difference has a concrete implication for localisation. Suppose the template strongly favours one candidate and the colour map favours another, while a nearby candidate receives reasonably good evidence from both. Combining the maps can select that shared candidate. Interpolation between the two individual winners uses only their positions. The intermediate point it produces may correspond to good agreement, or it may lie where both maps give weak scores. Retaining the maps lets Staple distinguish these cases. The paper's experiment provides evidence for that choice, alongside the more general claim that template and colour evidence are complementary.
The same experiment helps interpret the fixed merge weight. A setting that works well can take advantage of different shapes in the two response maps. It still assigns the same coefficients in every frame. The measured benefit establishes that a fixed combination with compatible score magnitudes can work well in the benchmark setting. The experiment leaves open how much a separate per-frame weighting rule could improve on it.
The learning rates govern the trade-off between memory and adaptation
The learning-rate study varies the template and histogram rates and observes the number of failures. A slower update gives earlier frames more influence, which can help when the latest estimate is contaminated by a temporary disturbance or a small localisation error. A faster update lets the learner follow a sustained change in appearance more quickly. That responsiveness can also allow a mistaken estimate to change the learned appearance substantially. Separate rates let the template and histogram balance those effects independently.
The authors report that the best robustness in the learning-rate heatmap occurs around 0.01 for both rates and that accuracy follows a similar pattern. The plot distinguishes measured settings from interpolated locations between them. It therefore supports a region of relatively good behaviour, with exact comparisons tied to the settings that were run. The standard experimental configuration uses 0.01 for the template and 0.04 for the histogram. The table describes the configuration used in the main benchmark comparisons, and the heatmap describes how performance varied during a parameter study.
The learning-rate test measures the consequence of changing how much recent evidence matters. Its outcome is the resulting benchmark accuracy and failure rate. It does not assign each individual failure to a mechanism, such as a background colour entering the object region or an old outline remaining too prominent in the template. The aggregate result supports slower adaptation in the tested region without identifying a particular cause for every improvement.
Reducing the representation trades some robustness for speed
The efficiency experiment changes HOG cell size and the fixed area used to represent the patch. The paper considers HOG cell sizes of 1 × 1, 2 × 2, 4 × 4 and 8 × 8. Cell size determines the spatial granularity of the gradient representation relative to the resampled patch. Fixed area controls how large that patch is. Together they affect the number of template positions that must be transformed and scored, as well as the detail the gradient grid can preserve.
The standard settings use a fixed area of 150² and a cell size of 4 × 4. In the faster example, the authors use a fixed area of 50² with 2 × 2 cells. The prototype exceeds 100 frames per second with that setting, and the paper reports only a small increase in failures. The authors say accuracy changes in a similar way. Because the example changes both the area and cell size, it demonstrates a usable combination of settings. Its speed gain cannot be assigned to either parameter in isolation from that example.
The paper's main speed figure and the faster variant describe different points on the performance curve. The approximately 80-frame-per-second configuration is the one used for the main reported results. The faster configuration is evidence that the tracker can reduce its patch representation and retain much of its tracking performance. That flexibility matters when the tracker has to share a processing budget with other work.
What the examples and neighbouring baselines add
The motivating examples show how disagreement between the cues can arise. When colours are common in the surroundings, a colour histogram can produce similar responses for the object and its neighbours. The template can still locate the object if its gradients form a distinctive arrangement. When the object quickly changes shape, the template's spatial correspondence can weaken while the colours remain characteristic. The examples illustrate these mechanisms. They provide less evidence about their prevalence across the benchmarks than the aggregate results and parameter studies do.
The comparison with ACT adds a related check. ACT brings colour into a template learned by a correlation filter. Staple's stronger OTB results are consistent with the value of giving colour a separate, permutation-invariant representation and learning objective. ACT differs from Staple in other design choices as well, so the comparison leaves those differences entangled. The merge-factor experiment directly varies the contribution of Staple's two cues, and the dense-versus-interpolated comparison directly varies how their outputs are combined.
Limitations
Limits the authors identify
The paper addresses short-term tracking around a recent estimate. Its search is bounded near the preceding location and its learning loop assumes the object is sufficiently well localised to make the current image useful as training evidence. Long-term systems in the paper have mechanisms for recovering an object after it disappears or after the tracker loses it. Staple's contribution concerns the short-term component of that problem. The reinitialisation in VOT comes from the evaluation protocol and supplies a fresh ground-truth location.
The candidate geometry is another explicit boundary. Translation and scale vary, with aspect ratio and orientation held fixed. Shape tolerance comes from the colour score's insensitivity to the arrangement of pixels and can help the tracker maintain the right location through a deformation. The output remains a rectangle with limited geometric changes. A parts-based representation has more capacity to describe how an object's shape changes, and the authors point out that the benchmarks may give little credit for that richer representation.
Both cues retain their individual weaknesses. The authors describe templates as sensitive to changes in spatial layout and describe colour distributions as vulnerable to illumination changes or confusion with the background. Combining them helps when one cue remains useful under a change that harms the other. It leaves difficult cases in which both cues give little information about the target position. The histogram's bias towards small, colour-pure windows is an explicit example of a weakness that changes the tracker design. Staple leaves scale estimation to the separate template.
The authors use a computational approximation for the multi-channel template fit. The exact expression involves a matrix of channel correlations at each frequency. The approximation uses one scalar denominator there, which makes the update fast. The experiments establish the performance of Staple with this choice. The paper also uses circular shifts and a Hann window, retaining the fast training structure and attenuating some boundary effects.
Limits visible in the evaluation and design
The performance claims apply to the reported benchmarks and comparison systems. The VOT15 runs use the sequences on which the parameters were selected. Their numbers are informative about the validation setting and are weaker evidence of generalisation than the reuse of those choices on VOT14 and OTB. The paper also uses available published results for some comparators, so the comparisons depend on which trackers have results for the relevant protocol. The OTB result for SRDCF demonstrates that the ordering can change with the evaluation.
VOT's reset rule limits what its failure counts tell a reader about continuous operation. The protocol marks that a tracker has lost overlap and later supplies a correct rectangle. That is enough to compare short-term losses under the benchmark. It gives no recovery time for Staple after a lost target when ground truth is unavailable. Overlap success also measures box agreement. It provides little information about what happened to individual parts of a deforming object inside the box, or how accurately the tracker could represent that deformation.
The colour learner's invariance applies to rearrangements of its feature pixels. It follows that a similarly coloured distractor can be hard to distinguish by colour, and that a change in lighting can matter when it changes the assigned bins. The invariance does not imply that the observed histogram stays fixed through every deformation. The set of visible colours can change when the object turns, when part of it is occluded, or when surrounding pixels enter the estimated rectangle. The paper's complementarity claim is about the usefulness of the two kinds of evidence together under the tested conditions.
Both learners eventually take their examples from the same estimated rectangle. Separate training objectives allow the same image to contribute different evidence, but they do not provide independent supervision. A mislocalised estimate can alter the gradient patch and also alter which pixels are counted as foreground or background. The learning rates reduce how quickly a single new frame changes the stored evidence. Sustained bad estimates can still affect both learners. The ablations show how robustness responds to the rates chosen, and they leave open how the tracker would behave if its updates were gated by an additional confidence check.
The reported frame rates belong to a MATLAB prototype, a specified processor and particular patch settings. The speed study shows how Staple responds to changes in its own feature grid. Reported rates for competing implementations give an indication of their practical cost, with differences in experimental conditions left outside the comparison. A deployment with a different processor or alongside additional video processing would need its own measurement to establish the time available per frame.
What came after
The documented line of work ends with Staple. The paper traces the methods that informed its design and compares it with contemporary trackers. Subsequent trackers that adopted or extended its response fusion fall outside that account.
Cite
Cite as Luca Bertinetto, Jack Valmadre, Stuart Golodetz, Ondřej Mikšík and Philip H. S. Torr. 2016. Staple: Complementary Learners for Real-Time Tracking. IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings.
@inproceedings{bertinetto2016staple,
title = {{Staple: Complementary Learners for Real-Time Tracking}},
author = {Luca Bertinetto, Jack Valmadre, Stuart Golodetz, Ondřej Mikšík and Philip H. S. Torr},
booktitle = {IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings - IEEE Computer Society Conference on Computer Vision and Pattern Recognition/Proceedings},
year = {2016},
doi = {10.1109/cvpr.2016.156},
eprint = {1512.01355},
archivePrefix = {arXiv},
url = {https://doi.org/10.1109/cvpr.2016.156}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bertinetto-2016-staple-complementary-learners-real-time/