Elamur Research

YOLACT++: Better Real-time Instance Segmentation

Paper · 2019 · Daniel Bolya, Chong Zhou, Fanyi Xiao et al.

Summary

Two objects can have the same name and still need separate outlines. A system that draws a box around each person in a photograph tells us roughly where they stand. Instance segmentation goes further by identifying the pixels that belong to each person, even when their boxes overlap. The paper asks how to produce those outlines at a rate suitable for real-time processing. Earlier systems frequently waited for candidate boxes, extracted a separate set of features for each region, and then predicted masks from those features. YOLACT reorganizes the work so that most of what it needs for masks can be computed while the detector is still deciding which objects are present.

One branch builds a collection of spatial patterns, called prototypes, across the image. Another predicts a short list of weights for each candidate object alongside its class and box. To build a mask, YOLACT adds and subtracts the shared patterns according to those weights, then uses the predicted box to remove pixels outside the object’s region. A single matrix multiplication assembles the masks for the surviving detections. The patterns are learned from the finished masks and can serve objects of different categories. Some respond to objects on different sides of the image, some emphasize edges or background, and some combine several roles. These responses help distinguish nearby objects even when a box alone gives an ambiguous crop.

The paper also introduces Fast NMS, a way to remove duplicate detections using parallel operations. YOLACT++ keeps the original mask assembly and improves three other parts of the system. It gives the detector more reference box scales, allows selected convolutions to sample features at adjustable positions, and estimates mask quality so that a confident category prediction with a poor outline can receive a lower rank. On MS COCO test-dev, the ResNet-50 version of YOLACT++ achieves 34.1 mask average precision, or AP, at 33.5 frames per second on a single Titan Xp. The original YOLACT with ResNet-101 reaches 29.8 mask AP at 33.5 frames per second in the main comparison. Mask R-CNN reaches 35.7 mask AP at 8.6 frames per second in that comparison.

The results distinguish finding an object from tracing it accurately. The authors show clean contours on some large objects and report that the original YOLACT slightly exceeds Mask R-CNN at the strictest overlap threshold they discuss, even though its overall mask AP is lower. They also observe steadier masks in selected video examples despite training on still images. Crowded regions, inaccurate boxes, and stray foreground pixels remain sources of error. When the authors substitute annotated masks for the predicted ones in a diagnostic, much of the gap associated with detection remains. The paper thus explains both where the speed comes from and why better outlines alone can close only part of the overall accuracy gap.

Deep dive: YOLACT++: Better Real-time Instance Segmentation

YOLACT++ builds object masks from shared image-wide patterns and improves mask accuracy while running in real time on MS COCO. · about 34 minutes to read

The problem and its context

From locating objects to assigning pixels

An object detector answers two questions about a candidate. What kind of object is it, and where is it? A category and a bounding box can answer both at a useful level of detail. The rectangle is a compact description. It includes some background in almost any ordinary scene, and it can include part of another object. A mask answers a finer question by marking the pixels attributed to the object. A segmentation system that reports instances keeps that assignment separate for every detected object. A semantic segmentation system instead labels pixels by category. An image region containing adjacent animals of the same kind can be correctly labeled by category while still leaving their individual outlines unresolved.

The extra requirement affects the design of a fast detector. A box can be described by a small set of values predicted at a feature location. A mask is a spatial array whose neighboring entries often belong to the same object. The paper argues that convolution is a good fit for learning such patterns because the computation retains spatial relationships. The challenge is to use that property while also producing different masks for separate detections. Attaching a vector of independent mask outputs to each detection gives the system a way to emit masks, but it makes the detector responsible for reconstructing a spatially organized shape from those outputs.

The emphasis on real time makes the order of operations important. In the paper, the target is above 30 frames per second. The detector, the computations that produce masks, and the work that removes duplicates all draw on the same time budget. An operation which is a small part of a slow pipeline can be a substantial expense at the rate the authors want. The question is therefore which intermediate calculations must wait for object localization and which can be shared across the image from the start.

How earlier systems localized masks

The paper treats Mask R-CNN as the representative two-stage approach. A first stage proposes regions of interest, or RoIs, likely to contain objects. A later stage classifies and segments those regions. The process draws on the line of work represented by Faster R-CNN, which uses a region proposal network to find candidates. Once a region is known, an operation such as RoIAlign samples the appropriate part of the feature maps. The mask branch receives a region-specific representation with spatial layout preserved, which gives it a well-defined area in which to predict the outline. Faster R-CNN

That approach makes the mask calculation depend on the proposals. The mask branch needs to know where to sample, and the sampled features still require further processing. The paper describes improvements to this family that strengthen the features or address how mask confidence relates to localization accuracy. Those changes pursue valuable accuracy improvements within a pipeline that still carries the cost of processing candidate regions. Making the input smaller can reduce some of the work, while the dependence between proposal and mask computation remains.

For bounding boxes alone, SSD and the YOLO line illustrate a different schedule. A single-stage detector can predict candidates across feature maps and avoid the separate proposal-and-classification sequence. The authors describe training and design choices such as stronger augmentation and better anchor selection as ways these detectors can recover accuracy. An anchor is a reference rectangle attached to a location in a feature map. A detector adjusts it to fit an object and predicts how confidently the resulting candidate belongs to a category. Transferring this schedule to masks raises the question of where the spatial representation for each detection will come from. YOLO9000

