Class-Aware Robust Adversarial Training for Object Detection

Pin-Chun Chen, Bo-Han Kung, Jun-Cheng Chen

Introduction

Object detection models are notoriously vulnerable to adversarial attacks. While adversarial training has become a gold standard for securing image classifiers, applying it to object detection is significantly more complex. Unlike classification, where an image has one label, detection requires identifying and locating multiple objects of varying sizes and classes simultaneously. Standard defense techniques often fail because they treat all objects in an image as a single, uniform target, leading to imbalanced robustness.

The Challenge: The "Lazy" Attacker

The authors identify a core problem in vanilla adversarial training for detectors: the "Lazy" Attacker. Standard adversarial attacks naturally gravitate toward the easiest way to increase the total loss. In a multi-object scene, this often means the attack focuses on "breaking" just one or two objects while ignoring others.

This behavior leads to three major imbalances:

  1. Multi-task Imbalance: Classification and localization losses have different scales; one often dominates the gradient during attack generation.
  2. Object Dominance: The training process focuses on attacking the objects with the highest loss, leaving others poorly defended.
  3. Class Imbalance: In crowded scenes, majority classes (e.g., cars) drown out the training signal for minority classes (e.g., pedestrians).
Standard adversarial attacks are often "lazy," resulting in an imbalanced loss distribution that leaves certain objects (like the cat in this example) undefended during training.

Proposed Method: Class-Aware Robust Adversarial Training (CWAT)

To create more evenly robust detectors, the authors introduce Class-Aware Robust Adversarial Training (CWAT). This hierarchical approach "evens out" the adversarial training process through several key mechanisms:

  • Multi-task & Object-wise Clipping: The framework caps the loss value for any single object or task (classification vs. regression) at a specific threshold. This prevents a single outlier from dominating the gradients used to update the model.
  • Class-Aware Normalization: Instead of a global normalization, the loss is decomposed into class-specific buckets. Each class's loss is normalized by the number of objects of that specific class in the image, ensuring that rare objects still provide a significant training signal.
  • Fast Adversarial Training: To address the high computational cost of detection-based adversarial training, the authors adapted fast training techniques that recycle gradient information, making the process 7 to 30 times faster than traditional PGD-based methods.
By forcing the attack to be class-aware, CWAT ensures a balanced loss distribution across all objects, leading to more uniform robustness.

Key Results and Insights

The researchers evaluated CWAT on the PASCAL VOC and MS-COCO benchmarks, demonstrating consistent improvements over standard training (STD) and previous state-of-the-art multi-task attacks (MTD):

  • Significant Robustness Gains: On PASCAL VOC, while a standard SSD model's mean Average Precision (mAP) drops from 0.752 to nearly zero under a strong PGD-10 attack, the CWAT-trained model maintains a robust 0.224 mAP.
  • Even Defense Across Categories: Qualitative results show that CWAT-trained models are much harder to fool across all objects in a scene. Previous methods often left certain classes, such as chairs or dining tables, completely vulnerable because they were ignored by the "lazy" attacker during training.
  • Architecture Agnostic: The method proved effective across different backbones, including VGG-16 and ResNet-50.

Conclusion

The primary insight of this work is that distributional balance—across tasks, objects, and classes—is more critical for a detector's overall reliability than simply maximizing total loss. By addressing the inherent imbalances in multi-object scenes, CWAT provides a path toward more reliable object detection in complex, real-world environments.

Summary updated

BibTeX
@inproceedings{chen2021class,
  author = {Pin-Chun Chen and Bo-Han Kung and Jun-Cheng Chen},
  title = {{Class-Aware Robust Adversarial Training for Object Detection}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2021},
  doi = {10.1109/cvpr46437.2021.01028},
}
Figure