FASA: Feature Augmentation and Sampling Adaptation for Long-Tailed Instance Segmentation

Recent methods for long-tailed instance segmentation still struggle on rare object classes with few training data. We propose a simple yet effective method, Feature Augmentation and Sampling Adaptation (FASA), that addresses the data scarcity issue by augmenting the feature space especially for rare classes. Both the Feature Augmentation (FA) and feature sampling components are adaptive to the actual training status -- FA is informed by the feature mean and variance of observed real samples from past iterations, and we sample the generated virtual features in a loss-adapted manner to avoid over-fitting. FASA does not require any elaborate loss design, and removes the need for inter-class transfer learning that often involves large cost and manually-defined head/tail class groups. We show FASA is a fast, generic method that can be easily plugged into standard or long-tailed segmentation frameworks, with consistent performance gains and little added cost. FASA is also applicable to other tasks like long-tailed classification with state-of-the-art performance.


Introduction
A growing number of methods are proposed to learn from long-tailed data in vision tasks like face recognition [19], image classification [31] and instance segmentation [15]. We focus on the problem of long-tailed instance segmentation, which is particularly challenging due to the class imbalance issue. State-of-the-art methods [2,5,16,27] often fail to handle this issue and witness a large performance drop on rare object classes. Fig. 1 exemplifies the struggle of the competitive Mask R-CNN [16] baseline on highly imbalanced LVIS v1.0 dataset [15]. We can see that there are about 300 rare classes in the tail that have no more than 10 2 positive object instances. Such scarce training data result in poor performance for most of the tail classes, with 1 GitHub: https://github.com/yuhangzang/FASA. 2 Project page: https://www.mmlab-ntu.com/project/fasa/index.html. near-zero class probabilities predicted for them.
To address the data scarcity issue, one intuitive option is to over-sample images that contain the tail-class objects [15]. But the downside is that the over-sampled images will include more head-class objects at the same time due to the class co-occurrence within images. Hence for the instance segmentation task, re-sampling at the instance level is more desirable than at image level. Another option is data augmentation for considered objects, either in image space (e.g., random flipping) or in feature space (i.e., feature augmentation, on object regional features). Along this line, many methods have proven effective by augmenting the image/feature space of rare classes. The feature augmentation methods already show benefits for face recognition [48,28], person Re-ID [28] and classification [22,8]. However, these methods require manual design of class groups, e.g., using heuristics like class size. And they often involve two stages of feature training and feature transfer, which induce additional cost.
Feature augmentation remains little explored for longtailed instance segmentation tasks. In this paper, we present an efficient and effective method, called Feature Augmentation and Sampling Adaptation (FASA). FASA does not require any elaborate transfer learning or loss design [25,37,45]. As a result, FASA keeps its simplicity, has extremely low complexity, while remains highly adaptive during training. In the proposed method, we perform online Feature Augmentation (FA) for each class. The FA module generates class-wise virtual features using a distributional prior with its statistics calculated from previously observed real samples. This allows FA to capture class distributions and adapts to evolving feature space.
The augmented features can still be limiting for rare classes. This is because the observed feature variance is often small with few training examples. To overcome this problem, we adapt the sampling density of virtual features for each class. This way, our synthesized virtual features still live in the true feature manifold, just with different sampling probabilities to avoid under-fitting or over-fitting. We propose an adaptive sampling method here: when aug- mented features improve the corresponding class performance in validation loss, the feature sampling probabilities get increased, otherwise decreased. Such a loss-optimized sampling method is effective to re-balance the model predicting performance, see Fig 1(b). It is noteworthy that our full FASA approach handles virtual features only, thus it can serve as a plug-and-play module applicable to existing methods that learn real data with any re-sampling schemes or loss functions (standard or tailored for class imbalance). Comprehensive experiments of instance segmentation on LVIS v1.0 [15] and COCO-LT [42] datasets demonstrate FASA as a generic component that can provide consistent improvement to other methods. Take LVIS dataset as an example. FASA improves Mask R-CNN [16] by 9.0% and 3.3% in mask AP metrics for rare and overall classes respectively, and improves a contemporary loss design [37] by 10.3% and 2.3%. Moreover, these gains come at the cost of merely a ∼ 3% increase in training time, see Fig. 1(c). Furthermore, FASA can generalize beyond the instance segmentation task, achieving state-ofthe-art performance on long-tailed image classification as well.
To summarize, the main contributions of this work is a fast and effective feature augmentation and sampling approach for long-tailed instance segmentation. The proposed FASA can be combined with existing methods in a plug-and-play manner. It achieves consistent gains and surpasses more sophisticatedly designed state-of-the-art methods. FASA also generalizes well to other long-tailed tasks.