The paper also considers approaches that already combine substantial image-wide computation with per-instance output. FCIS uses maps with position-sensitive roles and pools from them to build a mask. Other systems use semantic scores and directional cues, or perform operations such as mask voting after locating objects. A further group starts from pixel predictions and determines instances through boundaries, embeddings, or clustering. In an embedding-based approach, the network gives pixels representations that can be used to group them into individual objects. The authors regard the extra grouping or refinement steps as important to the speed comparison. They also acknowledge earlier systems that pursued real-time instance segmentation on other benchmarks, where the available accuracy and timing comparisons depend on the task and dataset. Instance Segmentation by Jointly Optimizing Spatial Embeddings and Clustering Bandwidth

What a prototype represents

The term prototype already had a history in vision. The paper describes visual vocabularies and codebooks used to represent image features, as well as work that used fixed shape primitives. YOLACT's prototypes are arrays of spatial responses computed afresh for an image. The network that computes them carries what was learned during training, while the arrays themselves change with the scene. Several detections can use the same array, including detections assigned different categories. A prototype can respond to the same kind of structure at several locations, or it can emphasize a particular part of the image.

This gives the authors a way to divide the task according to the kind of output each branch handles. A convolutional branch supplies the spatial material for the masks. An anchor-based prediction head supplies a vector that tells the system how to use that material for a particular object. The box provides a final spatial constraint. The design places much of the segmentation computation upstream of any per-object crop and makes assembly small enough to perform jointly for the remaining detections.

The method, step by step

Two branches share the same image features

Imagine two umbrellas with overlapping boxes. An image-wide feature map may respond strongly to parts of both. A second feature map might emphasize the umbrella on one side. By giving the second map a negative weight, an instance can suppress a response that would otherwise belong to its neighbor. Different weights can select a different umbrella from the same collection of maps. This is the division of work in YOLACT. The spatial branch supplies patterns that can be reused, and the detection head chooses an individual mixture for each candidate. The box then restricts the area in which the mixture will count as that candidate's mask.

The following sequence includes the score adjustment added by YOLACT++. The prototype maps and candidate predictions occupy the same pipeline step because each can be computed from image features without waiting for the other. Duplicate removal acts on the detection predictions before mask assembly, so rejected candidates need never receive a finished mask.

From image features to scored instance masks

The steps in order.

From image features to scored instance masksStep 1: Extract features at several spatial scales1. Extract features at several spatial scalesStep 2: Predict prototypes and per-anchor outputs in parallel2. Predict prototypes and per-anchor outputs in parallelStep 3: Filter candidates and suppress duplicate boxes3. Filter candidates and suppress duplicate boxesStep 4: Assemble masks from prototypes and coefficients4. Assemble masks from prototypes and coefficientsStep 5: Crop each mask with its predicted box5. Crop each mask with its predicted boxStep 6: Estimate mask overlap and adjust confidence scores6. Estimate mask overlap and adjust confidence scores

The original YOLACT conference work introduced the shared mask representation. YOLACT++ retains that representation and changes feature sampling, candidate coverage, and mask ranking. Those changes operate at different points in the sequence. Adjustable sampling changes the features both branches can use. Additional reference scales affect which detections the prediction head can supply. Mask rescoring acts after the mask has been assembled and cropped. YOLACT: Real-time Instance Segmentation

Build features and predict candidates

The usual starting point in the paper is a ResNet-101 backbone with a feature pyramid network, or FPN. The backbone transforms the image into successive spatial feature maps. The pyramid makes maps at different spatial scales available to the prediction heads. Maps with more spatial detail help describe smaller structures, while coarser maps can support predictions over larger regions. The particular arrangement also supplies the prototype branch with a relatively fine map that already contains information from deeper in the backbone. Deep Residual Learning for Image Recognition · Feature Pyramid Networks for Object Detection

The standard image size is 550 × 550. The authors resize to these dimensions without preserving each image's original aspect ratio, which gives them consistent input dimensions for timing. The pyramid omits P₂. It constructs P₆ and P₇ in succession from P₅ using 3 × 3 convolutions with stride 2. A stride specifies how far the operation moves between neighboring output positions. The base detector associates each feature position with anchors using aspect ratios of 1, 1/2, and 2. Its scale sequence across the pyramid is 24, 48, 96, 192, and 384.

Each prediction head begins with a shared 3 × 3 convolution. Its branches then each use their own 3 × 3 convolution. The outputs at an anchor include box adjustments and class confidences. YOLACT adds the weights needed to combine the prototypes. In the paper's notation, a head that would otherwise emit 4 + c values per anchor emits 4 + c + k, where 4 counts the box regressors, c counts the class confidences in this description, and k counts the prototypes and their corresponding weights. A candidate can therefore carry information about where its object is, what category it belongs to, and which spatial responses its mask needs.

The head follows the general organization of RetinaNet and is shallower in the paper's design. Training the classification branch uses softmax cross-entropy and online hard example mining. The training labels include c positive categories and 1 background label. Examples are selected at a 3:1 negative-to-positive ratio. Hard example mining concentrates the selected negative examples on cases where the classifier makes larger errors. The authors tried focal loss and report that it was unsuitable for their setup. They use the SSD convention for box regression and train the box offsets with smooth L₁ loss. Focal Loss for Dense Object Detection · Training Region-Based Object Detectors with Online Hard Example Mining

Generate prototypes and signed coefficients

