Introduction
In the realm of weakly supervised learning, researchers often rely on image-level labels to train deep neural networks. While this approach significantly reduces the cost of data annotation, it frequently results in "lazy" attention maps. Standard techniques like Grad-CAM tend to highlight only the most discriminative features—such as a bird's beak or a cat's face—while ignoring the rest of the object's body. This limitation hampers performance in downstream tasks like semantic segmentation and makes models susceptible to dataset bias.
The Challenge of Dataset Bias
One of the most significant issues with lazy attention is the learning of pathological biases. If a specific object class is consistently paired with a particular background in the training set, the network may learn to identify the background rather than the object itself.
As shown in Figure 1, a model trained on a biased dataset of boats might focus primarily on the water. When presented with a boat in a different context—such as on a trailer in a parking lot—the model fails because its primary "attention" cue is missing. GAIN addresses this by treating attention as a requirement rather than a side effect, forcing the network to look beyond the most obvious correlations.
The GAIN Framework
The Guided Attention Inference Network (GAIN) transforms attention maps into active, trainable components. Unlike previous iterative "erase-and-retrain" methods, GAIN operates in a single forward/backward pass using two parameter-sharing streams:
- Classification Stream ($S_{cl}$): A standard CNN that predicts image labels and generates online attention maps using a differentiable version of Grad-CAM.
- Attention Mining Stream ($S_{am}$): This stream takes the attention map from the first stream, converts it into a soft mask, and "erases" the high-attention regions from the original image.
- Attention Mining Loss ($L_{am}$): The network is penalized if it can still identify the object in the erased image. This forces the model to explore and identify the "non-discriminative" parts of the object to minimize loss.
Additionally, the authors introduced GAINext, an extension that incorporates a small amount of pixel-level supervision (as little as 1–10% of the dataset) to directly guide attention, bridging the gap between weak and full supervision.
Experimental Results
The authors evaluated GAIN across several benchmarks, including PASCAL VOC 2012, a custom "Biased Boat" dataset, and an Industrial Camera dataset for fine-grained orientation tasks.
As illustrated in Figure 2, GAIN forces the network to attend to the entire body of the object. This complete coverage is vital for semantic segmentation. Key results include:
- Segmentation Accuracy: On PASCAL VOC 2012, GAIN achieved a 56.8% mIoU, significantly outperforming the baseline SEC (51.7%).
- Semi-Supervised Boost: With only 10% pixel-level labels, GAINext reached 62.1% mIoU.
- Robustness to Bias: In the "Biased Boat" test set, GAIN improved accuracy from 36% (baseline) to 55%, while GAINext reached 84% with minimal extra supervision.
Conclusion and Future Work
By treating attention as a trainable constraint, GAIN effectively decouples objects from biased backgrounds and ensures more complete object localization. While the dual-stream approach introduces some computational overhead and hyperparameter sensitivity, the framework's efficiency and performance gains make it a powerful tool for weakly supervised learning. Future work may explore applying this framework to other high-level tasks like regression or Visual Question Answering (VQA).
Summary updated