Related Work
Long-tailed classification. For the long-tailed classification task, there is a rich body of widely used methods including data re-sampling [4] and re-weighting [3,9]. Recent works [21,52] reveal the effectiveness of using different sampling schemes in decoupled training stages.
Instance-balanced sampling is found useful for the first feature learning stage, which is followed by a classifier finetuning stage with class-balanced sampling. Long-tailed instance segmentation. To handle class imbalance in instance segmentation task, recent methods still heavily rely on the ideas of data re-sampling [15,34,18,45], re-weighting [37,33,36,41,54,43,51] and decoupled training [25,42]. For re-sampling, class-balanced sampling [34] and Repeat Factor Sampling (RFS) [15] are conducted at the image level. However, image-level re-sampling sometimes worsens the imbalance at instance level due to the instance co-occurrence within images. The methods of data-balanced replay [18] and NMS resampling [45] belong to the category of instance-level resampling. For the re-weighting scheme, Equalization loss v1 [37] and v2 [36] are such representative methods that re-weigh the sigmoid loss. More recent works [25,45] attempt to divide imbalanced classes into relatively balanced class groups for robust learning. However, the class grouping process relies on static heuristics like class size or semantics which is not optimal. Tang et al. [38] studied the sample co-existence effect in the long-tailed setting and proposed de-confounded training. Seesaw Loss [41] dynamically rebalances the gradients of positive and negative samples, especially for rare categories. Surprisingly, data augmentation as a simple technique, has been barely studied for long-tailed instance segmentation. In this paper, we show that competitive results can be obtained from smart data augmentation and re-sampling in the feature space, while being intuitively simple and computationally efficient. Also our approach is orthogonal to prior works, and can be easily combined with them to achieve consistent improvements. Data augmentation. To avoid over-fitting and improve generalization, data augmentation is often used during network training. In the context of long-tailed recognition, data augmentation can also be used to supplement effective training data of under-represented rare classes, which helps to re-balance the performance across imbalanced classes.
There are two main categories of data augmentation methods: augmentation in the image space and feature space (i.e., feature augmentation). Commonly used imagelevel augmentation methods include random image flipping, scaling, rotating and cropping. A number of advanced methods have also been proposed, such as Mixup [50] and Cutmix [49]. For our considered instance segmentation task, the copy-and-paste technique such as InstaBoost [13] and Ghiasi et al. [14] and prove effective. More recent works try to synthesize novel images using GAN [30] or semi-supervised learning method [46]. Compared to the well established image-level data augmentation technique in deep learning, feature augmentation has not yet received enough attention. On the other hand, Feature Augmentation (FA) directly manipulates the feature space, hence it can reshape the decision boundary for rare classes. Classic FA is built on SMOTE [4]-typed methods that interpolate neighboring feature points. More recently, researchers propose to Manifold Mixup [39] or MoEx [23] for better performance. ISDA [44] augments data samples by translating CNN features along the semantically meaningful directions. Such methods are often not directly applied for imbalanced class discrimination and suffer from high complexity.
Some recent works have shown that feature augmentation benefits long-tail tasks such as face recognition [48], person Re-ID [28], or long-tail classification [8,22,29,24]. However, we observe that these methods have limitations when apply them to the long-tailed instance segmentation datasets such as LVIS [15]. Due to the high computational cost of instance segmentation task, some methods [48,22,8] rely on two-phase pipeline or large memory of historical features [29] incur high cost in time and memory thus less efficient. The special background class exists for the instance segmentation task (no class anchor), makes method [28] that rely on margin-based classification loss less effective. In addition, the small batch size of the instance segmentation frameworks limits the performance of approach [8] that rely on mining confusing categories. Our approach is specially designed for long-tailed instance segmentation, waives the need for complex two-phase training and the associated costs. We compare with them in our experiments, see Sec 4.1.

Methodology
In this section, we introduce the proposed Feature Augmentation and Sampling Adaptation (FASA) approach consisting of two components: 1) adaptive Feature Augmentation (FA) that generates virtual features to augment the feature space of all classes (especially for rare classes), 2) adaptive Feature Sampling (FS) that dynamically adjusts the sampling probability of virtual features for each class.
To better illustrate how FASA works for long-tailed in-stance segmentation, we take the Mask R-CNN [16] framework as our baseline and show an example of combining FASA and the segmentation baseline. The overall pipeline is shown in Fig. 2. Note FASA is a standalone module for feature augmentation, leaving the baseline module unaltered. Therefore, FASA serves as a plug-and-play module and it can combine with and facilitate stronger baselines other than Mask R-CNN. We will show this flexibility in our experiments. Under the Mask R-CNN framework, the standard multitask loss is defined for each Region of Interest (RoI): For simplicity, we apply FASA to the classification branch only, which is the most vulnerable branch on long-tailed data as supported in Fig. 1(b). More discussion is provided in the supplementary materials. It is possible to augment other branches using FASA as well. We leave that to future work and expect further improvements.