The prototype network, which the authors call protonet, starts from P₃. It uses convolutions to produce a grid of responses for each prototype. The final layer has one output channel per prototype. The architecture diagram uses 3 × 3 convolutions before a final 1 × 1 convolution and illustrates an upsampling step followed by a convolution. Upsampling increases the density of the spatial grid. The branch produces maps at approximately one fourth of the input dimensions, which the authors use to preserve more detail, particularly for smaller objects. For the standard image size, they report a final mask grid of 138 × 138. Fully Convolutional Networks for Semantic Segmentation

Each prototype spans the image in the sense that its grid refers to the whole frame. Its resolution can be lower than that of the input photograph. Every pixel position on that grid has a value for each prototype. The authors use a rectified linear unit, or ReLU, at the output. It sets negative values to zero and leaves positive values unbounded. This lets a strong spatial response dominate a combination when the network has clear evidence, for example about obvious background. The paper also allows the final layer to run without an activation and chooses ReLU because its prototype visualizations are easier to interpret.

The detection head uses a different activation. It applies the hyperbolic tangent, tanh, to the mask coefficients, allowing both positive and negative weights with bounded magnitude. A positive coefficient increases the contribution of a map. A negative coefficient permits the same map to suppress pixels, and a coefficient near zero has little effect. Since each candidate receives its own vector, the same strong feature can support one mask and be canceled in another. The authors found these outputs more stable with tanh than with unrestricted coefficients.

The prototypes have no separate target that declares what each channel should depict. During training, the loss on the assembled instance masks teaches the prototype branch which spatial responses are useful and the coefficient branch how to use them. This makes a prototype a shared component of a representation. A pattern that responds to a contour in one region or to the foreground on one side of the image can be useful to several detections. The count of prototypes is a choice about the size of that representation and is independent of the number of object categories.

Remove duplicate boxes before assembling masks

An anchor detector can produce several nearby boxes for the same object. Non-maximum suppression, or NMS, uses candidate scores and overlaps to decide which boxes survive. Intersection over union, abbreviated IoU, is the area shared by two shapes divided by the area covered by either of them. For duplicate removal, those shapes are bounding boxes. Standard NMS sorts detections for a class by confidence. Each surviving candidate can remove lower-scoring candidates that overlap it too much. Which box survives can therefore depend on the outcome of an earlier decision.

Fast NMS changes the condition for suppression. Any higher-scoring candidate can suppress a lower-scoring one, even if the higher-scoring candidate will itself be discarded. To see the consequence, consider a top-ranked box that overlaps a second box strongly. Suppose that second box in turn overlaps a third box strongly, while the top-ranked box scarcely overlaps the third. Standard NMS can keep the third box after removing the second. Fast NMS can discard both. Permitting this outcome makes the decisions independent enough to compute in parallel and explains the tendency to remove extra boxes.

The implementation sorts the top n boxes in each class and computes their pairwise overlaps. The paper writes the resulting array as X, with dimensions c × n × n. Here c is the number of classes, and n is the number of candidate detections under consideration per class in this step. The following rule clears self-comparisons and the entries that would let a lower-ranked box suppress a higher-ranked one.

Xₖᵢⱼ = 0 for all k, i, j with i ≥ j

Xₖᵢⱼ represents the overlap entry between the boxes at rank positions i and j in class k. Smaller rank indices come earlier in the descending score order. The condition i ≥ j covers the diagonal and the lower triangle. The value 0 replaces each of those entries so the remaining overlaps in a column come from higher-ranked boxes.

Kₖⱼ = maxᵢ Xₖᵢⱼ

Kₖⱼ is the largest retained overlap for the box at position j in class k. The maximum runs over row index i, and Xₖᵢⱼ now refers to the entries after the triangular operation. Each column supplies the one value needed to decide the fate of its candidate.

K < t

K is the matrix of maximum overlap values, and t is the suppression threshold. The inequality is applied element by element and identifies the candidates to keep under the written rule. Batched sorting, pairwise overlap calculation, triangular masking, and the column reduction all fit the paper's use of GPU and parallel computing.

Combine the prototypes and crop the result

Once the detections have passed box suppression and score filtering, their coefficient vectors can be stacked into one matrix. The prototype maps can likewise be arranged so that each grid position has a row of prototype values. Multiplying these arrays brings together the spatial response at a given position and the weights for a given detection. In the resulting array, each entry is the summed response for one detection at one grid position. The sigmoid maps that response to a soft foreground value.

M = σ(P Cᵀ)

M is the collection of assembled soft masks. The function σ is the sigmoid, applied to each entry. P holds the prototypes with spatial height h, width w, and k channels, where k is the number of prototypes. For the multiplication, the spatial dimensions h and w are treated as a single grid-position dimension. C is the n × k matrix of coefficients, with n now denoting the detections that survived filtering and k again denoting the prototypes. The superscript ᵀ transposes C, bringing its prototype dimension next to the matching dimension of P. Juxtaposition denotes matrix multiplication.

The assembly is linear up to the sigmoid. A coefficient for one prototype applies across the whole grid for that instance. Any spatial variation in the contribution comes from the prototype itself. This gives the method a compact calculation, but it also makes the usefulness of the prototype representation important. An instance cannot independently adjust a weight at each location. It must find a combination of the spatial responses available to it. A large coefficient error can erase part of a desired mask or reveal pixels that belong to another object.

At inference, the predicted bounding box sets the mask values outside the box region to zero. The crop acts on the already assembled mask. The paper’s illustrations show this at prototype resolution with one pixel of padding in every direction. The displayed detection rectangle is drawn at the original image resolution without that padding. A small discrepancy between the visible rectangle and the edge of a displayed mask can result from this difference in how the two are produced. The crop also means that a broad prototype response can be useful even if it activates on irrelevant objects elsewhere in the frame.

