Mining Cross-Image Semantics for Weakly Supervised Semantic Segmentation

This paper studies the problem of learning semantic segmentation from image-level supervision only. Current popular solutions leverage object localization maps from classifiers as supervision signals, and struggle to make the localization maps capture more complete object content. Rather than previous efforts that primarily focus on intra-image information, we address the value of cross-image semantic relations for comprehensive object pattern mining. To achieve this, two neural co-attentions are incorporated into the classifier to complimentarily capture cross-image semantic similarities and differences. In particular, given a pair of training images, one co-attention enforces the classifier to recognize the common semantics from co-attentive objects, while the other one, called contrastive co-attention, drives the classifier to identify the unshared semantics from the rest, uncommon objects. This helps the classifier discover more object patterns and better ground semantics in image regions. In addition to boosting object pattern learning, the co-attention can leverage context from other related images to improve localization map inference, hence eventually benefiting semantic segmentation learning. More essentially, our algorithm provides a unified framework that handles well different WSSS settings, i.e., learning WSSS with (1) precise image-level supervision only, (2) extra simple single-label data, and (3) extra noisy web data. It sets new state-of-the-arts on all these settings, demonstrating well its efficacy and generalizability. Moreover, our approach ranked 1st place in the Weakly-Supervised Semantic Segmentation Track of CVPR2020 Learning from Imperfect Data Challenge.


Introduction
Recently, modern deep learning based semantic segmentation models [5,6], trained with massive manually labeled data, achieve far better performance than before. However, the fully supervised learning paradigm has the main limitation of requiring intensive manual labeling effort, which is particularly expensive for annotating pixel-wise ground-truth for semantic segmentation. Numerous efforts are motivated to develop semantic segmentation with weaker forms of supervision, such as bounding boxes [45], scribbles [36], points [3], and image-level labels [46], etc. Among them, a prominent and appealing trend is using only image-level labels to achieve weakly supervised semantic segmentation (WSSS), which demands the least annotation efforts and is followed in this work.
To tackle the task of WSSS with only image-level labels, current popular methods are based on network visualization techniques [80,86], which discover discriminative regions that are activated for classification. These methods use image-level labels to train a classifier network, from which class-activation maps are derived as pseudo ground-truths for further supervising pixel-level semantics learning. However, it is commonly evidenced that the trained classifier tends to over-address the most discriminative parts rather than entire objects, which becomes the focus of this area. Diverse solutions are explored, typically adopting: image-level operations, such as region hiding and erasing [30,69], regions growing strategies that expand the initial activated regions [27,62], and feature-level enhancements that collect multi-scale context from deep features [33,71].
These efforts generally achieve promising results, which demonstrates the importance of discriminative object pattern mining for WSSS. However, as shown in Fig. 1(a), they typically use only single-image information for object pattern discovering, ignoring the rich semantic context among the weakly annotated data. For example, with the image-level labels, not only the semantics of each individual image can be identified, the cross-image semantic relations, i.e., two images whether sharing certain semantics, are also given and should be used as cues for object pattern mining. Inspired by this, rather than relying on intraimage information only, we further address the value of cross-image semantic correlations for complete object pattern learning and effective class-activation map inference (see Fig. 1(b-c)). In particular, our classifier is equipped with a differentiable co-attention mechanism that addresses semantic homogeneity and difference understanding across training image pairs. More specifically, two kinds of co-attentions are learned in the classifier. The former one aims to capture cross-image common semantics, which enables the classifier to better ground the common semantic labels over the co-attentive regions. The latter one, called contrastive co-attention, focuses on the rest, unshared semantics, which helps the classifier better separate semantic patterns of different objects. These two co-attentions work in a cooperative and complimentary manner, together making the classifier understand object patterns more comprehensively.
In addition to benefiting object pattern learning, our co-attention provides an efficient tool for precise localization map inference (see Fig. 1(c)). Given a training image, a set of related images (i.e., sharing certain common semantics) are utilized by the co-attention for capture richer context and generate more accurate localization maps. Another advantage is that our co-attention based classifier learning paradigm brings an efficient data augmentation strategy, due to the use of training image pairs. Overall, our co-attention boosts object discovering during both the classifier's training phase as well as localization map inference stage. This provides the possibility of obtaining more accurate pseudo pixel-level annotations, which facilitate final semantic segmentation learning.
Our algorithm is a unified and elegant framework, which generalizes well different WSSS settings. Recently, to overcome the inherent limitation in WSSS without additional human supervision, some efforts resort to extra image-level supervision from simple single-class data readily available from other existing datasets [35,48], or cheap web-crawled data [18,53,54,70]. Although they improve the performance to some extent, complicated techniques, such as energy function optimization [18,58], heuristic constraints [54], and curriculum learning [70], are needed to handle the challenges of domain gap and data noise, restricting their utility. However, due to the use of paired image data for classifier training and object map inference, our method has good tolerance to noise. In addition, our method also handles domain gap naturally, as the co-attention effectively addresses domain-shared object pattern learning and achieves domain adaption as a part of co-attention parameter learning. We conduct extensive experiments on PASCAL VOC 2012 [10], under three WSSS settings, i.e., learning WSSS with (1) PASCAL VOC image-level supervision only, (2) extra simple singlelabel data, and (3) extra web data. Our algorithm sets state-of-the-art on each case, verifying its effectiveness and generalizability. Our method also ranked 1 st place in the Weakly-supervised Semantic Segmentation Track of CVPR2020 Learning from Imperfect Data (LID) Challenge [72] (LID 20 ), outperforming other competitors by large margins.
Our contributions are three-fold. (1) We address the value of cross-image semantic correlations for complete object pattern learning as well as object location inference, which is achieved by a co-attention classifier that works over paired training samples. (2) Our co-attention classifier mines semantic cues in a more comprehensive manner. In addition to single-image semantics, it mines complimentary supervision from cross-image semantic similarities and differences by the co-attention and contrastive co-attention, respectively. (3) Our approach is general enough to learn WSSS with precise image-level supervision, or with extra simple single-label, or even noisy web-crawled data. It solves inherent challenges of different WSSS settings elegantly, and shows promising results consistently.

