---
abstract: 'Instance search is an interesting task as well as a challenging issue due to the lack of effective feature representation. In this paper, an instance level feature representation built upon fully convolutional instance-aware segmentation is proposed. The feature is ROI-pooled from the segmented instance region. So that instances in various sizes and layouts are represented by deep features in uniform length. This representation is further enhanced by the use of deformable ResNeXt blocks. Superior performance is observed in terms of its distinctiveness and scalability on a challenging evaluation dataset built by ourselves. In addition, the proposed enhancement on the network structure also shows superior performance on the instance segmentation task.'
address: |
    The School of Information Science and Technology,\
    Xiamen University\
    Xiamen, 361005, P. R. China.\
author:
- Yu Zhan
- 'Wan-Lei Zhao'
bibliography:
- 'yzhan.bib'
title: |
    Instance Search via Instance Level\
    Segmentation and Feature Representation
---

Instance search ,Instance segmentation ,CNN

Introduction
============

With the proliferation of massive multimedia contents in our daily life, it is desired that users are allowed to browse over relevant images/videos in which the specified visual instance (e.g., an object or a landmark or a person) appears. This is known as instance search [@Awad17], which arises from several application scenarios such as online product search in the shopping website, video editing, and person re-identification, etc.

Instance search is essentially different from conventional content-based image retrieval (CBIR) [@RuiHC99; @AlZubiAR15] in several perspectives. First of all, in instance search, the query is a visual object that is outlined (usually by a bounding box) in an image. While in CBIR, the whole image is treated as the query. Secondly, instance search requires the intended visual objects to come from the same instance (while possibly under different transformations) as the query [@Awad17]. In contrast, CBIR only requires the returned contents to be visually similar as the query image no matter whether they share the same origin. Moreover, instance search should localize the target instance in the returned images.

There are basically two stages in visual content search system, namely feature representation [@Sivic03; @Jegou10; @JegouDS10; @RetaCMGAD18; @DalalT05; @PerronninSM10; @ZhangLZCY15; @RaveauxBO13; @WANG201363; @Babenko14; @Razavian14; @Babenko15; @NgYD15] and fast retrieval [@JegouDS11; @DatarIIM04; @MujaL09; @MujaL14]. In the whole process, feature representation plays the key role to the success of the system. On one hand, features are required to be robust to various image transformations, such as scaling, rotation and occlusions, motion blur, etc. On the other hand, they should be distinctive enough so that the retrieval quality does not suffer severe degradation as the scale of the reference set grows.

In the existing solutions, instance search has been mainly addressed by conventional approaches that are originally designed for image search [@Awad17; @RuiHC99], such as bag-of-visual words (BoVW) [@Sivic03], RoI-BoVW [@ZhangLZCY15], VLAD [@Jegou10] and FV [@PerronninSM10]. All these approaches are built upon image local features such as SIFT [@Lowe04], RootSIFT [@ArandjelovicZ12], SURF [@BayTG06]. Although local features are much more distinctive than global features, they are still unsuitable for instance search task. First of all, local features are not robust to out-of-plane rotation and deformation, both of which are widely observed in the real world. Moreover, it is not rare that very few local features are extracted from transparent objects (e.g., bottles) or objects with flat surface (e.g., balls). Additionally, it is not guaranteed that the regions covered by local features are exactly from one instance. As a result, the local features used to describe a target instance are more or less contaminated by the contents from the background. For this reason, similar as global features, isolated feature representation for individual instances is not desirable.

Recently, pre-trained CNNs are gradually introduced to image retrieval tasks [@Babenko14; @Razavian14; @Babenko15; @NgYD15; @ZhengZWWT16; @ArandjelovicGTP16; @XieZWYT16] due to their great success in visual object classification tasks [@DengDSLL009]. In the existing practices, image features are typically extracted from the whole image or a series of local regions with convolution or fully connected layers. Encouraging results are observed on the landmark retrieval tasks in [@Razavian14; @Babenko15]. However, they are unfeasible for instance representation since it is essentially a type of global feature. The feature vector is comprised by a mixture of activations from a variety of latent instances in the image. Although recent research [@Tolias15; @Kalantidis16] attempts to localize the representation to regional level, exhaustive sliding search or feature aggregation is still inevitable. Moreover, since such region level representation is given by a coarsely restricted region, their improvement is still limited.

