Elamur Research

CIAN: Cross-Image Affinity Net for Weakly Supervised Semantic Segmentation

Paper · 2020 · Junsong Fan, Zhaoxiang Zhang, Tieniu Tan et al.

Summary

An image tag can tell you that a bicycle appears in a photograph. A segmentation mask has to show where the bicycle ends and the rest of the scene begins. Drawing those masks for training takes much more work than tagging photographs. CIAN, short for Cross-Image Affinity Net, addresses the gap between the two kinds of annotation. It learns to assign a category to each pixel using training images whose human annotations identify the categories present in the image as a whole.

The authors start with class activation maps, which show where an image classifier finds evidence for a category. A classifier can recognize a bicycle from a conspicuous part and leave much of the bicycle unmarked. Another photograph may make a different part easy to recognize. CIAN gives a segmentation network a way to use information from both photographs. During training, the network pairs images that share an image tag, compares features at locations across the pair, and uses those comparisons to decide how much information to bring from the reference image into each location of the image it is segmenting.

The training procedure uses both the initial pixel labels, called seeds, and new pixel labels generated from the network’s predictions. A prediction can supply a new label when its highest-scoring category agrees with the image tags. This gives the network supervision at some locations the seeds left blank. CIAN also learns to gather information from other locations within the same image. That operation stays in use at test time, when the network receives one image at a time.

With a ResNet101 backbone, CIAN reaches 64.3% mean intersection over union on the Pascal VOC 2012 validation split and 65.3% on the test split. This metric measures how closely predicted regions overlap the annotated regions, averaged across categories. The authors report the highest scores among the image-label approaches in their comparison. Their controlled experiments help explain the result. Adding cross-image information under the original seed supervision produces a modest gain. A larger gain follows when the network also uses its predictions to fill gaps in that supervision, and the gain is stronger when the reference images are chosen using shared tags. The visual examples show recovered object parts, fewer spurious predictions, and a failure involving small, interwoven objects of similar appearance.

Deep dive: CIAN: Cross-Image Affinity Net for Weakly Supervised Semantic Segmentation

CIAN learns from related training images to turn image tags into more complete pixel masks, then segments each new image on its own. · about 32 minutes to read

The problem and its context

What an image tag leaves unresolved

Semantic segmentation asks for a prediction at every pixel. A region belonging to a foreground category should be assigned that category throughout its visible extent, and pixels outside the foreground categories can be assigned to background. A whole-image classification task has a different endpoint. Once a classifier has found enough evidence that a category appears somewhere in a photograph, it can give the correct image-level answer. For segmentation, evidence that establishes presence is only the beginning. The network also has to recover the extent of the region and distinguish it from its surroundings.

The difference matters when assembling a training set. A dense mask gives the learning procedure a target at every annotated location. A bounding box gives a rough location and extent, while a scribble gives a trail of labeled points. An image tag gives the category with no spatial attachment. The paper describes these as different forms of weak supervision and takes up the image-tag setting, where the training procedure has the greatest amount of spatial information to recover among the annotation types it discusses.

Suppose a training photograph has several tags. Each one says that its category is present somewhere, and all of them apply to the photograph as a whole. A segmentation network has to work out which locations belong to which category and where background begins. An image tag has another use, however. If a second photograph has a tag in common with the first, the learning procedure can look for features that recur across the photographs. It can do so before it has reliable boundaries for the objects in either scene. CIAN uses the tags in both ways. They constrain the categories a training prediction can supply, and they guide the choice of images that can exchange information.

This is why the paper focuses on relationships across training examples. Any training set already contains recurring objects, parts and appearances. In the pipeline the authors describe as typical, those examples contribute to learning through shared network parameters while the processing used to construct or complete each image’s mask works on that image individually. CIAN makes a particular relationship between training images available during the calculation of a prediction. A location in one image can receive information from specific locations in another.

Where the first pixel labels come from

The common pipeline described in the paper begins by making approximate masks out of image tags. These masks supply initial pixel labels, which the paper calls seeds. The segmentation network then trains on those labels. Class activation mapping, or CAM, is a widely used way to get the foreground seeds. It gives each category a spatial score map derived from the same classifier that learned to recognize the category at image level.

A CAM’s usefulness comes from its ability to point to a region with evidence for a category. Its weakness comes from the objective that produced that evidence. The image classifier can succeed when a distinctive feature accounts for the category prediction. Its task gives it little reason to assign equally strong evidence to every visible part of an object. Turning the strongest locations into training labels therefore frequently supplies a recognizable patch surrounded by pixels whose status remains open.

The distinction between an unknown pixel and a background pixel is important here. An initial mask can contain confident foreground, selected background, and locations left without a label. A blank location adjacent to a foreground seed may belong to the same object. Treating blank locations as background would make the classifier’s incomplete coverage into a dense instruction to exclude them. Ignoring the blanks keeps that initial supervision more conservative, while leaving the segmentation network with fewer locations from which to learn directly.

Earlier methods, as described by the authors, give the pipeline several ways to find more evidence. Iterative erasing hides a region the classifier already uses so that another pass can discover other informative regions. The multi-dilation approach combines activation maps made with different convolutional dilation rates, which lets the maps draw on spatial evidence at different scales. Seeded region growing fills previously undefined regions from existing seeds as training proceeds. Each responds to the same practical difficulty: the pixels easiest to label from a classifier cover only part of what a useful segmentation mask must contain.

Other work changes the way predictions or seeds are constructed. The paper describes an iterative method that alternates between a classifier operating on superpixels, which are groups of pixels treated as units, and a segmentation network. It also mentions approaches that regularize predicted masks with additional constraints. The concurrent FickleNet method randomly drops connections within sliding windows, giving the classification computation different views of the evidence. These approaches show why the quality and coverage of the original localization cues mattered to the field. CIAN adds a source of evidence at the stage where the segmentation network builds its own representation.

Where cross-image affinity fits