Related Work
Weakly Supervised Semantic Segmentation. Recently, lots of WSSS methods have been proposed to alleviate labeling cost. Various weak supervision forms have been explored, such as bounding boxes [9,45], scribbles [36], point supervision [3], etc. Among them, image-level supervision, due to its less annotation demand, gains most attention and is also adopted in our approach.
Current popular solutions for WSSS with image-level supervision rely on network visualization techniques [80,86], especially the Class Activation Map (CAM) [86], which discovers image pixels that are informative for classification. However, CAM typically only identifies small discriminative parts of objects, making it not an ideal proxy ground-truth for semantic segmentation training. Therefore, numerous efforts are made towards expanding the CAM-highlighted regions to the whole objects. In particular, some representative approaches make use of image-level hiding and erasing operations to drive a classifier to focus on different parts of objects [30,34,69]. A few ones instead resort to a regions growing strategy, i.e., view the CAM-activated regions as initial "seeds" and gradually grow the seed regions until cover the complete objects [2,22,27,62]. Meanwhile, some researchers investigate to directly enhance the activated regions on feature-level [31,33,71]. When constructing CAMs, they collect multi-scale context, which is achieved by dilated convolution [71], multi-layer feature fusion [33], saliency-guided iterative training [62], or stochastic feature selection [31]. Some others accumulate CAMs from multiple training phases [23], or self-train a difference detection network to complete the CAMs with trustable information [55]. In addition, a recent trend is to utilize class-agnostic saliency cues to filter out background responses [11,22,31,34,62,69,71] during localization map inference.
Since the supervision provided in above problem setting is so weak, another category of approaches explores to leverage more image-level supervision from other sources. There are mainly two types: (1) exploring simple and single-label examples [35,48] (e.g., images from existing datasets [15,51]); or (2) utilizing near-infinite yet noisy web-sourced image [18,53,54,70] or video [18,32,58] data (also referred as webly supervised semantic segmentation [24]). In addition to the common challenge of domain gap between the extra data and target semantic segmentation dataset, the second-type methods need to handle data noise.
Past efforts only consider each image individually, while only few exceptions [11,53] address cross-image information. [53] simply applies off-the-shelf co-segmentation [25] over the web images to generate foreground priors, instead of ours encoding the semantic relations into network learning and inference. For [11], although also exploiting correlations within image pairs, the core idea is to use extra information from a support image to supplement current visual representations. Thus the two images are expected to better contain the same semantics, and unmatched semantics would bring negative influences. In contrast, we view both semantic homogeneity and difference as informative cues, driving our classifier to more explicitly identify the common as well as unshared objects, respectively. Moreover, [11] only utilizes single image to infer the activated objects, but our method comprehensively leverages the cross-image semantics in both classifier training and localization map inference stages. More essentially, our framework is neat and flexible, which is not only able to learn WSSS from clean image-level supervision, but general enough to naturally make use of extra noisy web-crawled or simple single-label data, contrarily to previous efforts which are limited to specific training settings and largely dependent on complicated optimization methods [18,58] or heuristic constraints [54]. Deterministic Neural Attention. Differentiable attention mechanisms enable a neural network to focus more on relevant elements of the input than on irrelevant parts. With their popularity in the field of natural language processing [7,37,41,47,59], attention modeling is rapidly adopted in various computer vision tasks, such as image recognition [12,21,57,64,73], domain adaptation [65,84], human pose estimation [8,61,78], reasoning among objects [52,87], and image generation [77,82,88]. Further, co-attention mechanisms become an essential tool in many vision-language applications and sequential modeling tasks, such as visual question answering [39,42,76,79], visual dialog [74,85], vision-language navigation [66], and video segmentation [40,60], showing its effectiveness in capturing the underlying relations between different entities. Inspired by the general idea of attention mechanisms, this work leverages co-attention to mine semantic relations within training image pairs, which helps the classifier network learn complete object patterns and generate precise object localization maps.