Train the detector and mask branches together

Training uses category labels, bounding boxes, and instance masks. A labeled object can be matched to multiple predictions. NMS is left out of training, so each positive match can contribute box and mask supervision. Training crops the assembled mask with the ground-truth box. This gives the mask branches a region specified by the annotation while they learn to recover its pixels. The authors normalize the mask loss by the ground-truth box area to preserve the influence of small objects.

Lₘₐₛₖ = BCE(M, M₍gt₎)

Lₘₐₛₖ is the mask loss before the area normalization described above. BCE denotes pixel-wise binary cross-entropy, which measures how well a predicted foreground value agrees with a foreground or background target. M contains the assembled predictions used for training, and M₍gt₎ contains the corresponding ground-truth masks. Gradients from this comparison reach both the prototype maps and the predicted coefficients through the assembly.

L = 1 × L₍cls₎ + 1.5 × L₍box₎ + 6.125 × Lₘₐₛₖ

L denotes the combination of the three main losses. L₍cls₎ is the classification loss, L₍box₎ is the box regression loss, and Lₘₐₛₖ is the mask loss with the training normalization applied. The numeric factors are their respective weights. The multiplication sign indicates scaling of each term, and the plus signs indicate that the weighted contributions are added together. The paper describes auxiliary semantic supervision separately from these three main losses.

For that auxiliary supervision, the authors attach a 1x1 convolution with c output channels directly to P₃. Its targets are constructed from the instance annotations by marking the classes present at each pixel. A pixel can have more than one target category in this construction. The head therefore uses a separate sigmoid for each channel, allowing multiple categories to be active. Its loss has a weight of 1. The head is used during training, so the resulting pressure to learn useful features adds no forward computation to inference.

On COCO, training begins with ImageNet-pretrained weights and uses a batch size of 8 on one GPU. The authors leave the pretrained batch normalization layers unfrozen and add no further batch normalization layers. They use stochastic gradient descent for 800k iterations, starting at a learning rate of 10⁻³ and dividing it by 10 at 280k, 600k, 700k, and 750k iterations. Weight decay is 5×10⁻⁴ and momentum is 0.9. The data augmentations follow SSD. Training on a Titan Xp takes 4-6 days for COCO, depending on the configuration.

For the Pascal experiment, training runs for 120k iterations, with learning-rate changes at 60k and 100k. The authors multiply the anchor scales by 4/3 because the objects in that setting tend to be larger. They report a training time of less than 1 day on that benchmark. For the COCO input-size comparisons, they adjust the reference scales according to the input dimensions.

sₓ = s₅₅₀ / 550 × x

sₓ is an anchor scale at input size x, and s₅₅₀ is the corresponding scale for the standard 550 × 550 input. The divisor 550 is the baseline side length, and x is the side length of the square input being used. The division and multiplication preserve the anchor's scale relative to the input dimensions. The authors released the implementation of YOLACT and YOLACT++ through their official GitHub repository.

Improve sampling, candidate coverage, and ranking

YOLACT++ changes the backbone with deformable convolutions. An ordinary convolution reads features from a fixed grid around each location. A deformable convolution can adjust where it samples. The authors reason that flexible sampling can better align features to objects with different sizes, orientations, or proportions. They also argue that alignment at this stage matters especially to YOLACT because its mask branch uses the image-wide features directly. A region-based system has a later opportunity to sample features within a proposed object.

The authors first replace the 3 × 3 convolutions in the relevant ResNet blocks from C₃ through C₅ with deformable versions. They leave out modulated deformable modules to control inference cost. Applying the replacement throughout those stages in ResNet-101 requires 30 deformable layers. The configuration chosen after the interval experiments uses a deformable layer at an interval of 3 in those stages, for a total of 11 deformable layers. The intervening blocks retain ordinary convolutions. This arrangement spreads flexible sampling across different depths while containing its cost.

The anchor change addresses which candidates the detector can represent well. The paper compares giving the head more aspect ratios with giving it more scales at each pyramid level. In the aspect-ratio variant, it adds the more elongated ratios 1/3 and 3 to the original set. In the scale variant, it keeps the original ratios and supplies 3 scales per level. A finer set of sizes gives the detector more options between the sizes associated with adjacent pyramid levels. The authors select the multiple-scale variant from the measured speed and accuracy tradeoff.

Finally, YOLACT++ adds a mask quality predictor. A detector can be sure that a giraffe is present while producing an inaccurate giraffe mask. Conversely, a more accurate mask may come from a detection whose category score is lower. The rescoring branch sees the cropped, unthresholded mask. It uses 6 convolutional layers with ReLU and a final global pooling layer, which aggregates spatial responses. Its output estimates mask IoU for each category. The category predicted by the detector determines which estimate is multiplied by the corresponding classification confidence. A lower estimate reduces the rank of a detection whose original score overstated its value as an instance mask.

The branch reads only the full-image mask array, with zeros outside the box. It dispenses with the feature concatenation, region sampling, and fully connected layers used in the heavier Mask Scoring R-CNN design that inspired it. The operation changes the confidence assigned to a mask which has already been generated. Its direct effect is therefore on which detections are ranked ahead of others. The images in the paper illustrate that role with a giraffe whose mask receives a better rank under the quality-aware score.

Experiments and results

What the benchmarks measure