Adaptive Feature Augmentation
Mask R-CNN is originally trained on "real" feature embeddings of positive region proposals generated by the Region Proposal Network (RPN). For each class, we aim to augment its real features that are likely scarce (e.g., for rare classes). An ideal FA component should have the following properties: 1) generate diverse virtual features to enrich the feature space of corresponding class, 2) the generated virtual features capture intra-class variations accurately and do not deviate much from the true manifold which hinders learning, 3) adapt to the actual feature distribution that is evolving during training, 4) high efficiency.
To this end, we maintain an online Gaussian prior from previously observed real features, which fulfills the abovementioned requirements. We found such prior suffices for FA purpose by generating up-to-date and diverse features even when the actual features are not Gaussian. Concretely, for each foreground class c within the current batch, we can calculate the corresponding feature mean µ t c ∈ R d and standard deviation σ t c ∈ R d which together define a Gaussian feature distribution. Given the noisy nature of µ t c and σ t c , we use them to continuously update the more robust estimates µ c and σ c instead, via a momentum mechanism: where m is set to 0.1 in all experiments. Then according to a Gaussian prior with up-to-date µ c and σ c , we generate the class-wise virtual featuresx c by random perturbation under the feature independence assumption:  The feature independence assumption allows for efficient FA, where augmented features are treated as IID random variables. We consider the covariance matrix of the Gaussian to be diagonal, thus largely reduce the complexity from d 2 to d. Such generated virtual features {x c } will need to be re-sampled (detailed later). Finally, both re-sampled {x c } and real features {x c } (with its own sampling strategy in any baseline method) are sent to compute L cls in Eq. (1).

Adaptive Feature Sampling
For a wise use of the generated virtual features for each class, we propose an adaptive Feature Sampling (FS) scheme to effectively avoid under-fitting or over-fitting from FA. The sampling process operates in a relative fashion: if virtual features improve the corresponding class performance, their sampling probabilities get increased, otherwise decreased. Such relative adjustments of virtual feature sampling probabilities cater to the changing needs of FA during training. We can imagine that FA may be useful for rare classes during some training periods, but other training stages may call for decreased amount of FA to avoid overfitting. By contrast, a static predefined sampling distribution would be independent of training dynamics and thus suboptimal. Parametric sampling formulation. Note we still need an initial feature sampling distribution so as to adjust it later on. Obviously, we can benefit from a good initialization that avoids initial biased FA and costly adjustments. We choose to initialize the sampling distribution simply based on the inverse class frequency. It favors rare classes with higher sampling probabilities p c and is useful in our classimbalanced setting with minimal assumption about data distribution. Now we have a predefined skewed sampling distribution at the beginning. Then we dynamically scale the per-class sampling probability p c as follows: where s c is the scaling factor to be estimated at each time, and N c denotes the class size of class c. Adaptive sampling scheme. Recall the insight behind adapting the sampling probability p c is that: if FA does improve the performance of class c, then we should generate more virtual features and increase p c ; if we observe worse performance from FA, then p c is probably big enough and we should decrease it to avoid over-fitting with the augmented features. In practice, we use multiplicative adjustments to update p c every epoch. Specifically, we increase p c to min(1, p c · α) with α = 1.1, and decrease p c to max(0, p c · β) with β = 0.9. One can adopt different performance metrics to guide the adjustment of p c . Existing adaptive learning systems are either based on the surrogate loss [35] or the more ideal actual evaluation metric [20]. However for large-scale instance segmentation tasks, frequent evaluation of metrics like mAP on large datasets is very expensive. Therefore, we use the classification loss L cls on validation set to adjust p c for our large-scale segmentation task. For the validation set, we apply Repeat Factor Sampling (RFS) [15] method to balance the class distribution and provide more meaningful losses. The aforementioned setting works reasonably well in our experiments. Group-wise adaptation. To make our method more robust to different scenarios, we need to address two common challenges in the long-tailed instance segmentation task. First, the per-class loss can be extremely noisy on limited evaluation data, e.g., for rare classes. In this case, both loss and metric cannot serve as reliable performance indicators. Second, the evaluation data may simply not be available for all classes. For example, the validation set of LVIS dataset [15] only has 871 classes out of 1203 from training set. This makes it impossible to evaluate loss for the other 332 classes on validation set. To solve the aforementioned issues, we propose to cluster all training classes into super-groups. Then we compute the average validation loss of within-group classes, and adjust their feature sampling probabilities together. In other words, we adjust the sampling probabilities by a single scaling factor (α or β) depending on the average of group-wise loss. By doing so, those classes with missing evaluation data can be safely ignored when computing the loss average, but their sampling probabilities can still be updated along with other classes within the same group. Moreover, the group-wise update is less noisy since it is based on the loss average computed on bigger data (from multiple classes).
For clustering, rather than using predefined heuristics like class size or semantics as in [25,45], we use the online class-wise feature mean µ c and standard deviation σ c . We adopt the density-based [12] clustering algorithm using the following distance based on Fisher's ratio: The resulting super-groups are much more adaptive and meaningful than the predefined ones (e.g., rare, common, and frequent class groups), and facilitate better group-wise feature re-sampling. Please refer to the supplementary materials for the visualization of some super-groups of semantically similar classes.

