Constrained Convolutional Neural Networks for Weakly Supervised Segmentation

Deepak Pathak, Philipp Krähenbühl, Trevor Darrell

Abstract

We present an approach to learn a dense pixel-wise labeling from image-level tags. Each image-level tag imposes constraints on the output labeling of a Convolutional Neural Network (CNN) classifier. We propose Constrained CNN (CCNN), a method which uses a novel loss function to optimize for any set of linear constraints on the output space (i.e. predicted label distribution) of a CNN. Our loss formulation is easy to optimize and can be incorporated directly into standard stochastic gradient descent optimization. The key idea is to phrase the training objective as a biconvex optimization for linear models, which we then relax to nonlinear deep networks. Extensive experiments demonstrate the generality of our new learning framework. The constrained loss yields state-of-the-art results on weakly supervised semantic image segmentation. We further demonstrate that adding slightly more supervision can greatly improve the performance of the learning algorithm.

Introduction

Semantic segmentation—the task of labeling every single pixel in an image—is a cornerstone of computer vision. However, it suffers from a significant "data hunger" problem. Training these models typically requires thousands of images with manually traced pixel-level masks, which are incredibly time-consuming and expensive to produce.

The alternative is weakly supervised learning, where models are trained using cheaper labels like image-level tags (e.g., "this image contains a car and a person"). The challenge is that these tags indicate what is in the image, but not where it is. Previous attempts to bridge this gap often struggled with optimization, frequently getting stuck in "bad local optima" where the model makes nonsensical predictions that technically satisfy the tags but fail to match visual reality.

Methodology: Constrained CNNs

The authors introduce CCNN (Constrained CNN). Instead of attempting to force the neural network to learn directly from vague tags, they treat the tags as a set of linear constraints on the model's output.

Overview of the CCNN framework, showing how image-level tags are translated into constraints on a latent distribution.

Latent Distributions and Optimization

Directly optimizing a deep network with constraints is mathematically non-convex and difficult. To solve this, CCNN introduces a latent probability distribution ($P$):

  1. The Constraints: They define what a "plausible" segmentation looks like based on the tags. For instance, a Suppression constraint ensures that if the tag "dog" is missing, the probability of any pixel being a dog is zero. Conversely, a Foreground constraint ensures that if "dog" is present, at least a certain percentage of pixels are labeled as such.
  2. The Optimization: The process uses an alternating optimization. First, it finds a latent distribution $P$ that satisfies all constraints and is as close as possible to the current network's output. Then, the network's weights are updated to move its output closer to $P$ using standard Stochastic Gradient Descent (SGD).

This approach "pulls" the network toward a valid solution space in every training iteration, significantly stabilizing the learning process.

Experimental Setup

The framework was evaluated primarily on the PASCAL VOC 2012 benchmark, which contains 20 object classes. The models utilized a VGG-16 network architecture, initially pre-trained on ImageNet before being fine-tuned for the segmentation task.

Results and Discussion

CCNN achieved state-of-the-art results, outperforming previous weakly supervised methods on the PASCAL VOC 2012 dataset. On the VOC 2012 test set, CCNN using only tags achieved 35.6% mIoU (mean Intersection over Union).

The Power of "A Little Bit More"

A key insight from the study is how much a small amount of additional information can boost performance. By adding a simple "size constraint"—indicating whether an object covers more or less than 10% of the image—the model's accuracy jumped significantly to 45.1% mIoU.

Qualitative comparison of segmentation results using image tags alone versus image tags combined with size constraints.

As shown in the qualitative results, adding size constraints helps the model better localize objects and produce masks that more closely resemble the ground truth compared to using image tags alone. Furthermore, unlike previous methods such as MIL-FCN, CCNN is much less sensitive to initialization, making it a more robust and reliable framework.

Conclusion and Future Work

While CCNN represents a major advancement for weak supervision, a performance gap remains compared to fully supervised models (which achieve approximately 66% mIoU). The authors noted that size constraints, while helpful for localization, can sometimes cause the model to miss very small objects if applied too aggressively.

Future research could explore more complex, non-linear spatial constraints or integrate CCNN into semi-supervised pipelines where a limited number of pixel-level masks are available alongside a larger set of image tags.

Summary updated

BibTeX
@inproceedings{pathak2015constrained,
  author = {Deepak Pathak and Philipp Krähenbühl and Trevor Darrell},
  title = {{Constrained Convolutional Neural Networks for Weakly Supervised Segmentation}},
  booktitle = {IEEE/CVF International Conference on Computer Vision},
  year = {2015},
  url = {https://openreview.net/forum?id=B1W9eZM_bS},
}
Figure