The closest term in some earlier work is pixel affinity. In this context, an affinity indicates how strongly two feature locations are related. AffinityNet, as the paper describes it, samples locations with guidance from CAM seeds and trains an additional network to learn affinities. Those learned relationships help complete seeds. CIAN’s affinity computation is part of the segmentation network and supplies a contribution to its features during training. The segmentation losses can shape the affinity calculation at the same time as they shape the category predictions.

The authors also relate their module to non-local networks. A non-local operation can use information from distant locations within an image. The operation offers a useful template for CIAN because a location can gather evidence from a spatially distributed set of features. For CIAN’s cross-image path, that set comes from another photograph. The distinction concerns where the evidence comes from and what training problem it serves. Non-local image context helps represent relationships inside a scene. Cross-image context lets a feature in one scene draw on related features found elsewhere in the training set.

Co-segmentation is related in a different way. It uses a group of images to find objects that the group has in common. The paper describes its outputs as class-agnostic masks, meaning that the mask identifies the common object without having to assign it a category from the segmentation task’s vocabulary. The group is part of the input when co-segmentation is applied. CIAN uses groups during learning, while its deployed task is to assign known categories to the pixels of a single image. The paper also distinguishes its approach from using co-segmentation to generate initial seeds. CIAN incorporates the exchange of features into the network that learns segmentation from the seeds.

The authors’ motivating example shows what the exchange is meant to accomplish. A query image and a reference image of the same category each have only a portion of the object strongly activated. Starting from a marked query location, the affinity calculation assigns weights over reference locations. The retrieved information changes the activation in the query image. The example makes two uses of reference evidence easy to distinguish. It can reinforce a part for which the query already has evidence, or help bring out a part that the query represents weakly. Both effects concern the feature used to make the prediction. The image tag identifies a useful relationship between photographs and leaves the network to learn which locations will make use of it.

The method, step by step

From tags to initial seeds

The method starts by training an image classifier. Its last classification layer sits after global average pooling, which gathers the spatial features into an image-level representation. The classifier learns from the category tags. Once it is trained, the authors remove the global averaging step and apply the classification layer at each feature-map location. That yields a spatial map of scores for a category. A location with a high score is a candidate seed for that category.

The seed generator uses a VGG16 backbone pretrained on ImageNet. The authors change the last two pooling layers to stride 1 and set the dilation rate in the Conv5 block to 2. Stride governs how far the pooling operation moves between locations. Dilation governs the spacing of the positions sampled by the convolution. The changes let the classifier retain larger spatial maps for generating seeds. The authors train it with a sigmoid loss for the image categories, using a learning rate of 1e-3. The category tags allow several foreground categories to be present in the same image.

The CAM scores are normalized to the interval [0, 1], and the paper uses a threshold of 0.3 to identify foreground seeds. A separate, off-the-shelf saliency system supplies background seeds with a threshold of 0.06. Saliency is used here as a cue about which parts of an image are visually prominent, giving the procedure a way to identify candidate background independently of the per-category CAM scores. Pixels left unassigned, or given conflicting assignments, are marked to be ignored. The resulting training targets are intentionally sparse. A certain foreground or background assignment can enter the seed loss, and the other positions remain available for the completion procedure.

Seed generation and segmentation play different roles in the method. The classifier creates the initial supervision before the segmentation training described below. The affinity module operates on the segmentation network’s own features and learns to change those features as training proceeds. A reference image supplies feature vectors during that calculation. Its initial mask is a source of supervision when training uses that image as a query, while the message sent to another query is formed from its features.

Choosing images and collecting their features

The image being segmented is called the query. A reference is another training image chosen to help represent the query. The paper samples references at random from images with at least one category in common with the query. Matching every tag would make compatible pairs hard to find when an image can contain several categories. Requiring a shared category supplies a reason to expect some useful correspondence and makes a much broader set of partners available. The feature comparison still has to resolve where those correspondences lie.

Both images pass through a shared segmentation backbone. The backbone is the feature-producing part of the network. The paper’s architecture uses the same feature extractor for query and reference, sometimes called a Siamese arrangement. This puts both images into a common feature representation. CIAN then takes the feature maps just before the segmentation classifier. These are spatial grids of vectors. Each location has a vector of learned features, and the paper calls such locations pixels when describing affinity. The matching operation therefore works on the spatial grid produced by the network.

At a query location, the module compares its feature vector with the projected feature vectors across the reference map. A high match gives the corresponding reference location more influence over what the query receives. The same kind of calculation can run with the query as its own reference. The module transforms the retrieved information and adds it to the original query feature, so the segmentation classifier receives a feature carrying both the original evidence and the retrieved contribution.

CIAN from image tags to single-image segmentation

The steps in order.

CIAN from image tags to single-image segmentationStep 1: Generate foreground and background seeds1. Generate foreground and background seedsStep 2: Sample a reference with a shared category2. Sample a reference with a shared categoryStep 3: Extract query and reference feature maps3. Extract query and reference feature mapsStep 4: Retrieve features through cross-affinity and self-affinity4. Retrieve features through cross-affinity and self-affinityStep 5: Add the retrieved information to query features5. Add the retrieved information to query featuresStep 6: Train on seed labels and online completions6. Train on seed labels and online completionsStep 7: Retrain on refined predictions7. Retrain on refined predictionsStep 8: Segment each test image with self-affinity8. Segment each test image with self-affinity

Scoring a match between locations

Let q denote the query image and r the reference. Write S(q) and S(r) for their sets of feature-map locations. A query index i belongs to S(q), and a reference index j belongs to S(r). The feature vectors at these locations are xᵢ and xⱼ. CIAN first computes a positive affinity score for every such query–reference pair.

kᵢⱼ = exp(φq(xᵢ) · φr(xⱼ))

Here kᵢⱼ is the unnormalized affinity from query location i to reference location j. The learned function φq projects a query feature and φr projects a reference feature. The dot · denotes the inner product of the projected vectors. The function exp exponentiates that scalar score. Both projections are trained by the segmentation objective, so the features used to compare locations can adapt to the task. Two spatial positions need only have compatible projected features to receive a large affinity. Their coordinates can be entirely different.