Experiments
Datasets. Our experiments are conducted on two datasets: LVIS v1.0 [15] with 1203 categories and COCO-LT [42] with 80 categories. Both of them are designed for longtailed instance segmentation with highly class-imbalanced distribution. We choose LVIS v1.0 dataset over LVIS v0.5 since the former has more labeled data for meaningful evaluations and comparisons. LVIS v1.0 dataset defines three class groups: rare [1,10), common [10,100), and frequent [100, -) based on the number of images that contain at least one instance of the corresponding class. Similarly, COCO-LT dataset defines four class groups [1,20), [20,400), [400, 8000), [8000, -). We use the standard mean average precision (mAP) as the evaluation metric. Using this metric on different class groups can well characterize the long-tailed class performance. Following [15], we denote the corresponding performance metrics of rare, common and frequent class groups as AP r , AP c and AP f . Recently, Dave et al. [10] proposed that the mAP metric is sensitive to changes in cross-category ranking, and introduced two complementary metrics AP Fixed and AP Pool . We also report the performance of FASA under the AP Fixed and AP Pool metrics in the supplementary materials. Implementation details. Our implementation is based on the MMDetection [6] toolbox. We follow the same experimental setting as in [15,37] for fair comparison. Please refer to supplementary materials for other details.

Ablation Study on LVIS
We first perform ablation studies on the large-scale LVIS dataset. We report the validation performance to ablate the core modules of our FASA approach. Effectiveness of FA and FS. Table 1 verifies the critical roles of our adaptive modules for Feature Augmentation (FA) and Feature Sampling (FS). The baseline (top row) only performs repeat factor sampling [15] for real features, without using any FASA components. Our FA module (second row) significantly improves the performance, both for overall and rare classes. Our adaptive FS further boosts the performance, especially in the rare class groups (AP m r 12.7% → 17.8%) with other groups being competitive. The results suggest the effectiveness of both the FA and FS components in improving the training performance. Comparison with other augmentation methods. To further show the simplicity and efficacy of our method, we compare with the classic SMOTE method [4], MoEx [23], InstaBoost [13] and state-of-the-art methods [28,8,48] that are specially designed for the long-tailed setting. Since [28,8,48] only report results on face recognition and person Re-ID, while no public codes are available, we re-implemented them and optimized their parameters and performance for LVIS (see the supplementary materials for implementation details). Table 2 shows favorable results of our FASA when compared to others. Our gains are particularly apparent for AP r and AP c . Since SMOTE [4], MoEx [23] and Insta-Boost [13] are not directly designed for long-tailed setting, we verify that our FASA obtains a favorable performance over them. For more related feature augmentation approaches [8,28,48], we observe some limitations when transferring them into the instance segmentation task. Liu et al. [28] are based on margin-based face recognition loss such as ArcFace [11] that constrains the margin between each instance and its class anchor. Unfortunately, since the instance segmentation task has to deal with the special background class that no distinct anchor, the margin-based loss does not perform well on LVIS. In contrast, our approach is not restricted by the form of loss function. As for Chu et al. [8], the performance is limited by the small batch size of the instance segmentation task, which does not guarantee the selection of top confusing samples. Both [8] and [48] apply feature transfer from head to tail classes. They use a two-stage training pipeline that requires a pre-trained model to extract features. In contrast, our proposed FA method can be trained end-to-end, much faster than [8,48] and only incurs a small extra memory which is constant. Analysis of adaptive FS. Recall in Eq. (4), our class-wise feature sampling probabilities are adaptively adjusted by the scaling factor s c in an adaptive manner. Table 3 validates our design, showing that sampling is poor with a static sampling strategy. Specifically, we observe that s c = 5 works best for AP r , but is not optimal for AP f that needs s c = 1 instead. On the other hand, our adaptive FS tunes s c online to effectively re-balance the performance across categories. Fig. 3(a) depicts how the class-wise sampling probabilities change during training. Overall, the rare classes exhibit high sampling probabilities compared with the common and frequent classes. The rare-class sampling probabilities typically get increased to use more virtual features at the beginning. Then they gradually decrease to avoid over-fitting. Upon convergence, when the learning rate decreases, the sampling probabilities of rare categories see a bump to help with the corresponding classifier 'fine-tuning'. By contrast, the changes of sampling probabilities for the common and frequent classes are smaller. Fig. 3(b) further shows the dynamic changes of sampling probabilities within each class group.