Methodology
Problem Setup. Here we follow current popular WSSS pipelines: given a set of training images with image-level labels, a classification network is first trained to discover corresponding discriminative object regions. The resulting object localization maps over the training samples are refined as pseudo ground-truth masks to further supervise the learning of a semantic segmentation network. Our Idea. Unlike most previous efforts that treat each training image individually, we explore cross-image semantic relations as class-level context for understanding object patterns more comprehensively. To achieve this, two neural co-attentions are designed. The first one drives the classifier to learn common semantics from the co-attentive object regions, while the other one enforces the classifier to focus on the rest objects for unshared semantics classification.

Co-attention Classification Network
Let us denote the training data as I = {(I n , l n )} n , where I n is the n th training image, and l n ∈{0, 1} K is the associated ground-truth image label for K semantic categories. As shown in Fig. 2(a), image pairs, i.e., (I m , I n ), are sampled from I for training the classifier. After feeding I m and I n into the convolutional embedding part of the classifier, corresponding feature maps, F m ∈ R C×H×W and F n ∈ R C×H×W , are obtained, each with H×W spatial dimension and C channels.
As in [23,31,32], we can first separately pass F m and F n to a class-aware fully convolutional layer ϕ(·) to generate class-aware activation maps, i.e., S m = ϕ(F m ) ∈ R K×H×W and S n = ϕ(F n ) ∈ R K×H×W , respectively. Then, we apply global average pooling (GAP) over S m and S n to obtain class score vectors s m ∈ R K  and s n ∈ R K for I m and I n , respectively. Finally, the sigmoid cross entropy (CE) loss is used for supervision: So far the classifier is learned in a standard manner, i.e., only individual-image information is used for semantic learning. One can directly use the activation maps to supervise next-stage semantic segmentation learning, as done in [22,32]. Differently, our classifier additionally utilizes a co-attention mechanism for further mining cross-image semantics and eventually better localizing objects. Co-Attention for Cross-Image Common Semantics Mining. Our coattention attends to the two images, i.e., I m and I n , simultaneously, and captures their correlations. We first compute the affinity matrix P between F m and F n : where F m ∈ R C×HW and F n ∈ R C×HW are flattened into matrix formats, and W P ∈ R C×C is a learnable matrix. The affinity matrix P stores similarity scores corresponding to all pairs of positions in F m and F n , i.e., the (i, j) th element of P gives the similarity between i th location in F m and j th location in F n . Then P is normalized column-wise to derive attention maps across F m for each position in F n , and row-wise to derive attention maps across F n for each position in F m : where softmax is performed column-wise. In this way, A n and A m store the co-attention maps in their columns. Next, we can compute attention summaries where F m∩n m and F m∩n n are reshaped into R C×W×H . Co-attentive feature F m∩n m , derived from F n , preserves the common semantics between F m and F n and locate the common objects in F m . Thus we can expect only the common semantics l m ∩ l n can be safely derived from F m∩n m , and the same goes for F m∩n n . Such coattention based common semantic classification can let the classifier understand the object patterns more completely and precisely.
To make things intuitive, consider the example in Fig. 2, where I m contains Table and Person, and I n has Cow and Person. As the co-attention is essentially the affinity computation between all the position pairs between I m and I n , only the semantics of the common objects, Person, will be preserved in the co-attentive features, i.e., F m∩n m and F m∩n n (see Fig. 2(b)). If we feed F m∩n m and F m∩n n into the class-aware fully convolutional layer ϕ, the generated class-aware activation maps, i.e., S m∩n m =ϕ(F m∩n m )∈R K×H×W and S m∩n n =ϕ(F m∩n n )∈R K×H×W , are able to locate the common object Person in I m and I n , respectively. After GAP, the predicted semantic classes (scores) s m∩n m ∈ R K and s m∩n n ∈ R K should be the common semantic labels l m ∩ l n of I m and I n , i.e., Person.
Through co-attention computation, not only the human face, the most discriminative part of Person, but also other parts, such as legs and arms, are highlighted in F m∩n m and F m∩n n (see Fig. 2(b)). When we set the common class labels, i.e., Person, as the supervision signal, the classifier would realize that the semantics preserved in F m∩n m and F m∩n n are related and can be used to recognize Person. Therefore, the co-attention, computed across two related images, explicitly helps the classifier associate semantic labels and corresponding object regions and better understand the relations between different object parts. It essentially makes full use of the context across training data.
Intuitively, for the co-attention based common semantic classification, the labels l m ∩ l n shared between I m and I n are used to supervise learning: Contrastive Co-Attention for Cross-Image Exclusive Semantics Mining. Aside from the co-attention described above that explores cross-image common semantics, we propose a contrastive co-attention that mines semantic differences between paired images. The co-attention and contrastive co-attention complementarily help the classifier better understand the concept of the objects. As shown in Fig. 2(a), for I m and I n , we first derive class-agnostic coattentions from their co-attentive features, i.e., The set operation '∩' is slightly extended here to represent bitwise-and.
where σ(·) is the sigmoid activation function, and the parameter matrix W B ∈ R 1×C learns for common semantics collection and is implemented by a convolutional layer with 1×1 kernel. B m∩n m and B m∩n n are class-agnostic and highlight all the common object regions in I m and I n , respectively, based on which we derive contrastive co-attentions: The contrastive co-attention A m\n m of I m , as its superscript suggests, addresses those unshared object regions that are only of I m , but not of I n , and the same goes for A n\m n . Then we get contrastive co-attentive features, i.e., unshared semantics in each images: Compared with the co-attention that investigates common semantics as informative cues for boosting object patterns mining, the contrastive co-attention addresses complementary knowledge from the semantic differences between paired images. Fig. 2(b) gives an intuitive example. After computing the contrastive co-attentions between I m and I n (Eq. 7), , the classifier is required to accurately recognize Table and Cow classes, respectively. When the common objects are filtered out by the contrastive co-attentions, the classifier has a chance to focus more on the rest image regions and mine the unshared semantics more consciously. This also helps the classifier better discriminate the semantics of different objects, as the semantics of common objects and unshared ones are disentangled by the contrastive co-attention. For example, if some parts of Cow are wrongly recognized as Person-related, the contrastive co-attention will discard these parts in F n\m n . However, the rest semantics in F n\m n may be not sufficient enough for recognizing Cow. This will enforce the classifier to better discriminate different objects.
For the contrastive co-attention based unshared semantic classification, the supervision loss is designed as: The set operation '\' is slightly extend here, i.e., ln\lm = ln − ln∩lm.
More In-Depth Discussion. One can interpret our co-attention classifier from a view of auxiliary-task learning [14,43], which is investigated in self-supervised learning field to improve data efficiency and robustness, by exploring auxiliary tasks from inherent data structures. In our case, rather than the task of singleimage semantic recognition which has been extensively studied in conventional WSSS methods, we explore two auxiliary tasks, i.e., predicting the common and uncommon semantics from image pairs, for fully mining supervision signals from weak supervision. The classifier is driven to better understand the cross-image semantics by attending to (contrastive) co-attentive features, instead of only relying on intra-image information (see Fig. 2(c)). In addition, such strategy shares a spirit of image co-segmentation. Since the image-level semantics of training set are given, the knowledge about some images share or unshare certain semantics should be used as a cue, or supervision signal, to better locate corresponding objects. Our co-attention based learning pipeline also provides an efficient data augmentation strategy, due to the use of paired samples, whose amount is near the square of the number of single training images.