The authors train the COCO systems on train2017 and use val2017 for controlled comparisons. The main comparison with other instance segmentation approaches is on test-dev. They also evaluate on Pascal 2012 SBD and report COCO bounding-box detection scores separately. The COCO comparisons use individual systems without test-time augmentation. The paper reports timings from a single Titan Xp and, where it remeasures baselines, the resulting speeds can differ from those originally published for them. Microsoft COCO: Common Objects in Context

Average precision uses the confidence ordering of detections. As more detections are accepted, precision reflects how many accepted predictions are correct, and recall reflects how much of the annotated object set has been recovered. A candidate must meet the required overlap with the corresponding annotation. For mask AP, the overlap compares the foreground pixels of the masks. For box AP, it compares the rectangles. The main COCO AP figure aggregates over overlap requirements. AP₅₀ and AP₇₅ expose results at particular thresholds, and the size-specific scores report performance for small, medium, or large objects. FPS measures processing rate, while milliseconds describe the time per image in the relevant timing setup. Evaluation and benchmarks

These metrics capture different aspects of the task. A system can have good contours for detections that match while still missing some instances or classifying them incorrectly. It can also produce a usable mask that appears too low in the confidence ordering to contribute as much to AP. This is why the paper reports box scores, mask scores, and comparisons at specific overlap thresholds. The combination helps locate a change in candidate coverage, geometry, or ranking.

Instance masks on COCO test-dev

The main comparison shows what the enhanced design buys at the speed of the original system. With the standard input size and a ResNet-101 feature pyramid, YOLACT-550 reports 29.8 mask AP at 33.5 FPS. YOLACT++ with a ResNet-50 feature pyramid reports 34.1 mask AP at 33.5 FPS. The paper reports the improvement between those two configurations as 4.3 mAP. The corresponding YOLACT++ configuration with ResNet-101 reaches 34.6 mask AP and 27.3 FPS. The highest mask AP in the YOLACT family in this comparison comes from the heavier backbone, and the lighter enhanced configuration meets the paper's real-time target.

Instance segmentation systems on COCO test-dev by mask AP

The enhanced real-time configuration improves on the original YOLACT while Mask R-CNN retains a higher overall score.

Instance segmentation systems on COCO test-dev by mask APFCIS: 29.5FCIS29.5YOLACT-550 ResNet-101: 29.8YOLACT-550 ResNet-10129.8YOLACT++-550 ResNet-50 (this paper): 34.1YOLACT++-550 ResNet-50 (this paper)34.1Mask R-CNN: 35.7Mask R-CNN35.7
The numbers
System or settingmask AP
FCIS29.5
YOLACT-550 ResNet-10129.8
YOLACT++-550 ResNet-50 (this paper)34.1
Mask R-CNN35.7

Instance segmentation systems on COCO test-dev by processing rate

The enhanced ResNet-50 configuration matches the reported processing rate of the original ResNet-101 configuration.

Instance segmentation systems on COCO test-dev by processing rateFCIS: 6.6FCIS6.6Mask R-CNN: 8.6Mask R-CNN8.6YOLACT-550 ResNet-101: 33.5YOLACT-550 ResNet-10133.5YOLACT++-550 ResNet-50 (this paper): 33.5YOLACT++-550 ResNet-50 (this paper)33.5
The numbers
System or settingFPS
FCIS6.6
Mask R-CNN8.6
YOLACT-550 ResNet-10133.5
YOLACT++-550 ResNet-50 (this paper)33.5

The broader baseline table places RetinaMask at 34.7 mask AP and 6.0 FPS, PA-Net at 36.6 mask AP and 4.7 FPS, and Mask Scoring R-CNN at 38.3 mask AP and 8.6 FPS. These configurations give context for the paper's term competitive. Several alternatives obtain higher overall mask AP. Relative to Mask R-CNN, the authors report that the real-time YOLACT++ configuration is 3.9x faster and trails by 1.6 mAP on COCO test-dev. That comparison concerns the measured operating points on the selected hardware.

Keeping the backbone fixed isolates a different comparison between the original and enhanced systems. The original ResNet-50 YOLACT-550 records 28.2 mask AP and 45.0 FPS on test-dev. Its enhanced counterpart records 34.1 mask AP and 33.5 FPS, with a reported gain of 5.9 mAP. For ResNet-101 at the same input size, the authors report a gain of 4.8 mAP for the enhanced design. These same-backbone comparisons show the extra work introduced by the enhancements as well as the accuracy they recover. The comparison between the enhanced lighter backbone and the original heavier one captures a different result, namely how to spend nearly the same inference time more effectively.

The size breakdown adds nuance. On test-dev, the enhanced ResNet-50 configuration reports APₛ of 11.7, APₘ of 36.1, and APₗ of 53.6. Mask R-CNN reports 15.5, 38.1, and 52.4 on those respective measures. The enhanced configuration compares more favorably on large objects than on small or medium objects. A single aggregate score therefore understates some of the strengths and weaknesses of this particular operating point.

How mask quality appears in scores and images

For the original YOLACT-550 and Mask R-CNN, the paper reports a gap of 9.5 AP at the 50% overlap threshold and 6.6 AP at the 75% threshold on COCO test-dev. At 95% IoU, it reports 1.6 AP for the original YOLACT and 1.3 AP for Mask R-CNN. The absolute AP values at that strict threshold are low. The result supports the narrower claim that YOLACT can generate some very closely aligned masks even though it recovers fewer successful instances overall.

