Adversarial Structure Matching Loss for Image Segmentation

Jyh-Jing Hwang, Tsung-Wei Ke, Jianbo Shi, Stella X. YuarXiv 2018

Abstract

Pixel-wise losses, e.g., cross-entropy or L2, have been widely used in structured prediction tasks as a spatial extension of generic image classification or regression. However, its i.i.d. assumption neglects the structural regularity present in natural images. Various attempts have been made to incorporate structural reasoning mostly through structure priors in a cooperative way where co-occurring patterns are encouraged. We, on the other hand, approach this problem from an opposing angle and propose a new framework, Adversarial Structure Matching (ASM), for training such structured prediction networks via an adversarial process, in which we train a structure analyzer that provides the supervisory signals, the ASM loss. The structure analyzer is trained to maximize the ASM loss, or to emphasize recurring multi-scale hard negative structural mistakes among co-occurring patterns. On the contrary, the structured prediction network is trained to reduce those mistakes and is thus enabled to distinguish fine-grained structures. As a result, training structured prediction networks using ASM reduces contextual confusion among objects and improves boundary localization. We demonstrate that our ASM outperforms pixel-wise IID loss or structural prior GAN loss on three different structured prediction tasks: semantic segmentation, monocular depth estimation, and surface normal prediction.

Introduction

Standard deep learning approaches for structured prediction tasks, such as semantic segmentation and depth estimation, typically rely on pixel-wise losses like cross-entropy or $L_2$. These losses operate under the Independent and Identically Distributed (IID) assumption, treating each pixel as an isolated data point. However, natural images possess inherent structural regularities—objects have characteristic shapes, and surfaces follow geometric constraints. Pixel-wise losses fail to capture these global dependencies, often leading to results with blurred boundaries or structurally impossible configurations. While Generative Adversarial Networks (GANs) attempt to address this by learning a "realness" prior, they frequently struggle with precise localization and training stability.

Adversarial Structure Matching (ASM)

To overcome these limitations, we introduce Adversarial Structure Matching (ASM). This framework reformulates training as a minimax game between two competing networks: a Structured Predictor ($S$) and a Structure Analyzer ($A$).

The ASM framework: The Predictor $S$ generates a prediction $\hat{y}$, while the Analyzer $A$ identifies structural discrepancies between $\hat{y}$ and the ground truth $y$. A Regularizer $R$ ensures the Analyzer learns meaningful structural features.

The Structure Analyzer is a multi-layer CNN designed to extract multi-scale features from both the ground truth and the predicted output. Unlike a binary GAN discriminator, the Analyzer is trained to maximize the discrepancy between these features, effectively acting as a "picky teacher" that highlights the model's most significant structural errors. Simultaneously, the Predictor is trained to minimize this discrepancy. To ensure the Analyzer focuses on valid structural patterns rather than noise, a Structure Regularizer ($R$) is employed. This regularizer forces the Analyzer to maintain enough information to reconstruct the ground truth, ensuring its feedback is grounded in the actual structure of the data.

Experimental Results

We evaluated ASM across three tasks: semantic segmentation (PASCAL VOC 2012), monocular depth estimation, and surface normal prediction (Stanford 2D-3D-S).

Qualitative comparison of ASM against IID and GAN losses. ASM demonstrates superior boundary localization in segmentation and better detail preservation in depth and surface normal estimation.

Semantic Segmentation

On the PASCAL VOC 2012 benchmark, ASM significantly improved the performance of various backbones. For instance, an FCN model saw its Mean Intersection over Union (mIoU) rise from 68.91% with IID loss to 72.14% with ASM. Qualitative analysis reveals that ASM is particularly effective at capturing fine-grained structures, such as bicycle wheels and thin object boundaries, which are often lost with standard losses.

Depth and Surface Normal Estimation

In indoor scene analysis using the Stanford 2D-3D-S dataset, ASM reduced the Root Mean Square Error (RMSE) for depth estimation from 1.174 to 1.079. It also improved the accuracy of surface normal predictions, especially for complex objects like bookshelves, where structural consistency is paramount.

Conclusion

Adversarial Structure Matching provides a powerful alternative to traditional pixel-wise losses by explicitly supervising the structural integrity of predictions. By using an adversarial "analyzer" to hunt for structural flaws during training, ASM enables models to learn complex shapes and boundaries without any additional computational cost during inference. Future work includes exploring the application of ASM to other domains, such as medical imaging and natural language processing.

Summary updated

BibTeX
@misc{hwang2018adversarial,
  author = {Jyh-Jing Hwang and Tsung-Wei Ke and Jianbo Shi and Stella X. Yu},
  title = {{Adversarial Structure Matching Loss for Image Segmentation}},
  year = {2018},
  eprint = {1805.07457},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1805.07457},
}
Figure