Introduction
Deep learning models are notorious "shortcut learners." If a neural network can find a simple pattern to solve a task—even if that pattern is irrelevant to the underlying logic—it will exploit it. In medical imaging, this often manifests as a model learning to detect pneumonia by identifying a hospital's text tag in the corner of an X-ray rather than analyzing the lung tissue itself.
Researchers at Imperial College London have introduced a more efficient way to mitigate this behavior: Targeted Activation Penalty (TAP). This method prevents Convolutional Neural Networks (CNNs) from relying on "spurious signals" by penalizing specific activations in the network's hidden layers.
The Problem: Shortcut Learning and Explanatory Supervision
In Explanatory Supervision (XS), the goal is to train models to be "right for the right reasons." Standard training focuses solely on output accuracy. XS adds a layer of supervision by instructing the model on where not to look.
Existing methods like RRR (Right for the Right Reasons) and RBR (Right for Better Reasons) penalize the network's input gradients. They essentially enforce that the derivative of the output with respect to "junk" pixels should be zero. However, these methods suffer from two major drawbacks:
- Computational Cost: They require second-order derivatives, which are slow and memory-intensive.
- Deep Layer Re-emergence: In deep architectures like ResNet or DenseNet, a model might ignore a spurious signal at the input level but "rediscover" it in deeper feature maps.
Methodology: Targeted Activation Penalties (TAP)
TAP addresses these issues by targeting activations (feature maps) directly rather than gradients. Because convolutional layers preserve spatial relationships, the location of "junk" areas in the input image can be mapped to corresponding regions in hidden feature maps.
TAP applies a penalty to the sum of activations in these specific regions across multiple layers. To match input-level masks to smaller, deeper feature maps, the researchers use a combination of max-pooling and average pooling. Furthermore, to reduce the need for expensive human annotations, they propose a Teacher-Student framework where a "Teacher" model trained on a small amount of clean data generates saliency maps to serve as masks for a "Student" model.
Experimental Evaluation
The method was evaluated on three benchmarks: MNIST (digits with colored patches), PNEU (chest X-rays with text tags), and KNEE (radiographs with artifacts). These were tested across VGG-16, ResNet-18, and DenseNet-121 architectures.
Results and Discussion
TAP demonstrates significant advantages in both efficiency and effectiveness. Because it avoids second-order derivatives, TAP is roughly 4x faster than RRR and uses 50% less VRAM, making XS viable for large-scale modern architectures that previously faced out-of-memory (OOM) errors.
Crucially, TAP is more effective at suppressing spurious signals in deep layers. While gradient-based methods might allow signals to leak through and reappear later in the network, TAP "mops up" these signals throughout the network's depth. As shown in the results, TAP-trained models maintain high performance even when spurious signals are randomized at test time, matching the performance of models trained on perfectly clean data. In deep architectures like DenseNet-121, TAP significantly outperforms RRR, which fails to maintain robustness against contamination.
Conclusion
Targeted Activation Penalties offer a scalable and robust solution for training CNNs that ignore spurious shortcuts. By shifting focus from input gradients to internal activations, TAP achieves superior suppression of artifacts in deep networks while significantly reducing computational overhead. While currently optimized for spatial architectures like CNNs, future work may extend these principles to global attention mechanisms in Transformers.
Summary updated