The relevant set of reference locations changes with the image pair, and the same reference location can matter differently to different query locations. For each query location, CIAN normalizes over the reference map. Using t as the index in the denominator makes the direction of the normalization explicit.

k̄ᵢⱼ = kᵢⱼ / ∑ₜ∈S(r) kᵢₜ

The bar in k̄ᵢⱼ marks the normalized affinity. The numerator is the raw score for reference location j. In the denominator, ∑ adds the scores for the fixed query location i over every reference index t in S(r). The sum makes the weights over the reference positions add to a unit for each query location. The resulting weights have a relative interpretation. When the score for one reference position rises relative to the others, that position takes a larger share of the contribution to the given query location.

This comparison has a directional role. The query asks for information and the reference supplies it. The projections have different learned functions, and the denominator is tied to the reference positions available to a particular query. Reversing the images would set up a new calculation with a new set of positions to normalize over. The paper’s use of affinity is therefore a way to select information for a prediction. It does not depend on first establishing a symmetric correspondence between object masks.

Building and adding the message

CIAN uses a separate learned transformation for the content it retrieves. The projection used to compare a reference location with the query can emphasize features useful for deciding whether it matches. The content transformation can preserve features useful to the query once that decision has been made. These two roles are represented by φr and φc, respectively.

mᵢⱼ = k̄ᵢⱼ φc(xⱼ)

The vector mᵢⱼ is the message from reference location j to query location i. The function φc compresses the reference vector xⱼ into the information available for retrieval. The scalar k̄ᵢⱼ weights that vector by the normalized affinity. Locations with higher weights have more influence on the incoming message. A query can gather evidence from several places, with the amount from each place determined separately.

mᵢ = ∑ⱼ∈S(r) mᵢⱼ

In this expression, mᵢ is the total message at query location i, and ∑ adds the weighted message vectors over all reference locations j in S(r). The sum leaves the query’s spatial layout intact. There is a total message for each location of the query feature map, constructed by looking across the reference map. The construction is repeated at every query location, so different parts of the same object can retrieve different mixtures of reference information.

x̂ᵢ = xᵢ + φo(mᵢ)

Here x̂ᵢ is the augmented query feature at location i. The function φo transforms and normalizes the accumulated message mᵢ before the + adds it to the original feature xᵢ. The added term is called a residual. At the start of training, the authors expect the affinity scores to be unreliable. They attach a zero-initialized batch normalization layer to this output transformation before the addition. This lets learning start with the original feature dominating the prediction and develop the contribution of the residual as training progresses.

The segmentation classifier receives x̂ᵢ and produces category probabilities for that location. A prediction depends on what the query represents, how the projections score the available reference positions, and what the content transformation sends back. The seed and completion losses act on the resulting prediction. They can reward a useful retrieval indirectly by making its effect on the segmentation decision part of the supervised computation. There is no separate training annotation that specifies which point in one photograph matches which point in another.

Combining reference and self-affinity messages

The paper defines the operation for a query with several possible references. Each query–reference pair is processed separately up through the sum over that reference’s feature map. This produces a message at each query location for each partner. The messages then need to be merged before they are added to the original feature.

mᵢ = maxₕ∈{1, …, N} mᵢ⁽ʰ⁾

In the multiple-reference form, N is the number of partners and h indexes them from 1 through N. The vector mᵢ⁽ʰ⁾ is the message delivered to query location i by partner h after summing over that partner’s locations. The maximum combines the partner messages component by component into mᵢ. The paper also names averaging as a possible merge. After merging, φo transforms the resulting vector before it is added to the original query feature, as in the single-reference calculation.

The implementation uses a single external reference per query and also uses the query paired with itself. During training, the self-pair can participate in the message merge. It gives the query access to useful evidence inside its own image even when an external reference shares only some of its categories. The authors found that additional external partners brought negligible improvement in their experiments. They suggest that random sampling across training can expose a query to many partners over time, even when each visit uses just one external reference. That schedule separates the number of references processed for a particular prediction from the variety of pairs encountered during learning.

For the affinity projections φq, φr and φc, the implementation uses single 1 × 1 convolutional layers. These transform the channels at each feature location. The query and reference matching projections halve the feature dimensions. On the reference side, max-pooling with stride 2 spatially downsamples the projected matching features and the projected content features. These choices reduce the work involved in comparing query locations to reference locations and collecting the messages. The module runs near the top of Deeplab-V2-Largefov, where the feature maps already have relatively small spatial dimensions.

Learning from the seed labels

The segmentation classifier applies a softmax to give a probability distribution over the categories for each augmented location. Call this classifier f꜀, with C denoting the number of categories in its output. For query image q, the collection x̂ consists of the augmented feature x̂ᵢ at each query location. For those locations with an initial seed label, training uses the usual cross-entropy objective.

Lce(x̂) = −(1 / |S′(q)|) ∑ᵢ∈S′(q) yᵢᵀ log f꜀(x̂ᵢ)

The quantity Lce(x̂) is the seed cross-entropy loss for the query’s augmented features. The set S′(q) contains query locations with valid seed labels, and |S′(q)| is the number of those locations. The sum runs over the indices i in that set. The vector yᵢ encodes the seed label at location i, with a unit entry for the seed’s category and zero entries elsewhere. The superscript ᵀ transposes the vector so it can select the corresponding entry from log f꜀(x̂ᵢ), the vector of log probabilities. The negative sign turns a higher probability for the seed category into a smaller loss. Division by the number of valid locations gives the mean over the seed-labeled portion of the image.

A position whose seed was missing or conflicting has no term in this loss. The module can still construct an affinity and a feature for it, because affinity is calculated over the feature maps. This creates a distinction between the locations at which the architecture can retrieve complementary information and the locations at which the seed loss can directly reward a successful prediction. The completion loss adds supervision to some of the positions for which this difference matters.

Making more targets during training

The completion procedure applies the segmentation classifier to the augmented features and turns some of its current decisions into temporary training targets. First it identifies the highest-scoring category at a location. Then it checks whether that category is among the image-level labels for the query. A category-compatible winner supplies an online pseudo-label, meaning a label produced during the current training process instead of one entered by an annotator or fixed at the seed stage.