Co-Attention Classifier Guided WSSS Learning
Training Co-Attention Classifier. The overall training loss for our co-attention classifier ensembles the three terms defined in Eq. 1, 5, and 9: The coefficients of different loss terms are set as 1 in our all experiments. During training, to fully leverage the co-attention to mine the common semantics, we sample two images (I m , I n ) with at least one common class, i.e., l m ∩l n = 0. Generating Object Localization Maps. Once our image classifier is trained, we apply it over the training data I = {(I n , l n )} n to produce corresponding object localization maps, which are essential for semantic segmentation network training. We explore two different strategies to generate localization maps.
-Single-round feed-forward prediction, made over each training image individually. For each training image I n , running the classifier and directly using its class-aware activation map (i.e., S n ∈ R K×H×W ) as the object localization map L n , as most previous network visualization based methods [23,32,54] done. -Multi-round co-attentive prediction with extra reference information, which is achieved by considering extra information from other related training images (see Fig. 1(c)). Specifically, given a training image I n and its associated label vector l n , we generate its localization map L n in a class-wise manner. For each semantic class k ∈ {1, · · · , K} labeled for I n , i.e., l n,k = 1 and l n,k is the k th element of l n , we sample a set of related images R = {I r } r from I, which are also annotated with label k, i.e., l r,k = 1. Then we compute the co-attentive feature F m∩r n from each related image I r ∈ R to I n , and get the co-attention based class-aware activation map S m∩r n . Given all the class-aware activation maps {S m∩r n } r from R, they are integrated to infer the localization map only for class k, i.e., L n,k = 1 |R| r∈R S m∩r n,k . Here L n,k ∈ R H×W and S (·) n,k ∈ R H×W indicate the feature map at k th channel of L n ∈ R K×H×W and S (·) n ∈ R K×H×W , respectively. '|·|' numerates the elements. After inferring the localization maps for all the annotated semantic classes of I n , we can get L n .
These two localization map generation strategies are studied in our experiments ( §4.5), and the last one is more favored, as it uses both intra-and interimage semantics for object inference, and shares a similar data distribution of the training phase. One may notice that the contrastive co-attention is not used here. This is because contrastive co-attentive feature (Eq. 8) is from its original image, which is effective for boosting feature representation learning during classifier training, while contributes little for localization maps inference (with limited cross-image information). Related experiments can be found at §4.5. Learning Semantic Segmentation Network. After obtaining high-quality localization maps, we generate pseudo pixel-wise labels for all the training samples I, which can be used to train arbitrary semantic segmentation network. For pseudo groundtruth generation, we follow current popular pipeline [20,22,23,31,32,81], that uses localization maps to extract class-specific object cues and adopts saliency maps [19,38] to get background cues. For the semantic segmentation network, as in [20,23,31,32], we choose DeepLab-LargeFOV [5]. Learning with Extra Simple Single-Label Images. Some recent efforts [35,48] are made towards exploring extra simple single-label images from other existing datasets [15,51] for further boosting WSSS. Though impressive, specific network designs are desired, due to the issue of domain gap between additionally used data and the target complex multi-label dataset, i.e., PASCAL VOC 2012 [10]. Interestingly, our co-attention based WSSS algorithm provides an alternate that addresses the challenge of domain gap naturally. Here we revisit the computation of co-attention in Eq. 2. When I m and I n are from different domains, the parameter matrix W P , in essence, learns to map them into a unified common semantic space [44] and the co-attentive features can capture domainshared semantics. Therefore, for such setting, we learn three different parameter matrixes for W P , for the cases where I m and I n are from (1) the target semantic segmentation domain, (2) the one-label image domain, and (3) two different domains, respectively. Thus the domain adaption is efficiently achieved as a part of co-attention learning. We conduct related experiments in §4.2. Learning with Extra Web Images. Another trend of methods [18,24,54,70] address webly supervised semantic segmentation, i.e., leveraging web images as extra training samples. Though cheaper, web data are typically noisy. To handle this, previous arts propose diverse effective yet sophisticated solutions, such as multi-stage training [24] and self-paced learning [70]. Our co-attention based WSSS algorithm can be easily extended to this setting and solve data noise elegantly. As our co-attention classifier is trained with paired images, instead of previous methods only relying on each image individually, our model provides a more robust training paradigm. In addition, during localization map inference, a set of extra related images are considered, which provides more comprehensive and accurate cues, and further improves the robustness. We experimentally demonstrate the effectiveness of our method in such a setting in §4.3.