Comparison with State of the Arts on LVIS
In this section, we evaluate the full FASA method against state-of-the-art methods on the LVIS v1.0 dataset. We consider the following representative methods: 1) Repeat Factor Sampling (RFS) [15] is an image-level data re-sampling technique. We use the same repeat factor 1e−3 as proposed in the original paper. 2) Equalization Loss (EQL) [37] is a loss re-weighting method that aims to ignore the harmful gradients from rare classes. 3) Classifier Re-training (cRT) [21] first uses random sampling for feature representation learning, and then re-trains the classifier with repeat factor sampling. 4) Balanced Group Softmax (BAGS) [25] first performs class grouping and then makes the classification loss relatively balanced across those class groups. Grouping simply relies on the class sizes that are independent of training dynamics and suboptimal. 5) Seesaw Loss [41] balances ratio of cumulative gradients for the positive samples and negative samples of different categories. Comparing using Mask R-CNN baseline. The aforementioned methods have shown solid improvements when combined with the Mask R-CNN baseline. Here we conduct a more comprehensive comparison with even stronger versions of these methods under different training schedules. Specifically, we experimented with the default 12 and 24 epochs schedules [6], as well as the decoupled two-stage training schedule [21,25]. In the first stage, we train the model for 12 epochs with standard random data sampling and cross-entropy loss. Then in the second stage, we finetune for 12 epochs using those advanced re-sampling or reweight approaches, such as RFS and BAGS. We refer to this schedule as '12+12'. We compare with all of these methods by plugging in our FASA module and comparing the performance difference. Table 4 summarizes the comparison results. Specifically, we repeat each experiment three times with different random seeds and report the mean value of results. When we combine our FASA with vanilla Mask R-CNN, we observe huge 3.3% gains in the overall metric AP. Our benefits are particularly evident in the rare class performance AP r , with gains of 9.0%. This validates FASA's superior ability to deal with long-tailed tasks. We also verify that the benefits of FASA remain consistent over multiple runs. When combined with stronger methods (RFS/EQL/cRT/BAGS/Seesaw) or training schedules, FASA can still obtain consistent improvements in overall AP, where the rare-class improvements in AP r dominate. Such gains come without compromising the common-and  Table 4: Comparing state-of-the-art methods with and without our FASA on the LVIS v1.0 validation dataset. We compare with the Mask R-CNN baseline, and state-of-the-art re-sampling approach Repeat Factor Sampling (RFS) [15], Equalization Loss (EQL) [37], Classifier Re-training (cRT) [21], Balanced Group Softmax (BAGS) [25] and Seesaw Loss [41]. The 'Uniform' method indicates random and uniform sample images. These methods are trained under different training schedules (24 or 12+12 epochs) using the public codes. All methods use ResNet-50 [17] as the backbone for fair comparison.  [47]) and advanced instance segmentation framework Cascade Mask R-CNN [2]. As shown in Table 5, the benefits of FASA still hold under different settings. On the validation set, FASA improves the performance of Mask R-CNN baseline (ResNet-101 backbone) by a large margin. We observe improvements in overall AP and rare-class AP r by 1.9% and 5.9% respectively. For the stronger ResNeXt101 backbone, we observe similar trend. FASA significantly improves the rare class performance AP r by 4.6%. For Cascade Mask R-CNN [2] framework and Seesaw loss [41], FASA offers consistent performance boost in rare classes while remaining strong on both common and frequent classes. Analyzing classifier weight norm. As discussed in [21,25], the weight norm of a classifier is correlated with the imbalanced learning performance, with the weight norms of tail classes often being much smaller on long-tailed data.  Entropy baseline and Seesaw Loss [41]. This partially explains why FASA greatly improves the rare-class performance of these methods.

Evaluation on COCO-LT
We evaluated FASA on COCO-LT [42] dataset to examine the generalizability of our approach. For a fair comparison, we follow the same experiment setting as SimCal [42]. There are two main differences compared to the implemen-   tation details we described in the LVIS dataset: (1) Singlescale training is used. We set the input image's short side to 800 pixels and do not use multi-scale jittering. (2) The bounding box head and mask head are class agnostic. Table 6 summarizes the results. The top row shows results of the Mask R-CNN [16] with ResNet50 [17] backbone and FPN [26] neck. The second row shows results obtained by the previous state-of-the-art method SimCal [42], which involves classification calibration training and then dual head inference. The third row shows results of the Mask R-CNN baseline augmented with our FASA. Note how FASA improves the performance of Mask R-CNN considerably, especially for those rare classes (AP m 1 and AP m 2 ). Overall, FASA performs better than SimCal [42] without any form of decoupled training.