ŷᵢ,ₗ = 𝟙[(arg max f꜀(x̂ᵢ) = l) ∧ (l ∈ L(q))]

The symbol ŷᵢ,ₗ denotes the entry for category l in the online target vector ŷᵢ at query location i. The operation arg max returns the category index with the largest probability in f꜀(x̂ᵢ). The set L(q) contains the query image’s labels, and ∈ tests whether l belongs to that set. The symbol ∧ requires both conditions to hold. The indicator 𝟙 gives a unit entry when the predicted winner equals l and the image label set contains l. It gives zero otherwise.

The order of the check matters. A location supplies a target when the classifier’s winner passes the image-label check. The rule does not choose the best permitted category after discarding a higher-scoring incompatible winner. This gives the completion procedure a way to skip that location. A prediction that passes the check can provide a target even where there was no seed. It still rests on the network’s spatial judgment. The presence of a category in the image is evidence that the category is possible somewhere in the scene.

Lcp(x̂) = −(1 / |S″(q)|) ∑ᵢ∈S″(q) ŷᵢᵀ log f꜀(x̂ᵢ)

The quantity Lcp(x̂) is the completion loss for the query. The set S″(q) contains the effective locations under the online targets, and |S″(q)| counts those locations. The sum runs over their indices i. The transposed online target ŷᵢᵀ selects the log probability assigned by f꜀ to the category that passed the check at that location. The minus sign and the division have the same roles as in the seed loss. The loss is the mean negative log probability over the locations carrying effective online targets.

The seed and completion losses give the network two sources of supervision with different origins. Seed labels come from the image classifier and saliency stage. Online labels come from the segmentation network’s current augmented features and can change as those features improve. If retrieval makes a previously weak object region recognizable, the completion rule gives that prediction a way to contribute to training. This is the mechanism the authors use to turn a more informative representation into broader spatial supervision.

Keeping the training and test computations aligned

The authors apply both losses to the features augmented through cross-affinity and to the features augmented through self-affinity. In the self-affinity computation, the query and reference inputs are the same image. Its other locations can supply information to a query position, using the same form of weighting and retrieval that is used for external pairs.

L = Lce(x̂ᶜ) + Lce(x̂ˢ) + Lcp(x̂ᶜ) + Lcp(x̂ˢ)

Here L is the overall training loss. The superscripts c and s identify the augmented query representations for the cross-affinity and self-affinity cases, respectively. Lce is the cross-entropy term on the initial seed labels, and Lcp is the cross-entropy term on the online completion targets. Each + adds another supervision term. The expression trains the classifier to work with affinity-augmented features when cross-image information is available and when the query image must supply its own context.

The self-affinity branch serves a practical purpose at test time. CIAN has learned to make predictions with a residual added to the original feature. The authors expect that removing the residual at deployment would substantially change the representations seen by the classifier. At test time the image supplies its own reference features, so it can keep the residual operation and predict from a feature of the kind used during training. The benefit of external reference images must therefore survive in the learned parameters by the time the network is tested.

Optimizing, refining and retraining

The segmentation backbones are pretrained on ImageNet. The paper specifies random normal initialization with standard deviation 0.01 for newly added layers, alongside the special zero initialization attached to the affinity output. Training uses stochastic gradient descent, which updates parameters from batches of examples, with initial learning rate 5e-4 and momentum 0.9. The learning rate follows a polynomial decay with power 0.9. The authors use batch size 16, train for 20 epochs, and randomly crop images to size 321. The data augmentation also includes scaling and horizontal flipping.

After the initial segmentation training, the authors use the trained network to generate new predictions and use those as pseudo-labels for another round of training. This retraining step operates on masks produced by a trained network. The online completion loss operates inside the earlier optimization, as predictions and affinities are developing together. The authors use a conditional random field, or CRF, with default parameters for post-processing. In the retraining procedure, CRF refinement makes the predicted boundaries more suitable for use as new targets. The implementation is written in MXNet and was released in the authors’ CIAN code repository.

Experiments and results

The benchmark and how to read the score

The paper evaluates CIAN on the Pascal VOC 2012 semantic segmentation benchmark using an expanded training set. According to the reported counts, the training set contains 10,582 images, the validation set contains 1,449, and the test set contains 1,456. The task has 20 foreground categories and a background category, and an image can contain several categories. In the main weakly supervised experiment, the training annotations for the benchmark images are image-level labels. The segmentation masks supply dense ground truth for evaluating predicted shapes. A separate seed-quality experiment deliberately introduces some of those stronger annotations into training and is interpreted under that different setup.

The metric is mean intersection over union, abbreviated mIoU, across the 21 classes. For an individual class, the intersection consists of pixels assigned that class in both the prediction and the ground truth. The union consists of pixels assigned that class in either. Dividing the intersection by the union gives the class’s overlap score. A missing object region contributes pixels that belong to the ground truth alone. A false positive contributes pixels that belong to the prediction alone. Both kinds of error reduce the overlap. Averaging the class scores gives each class a place in the reported metric, including background.

This metric is suited to the paper’s question because correct image classification would leave substantial room for error in regional overlap. A prediction can identify the right category and still cover only the part originally highlighted by CAM. It can also extend into another object and lose credit through the union. mIoU captures both effects in the same measure. It compresses the outcome across the benchmark into an aggregate, while the authors’ visual comparisons give examples of what the errors look like in individual images.

Main benchmark performance

CIAN with ResNet101 achieves 64.3% mIoU on the Pascal VOC 2012 validation split and 65.3% mIoU on the test split. These are the full pipeline results, including the authors’ training and refinement procedure. The paper places them above the previous image-label results in its comparison. Since the final network predicts with self-affinity, the test score measures the complete training recipe for single-image segmentation. External reference retrieval is part of how that network learned.