Detailed Network Architecture
Network Configuration. In line with conventions [23,71,83], our image classifier is based on ImageNet [29] pre-trained VGG-16 [56]. For VGG-16 network, the last three fully-connected layers are replaced with three convolutional layers with 512 channels and kernel size 3×3, as done in [23,83]. For the semantic segmentation network, for fair comparison with current top-leading methods [2,23,31,55], we adopt the ResNet-101 [17] version Deeplab-LargeFOV architecture. Training Phases of the Co-Attention Classifier and Semantic Segmentation Network. Our co-attention classifier is fully end-to-end trained by minimizing the loss defined in Eq. 10. The training parameters are set as: initial learning rate (0.001) which is reduced by 0.1 after every 6 epochs, batch size (5), weight decay (0.0002), and momentum (0.9). Once the classifier is trained, we generate localization maps and pseudo segmentation masks over all the training samples (see §3.2). Then, with the masks, the semantic segmentation network is trained in a standard way [23] using the hyper-parameter setting in [5]. Inference Phase of the Semantic Segmentation Network. Given an unseen test image, our segmentation network works in the standard semantic segmentation pipeline [5], i.e., directly generating segments without using any other images. Then CRF [28] post-processing is performed to refine predicted masks.
Note that above settings are used in traditional WSSS datasets (i.e., §4.1, §4.2, §4.3). Due to the specific task setup in LID 20 [72], corresponding training and testing settings will be detailed in §4.4.