The visual comparison shows an arm whose contour the YOLACT mask follows more cleanly than the examples from Mask R-CNN and FCIS. The authors attribute this to the spatial resolution of the mask and to using features directly on the image grid. Region sampling can affect the alignment and detail available to a subsequent mask predictor. The comparison illustrates the proposed explanation, while the two systems also differ in their detectors and mask designs. It consequently provides evidence about the resulting masks instead of a measurement of a single cause.

Other images address whether the prototype representation can separate individuals of the same category. In the elephant example, the predicted boxes overlap, but the masks assign visibly separate silhouettes. The authors show related cases involving zebras and birds. When two boxes share an area, cropping by itself supplies no rule for deciding which animal owns each pixel in that area. These examples illustrate what the selected prototypes and their coefficients add to the box constraint.

The paper also shows the enhanced detector finding instances with more useful boxes and class confidences. In one example, the box and mask on a zebra are more precise. In another, the quality score brings the best giraffe mask to the top of the displayed ranking. These examples are worth distinguishing. The first concerns the spatial evidence and the detection used to generate the mask. The second concerns which mask the system presents with the greatest confidence.

Pascal and box-only detection

On Pascal 2012 SBD, the authors evaluate the ResNet-50 version of YOLACT-550 against FCIS and MNC. The reported region-mask AP for YOLACT is 72.3 at an overlap threshold of 50 and 56.2 at 70, with a processing rate of 47.6 FPS. FCIS reports 65.7 and 52.1 at the corresponding thresholds and runs at 9.6 FPS. MNC reports 63.5 and 41.5 and runs at 2.8 FPS. The authors retime FCIS on a Titan Xp for the comparison. They caution that Pascal and COCO processing rates are not directly comparable, since Pascal has fewer classes and the detection workload differs.

The box-only experiment uses COCO test-dev and omits the mask computation during timing. It compares YOLACT with variants of YOLOv3 matched broadly by detection performance. YOLACT-400 reaches 28.4 box AP at 55.43 FPS. YOLOv3-320 reaches 28.2 box AP at 71.17 FPS. At another operating point, YOLACT-550 with DarkNet-53 reaches 31.0 box AP at 52.99 FPS, while YOLOv3-416 reaches 31.0 box AP at 54.47 FPS. The equality of aggregate AP there coexists with differences in threshold-specific results. Their reported box AP₅₀ values are 51.1 and 55.3, respectively.

The paper also gives a comparison at higher detection accuracy. YOLACT-700 reaches 33.7 box AP at 29.61 FPS, and YOLOv3-608 reaches 33.0 box AP at 30.54 FPS. The comparison tests whether the detector underneath YOLACT can work as a stand-alone box detector when it does no mask evaluation. It is a separate workload from the test-dev mask benchmark. The authors use the box-only timings to describe the mask branch's total cost as 6 ms. They suggest that training with masks and using a pyramid account for much of their detection performance, while the proposed combination with YOLO's detector improvements remains a hypothesis.

What the ablations show

Fast suppression and shared mask assembly

The Fast NMS experiment on COCO val2017 swaps the suppression rule while keeping the broader system in place. YOLACT with standard NMS records 30.0 mask AP at 24.0 FPS, with 41.6 ms per image. With Fast NMS it records 29.9 mask AP at 33.5 FPS and 29.8 ms. The authors describe the latency reduction in their implementation as 11.8 ms. The small change in aggregate AP is consistent with the expected tradeoff from allowing boxes that will be removed to suppress other candidates.

The authors repeat the experiment inside the Mask R-CNN benchmark suite. Standard NMS gives 36.1 mask AP at 8.6 FPS on val2017. Fast NMS gives 35.8 mask AP at 9.9 FPS. The paper reports a 15.0 ms reduction relative to that suite's standard CUDA implementation. This shows the replacement can benefit a second pipeline. Its impact on the end-to-end processing rate depends on how much time the rest of that pipeline takes.

A separate comparison on val2017 accelerates alternative mask pipelines. FCIS without mask voting reaches 27.8 mask AP at 9.5 FPS. Mask R-CNN with 550 × 550 inputs reaches 32.2 mask AP at 13.5 FPS. The authors also try an fc-mask variant of their own detector, in which an anchor predicts a vector that is reshaped into a 16 × 16 mask. It reaches 20.7 mask AP at 25.7 FPS. In the same comparison, the original prototype-based YOLACT-550 reaches 29.9 mask AP at 33.5 FPS. The direct prediction variant tests the paper's alternative to sharing spatial work. Its poorer accuracy and processing rate show that directly emitting a mask at each anchor was costly in this particular implementation.

How many prototypes are useful

The prototype-count comparison uses COCO val2017 and trains the variants for 400k iterations. With 8 prototypes, it reports 26.8 mask AP at 33.0 FPS. With 32, the result is 27.7 mask AP at 32.4 FPS, and with 64 it is 27.8 at 31.7 FPS. At 256 prototypes, mask AP is 27.7 while the processing rate is 29.8 FPS. The paper chooses 32 for the balance of accuracy and speed. These scores belong to the shorter ablation schedule and should be read as a comparison of counts under that schedule.

The shape of the comparison suggests that the benefit from expanding the shared representation diminishes. In the authors' interpretation, an existing prototype can carry several useful behaviors, and the coefficient branch can invoke them when the image calls for them. Furthermore, a larger set of prototypes gives the prediction head more weights to estimate for every object. Large errors in those weights can spoil a linear combination even when the available patterns would suffice to construct a good mask. The authors observe that when they use more prototypes, some of the added maps contain similar responses with small differences near edges. They report only limited gains at the strictest overlap threshold.

What the prototype visualizations reveal