The comparison includes methods trained with different forms of supervision. The authors point out that their result exceeds an early fully supervised FCN result and is comparable with some approaches trained using bounding boxes or scribbles. The paper also calls attention to differences in backbones. Those comparisons show where CIAN’s benchmark score falls among published systems, with supervision, feature extractors and training recipes varying together. The paper’s own same-capacity ablations provide the more direct evidence about the effect of cross-image training.

The authors give a closer published comparison with AISI. They report that CIAN performs better when the backbone and training set are held the same. AISI uses an instance-saliency network trained with pixel-level instance masks. This distinction matters because the systems can draw on different sources of supervision even when their segmentation benchmark and backbone match. The foreground and background seeds used by CIAN still have their stated sources, including the off-the-shelf saliency cue for background. The term image-level refers to the annotation setting for CIAN’s benchmark training images.

The paper also compares the lighter ResNet50 version of CIAN with approaches using ResNet101 and describes its performance as comparable with the stronger published systems it lists. The available quantitative claim for this comparison is the authors’ relative assessment. Their central exact scores concern ResNet101. The ResNet50 comparison is relevant because the authors attribute part of the benefit to how information is exchanged, a change that can also be used with a different backbone.

The baseline that isolates cross-image access

The main controlled baseline uses the affinity module on an image paired with itself. CIAN and the baseline can therefore use the same kind of learned spatial aggregation and the same capacity for that calculation. The external image changes what the module can draw on during training. At inference, both use self-affinity. This comparison helps distinguish the value of training with external images from the value of adding a more expressive spatial operation to the segmentation network.

The paper also tests a reference sampling rule that ignores category tags. This retains a second image in the training calculation while changing the likelihood that it can supply relevant object features. The chart compares gains over the self-affinity baseline in the completion-loss configurations. Its values are improvements reported by the authors, rather than the absolute mIoU of the corresponding settings.

Pascal VOC 2012 validation mIoU gains by reference sampling rule

With completion loss, shared-category pairs produce a larger gain over the self-affinity baseline.

Pascal VOC 2012 validation mIoU gains by reference sampling ruleRandom-class reference pairs: 1.4Random-class reference pairs1.4Common-class reference pairs (this paper): 4.2Common-class reference pairs (thispaper)4.2
The numbers
System or settingreported mIoU improvement over baseline (%)
Random-class reference pairs1.4
Common-class reference pairs (this paper)4.2

Runtime and the examples behind the aggregate

The paper evaluates computational complexity using ResNet101. The authors describe the additional work as marginal relative to the segmentation backbone, pointing to the small spatial maps where the affinity calculation takes place. Reducing the projected feature dimensions and downsampling the reference map are important to this account. The cost of the external image and its comparisons belongs to training. At test time, CIAN has the same computation complexity as the self-affinity baseline. The authors’ claim about this comparison uses a baseline that already includes the affinity operation.

The Pascal VOC 2012 validation examples illustrate several ways a predicted mask can change. In one group of examples, CIAN fills gaps where the baseline misses parts of the foreground. In another, it suppresses false positives. A further group shows cleaner separation from distracting material in the image. In each case the final mask comparison concerns networks run on single images. The authors interpret the differences as effects of learning with cross-image relationships, which can reinforce features that recur across training examples and reduce the influence of less reliable patterns.

The failure case gives a different picture. Small objects of different categories are interwoven, and their appearances are similar. The network confuses them. An example of this kind helps put the retrieval mechanism in concrete terms. Similar features can be helpful when they belong to the same category, and difficult when they come from different categories in adjacent parts of a scene. The visual examples show particular predictions and their errors. The benchmark metric supplies the aggregate comparison.

What the ablations show

How much the network learns from the original seeds

The main ablation uses Pascal VOC 2012 validation mIoU, with ResNet101 as the default backbone. It starts with the self-affinity baseline. The authors then train with cross-image representations under cross-entropy on the initial seeds, the setting labeled +CE in the paper. They report a 0.8% improvement over the baseline. This comparison asks whether access to related images can help when the training targets are still the original sparse seeds. The gain shows that the added information can improve the representation under the supervision already available at the labeled positions.

The size of the gain is also consistent with the training constraint the authors identify. The architecture can retrieve information at a location the initial seeds left blank. The seed loss gives that location no direct target. A reference may make such a location more recognizable and still have a limited effect on the optimization through seed cross-entropy alone. This is why the authors examine whether the next training setting can make wider use of the augmented features.

Adding completion loss for the cross-image representations, the +CP setting, improves Pascal VOC 2012 validation mIoU by another 3.4% according to the paper. The comparison is incremental, over the cross-image setting trained with seed cross-entropy. The authors explain the larger gain through the extra pseudo-labels the better representations can produce. The result supports their account of the interaction between retrieval and supervision. The module can help a query form an object prediction, and a category-compatible prediction can in turn give training a target at additional positions.

The next setting, +RT, adds retraining with masks made from the trained network’s predictions. The authors report a further 1.8% improvement on Pascal VOC 2012 validation mIoU. They attribute the gain to using CRF refinement to recover boundaries in the masks that become retraining targets. This comparison measures the effect of the retraining strategy as implemented, including the prediction refinement within it. It also places the headline benchmark score in context. The final result reflects stages that improve the features, extend supervision during training, and refine the masks used in the subsequent training round.

Why reference selection changes the result

An image paired at random can, by chance, share a category with the query. The random-class sampling rule gives up the guarantee that at least one category is shared. In the comparison without the extra completion term, the authors describe its performance as in line with the self-affinity baseline. This is a useful control because the network still performs the cross-image operation. The change lies in the relationship between the training examples that enter it.

With completion loss, random-class pairs still improve Pascal VOC 2012 validation mIoU by 1.4% over the baseline. This is evidence that the network can obtain some benefit from its online labels with unguided references. The authors explain that predictions generated during training can cover useful regions beyond the sparse initial seeds. Their common-class setting with completion loss improves validation mIoU by 4.2% over the baseline. The larger gain shows that the reference sampling rule contributes to the effectiveness of completion in this setup.