Experiment
Overview. Experiments are first conducted over three different WSSS settings: (1) The most standard paradigm [22,23,55,69] that only allows image-level supervision from PASCAL VOC 2012 [10] (see §4.1). (2) Following [35,48], additional single-label images can be used, yet bringing the challenge of domain gap (see §4.2). (3) Webly supervised semantic segmentation paradigm [24,32,54], where extra web data can be accessed (see §4.3). Then, in §4.4, we show the results in WSSS track of LID 20 , where our method achieves the champion. Finally, in §4.5, ablation studies are made to assess the effectiveness of essential parts of our algorithm. Evaluation Metric. In our experiments, the standard intersection over union (IoU) criterion is reported on the val and test sets of PASCAL VOC 2012 [10]. The scores on test set are obtained from official PASCAL VOC evaluation server.

Experiment 1: Learn WSSS only from PASCAL VOC [10] Data
Experimental Setup: We first conduct experiment following the most standard setting that learns WSSS with only image-level labels [22,23,55,69], i.e., only image-level supervision from PASCAL VOC 2012 [10] is accessible. PASCAL VOC 2012 contains a total of 20 object categories. As in [5,69], augmented training data from [16] are also used. Finally, our model is trained on totally 10,582 samples with only image-level annotations. Evaluations are conducted on the val and test sets, which have 1,449 and 1,456 images, respectively. Experimental Results: Table 1a compares our approach and current topleading WSSS methods (highest mIoU is used for comparison) with image-level supervision, on both PASCAL VOC12 val and test sets. Additionally, we show some segmentation results in Fig. 3. We can observe that our method achieves mIoU scores of 66.2 and 66.9 on val and test sets respectively, outperforming all the competitors. The performance of our method is 87% of the DeepLab-LargeFOV [5] trained with fully annotated data, which achieved an mIoU of 76.3 on val set. When compared to OAA+ [23], current best-performing method, our approach obtains the improvement of 1.0% on val set. This well demonstrates that the localization maps produced by our co-attention classifier effectively detect more complete semantic regions towards the whole target objects. Note that our network is elegantly trained end-to-end in a single phase. In contrast, many other recent approaches including OAA+ [23] and SSDD [55], use extra networks [2,23,55] to learn auxiliary information (e.g., integral attention [23], pixel-wise semantic affinity [55], etc.), or adopt multi-step training [1,69,71].

