Attack is Good Augmentation: Towards Skeleton-Contrastive Representation Learning

Binqian Xu, Xiangbo Shu, Rui Yan, Guo-Sen Xie, Yixiao Ge, Mike Zheng Shou · DOI

TL;DR

The authors propose A²MC, a novel framework that repurposes adversarial attacks as a powerful data augmentation tool for skeleton-based action recognition. By using gradient-based attacks to push samples toward "semantic boundaries," the model generates high-quality hard positive and negative pairs, leading to more robust and discriminative skeletal representations in an unsupervised setting.

Introduction: The Need for Hard Pairs

Contrastive learning—the art of teaching a model that "this is like that, but not like those"—relies heavily on the quality of positive and negative sample pairs. In skeleton-based action recognition, researchers typically use "weak" or "strong" augmentations, such as random joint jittering or rotation, to create these pairs.

However, the authors identify two major gaps in this standard approach:

  1. Indirect Perturbation: Randomly changing the appearance of a skeleton only indirectly affects semantic meaning. It doesn't necessarily help the model understand the fine line between similar actions, like "drinking water" and "brushing teeth."
  2. Soft Pairs: Random perturbations can accidentally make a positive sample too similar to the original (too easy) or change it so much that it loses its original identity (becoming a misleading pair).
Conceptual comparison of the proposed hard positive/negative generation versus previous methods.

The challenge is to find "hard" pairs: positive samples that are as different as possible while remaining the same action, and negative samples that are as similar as possible while being different actions.

The A²MC Framework

The authors introduce the Attack-Augmentation Mixing-Contrastive (A²MC) framework, which explicitly targets the semantic boundaries between action classes.

Detailed architecture of the A²MC framework, highlighting the Att-Aug, PNM, and MC components.

The framework consists of three main components:

  • Attack-Augmentation (Att-Aug): Instead of random jittering, the model uses a gradient-based "white-box attack." It calculates how to change the skeleton's joints to maximize the entropy of its class prediction—effectively pushing the feature toward the "semantic boundary" where the model is most confused. This creates a hard positive feature.
  • Positive-Negative Mixer (PNM): To create hard negatives, the framework takes these hard positive features and mixes them with adversarial negative features from a memory bank. By blending features from different actions, the model creates a challenging negative sample that sits right on the edge of the decision boundary.
  • Mixing Contrast (MC) Loss: Standard contrastive losses pull single points together. MC Loss pulls the entire similarity distribution of these hard features toward a target distribution, forcing the model to learn more nuanced relationships between actions.

Experimental Results

The framework was evaluated on three widely used public benchmarks: NTU RGB+D 60, NTU RGB+D 120, and PKU-MMD. A²MC consistently outperformed state-of-the-art (SOTA) unsupervised methods:

  • Linear Evaluation: On NTU-120 (x-set), A²MC achieved 80.4% accuracy, outperforming the previous SOTA (CMD) by 1.7%. On the challenging PKU-II dataset, it improved SOTA by 5.4%.
  • Transfer Learning: When pre-trained on NTU-60 and tested on PKU-II, the model showed superior generalization, beating competitors by over 2%.
  • Qualitative Success: t-SNE visualizations show that A²MC creates much tighter, more distinct clusters for different actions compared to models using only standard augmentations. KNN results also show that the model is much better at distinguishing between fine-grained similar actions like "reading" vs. "writing."

Conclusion and Future Work

By treating "attack as an angel," the authors demonstrate that adversarial perturbations can be a powerful asset for unsupervised representation learning. The model learns to ignore superficial appearance changes and focus on the intrinsic movements that define an action.

While effective, the authors acknowledge that their current one-step gradient attack is relatively straightforward. Future directions include exploring more sophisticated, multi-step attack strategies and applying this "attack-as-augmentation" philosophy to other modalities such as raw video or point clouds.

Summary updated

Abstract

Contrastive learning, relying on effective positive and negative sample pairs, is beneficial to learn informative skeleton representations in unsupervised skeleton-based action recognition. To achieve these positive and negative pairs, existing weak/strong data augmentation methods have to randomly change the appearance of skeletons for indirectly pursuing semantic perturbations. However, such approaches have two limitations: i) solely perturbing appearance cannot well capture the intrinsic semantic information of skeletons, and ii) randomly perturbation may change the original positive/negative pairs to soft positive/negative ones. To address the above dilemma, we start the first attempt to explore an attack-based augmentation scheme that additionally brings in direct semantic perturbation, for constructing hard positive pairs and further assisting in constructing hard negative pairs. In particular, we propose a novel Attack-Augmentation Mixing-Contrastive skeletal representation learning (A$^2$MC) to contrast hard positive features and hard negative features for learning more robust skeleton representations. In A$^2$MC, Attack-Augmentation (Att-Aug) is designed to collaboratively perform targeted and untargeted perturbations of skeletons via attack and augmentation respectively, for generating high-quality hard positive features. Meanwhile, Positive-Negative Mixer (PNM) is presented to mix hard positive features and negative features for generating hard negative features, which are adopted for updating the mixed memory banks. Extensive experiments on three public datasets demonstrate that A$^2$MC is competitive with the state-of-the-art methods. The code will be accessible on A$^2$MC (https://github.com/1xbq1/A2MC).
BibTeX
@misc{xu2023attack,
  author = {Binqian Xu and Xiangbo Shu and Rui Yan and Guo-Sen Xie and Yixiao Ge and Mike Zheng Shou},
  title = {{Attack is Good Augmentation: Towards Skeleton-Contrastive Representation Learning}},
  year = {2023},
  eprint = {2304.04023},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2304.04023},
}
Figure