The comparison helps separate two explanations for the complete method’s performance. The ability to generate more training targets already has value in the randomized setting. The additional benefit with common-class sampling is consistent with the idea that a related reference supplies information that makes those targets more useful. A shared tag is a coarse indication that something in the reference might help. It leaves the spatial matching to the affinity function and can still admit regions from categories found in only one of the images. The authors also describe the self-pair as a way to reduce the influence of that mismatch.

The paper reports that a single external reference per training query is adequate and that further partners add negligible improvement in its experiments. This is a separate observation about how many images participate at a time. The authors offer random resampling as an explanation. The training procedure can encounter a variety of relationships across repeated visits to images. The finding pertains to the paper’s sampling setup and the amount of benefit the authors observe there.

Whether stronger seeds leave room for CIAN

The authors test what happens when the baseline and CIAN begin with better spatial targets. They randomly replace the initial seeds for a portion of the 10,582 training images with ground-truth masks. The two replacement settings are 5% and 10%. The untouched images keep their original seeds. This construction makes part of the training set densely supervised and uses that change to vary seed quality in a controlled way.

With replacements for 5% of the training seeds, CIAN improves Pascal VOC 2012 validation mIoU over the corresponding baseline by 4.4%. With replacements for 10%, the reported improvement over the corresponding baseline is 5.1%. The comparison in each case is against the baseline receiving the same kind of seed upgrade. The authors include settings with and without CRF post-processing in this analysis and describe similar benefits with ResNet50. The reported gains show that CIAN remains useful when the initial supervision becomes more informative under the replacement procedure.

Pascal VOC 2012 validation mIoU gains under stronger seed supervision

CIAN improves over the matched self-affinity baseline at both levels of ground-truth seed replacement.

Pascal VOC 2012 validation mIoU gains under stronger seed supervisionCIAN with 5% ground-truth seed replacement (this paper): 4.4CIAN with 5% ground-truth seedreplacement (this paper)4.4CIAN with 10% ground-truth seed replacement: 5.1CIAN with 10% ground-truth seedreplacement5.1
The numbers
System or settingreported mIoU improvement over baseline (%)
CIAN with 5% ground-truth seed replacement (this paper)4.4
CIAN with 10% ground-truth seed replacement5.1

The authors describe their approach as complementary to methods for generating stronger seeds. The experiment gives that claim a particular meaning. It demonstrates that the gain survives when a randomly chosen portion of the seed masks is replaced by dense annotations. A different seed-generation method could improve the initial labels in a different way, for example by finding neglected foreground regions while still producing masks with uncertain boundaries. The replacement results motivate such combinations and leave their specific outcomes for a direct test. They are also separate from the main results obtained with image-level benchmark training annotations.

What the affinity visualizations add

The authors visualize affinities and activations at several points in the calculation. For each illustrated pair, they show the query and reference, an average affinity map, and activations associated with the original feature, the cross-image residual and the feature after the residual has been added. This lets the reader inspect what is retrieved before interpreting the final prediction. A final mask on its own would make it hard to tell whether the cross-image step reinforced information already present or revealed a region with weak initial evidence.

In one example, the retrieved contribution has a similar spatial distribution to the original activation. The added signal strengthens the existing evidence, and the authors show that some false predictions are avoided. In the other example, the residual brings out a complementary region. The final prediction covers the object more completely. The examples correspond to the two mechanisms proposed in the paper’s motivation: a compatible reference can increase confidence in a useful feature, and it can supply evidence where the query representation is sparse.

The visualization complements the reference-sampling control. The control shows that related training pairs are useful in the benchmark aggregate. The images illustrate how specific residuals can change a representation. The affinity maps remain weighted feature associations. Their interpretation concerns the kinds of information the authors observe in these pairs, with the segmentation score providing the quantitative evidence for the overall procedure.

Limitations

Limits identified by the authors

The authors show that CIAN can confuse interwoven objects of different categories when those objects are small and resemble one another. That is an instructive case for a system that learns from appearance relationships. A query feature and a reference feature can look compatible while belonging to different semantic regions. The image tags can establish that both categories occur in the query, so category membership alone leaves the local ambiguity unresolved. The authors leave this failure pattern for future work.

The paper also identifies an imperfect pairing problem. Several categories can occur in an image, making exact matches of tag sets hard to arrange. The training rule guarantees a category in common and allows other categories to differ. The accompanying self-affinity path gives the query a source of within-image information for those parts that a particular reference may represent poorly. That is a practical accommodation of the uncertainty created by weak labels. The pairing rule cannot identify which query locations should attend to the reference.

Deployment imposes another condition the authors address directly. The task requires a prediction for each image on its own. A network trained to depend on external reference features would face a changed input when those features were unavailable. CIAN deals with this through self-affinity and applies training losses to the corresponding representation. The headline results therefore establish the value of a training procedure that can use other images under a single-image test protocol. The gains do not require retrieving an external image when a test prediction is made.

The paper explicitly cautions readers about comparisons involving different pretraining, backbones and supervision. A high result relative to an early fully supervised architecture does not isolate a difference due to annotation strength. The same concern applies to comparisons against systems trained from scribbles or bounding boxes. CIAN’s matched baseline and its reference controls are designed to answer more specific questions about the architecture and training procedure.

What follows from the evaluation setup

The quantitative scope is Pascal VOC 2012. The training, validation and test images share the benchmark’s category vocabulary, and the main reported metric averages across that vocabulary. Performance on a different segmentation benchmark, in different image conditions or on categories outside the training vocabulary remains open. The paper uses more than one backbone in its comparisons, which supports transfer across the particular backbone choices it studies. The measured results for adding CIAN to other segmentation frameworks are outside those experiments.

The shared-tag comparison gives evidence about how to select a reference, while the segmentation loss evaluates the maps through their effect on predictions. Neither comparison supplies a direct measurement of semantic correspondence between paired locations. The network may benefit from associations at the level of parts, larger regions or features that recur with a category. The selected affinity visualizations help a reader see how the learned operation can behave. They leave the frequency of each behavior, and the accuracy of the associations as correspondences, unmeasured.