Experiment 2: Learn WSSS with Extra Simple Single-Label Data
Experimental Setup: Following [35,48], we train our co-attention classifier and segmentation network with PASCAL images and extra single-label images. The extra single-label images are borrowed from the subsets of Caltech-256 [15] and ImageNet CLS-LOC [51], and whose annotations are within 20 VOC object categories. There are a total of 20,057 extra single-label images.  [2], OAA+ [23], and our method.  Table 1b. Our method significantly improves the most recent method (i.e., AttnBN [35]) in this setting by 5.0% and 4.2% in val and test sets, respectively. With the fact that objects of the same category but from different domains share similar visual patterns [35], our co-attention provides an end-to-end strategy that efficiently captures the common, cross-domain semantics, and learns domain adaption naturally. Even AttnBN is specifically designed for addressing such setting by knowledge transfer, our method still suppresses it by a large margin. Compared with the setting in §4.1 where only PASCAL images are used for training, our method obtains improvements on both val and test sets, verifying that it successfully mines knowledge from extra simple single-label data and copes with domain gap well.

Experiment 3: Learn WSSS with Extra Web-Sourced Data
Experimental Setup: We also conduct experiments using both PASCAL VOC images and webly craweled images as training data. We use the web data provided by [54], which are retrieved from Bing based on class names. The final dataset contains 76,683 images across 20 PASCAL VOC classes.
Experimental Results: Table 1c shows the performance comparisons between our method and the previous webly supervised segmentation methods. It shows that our method outperforms all other approaches and sets new state-of-thearts with mIoU score of 67.7 and 67.5 on PASCAL VOC 2012 val and test sets, respectively. Among the compared methods, Hong et al. [18] utilize richer information of the temporal dynamics provided by additional large-scale videos.
In contrast, although only using static image data, our method still outperforms it on the val and test sets by 9.6% and 8.8%, respectively. Compared with Shen et al. [54] which uses the same web data as ours, our method substantially improves it by a clear margin of 3.6% on the test set.  (8), weight decay (0.0005), and max epoch (15). During training, the equivariant attention [67] is also adopted. Once our image classifier is trained, we run the classifier and directly use its class-aware activation map (i.e., S n ) as the object localization map L n .

Ablation Studies
Inference Strategies. Table 2 shows mIoU scores on PASCAL VOC 2012 val set w.r.t. different inference modes (see §3.2). When using the traditional inference mode "single-round feed-forward", our method substantially suppresses Full Model co-attention Lbasic (Eq. 1)+Lco-att (Eq. 5)+L co-att (Eq. 9) 66.2 +contrastive co-attention = L (Eq. 10) basic classifier, by improving mIoU score from 61.7 to 64.7. This evidences that co-attention mechanism (trained in an end-to-end manner) in our classifier improves the underlying feature representations and more object regions are identified by the network. We can observe that by using more images to generate localization maps, our method obtains consistent improvement from "Test image only" (64.7), to "Test images and other related images" (66.2). This is because more semantic context are exploited during localization map inference. In addition, using contrastive co-attention for localization map inference doesn't boost performance (66.2). This is because the contrastive co-attentive features for one image are derived from the image itself. In contrast, co-attentive features are from the other related image, thus can be effective in the inference stage.
(Contrastive) Co-Attention. As seen in Table 4, by only using co-attention (Eq. 5), we already largely suppress the basic classifier (Eq. 1) by 3.8%. When adding additional contrastive co-attention (Eq. 9), we obtain mIoU improvement of 0.7%. Above analysis verify our two co-attentions indeed boost performance.  Table 5, it is easily observed that when increasing the number of related images from 0 to 3, the performance gets boosted consistently. However, when further using more images, the performance degrades. This can be attributed to the trade-off between useful semantic information and noise brought by related images. From 0 to 3 reference images, more semantic information is used and more integral regions for objects are mined. When further using more related images, useful information reaches its bottleneck and noise, caused by imperfect localization of the classifier, takes over, decreasing performance.

Conclusion
This work proposes a co-attention classification network to discover integral object regions by addressing cross-image semantics. With this regard, a co-attention is exploited to mine the common semantics within paired samples, while a contrastive co-attention is utilized to focus on the exclusive and unshared ones for capturing complimentary supervision cues. Additionally, by leveraging extra context from other related images, the co-attention boosts localization map inference. Further, by exploiting additional single-label images and web images, our approach is proven to generalize well under domain gap and data noise. Experiments over three WSSS settings consistently show promising results. Our method also ranked 1 st place in the weakly-supervised semantic segmentation track of LID 20 challenge.