Evaluation on CIFAR-LT-100
To demonstrate the generalizability of FASA in other domains, we further apply FASA on the long-tailed image classification task. We follow [3] to conduct experiments on the long-tailed CIFAR-100 dataset with a sub-stantial imbalance ratio of ρ = 100 (the ratio between sample sizes of the most frequent and least frequent class, We train for 200 epochs and use the top-1 accuracy as the evaluation metric. We compare FASA with two state-of-the-art feature-level augmentation approaches M2M [22] and Chu et al. [8]. When comparing with M2M [22], we use LDAM [3] loss as the baseline for a fair comparison. We use the same backbones of [22,8] to experiment under the same settings.
From Table 7, we observe that our FASA brings 1.7% accuracy improvement over the LDAM [3] baseline and is comparable with M2M [22]. When applied to the stronger baseline De-confound-TDE [38], FASA's benefits still hold. FASA is also better performing than Chu et al. [8] with the cross entropy loss. Other than that, our FASA is more timeefficient than M2M [22] and Chu et al. [8] because they need extra time for classifier pre-training while FASA can be applied online.

Conclusion
We have presented a simple yet effective method, Feature Augmentation and Sampling Adaptive (FASA), to address the class imbalance issue in the long-tailed instance segmentation task. FASA generates virtual features on the fly to provide more positive samples for rare categories, and leverages a loss-guided adaptive sampling scheme to avoid over-fitting. FASA achieves consistent gains on the Mask R-CNN baseline under different backbones, learning schedules, data samplers and loss functions, with minimal impact to the training efficiency. It shows large gains for rare classes without compromising the performance for common and frequent classes. Notably, as an orthogonal component, it improves other more recent methods such as RFS, EQL, cRT, BAGS and Seesaw. Compelling results are shown on two challenging instance segmentation datasets, LVIS v1.0 and COCO-LT, as well as an imbalanced image classification benchmark, CIFAR-LT-100.
In the supplementary materials, we discuss the ablation studies and implementation details that are not elaborated in the main paper. Section A highlights our FASA largely reduces the classification error. Section B analyzes some ablation studies of the adaptive feature sampling module. Section C validates the memory-and time-efficiency of FASA. Section D presents the clustering results used in the feature space. Section E provides the performance of FASA under the recently proposed AP Fixed and AP Pool metrics [10]. Section F reports our implementation details of feature augmentation methods. Section G compares FASA with another instance-level re-sampling based approach NMS resampling [45]. Section H shows the visualization result of FASA.

A. Error Analysis of Long-Tailed Instance Segmentation: Classification Error Dominates
In the main paper, we apply FASA only to the classification branch of Mask R-CNN. But why the choice? How does this simple mechanism impact performances of other branches like detection? To answer such questions, we need a detailed error analysis other than the default, single metric mean-average precision (mAP). We use the recent TIDE [1] toolbox to report six error metrics for long-tailed instance segmentation. Table 8 outlines the six error metrics on large-scale LVIS dataset. We see that for the Mask R-CNN baseline [16], classification error is the main bottleneck for long-tailed instance segmentation when compared to other error types, e.g., localization error. This explains our use of FASA to the classification branch of Mask R-CNN. Obviously, augmenting classification branch only will not incur a high cost. Performance-wise, we do see a significant reduction in classification error (from 25.10% to 20.74%) without deteriorating other errors much. With more budget, one could apply FASA to augment other branches of Mask R-CNN with the hope of more gains in all error metrics.

B.1. Initial Feature Sampling Probabilities
To initialize our adaptive virtual feature sampling process, we assigned class-wise sampling probabilities based on inverse class frequency. This scheme favors rare-class feature augmentation at the beginning, and does not rely on too many assumptions about skewed data distribution. Another sampling scheme that has minimal assumption of data distribution is based on uniform class distribution. Table 9 compares the two schemes empirically. We see that both the uniform initialization and the inverse class frequency initialization boost the performance compared with the no augmentation baseline. Overall, the inverse class frequency initialization approach achieves better overall mask mAP. The AP r and AP f results of uniform initialization are slightly worse than initialization based on inverse class frequency. So we use the initialization based on inverse class frequency by default for its effectiveness and simplicity.

B.2. Performance Metric for Sampling Adaptation
In the main paper, we propose a virtual feature sampling approach that is adapted to the validation loss rather than validation metric. This is to avoid the large computational cost from frequent metric evaluation on large-scale dataset. Concretely, evaluating the validation metric of mAP on the dataset takes nearly 45 minutes, which is very expensive if we were to conduct it in each epoch. To test how much we can gain from adapting to the true performance metric, we compare the use of the two supervisory signals on a smaller task. We choose the long-tailed image classification task on CIFAR-100-LT [3], a much smaller dataset than LVIS. Evaluating per-class accuracy is as efficient as evaluating the loss on CIFAR-100-LT validation set. Table 10 shows a marginal improvement from using the performance metric, which when translated to large-scale dataset, may not be worth the large cost for metric evaluation.

B.3. Group-wise vs. Class-wise Adaptation
By default, we adjust the feature sampling probability for each class group rather than each class. One of the reasons is that some classes may be missing for performance evaluation, e.g., on LVIS validation set. This makes it impossible for loss-adapted sampling probability adjustment for every class. But what if all classes are available for evaluation, appearing on both training and validation sets?
We again test on the CIFAR-100-LT [3] dataset that meets the requirement. In this case, class grouping is not a must anymore, and our goal is to see if group-wise sampling adaptation still holds its benefits over class-wise sampling adaptation. Table 11 gives a positive answer. We observe that group-wise sampling adaptation performs better and has a lower variance since it relies on the stabler groupwise loss average rather than the noisy per-class loss. Table 12 further validates the memory-and timeefficiency of our FASA approach. We see that FASA adds only a small amount of memory, which is used to maintain the online feature mean and variance of observed training samples. Thus the extra memory is constant and dependent only on the feature dimension. FASA is also found to incur a very small time cost.  [16] with and without FASA. We use the TIDE [1] toolbox and report the six error types (%) on LVIS v1.0 validation set: classification error (E cls ), location error (E loc ), both classification and location error (E both ), duplicate detection error (E dupe ), background error E bkg and missed ground truth error (Emiss). We observe the dominance of E cls for Mask R-CNN, and hence apply FASA only to the classification branch of Mask R-CNN at minimum cost. This leads to big improvements in E cls already. We expect more gains in E cls and other error metrics by augmenting other branches of Mask R-CNN if given more computational budget.  Figure 5: t-SNE [32] visualization of class groups. In the black dashed boxes, classes are often semantically related or visually similar. In the blue ellipse, we find classes that exhibit strong co-occurrence, e.g., between 'pillow' and 'bedspread'.

D. Visualizing Class Grouping Results
Recall our feature sampling probabilities are adjusted in a group-wise manner. The class groups are formed by the Mean-shift [7] clustering algorithm. Figure 5 presents some clustering results, where visually similar or semantically re-   lated classes stay close in the feature space (e.g., "hairnet" and "visor"). In addition, the co-occurrent classes also tend to stay close (e.g., "pillow" and "loveseat"). Intuitively, related classes are better suited to have their sampling probabilities adjusted together.

E. Evaluation with AP Fixed and AP Pool
The mean average precision metric (denotes as AP Old in the following) is the default evaluation metric for the instance segmentation task [27,15]. Recently, Dave et al. [10] argued that the AP Old metric is sensitive to changes in crosscategory ranking, and introduced two complementary metrics AP Fixed and AP Pool to replace AP Old for LVIS [15] dataset. Dave et al. [10] found that some methods improve AP Old but have less impact on AP Fixed and AP Pool . The AP Old metric limits the maximum detection results per image, resulting in cross-category competition. To address this issue, the AP Fixed metric limits the maximum detection results per class on the dataset instead. To highlight the score calibration property, Dave et al. [10] also proposed AP Pool metric that is class-agnostic and evaluates detection results across all categories together. Since AP Pool is classagnostic, the evaluation is influenced more heavily by frequent classes rather than rare classes.
We provide the experimental results of FASA under the AP Fixed and AP Pool in Table 13. We observe that FASA consistently boosts the performance under AP Fixed and AP Pool , especially for the rare categories. For AP Fixed , FASA improves overall AP and rare-class AP r by 1.1% / 1.7% respectively for Mask R-CNN and 1.3% / 2.4% for Cascade Mask R-CNN. For AP Pool , FASA still obtains 2.9% gains in AP r for Mask R-CNN and 2.0% for Cascade Mask R-CNN. Since AP Pool is mainly affected by the frequent class, the overall AP improvements are small. The AP Fixed and AP Pool results also demonstrate that FASA largely improves the performance of rare classes without compromising the common classes and frequent classes.

F. Implementation Details
Our implementation is based on the Mask R-CNN [16] backbone, which is the ImageNet pre-trained ResNet-50 [17] with a FPN [26] neck and a box head with two sibling fully connected layers for RoI classification and regression. We apply random horizontal image flipping and multiscale jittering with the smaller image sizes (640, 672, 704, 736, 768, 800) in all experiments. All models are trained with standard SGD on 8 NVIDIA V100 GPUs. We follow the default settings in MMDetection [6] to set other hyperparameters such as learning rates and training schedules.
Here we also describe the implementation details of the feature augmentation methods listed in Table 2 of the main paper. We detail the hyper-parameters of these approaches and our searched optimal choices in Table 14. SMOTE [4]. The SMOTE algorithm interpolates neighboring features (i.e., feature embeddings of region proposals) in the feature space. Specifically, for given features x i , we consider the k = 5 nearest neighbours {x j } based on cosine feature distance. Then we interpolate new features as: where λ is a random value in (0, 1]. MoEx [23]. Similar to SMOTE [4], the MoEx is also an interpolation-based augmentation method. As MoEx was developed for the image classification task, we transfer it to the instance segmentation task with the following modification: 1) we applied MoEx augmentation in the classifier of the Mask R-CNN [16] framework, 2) we searched the optimal value of parameters on the LVIS dataset and the results are shown in Table 14.
InstaBoost [13]. InstaBoost is an adaptive copy-and-paste FA method based on a location probability map. Since In-staBoost was already developed for the instance segmentation task, we use its default hyper-parameters.
Liu et al. [28]. Liu et al. [28] propose to transfer the angular distribution of face recognition loss such as CosFace [40] or ArcFace [11]. We select ArcFace for re-implementation: log e s(cos(θy+αy+ma)) e s(cos(θy+αy+ma)) + C j =y e s(cos(θj +αy)) (7) The symbol θ y refers to the angle between the input feature and the weight of the classifier. The symbol α y means the extra angular that transfers from head class to tail class. As shown in Eq (7), two parameters are involved: the symbol s means the scaling factor applied to logit, and the symbol m a refers to the angular margin. We tune these two parameters and show the results in Table 14.
We observed that since the instance segmentation task has to deal with the special background class, the marginbased ArcFace loss is unfortunately very sensitive to hyperparameter choices of m a . So margin-based augmentation [28] does not perform well on LVIS. Different from Liu et al. [28], our FASA is not limited to the form of loss functions. Chu et al. [8]. Chu et al. [8] mixed the class-specific features of each class and the corresponding class-generic features of 'confusing' classes to synthesize new data samples. The definitions of 'class-generic' and 'class-specific'  [2] with and without FASA under the recently proposed AP Fixed and AP Pool metric [10]. We report the results on the LVIS [15] validation set. AP, APr, APc and APf refer to the mask mAP metrics (%) for overall, rare, common and frequent class groups. The symbol AP Old refers to the standard mean average precision (mAP) metric. We observe FASA offers consistent performance boost under the AP Fixed and AP Pool , especially for the rare categories. All the models use the ResNet-101 [17] backbone and Repeat Factor Sampling (RFS) [15].   [48] αrecon Coefficient of the reconstruction loss 0.5 αreg Coefficient of the regularization loss 0.25 are based on the threshold masking of class activation map (CAM) [53]. For each real sample in the tail class, the authors sample N a images from its N f confusing classes.
During the re-implementation, we found that the difference in batch size between the classification and instance segmentation tasks limited the performance of Chu et al. [8] when transferred to the instance segmentation task. The classification task has a large batch size (e.g., 128) that can meet the demand of picking confusing categories (e.g., N a = N f = 3). However, instance segmentation models are limited by small batch size (e.g., 2) and there is no guarantee that the top confusing categories will appear in the same batch. Compared with Chu et al. [8], our FASA builds feature banks for each category to cache the features of the previous batch, thus getting rid of the small batch limitation.
Yin et al. [48]. Yin et al. [48] is a feature augmentation method designed for the face recognition task. A total of three loss functions are included: face classification loss L sf mx , reconstruction loss L recon and regularization loss L reg . The reconstruction loss L recon is critical to train the discriminative feature encoder and decoder. To transfer into the instance segmentation task, we apply the reconstruction loss to the feature embedding of each positive region proposal. Besides, Yin et al. [48] need a two-stage training pipeline. In the first stage, the authors fix the backbone and generate new feature samples to train the classifier. In the second stage, the authors fix the classifier and update the

G. Comparison with NMS Re-sampling [45]
NMS Re-sampling [45] is proposed to adjusting the NMS threshold for different categories during the training.
Specifically, the NMS thresholds for the frequent/common/rare categories are set as {0.7, 0.8, 0.9} with the increasing trend. Such a mechanism is beneficial to preserve more region proposals from the rare classes and suppress the number of proposals from frequent classes.
We compare the FASA with NMS Re-sampling in Table 15. The first line refers to the Mask R-CNN [16] baseline without any re-sampling or augmentation method.  From the second and the third line, we see that both FASA and NMS Re-sampling achieve better performance than the baseline method. FASA performs slightly better than NMS Re-sampling, especially for the rare classes. We believe such a performance gap is due to NMS Re-Sampling is mainly in adjusting the sampling weights of the current data samples, while FASA can further generate new virtual samplers. Also, the bottom results demonstrate that FASA as an orthogonal module can combine with NMS Re-sampling to further boost the performance.

H. Result Visualization
To better interpret the result, we show the segmentation results of the selected rare classes in Figure 6. We observe that without FASA, the prediction scores for rare classes are small or even missed. On the contrary, with the help of our FASA, the classification results of the rare classes become accurate.