The paper uses a solid red input to show that the prototype maps contain position information. Uniform visual input still produces spatially varying responses. The authors explain that convolutional padding gives the network a cue about distance to the edge of the frame. A layer can see padding near the boundary, and successive layers can propagate its influence inward. The paper reports 511px of padding in each direction for ResNet-101 and 239px for ResNet-50 in its discussion of effective padding. It also gives a receptive field of 1027 pixels for ResNet-101. A receptive field describes the area of input capable of influencing a feature response. With a sufficiently wide field, boundary information can affect activations far from the edge.

The visualizations also show responses changing when objects move within the image. The authors describe prototypes that favor objects on one side of a soft boundary, a pattern that responds to the bottom-left parts of objects, and patterns that respond to background, boundaries, or the apparent ground. The umbrella example makes the abstract mixture concrete. A map that responds to one umbrella and its neighbor can be combined with another map that favors the neighbor. Subtracting the second response helps isolate the desired instance. These examples support an interpretation of the learned representation as carrying spatial roles as well as responses to appearance.

The authors report that medium and large objects can sometimes be localized even with cropping removed. Together with the overlapping-instance examples, this makes learned localization a plausible part of the explanation. The prototype visualizations remain examples of what appeared in the trained system. They do not measure how frequently each role is used or how much accuracy would change if padding cues were removed.

What each YOLACT++ change contributes

The anchor comparison matches settings trained for 400k iterations and evaluates them on COCO val2017. The base head reports 27.7 mask AP, 29.8 box AP, and 32.4 FPS. With 5 aspect ratios it reaches 28.0 mask AP and 30.1 box AP at 33.2 FPS. With 3 scales per pyramid level it reaches 30.2 mask AP and 32.5 box AP at 31.2 FPS. In this setup, adding scale coverage provides the stronger accuracy improvement. The result is specific to these configurations, and the accompanying change in box AP supports the authors' explanation that the candidate detector contributes to the gain in mask AP.

The deformable-convolution comparison holds the ResNet-101 backbone and the multi-scale anchor choice fixed on val2017. Without deformable convolutions, the system reaches 31.7 mask AP at 30.8 FPS. Applying them throughout the selected stages yields 33.5 mask AP at 24.7 FPS. The interval of 3 yields 33.3 mask AP at 28.3 FPS, with the latency overhead reduced from 8 ms to 2.8 ms according to the paper. At an interval of 4, it achieves 33.0 mask AP at 29.2 FPS. The variants that put deformable convolutions in the last 10 or last 13 layers both report 33.0 mask AP, at 29.0 and 28.0 FPS respectively. The chosen interval provides the highest reported mask AP among the reduced-cost configurations.

The cumulative val2017 comparisons show how those gains combine with rescoring. Starting with ResNet-101, mask AP moves from 29.9 for the original system to 31.7 with the additional anchors, 33.3 after interval deformable convolutions, and 34.4 after rescoring. The corresponding processing rates are 33.5, 30.8, 28.3, and 27.3 FPS. With ResNet-50, the sequence gives 28.5, 29.9, 32.7, and 33.7 mask AP, at 45.0, 40.2, 34.7, and 33.5 FPS. These are cumulative measurements. In particular, the rescoring increment is measured on the masks produced by the preceding improvements.

The rescoring architecture has its own latency comparison. In the reported ResNet-101 setup, the fast branch adds 1.2 ms and changes the rate from 34.4 to 33 FPS. Incorporating the Mask Scoring R-CNN module into YOLACT would add 28 ms at that starting point and lower the rate to 17.5 FPS. The authors explain that the heavier branch needs region features that YOLACT does not already compute. The comparison measures the cost of putting each approach inside YOLACT. Mask R-CNN already has region features it can reuse.

The auxiliary semantic loss provides a different kind of gain. The paper reports a +0.4 mAP boost from the training-only head and attributes it to richer feature supervision. The discussion gives the gain without a separately labeled dataset split for that particular number. Since the head is omitted at evaluation, it does not have the inference cost of the detection and rescoring changes.

Where processing time goes

The authors also measure stages in isolation by disabling asynchronous GPU execution. That makes it easier to ascribe elapsed time to the feature backbone, the pyramid, prototype generation, the prediction heads, duplicate removal, postprocessing, and mask rescoring. The result is a timing diagnostic instead of a second measurement of ordinary throughput. The authors report that sequential execution is 3 times slower than normal in this comparison.

Under the diagnostic setup, the YOLACT++ ResNet-50 backbone accounts for 44.07 ms out of a total of 84.15 ms, or 52.37%. Protonet accounts for 4.58 ms and mask rescoring for 2.72 ms in that run. Those measurements show that feature extraction is a substantial part of the serialized workload. They also show why the serialized stage times should be interpreted together with the timing method. The rescoring overhead measured in the ordinary comparison answers a different question from the cost assigned to the stage when launches are forced to wait.

How much accuracy is left in the mask branch

The authors use annotated masks as a diagnostic to estimate how much mask AP is lost to the generated masks themselves. For YOLACT++ with ResNet-50 on the evaluation data, replacing the predicted masks with ground-truth masks raises mask AP from 33.7 to 35.1, with box AP of 34.9 for the underlying detector. The detection outputs retain the consequences of missed candidates, class errors, and other detector decisions. The limited increase leads the authors to place much of the remaining difference from Mask R-CNN in the detector. They also cite Mask R-CNN scores of 35.7 mask AP and 38.2 box AP in their discussion of the gap between the tasks.