The completion rule can admit a spatial mistake when the highest-scoring category is present somewhere in the image. It uses the tags to check category compatibility, which is much weaker than verifying that a given pixel belongs to that category. Because the network trains on the accepted prediction, a mistaken assignment can also become a training target. The positive ablation results measure the net effect of this mechanism in the benchmark experiments. They give no separate accounting of how frequently the online labels correct a seed omission, preserve an error or encourage an incorrect new assignment.

The weak-supervision claim also has a specific scope. CIAN uses image tags for the benchmark training annotations in its main experiment, while the feature extraction starts from ImageNet pretraining and the background seeds use an external saliency system. Those components are part of the reported procedure. In the stronger-seed ablation, a portion of the benchmark training examples receives dense ground truth, so the result answers a different question about changing seed quality. Evidence from those runs supports compatibility with that particular improvement to the initial supervision.

Finally, the conclusion about test-time cost is relative to the self-affinity baseline. That baseline already has the spatial feature aggregation operation, which CIAN retains when processing a single image. The controlled comparison establishes that external references add no extra computation at test time over that baseline. For training, the costs of matching locations depend on the feature-map sizes and the number of reference images examined. The authors’ assessment of marginal overhead concerns their choice of a late feature map, compressed projections and the reported training configuration.

What came after

The subsequent use of CIAN’s cross-image affinity method remains undocumented here.

Cite

Cite as Junsong Fan, Zhaoxiang Zhang, Tieniu Tan, Chunfeng Song and Jun Xiao. 2020. CIAN: Cross-Image Affinity Net for Weakly Supervised Semantic Segmentation. Proceedings of the AAAI Conference on Artificial Intelligence.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.1609/aaai.v34i07.6705 · arXiv 1811.10842

