Paper commentary
SiamMask: A Framework for Fast Online Object Tracking and Segmentation
SiamMask tracks and segments objects in real time from a single box
- Problem Box trackers cannot outline objects well, and fast mask methods for video segmentation ran below 10 frames per second. Test-time fine-tuning made them too slow for online use.
- Method SiamMask adds a binary mask branch and mask loss to a fully-convolutional Siamese tracker. It starts from one bounding box in the first frame and then runs once per frame with no parameter updates.
- Results SiamMask runs at 55 frames per second and reaches 85.42 mAP@0.5 IoU on VOT-2016, compared to 76.20 for SiamRPN.

Figure 6 . In order to generate a bounding box from a binary mask (in yellow), we experiment with three different methods. Min-max: the axis- aligned rectangle containing the object (red); MBR: the minimum bounding rectangle (green); Opt: the rectangle obtained via the optimisation strategy proposed in VOT-2016 [2], [67] (blue).
Original paper · CC BY 4.0 · Weiming Hu, Qiang Wang, Li Zhang, Luca Bertinetto, Philip H. S. Torr · SiamMask: A Framework for Fast Online Object Tracking and Segmentation · Original paper figure · Extracted the figure area from page 6 of the original PDF.Why boxes and masks were hard to combine
Visual object tracking usually describes the target with a bounding box, which is cheap to draw but fits non-rigid shapes poorly. Such a simple annotation keeps labelling costs low and lets a user initialize the target quickly. Under complex movements and non-rigid deformations, however, the box includes background pixels in the representation.
Figure 1 shows that a rectangle often fails to represent the object, which motivated a tracker that outputs binary masks from a box initialization.
Video object segmentation avoids this problem by predicting a pixel-wise mask for the target. Producing pixel-wise masks needs more computation than a box, so VOS methods have been traditionally slow. Such methods often need several seconds per frame, and even the fastest approaches have not operated in real-time. OSMN and RGMP are two fast approaches with competitive performance, but both run at less than 10 frames per second.
Much of the VOS cost comes from test-time techniques such as fine-tuning, data augmentation and optical flow. Some videos need minutes or even hours to process, although they last only a few seconds. These techniques raise accuracy but make online operation impossible, so the gap is one of method design, not only hardware. Some recent trackers do output masks, but Yeo et al.
reach only 4 frames per second, and Yan et al. need online learning.
The authors set out to keep the offline trainability and online speed of Siamese trackers while replacing the box with a mask. They build on fully-convolutional Siamese networks trained offline on millions of video frames, and on the YouTube-VOS dataset with pixel-wise annotations. Their plan is to train one Siamese network on three tasks, so the mask refines the box-level representation.
A mask branch on a Siamese tracker
SiamMask keeps the fully-convolutional Siamese tracker and adds a third output, a binary mask for each candidate window. Figure 1 shows the intended result: the tracker starts from a box like a conventional tracker, but its output follows the object's outline more closely. The network learns three tasks at once: a similarity measure over sliding-window candidates, box regression through a Region Proposal Network, and class-agnostic binary segmentation.
Each task has its own branch that departs from a shared CNN, and the final loss sums the three outputs.