A second diagnostic asks whether the coefficient head leaves better combinations of the existing prototypes unused. The researchers freeze the rest of an already trained YOLACT++ ResNet-50 system and fit only the coefficient branch on the evaluation data. Mask AP changes from 33.7 to 33.9 in that setting. The small change suggests that, given the fixed prototypes and the arrangement of the detector, the existing coefficient predictor already extracts much of the available performance. The authors see improved prototypes as a more promising route to shrinking the gap between box and mask AP. Fitting on the evaluation examples makes the result a diagnostic about the fixed representation, with no held-out improvement established by that procedure.

Limitations

Limits the authors identify

Crowds expose a weakness in sharing image-wide maps. If too many instances occupy the same part of the image, the available prototypes may respond to the group without isolating each object. The authors show a blue truck beneath a red airplane whose mask has this problem. A detector can indicate that an object exists while the combined mask looks more like foreground from the general area. YOLACT++ addresses some of these cases through improved anchor coverage and more flexible sampling. The examples demonstrate a partial improvement, and the authors still identify localization failure as a characteristic error.

Leakage comes from the interaction between the predicted box and a prototype mixture that was learned with cropping. The mixture can leave strong responses outside the area where the expected crop will fall. With a good crop, those responses are removed. An overly large or shifted box can retain them. The paper shows a skiing scene where foreground from other instances enters a mask because the relevant box includes it. The problem can therefore occur for distant instances as well as dense groups. A quality score can move a leaky mask down the ranking. Its pixels remain the output of the original assembly and crop.

The authors identify misclassification and box misalignment as important sources of remaining error. Substituting annotated masks supports this diagnosis under the conditions of their experiment. The detector still determines which objects have any candidate at all, how they are labeled, and how they are scored. A successful mask branch can sharpen a detection that exists. A missed object remains outside that branch's reach. This constraint helps explain why strong results on some large-object contours coexist with an overall gap to the most accurate methods in the comparison.

Fast NMS also has a direct tradeoff. Since a discarded candidate can suppress a lower-scoring candidate, the procedure can remove a box that sequential suppression would keep. The aggregate val2017 change is small in the reported implementations. The paper's rule nonetheless specifies exactly how another detection can disappear, and the reported average gives no breakdown of how often that happens for particular scene layouts or classes.

What the evaluation establishes

The real-time claim is tied to particular hardware and configurations. The paper reports the main COCO results on one Titan Xp and describes the original YOLACT's memory use as roughly 1500 MB of VRAM even with ResNet-101. The authors view this as encouraging for embedded deployment. The reported speed and memory measurements establish the behavior of their tested setup. They do not establish processing rate on an embedded device or under a different execution environment. The contrast between the normal and serialized GPU timings makes the dependence on execution conditions especially visible.

A fixed square input also shapes the evaluation. The authors report that preserving aspect ratio did not help on the nearly square COCO images in their setup, and fixed dimensions make evaluation time more consistent. That observation is tied to the images and resize policy they tested. Similarly, the results on small, medium, and large objects describe the benchmark's size groupings. The paper's comparison of input sizes shows that spatial resolution matters, while its specific speed and accuracy choices apply to the tested resolutions and data.

The temporal result is qualitative. The authors observe that YOLACT masks jitter less than those of Mask R-CNN in their video examples even though training uses static images and inference applies no temporal smoothing. They suggest that prototype generation is less directly affected by a change in a predicted box than a mask branch whose input features have been resampled using the region. This is a plausible explanation for the observed behavior. The prototype maps are recomputed for each frame, and a changing crop can still affect the final mask. The paper reports no video benchmark score that would establish the average size of the effect across motion or scene conditions.

The strict-overlap result and visual comparisons support a claim about the quality of some masks, especially those for large objects. They leave the causal role of regional resampling less certain. YOLACT and Mask R-CNN also differ in features, detection design, mask resolution, and assembly. Similarly, the prototype figures illustrate that padding and position-sensitive responses can coexist in the learned representation. A comparison that controls the padding policy while measuring segmentation would be needed to quantify that mechanism's contribution.

Finally, the diagnostics test particular interventions. Ground-truth mask substitution answers what happens when outlines are repaired for the existing detector outputs. The coefficient experiment answers what additional fitting can recover with the prototypes and the rest of the pipeline frozen. The cumulative YOLACT++ experiment measures components as they are added in the reported order. Their results support the authors' interpretation of the tested system while leaving open how a different detector, training schedule, or ordering of changes would affect the same tradeoffs.

What came after

The documented continuation of the original YOLACT work is YOLACT++ itself. The extension retains shared prototypes and per-instance coefficients, then improves the features used to build masks, the coverage of the detector, and the confidence ordering of its outputs. Those additions show how the authors developed the original idea while keeping its fast assembly procedure. Subsequent work building on YOLACT++ is outside the record considered here.

Cite

Cite as Daniel Bolya, Chong Zhou, Fanyi Xiao and Yong Jae Lee. 2019. YOLACT++: Better Real-time Instance Segmentation. arXiv:1912.06218.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1109/tpami.2020.3014297 · arXiv 1912.06218

@misc{bolya2019yolact,
  title = {{YOLACT++: Better Real-time Instance Segmentation}},
  author = {Daniel Bolya, Chong Zhou, Fanyi Xiao and Yong Jae Lee},
  year = {2019},
  doi = {10.1109/tpami.2020.3014297},
  eprint = {1912.06218},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1109/tpami.2020.3014297}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/bolya-2019-yolact-better-real-time-instance/