@inproceedings{fan2020cian,
  title = {{CIAN: Cross-Image Affinity Net for Weakly Supervised Semantic Segmentation}},
  author = {Junsong Fan, Zhaoxiang Zhang, Tieniu Tan, Chunfeng Song and Jun Xiao},
  booktitle = {Proceedings of the AAAI Conference on Artificial Intelligence},
  year = {2020},
  doi = {10.1609/aaai.v34i07.6705},
  eprint = {1811.10842},
  archivePrefix = {arXiv},
  url = {https://doi.org/10.1609/aaai.v34i07.6705}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/fan-2020-cian-cross-image-affinity-net/

References

41 references, from the paper's own bibliography.

  1. Ahn, J., and Kwak, S. 2018. Learning pixel-level semantic affinity with image-level supervision for weakly supervised semantic segmentation. arXiv:1803.10464. OpenAlex ↗ · Scholar ↗
  2. Briq, R.; Moeller, M.; and Gall, J. 2018. Convolutional simplex projection network (cspn) for weakly supervised semantic segmentation. arXiv:1807.09169. OpenAlex ↗ · Scholar ↗
  3. Chaudhry, A.; Dokania, P. K.; and Torr, P. H. 2017. Discovering class-specific pixels for weakly-supervised semantic segmentation. arXiv:1707.05821. OpenAlex ↗ · Scholar ↗
  4. Chen, L.-C.; Papandreou, G.; Kokkinos, I.; Murphy, K.; and Yuille, A. L. 2014. Semantic image segmentation with deep convolutional nets and fully connected crfs. arXiv:1412.7062. OpenAlex ↗ · Scholar ↗
  5. Chen, T.; Li, M.; Li, Y.; Lin, M.; Wang, N.; Wang, M.; Xiao, T.; Xu, B.; Zhang, C.; and Zhang, Z. 2015. Mxnet: A flexible and efficient machine learning library for heterogeneous distributed systems. arXiv:1512.01274. our card
  6. Chen, L.-C.; Papandreou, G.; Schroff, F.; and Adam, H. 2017. Rethinking atrous convolution for semantic image segmentation. arXiv:1706.05587. OpenAlex ↗ · Scholar ↗
  7. Chen, L.-C.; Papandreou, G.; Kokkinos, I.; Murphy, K.; and Yuille, A. L. 2018. Deeplab: Semantic image segmentation with deep convolutional nets, atrous convolution, and fully connected crfs. TPAMI 40(4):834–848. OpenAlex ↗ · Scholar ↗
  8. Chen, H.; Huang, Y.; and Nakayama, H. Semantic aware attention based deep object co-segmentation. arXiv:1810.06859. OpenAlex ↗ · Scholar ↗
  9. Dai, J.; He, K.; and Sun, J. 2015. Boxsup: Exploiting bounding boxes to supervise convolutional networks for semantic segmentation. In ICCV. our card
  10. Everingham, M.; Van Gool, L.; Williams, C. K.; Winn, J.; and Zisserman, A. 2010. The pascal visual object classes (voc) challenge. IJCV. OpenAlex ↗ · Scholar ↗
  11. Fan, R.; Hou, Q.; Cheng, M.-M.; Yu, G.; Martin, R. R.; and Hu, S.-M. 2018. Associating inter-image salient instances for weakly supervised semantic segmentation. In ECCV. OpenAlex ↗ · Scholar ↗
  12. Fu, J.; Liu, J.; Tian, H.; Li, Y.; Bao, Y.; Fang, Z.; and Lu, H. 2019. Dual attention network for scene segmentation. In CVPR. OpenAlex ↗ · Scholar ↗
  13. Hariharan, B.; Arbeláez, P.; Bourdev, L.; et al. 2011. Semantic contours from inverse detectors. In ICCV. OpenAlex ↗ · Scholar ↗
  14. Hou, Q.; Jiang, P.-T.; Wei, Y.; and Cheng, M.-M. 2018. Self-erasing network for integral object attention. In NIPS. OpenAlex ↗ · Scholar ↗
  15. Hsu, K.-J.; Tsai, C.-C.; Lin, Y.-Y.; Qian, X.; and Chuang, Y.-Y. 2018. Unsupervised cnn-based co-saliency detection with graphical optimization. ECCV. OpenAlex ↗ · Scholar ↗
  16. Hsu, K.-J.; Lin, Y.-Y.; and Chuang, Y.-Y. 2018. Co-attention cnns for unsupervised object co-segmentation. IJCAI. OpenAlex ↗ · Scholar ↗
  17. Huang, Z.; Wang, X.; Wang, J.; Liu, W.; and Wang, J. 2018. Weakly-supervised semantic segmentation network with deep seeded region growing. In CVPR. OpenAlex ↗ · Scholar ↗
  18. Jiang, H.; Wang, J.; Yuan, Z.; Wu, Y.; Zheng, N.; and Li, S. 2013. Salient object detection: A discriminative regional feature integration approach. In CVPR. OpenAlex ↗ · Scholar ↗
  19. Khoreva, A.; Benenson, R.; Hosang, J.; Hein, M.; and Schiele, B. 2017. Simple does it: Weakly supervised instance and semantic segmentation. In CVPR. OpenAlex ↗ · Scholar ↗
  20. Kolesnikov, A., and Lampert, C. H. 2016. Seed, expand and constrain: Three principles for weakly-supervised image segmentation. In ECCV, 695–711. Springer. OpenAlex ↗ · Scholar ↗
  21. Krähenbühl, P., and Koltun, V. 2011. Efficient inference in fully connected crfs with gaussian edge potentials. In NIPS. OpenAlex ↗ · Scholar ↗
  22. Lee, J.; Kim, E.; Lee, S.; Lee, J.; and Yoon, S. 2019. Ficklenet: Weakly and semi-supervised semantic image segmentation using stochastic inference. In CVPR. OpenAlex ↗ · Scholar ↗
  23. Li, M.; Dong, S.; Zhang, K.; Gao, Z.; Wu, X.; Zhang, H.; Yang, G.; and Li, S. 2018. Deep learning intra-image and inter-images features for co-saliency detection. BMVC. OpenAlex ↗ · Scholar ↗
  24. Li, W.; Jafari, O. H.; and Rother, C. 2018. Deep dbject co-segmentation. In Asian Conference on Computer Vision, 638–653. Springer. OpenAlex ↗ · Scholar ↗
  25. Lin, T.-Y.; Maire, M.; Belongie, S.; Bourdev, L.; Girshick, R.; Hays, J.; Perona, P.; Ramanan, D.; Zitnick, C. L.; and Dollár, P. 2014. Microsoft coco: Common objects in context. In ECCV. Springer. our card
  26. Lin, D.; Dai, J.; Jia, J.; He, K.; and Sun, J. 2016. Scribblesup: Scribble-supervised convolutional networks for semantic segmentation. In CVPR. OpenAlex ↗ · Scholar ↗
  27. Long, J.; Shelhamer, E.; and Darrell, T. 2015. Fully convolutional networks for semantic segmentation. In CVPR. our card
  28. Oh, S. J.; Benenson, R.; Khoreva, A.; Akata, Z.; Fritz, M.; and Schiele, B. 2017. Exploiting saliency for object segmentation from image level labels. In CVPR. OpenAlex ↗ · Scholar ↗
  29. Papandreou, G.; Chen, L.-C.; Murphy, K.; and Yuille, A. L. 2015. Weakly- and semi-supervised learning of a dcnn for semantic image segmentation. arXiv:1502.02734. OpenAlex ↗ · Scholar ↗
  30. Pathak, D.; Krähenbühl, P.; and Darrell, T. 2015. Constrained convolutional neural networks for weakly supervised segmentation. In ICCV, 1796–1804. OpenAlex ↗ · Scholar ↗
  31. Qi, X.; Liu, Z.; Shi, J.; Zhao, H.; and Jia, J. 2016. Augmented feedback in semantic segmentation under image level supervision. In ECCV16. OpenAlex ↗ · Scholar ↗
  32. Shen, T.; Lin, G.; Liu, L.; Shen, C.; and Reid, I. 2017. Weakly supervised semantic segmentation based on web image co-segmentation. arXiv:1705.09052. OpenAlex ↗ · Scholar ↗
  33. Vernaza, P., and Chandraker, M. 2017. Learning random-walk label propagation for weakly-supervised semantic segmentation. In CVPR. OpenAlex ↗ · Scholar ↗
  34. Wang, X.; Girshick, R.; Gupta, A.; and He, K. 2017. Non-local neural networks. arXiv:1711.07971 10. OpenAlex ↗ · Scholar ↗
  35. Wang, X.; You, S.; Li, X.; and Ma, H. 2018. Weakly-supervised semantic segmentation by iteratively mining common object features. In CVPR, 1354–1362. OpenAlex ↗ · Scholar ↗
  36. Wei, Y.; Feng, J.; Liang, X.; Cheng, M.-M.; Zhao, Y.; and Yan, S. 2017a. Object region mining with adversarial erasing: A simple classification to semantic segmentation approach. In CVPR. OpenAlex ↗ · Scholar ↗
  37. Wei, Y.; Liang, X.; Chen, Y.; Shen, X.; Cheng, M.-M.; Feng, J.; Zhao, Y.; and Yan, S. 2017b. Stc: A simple to complex framework for weakly-supervised semantic segmentation. TPAMI. OpenAlex ↗ · Scholar ↗
  38. Wei, Y.; Xiao, H.; Shi, H.; Jie, Z.; Feng, J.; and Huang, T. S. 2018. Revisiting dilated convolution: A simple approach for weakly- and semi-supervised semantic segmentation. In CVPR. OpenAlex ↗ · Scholar ↗
  39. Yuan, Y., and Wang, J. 2018. Ocnet: Object context network for scene parsing. arXiv:1809.00916. our card
  40. Zhou, B.; Khosla, A.; Lapedriza, A.; Oliva, A.; and Torralba, A. 2016. Learning deep features for discriminative localization. In CVPR. OpenAlex ↗ · Scholar ↗
  41. Zhou, Z.-H. 2017. A brief introduction to weakly supervised learning. National Science Review 5(1):44–53. OpenAlex ↗ · Scholar ↗