Figure 1 . Our method addresses both tasks of visual tracking and video object segmentation to achieve high practical convenience. Like conventional object trackers such as [22] (red), it relies on a simple bounding box initialization (blue) and operates online. However, SiamMask (green) is able to produce binary segmentation masks (out of which we can infer rotated bounding-boxes) that much more accurately describe the target object.
Original paper · CC BY 4.0Plain cross-correlation gives one value per position, so the authors replace it with depth-wise cross-correlation. Each candidate window then carries a 256-channel vector that describes the object inside that window. The segmentation branch hφ is two 1×1 convolutional layers, so each pixel classifier sees the entire RoW and its candidate window.
Because the mask is a function of both the search image x and the exemplar z, the exemplar acts as a guide that primes the segmentation. The branch outputs a w×h mask for each RoW, with one classifier per pixel.
The two-branch variant combines the mask loss with the similarity loss, as L2B = λ1·Lmask + λ2·Lsim. The three-branch variant adds the score and regression losses, as L3B = λ1·Lmask + λ2·Lscore + λ3·Lreg. The authors set λ1 to 32, following DeepMask, and set λ2 and λ3 to 1 without searching over them. The mask loss uses only positive RoWs, because the many negatives would unbalance it.
A weighted loss that balances positives and negatives gave worse results than using only the positives.
The segmentation labels are needed only during offline training, to compute the segmentation loss. During training, a RoW counts as positive in the three-branch variant when one anchor box has an IOU of at least 0.6 with the ground truth.
Online use and mask-to-box conversion
At test time SiamMask needs only a single bounding box in the first frame and runs once per frame. No network parameters are updated during tracking, so each frame is a single forward pass. On a single NVIDIA RTX 2080 GPU, the two-branch variant ran at 55 frames per second and the three-branch variant at 60.
Tracking benchmarks need a box, so the authors test three ways to turn a predicted mask into one. Min-max takes the axis-aligned rectangle that contains the object. MBR fits the rotated minimum bounding rectangle around the mask. Opt uses the optimisation strategy that the VOT benchmarks use for automatic box generation. The authors evaluate these alternatives in Section 6, in Table 4.
The two-branch variant takes the Min-max box of each predicted mask and uses it to crop the next search region. The three-branch variant instead uses the highest-scoring output of the box branch as the reference, because the authors found this more effective. In both variants, the output mask comes from the location with the maximum score in the classification branch.
Positive RoWs in the three-branch variant have an anchor with IOU of at least 0.6 against the ground-truth box.
Does the mask give a better box
The authors isolate box representation on VOT-2016 by sampling frames at random, so temporal effects drop out of the comparison. The three-branch variant with MBR scored 85.42 mAP@0.5 IoU, compared to 76.20 for SiamRPN and 56.42 for SiamFC. At the stricter 0.7 IoU threshold, the MBR version scored 50.86, compared to 32.47 for SiamRPN. The oracles use per-frame ground-truth information, and the MBR oracle reaches 84.07 mIoU.
That oracle gap shows the representation alone leaves room for improvement, since the fixed aspect-ratio oracle reaches 73.43 mIoU.
On the full VOT-2018 benchmark, the MBR version reached an EAO of 0.380, compared to 0.363 for the box-branch version. Opt reached an EAO of 0.387, but it runs at 5 frames per second. The authors judge that speed too slow for the small gain over MBR. So the MBR strategy keeps the real-time speed of 55 frames per second while still improving on the box branch.
On TrackingNet, SiamMask scored 72.5 AUC of success rate, compared to 56.3 for LUDT, 61.5 for USOT and 54.6 for PUL. LUDT, USOT and PUL are unsupervised methods, so they don't use the bounding-box and mask labels that SiamMask trains on. The comparison therefore reflects the gain from supervised training labels rather than the mask-to-box conversion alone.
Segmentation without fine-tuning
For video object segmentation, the authors compare SiamMask only with fast methods, because slow methods rely on fine-tuning and optical flow. SiamMask is initialised with the Min-max box extracted from the first-frame mask, and it runs with no adaptation at test time. Slow methods can take several minutes to process a short sequence, which makes online use impossible.
Without fine-tuning and with bounding-box initialisation, SiamMask reaches a mean J of 71.7 on the DAVIS-2016 validation set. That mean J is at 55 frames per second, far faster than the other methods in the comparison.
OSMN reaches a mean J of 74.0 at 8.0 frames per second, so SiamMask gives up some overlap to gain speed. SiamMask's decay in J is 3.0, compared to 9.0 for OSMN, which the authors read as robustness over long sequences. SiamMask's initialisation uses a bounding box instead of a pixel-wise mask, which gives it a simpler start than FAVOS, RGMP and OSMN.
On the YouTube-VOS validation set, SiamMask reaches a seen-class Jaccard score JS of 60.2 at 55 frames per second. That JS is compared to 60.0 for OSMN, and the overall score O is 52.8 against 51.2 for OSMN. On unseen classes, OSMN's JU of 40.6 is lower than SiamMask's 45.1. On DAVIS-2017, SiamMask scores a JM of 54.3, while OnAVOS scores 61.6.
The authors state that SiamMask doesn't have the best overall performance on these segmentation benchmarks.
Extending to several objects with a cascade
Multiple object tracking adds the need to keep each object's identity across frames, and that gets hard in crowded scenes. The authors use one SiamMask instance per target object, and a pre-trained segmentation-based detector initializes the individual tracks. SiamMask runs on the existing trajectories and produces N masks, one per track.
The IOU between each detected mask and each SiamMask mask serves as the pairwise affinity. The assignment keeps at most one match per mask on each side, and the Hungarian algorithm solves this constrained problem at every frame.
The first stage identifies a crop where the target is likely to be, and the second stage extracts an accurate pixel-wise mask. The first stage uses the box branch to find a coarse location, and the second stage refines it into a mask. Table 14 compares the two-stage SiamMask with the single-stage version, with both using HTC to initialize the tracks.
On the YouTube-VIS validation set, the two-stage version reaches an mAP of 0.381, compared to 0.366 for the single-stage version. The gain is 1.5% in mAP and 1.6% in average recall, which the authors call a modest improvement. The authors attribute the gain to the regression stage limiting the area the mask branch has to segment.
On the 2019 YouTube-VIS challenge leaderboard, the two-stage SiamMask ranked second with an mAP of 0.457. The first-place entry reached an mAP of 0.467, and the official baseline scored 0.313. Compared with that baseline, the two-stage version increases the mAP by a relative 46%. The method is simple, while the first-place approach splits the VIS task into detection, classification, segmentation and tracking.
Confusion is the weak point: when objects sit very close together, one object can take over the mask of another. The authors suggest modelling pixel relationships within a mask, for example with conditional random fields, but they note this would slow the tracker.
Limits and open questions
The most accurate box strategy, Opt, is also the slowest, so it doesn't fit the real-time setting the paper targets. Opt reaches 5 frames per second in the VOT tables, while SiamMask-MBR keeps 55 frames per second. The authors say Opt needs significant computational resources because of its slow optimisation procedure. Opt's gain over MBR is modest: EAO rises from 0.433 to 0.442 on VOT-2016, which the authors judge doesn't justify the extra cost.
Mask refinement improves contour accuracy, but it doesn't noticeably change the EAO tracking metric. The authors explain that EAO only scores rotated boxes, which are a crude approximation of the true object boundary. Their ablation separates the two-branch and three-branch variants with and without mask refinement, using the same backbone.
The three-branch variant reaches EAO 0.380 with refinement, against 0.375 without it.
The fine-tuning and online-update comparisons cover DAVIS-2016, DAVIS-2017 and YouTube-VOS only. The multiple-object cascade was evaluated on the YouTube-VIS validation set, with one tracker per object started from HTC tracks. Confusion remains open: when objects sit close together, one object can hijack the mask of another. The authors suggest conditional random fields or graph neural networks as fixes, but they note this would reduce tracking speed.
Paper info
- Authors
- Weiming Hu, Qiang Wang, Li Zhang, Luca Bertinetto, Philip H. S. Torr
- Venue
- arXiv · Preprint
- First published
- 2022-7-5
- Added
- 2026-11-6
- Updated
- 2022-7-5
- Version
- v1
- arXiv
- 2207.02088
- Category
- cs.CV
- Original paper terms
- CC BY 4.0
- What we show
- Paper info, commentary and permitted figures from the original paper
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Abstract
In this paper we introduce SiamMask, a framework to perform both visual object tracking and video object segmentation, in real-time, with the same simple method. We improve the offline training procedure of popular fully-convolutional Siamese approaches by augmenting their losses with a binary segmentation task. Once the offline training is completed, SiamMask only requires a single bounding box for initialization and can simultaneously carry out visual object tracking and segmentation at high frame-rates. Moreover, we show that it is possible to extend the framework to handle multiple object tracking and segmentation by simply re-using the multi-task model in a cascaded fashion. Experimental results show that our approach has high processing efficiency, at around 55 frames per second. It yields real-time state-of-the-art results on visual-object tracking benchmarks, while at the same time demonstrating competitive performance at a high speed for video object segmentation benchmarks.
Quote from the paper
Weiming Hu, Qiang Wang, Li Zhang, Luca Bertinetto, Philip H. S. Torr (2022). SiamMask: A Framework for Fast Online Object Tracking and Segmentation. arXiv:2207.02088v1. https://arxiv.org/abs/2207.02088v1
BibTeX
@misc{hu2022siammask,
title = {{SiamMask: A Framework for Fast Online Object Tracking and Segmentation}},
author = {Weiming Hu and Qiang Wang and Li Zhang and Luca Bertinetto and Philip H. S. Torr},
year = {2022},
eprint = {2207.02088},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2207.02088v1}
}