In this paper, an instance level feature representation is proposed, which is based on an effective instance segmentation approach, namely fully convolutional instance-aware semantic segmentation (FCIS) [@Li17]. Individual instances present in the image are detected and segmented on pixel level by FCIS. This is essentially different from the approach presented in [@Salvador16], in which the segmentation only reaches to the semantic category level. With the instance level segmentation, feature representation of each instance is derived from the feature maps of convolution layers using ROI pooling. So that instances in different sizes and layouts are represented with the feature vectors of the same size. In order to enhance the performance, two modifications have been made on the FCIS network.

-   The back-bone network of FCIS is replaced with a more powerful ResNeXt-101 [@Xie17] without increasing extra FLOPs complexity or the number of parameters;

-   To enable the receptive field to be adaptive to the various shape of potential objects, the plain layer in ResNeXt-101’s final stage is replaced with deformable convolution [@Dai17].

To the best of our knowledge, this is the first piece of work that visual instances are represented by features derived exactly from the instance region. Moreover, due to the lack of publicly available testing benchmark for instance search, a new dataset called *Instance-160* is constructed by harvesting test videos that are originally used for visual object tracking evaluation.

Framework for Instance Search {#sec:mthd}
=============================

Instance Level Feature Representation
-------------------------------------

Fully convolutional instance-aware semantic segmentation (FCIS) [@Li17] is designed primarily for instance segmentation and detection. The framework of FCIS is given as a sub-figure in Fig. \[fig:framework\], which is inside the bounding box in green. In the network, the idea of “position-sensitive score map” is adopted to perform segmentation and detection simultaneously. These two sub-tasks share the same set of score maps by assembling operation according to the region of interest (ROI). ROIs are generated by region proposal network (RPN), which is added on top of “conv4”. The score maps output “inside” and “outside” scores for the mask prediction and classification jointly. For details, readers are referred to [@Li17].

![Framework of instance-level feature representation from convolutional activations of FCIS [@Li17]. Processing flow with black arrows and dashed lines denote the proposed modification and enhancement over FCIS.[]{data-label="fig:framework"}](framework){width="0.84\linewidth"}

As seen from Fig. \[fig:framework\], there are three outputs from FCIS for one image, namely, the segmented instances (given as instance masks) and the corresponding category label, along with the bounding box of each instance. In order to extract the feature for each segmented instance, another pipeline is introduced into FCIS framework. Namely, with the generated bounding box, ROI pooling is performed on the feature maps that are generated in the convolution stages. This feature extraction pipeline is shown on the up-right of Fig. \[fig:framework\]. Since the size of feature map is different from the input image and varies from layer to layer, bounding box of each instance is scaled accordingly to fit the size of the feature map when we perform ROI pooling. The maximum activation is extracted from the scaled ROI region as one dimension of the feature representation. This ROI pooling is applied on all feature maps in the same layer. As a consequence, the size of the output feature equals to the number of the feature maps. Instances in different sizes and layouts are represented with the same size of feature vectors. Since the segmentation is precise and clean, this feature representation is on instance level of real sense. All per-ROI computation is simple and fast with a negligible cost, compared with forward pass.

Intuitively, convolution layers keep more abstract visual information as network goes deeper. It is therefore widely believed that shallower convolution layers are more suitable for low level feature representation. In our framework, the ROI pooling could be possibly applied on “conv2” to “conv5” and “conv” in Fig. \[fig:framework\]. In the experiment, a comparative study is made to show the distinctiveness of the feature extracted from these layers. In addition, we also test the possibility of concatenating features ROI-pooled from different stages. Features are *l$_{2}$*-normalized before and after the concatenation.

Performance Enhancement {#sec:boost}
-----------------------

In order to boost the performance of the proposed feature representation, the FCIS is modified in two aspects. Namely, the ResNet-101 [@He16], upon which FCIS is built, is replaced by more powerful ResNeXt-101 [@Xie17]. In addition, to enable the network to be more robust to severe shape variations, deformable convolution [@Dai17] is adopted in the last three bottle-neck blocks of ResNeXt-101.

As pointed out in [@Li17], the performance of ResNet [@He16] gets saturated when its depth reaches to *152*. To further improve the accuracy of this back-bone network, ResNet-101 is replaced by ResNeXt-101 [@Xie17] which corresponds to “conv1-4” and “conv-5” in Fig. \[fig:framework\]. Compared to ResNet, ResNeXt increases the *cardinality* of the building blocks. Fig. \[fig:blcok\] show the difference between blocks of ResNet and ResNeXt. *Cardinality* refers to the size of same-topology transformation aggregated in the building block. The cardinality of building blocks in our case is set to *32*. This is to control the FLOPs complexity on the same level as ResNet. Similar as ResNet-101, the weights of the model are initialized from ImageNet [@DengDSLL009] classification task. The layers (i.e., deformable convolution layer and RPN) absent from the pre-trained model are randomly initialized.

![Comparison between ResNet and ResNeXt blocks. In figure (b), ResNeXt’s block [@Xie17] is embedded with deformable convolution [@Dai17] with cardinality of *32*. The size of filter and the number of filters are shown on each convolution layer. In the enhanced instance feature design, structure in (b) is adopted. The last *3* bottle-neck blocks of ResNeXt-101 are replaced by deformable convolution given in figure (d).[]{data-label="fig:blcok"}](block){width="0.86\linewidth"}

Visual instances usually undergo various irregular geometric transformations in real scenario, which causes heavy deformations in their appearances. Plain convolution modules in CNNs are inherently vulnerable to such kind of transformations. Inspired from [@Dai17], deformable convolutions are introduced to replace the plain convolution in the last three bottle-neck blocks of ResNeXt-101 to alleviate this problem (illustrated in Fig. \[fig:blcok\]). Fig. \[fig:blcok\](d) shows the sampling structure of deformable convolution in contrast to plain one (Fig. \[fig:blcok\](c)). The deformable convolution calculates a set of offsets for the ultimate sampling locations to better adapt to the deformations of the instance. The offsets are easily learned by applying a convolutional layer over the same input feature maps. As is revealed later in the experiments, both modifications proposed in this section boost the performance of instance segmentation and instance search.

Evaluation Dataset Construction {#sec:data}
===============================

Since the initiatives of instance search task in TRECVID [@Awad17], several instance search approaches have been proposed one after another over the past few years. However, the publicly available evaluation benchmark is slow to occur. Approaches [@Tolias15; @Kalantidis16; @Salvador16] aiming for instance search are only evaluated on landmark datasets, typically Oxford5k [@Philbin07], Paris6k [@Jegou08] and Holidays [@Jegou08]. The evaluation does not reflect the real challenges, such as motion blur, partial occlusion, deformation and mutual object embedding, that instance search faces in the general cases. Dataset maintained by TRECVID [@Awad17] avoids such kind of disadvantages, whereas it is only open to TRECVID participants. In this paper, a new dataset, namely *Instance-160* is introduced. As visual object tracking and instance search are two similar tasks, *Instance-160* is built based on the video sequences used for visual object tracking evaluation. On one hand, this avoids the painstaking efforts to annotate the instances from new video sequences. On the other hand, videos that are used for visual object tracking have been widely accepted benchmarks. The variety of variations and transformations that could happen on visual instances are incorporated.

In the object tracking, the tracking algorithm is required to track the target object (selected on the first frame) in the rest of video frames. In order to verify the robustness of the tracking algorithm, the test videos are collected from different scenarios and cover a wide range of objects. Most popular evaluation benchmarks are OTB2015 [@Wu15] and ALOV++ [@Smeulders14]. They are collected from diverse circumstance including illuminations, transparency, specularity, confusion with similar objects, clutter, occlusion, severe deformation, motion blur and low contrast. Since instance search arises from similar application scenarios as object tracking, the same challenges are seen in instance search. Nevertheless, it is worth noting that instance search is different from object tracking. The latter assumes the visual object varies following the temporal order. For this reason, the temporal information is more or less capitalized in various object tracking algorithms. While this is not the case for instance search. Moreover, the tracking algorithm is allowed to update the feature representation from time to time as the tracking continues. In contrast, feature representation, once has been designed, is fixed all the way in instance search.

When we construct *Instance-160*, *58* and *102* sequences are selected from *100* and *300* video sequences from OTB2015 and ALOV++ respectively. The videos inside which the target instances are not covered by Microsoft COCO’s *80* categories are omitted. For each video, the first frame in which the query instance is given by a bounding box is extracted as the query side. For the rest, one frame is extracted for every other *4* frames as the reference dataset. This results in *11,885* reference images in total. Sample queries are seen in Fig. \[fig:query\](a). The distribution about the number of true-positives for all queries are shown in Fig. \[fig:query\](b). As shown in the figure, more than *90%* of the queries have more than *20* true-positives for each.

Experiments
===========

In this section, the proposed approach for instance search is evaluated on the dataset introduced in Section \[sec:data\]. Additionally, in order to verify the scalability of the presented approach, another *1* million images randomly crawled from Flickr are incorporated as distractors. The performance evaluation is studied in comparison to several representative approaches. They are BoVW [@Sivic03], BoVW+HE [@Jegou08], R-MAC [@Tolias15], Deepvision [@Salvador16] and CroW [@Kalantidis16]. The last three are based on deep features. For each CNN-based method, the network is initialized with the default pre-trained model and configuration described in the corresponding paper. For BoVW and BoVW+HE, the same visual vocabulary sized of *65,536* are used. The binary signature in HE is set to *64* bits. The performance is measured by mAP at top-*k*, where *k* varies from *10* to *100*. This is due to the fact that more than *95%* the queries have more than *10* corresponding true-positives as shown in Fig. \[fig:query\](b).

Under the same training protocol introduced in [@Li17], the feasibility of the proposed enhancement strategies is validated on PASCAL VOC 2012 [@EveringhamGWWZ10]. Thereby, FCIS and FCIS in-planted with the proposed enhancement strategies are trained on Microsoft COCO 2014 [@LinMBHPRDZ14]. All the experiments are conducted on a workstation with four Nvidia Titan X GPUs and one *3.20*GHz Intel CPU setup.

Configuration Test on FCIS
--------------------------

Theoretically speaking, feature ROI-pooled from any layer could be used to represent the detected instance. The distinctiveness of these features varies from layer to layer. In the first experiment, the distinctiveness of instance-wise representation that are extracted from different layers is studied. The feature representation with the best distinctiveness (reflected by the highest mAP) is selected as the final feature representation. Additionally, we also investigate the possibility of concatenating features from different layers.

![Performance of deep features extracted from different stages’ convolution layer, including experiments with feature concatenation.[]{data-label="fig:baseline"}](baseline){width="0.84\linewidth"}

According to our observation, the category label for the segmented instance from FCIS is in high accuracy. It is therefore could be adopted for early pruning. Namely, the instance query only needs to compare with the candidate instances which share the same category label. Such pruning strategy speeds up the retrieval by two times without notable drop in mAP. In the following experiments, pruning scheme is adopted as default configuration for our approach.

In the first experiment, the distinctiveness of features from different layers of FCIS network is studied. We also investigate the performance of hybrid features that combining features from two layers. Feature derived from the “conv” (see Fig. \[fig:framework\]) layer is given as comparison baseline.

Fig. \[fig:baseline\] summarizes the performance with features extracted from different stages. In the figure, mAP@*10* and mAP@*20* for all the configurations are low since not all potential true-positives are considered due to the fact that *90%* queries have more than *20* true-positives (see Fig. \[fig:query\](b)). As expected, features derived from intermediate layers perform better over feature from baseline (“conv”). Performance drops when features are derived from the shallow layers, such as “conv2” and “conv3”. This basically indicates that it is sub-optimal to employ representations only kept with local visual patterns. As seen in the figure, all three different combinations between features from different layers lead to better results. The combination of features from “conv3” and “conv4” achieves the best performance. As revealed in later experiment, this observation is consistent even we change the back-bone network from ResNet to ResNeXt.

FCIS+XD versus FCIS
-------------------

In this section, we are going to investigate the performance achieved by two enhancement strategies proposed in Section \[sec:boost\]. Since FCIS is primarily designed for instance segmentation, the effectiveness of the enhanced FCIS network is studied first on instance segmentation task. In the experiment, the performance of FCIS with ResNeXt back-bone network and deformable convolution layer are studied both as separate runs and as a combination. FCIS supported with deformable convolution is denoted as FCIS+D. FCIS supported with ResNeXt-101 is denoted as FCIS+X. FCIS+XD denotes that FCIS powered by both enhancement strategies.

The performance evaluation is conducted on PASCAL VOC 2012 [@EveringhamGWWZ10] and Microsoft COCO 2014 test-dev [@LinMBHPRDZ14]. $mAP^r@r$ is adopted for the evaluation. It basically calculates the mean of Average Precision (AP) measured for a method for which the corresponding recall exceeds *r*. Notice that it is essentially different from mAP that we use to evaluate the instance search performance.

The performance of instance segmentation using FCIS and its variants is summarized in Table \[tab:segmentation\_voc\] and Table \[tab:segmentation\_coco\]. On the two datasets PASCAL VOC 2012 and Microsoft COCO 2014, both networks individually supported by deformable convolution layers and ResNeXt bottle-neck blocks (denoted as FCIS+D and FCIS+X respectively) are able to achieve better results in comparison to original FCIS architecture. When both of these enhancement strategies are adopted (given as FCIS+XD), the best segmentation accuracy is attained. As we verified on PASCAL VOC 2012 and Microsoft COCO 2014, the segmentation accuracy of FCIS is relatively improved by *2.7%* and *5.5%* measured with mAP$^r$@0.5 respectively by FCIS+XD. Such results indicate that the enhancement strategies proposed in Section \[sec:boost\] are all effective in boosting the performance of instance segmentation task.

![Performance of FCIS, FCIS+D, FCIS+D and FCIS+XD with the hybrid features from different layers. The performance is measured by mAP at top-*50* on *Instance-160*.[]{data-label="fig:modification"}](modification){width="0.78\linewidth"}

In addition, we further study the performance of the features derived from FCIS+D, FCIS+X and FCIS+XD when they are adopted for instance search task. Similar as FCIS, the other three networks are trained on Microsoft COCO 2014 [@LinMBHPRDZ14]. Fig. \[fig:modification\] presents the performance of FCIS and its variants on *Instance-160*. mAPs at top-*50* are presented. Since hybrid features from different layers are always better than the ones from single layer, the results of features derived from single layer are omitted. As seen from the figure, hybrid features from “conv3 + conv4” achieve the best result. This is consistent with the observation on the results shown in Fig. \[fig:baseline\]. In the following experiments, hybrid feature from “conv3” and “conv4” is selected as the feature representation for each detected instance.

Table \[tab:self-cmpr\] further shows the performance of FCIS and its enhancements on *Instance-160*. For all different networks, the features are extracted from “conv3” and “conv4”. Due to the high accuracy on instance level segmentation, superior performance is observed with FCIS+XD across all the rankings. It outperforms FCIS by a constant *2-3%* margin. In the rest of our experiments, FCIS with ResNeXt back-bone network and deformable convolution, namely FCIS+XD is selected as the standard configuration for our approach.

Comparison to State-of-the-art Approaches
-----------------------------------------

In this section, the performance of proposed FCIS+XD is studied in comparison to five representative approaches in the literature. They are two local feature based approaches BoVW [@Sivic03] and BoVW+HE [@Jegou08] and three deep feature based approaches R-MAC [@Tolias15], Deepvision [@Salvador16] (denoted as DV-Vgg) and CroW [@Kalantidis16]. For Deepvision, the search is carried out in two steps. In the first step, the top-ranked candidates are produced by image level comparison. In the second step, instance level search is carried out on the top-*100* candidates. In order to make a more fair comparison between Deepvision and our approach, another run is also conducted for Deepvision. In this new run, back-bone network of Deepvision is replaced by ResNet-101, which becomes the same as FCIS. The filtering scheme in the first step is disabled. This run is denoted as DV-Res.

Table \[tab:comparison\] shows the performance from all approaches. As seen from the table, DV-Vgg and FCIS+XD show considerably better performance than the rest. BoVW+HE still shows competitive performance in comparison to deep feature approaches such as R-MAC and CroW. Although the results from Deepvision are very close to FCIS+XD, they do not reflect real behavior of Deepvision. In *Instance-160*, the videos are primarily collected from visual tracking evaluation. In many cases, the query instance shares similar background scene as the reference images. So that true instances are retrieved by Deepvision due to their similar background. For this reason, the image-wise feature representation in Deepvision still works seemingly well. However, the performance of Deepvision drops considerably when the target instances are cluttered in different backgrounds. This will be confirmed by another experiment afterwards. Another disadvantage for Deepvision lies in its low accuracy of generated instance bounding box. As shown in the table, the mAP of DV-Res is even lower than original FCIS (see Table \[tab:self-cmpr\]) although it is already powered by ResNet. This is mainly caused by its imprecise feature representation of each instance. In contrast, FCIS+XD is able to generate precise instance-level bounding-boxes owing to its precise object category-level classification and pixel-level mask prediction.

In order to further confirm our observation about Deepvision, *40* queries from *Instance-160*, in which severe background variations are observed, are selected to verify its real behavior. Table \[tab:subset\] shows the performance of FCIS, FCIS+XD and Deepvision on *40* queries. As observed from the table, the performance of Deepvision drops considerably compared to that of Table \[tab:comparison\]. As the background scenes from the instance query and the reference images are dissimilar, the first round search in Deepvision becomes ineffective since it is based on image-wise feature. As the consequence, decent results are not expected from the re-ranking stage since many true-positives are already missed in the first stage. Another disadvantage of this approach is that one has to keep two types of features. One is on image level, another is on region level, which induce heavy computational overhead.

Scalability Test
----------------

![Scalability test in comparison to five state-of-the-art approaches. The performance is measured by mAP at top-*50*.[]{data-label="fig:distract"}](distract){width="0.8\linewidth"}

In this section, the scalability of the proposed feature representation is studied. In the experiment, *1* million distractor images are added in the reference set. The same processing pipeline is undertaken on this *1* million images. In the experiment, five representative approaches are considered. For FCIS+XD, *1,648,654* instances are extracted from the distractor images, each of which is represented as an *1,536*-dimensional feature vector.

As seen from Fig. \[fig:distract\], FCIS+XD shows the best scalability. It outperforms Deepvision by a constant margin. As the computation cost is high and the results from BoVW, BoVW+HE, R-MAC, CroW and DV-Res are already much poorer than FCIS+XD and Deepvision (DV-Vgg) with 100K distractors, further verification on the whole *1* million distractors is not carried out for these approaches. Fig. \[fig:result\] shows six instance search results produced by FCIS+XD. As shown in the figure, all the top-*8* results for each individual query are meaningful. Although a few false-positive instances are returned, they indeed exhibit very close appearance as the query.

![Top-*8* search results of six sample queries produced by FCIS+XD with *1* million distractor images.[]{data-label="fig:result"}](result){width="0.98\linewidth"}

Conclusion
==========

We have presented a promising way of instance level feature representation for instance search. This representation is built upon a fully convolutional network that is originally used for instance segmentation. With the precise instance segmentation, the feature is derived by ROI pooling on the feature maps. To further boost its performance, two enhancement strategies are proposed. The distinctiveness and scalability of this feature have been comprehensively studied. As shown in the experiment, it outperforms most of the representative approaches in the literature. Considering the lack of publicly available evaluation benchmark, a medium-scale dataset for instance search is introduced by harvesting videos from object tracking benchmarks. Currently, the types of instances that our approach could handle with are restricted to Microsoft COCO-*80* categories. Although it already covers variety of instances that we encounter in the daily life, exploring more generic instance segmentation model that works beyond *80* categories will be our future research focus.

Acknowledgments
===============

This work is supported by National Natural Science Foundation of China under grants 61572408 and grants of Xiamen University 0630-ZK1083.
