Structure-Regularized Attention for Deformable Object Representation

Shenao Zhang, Li Shen, Zhifeng Li, Wei LiuarXiv 2021 · OpenReview

Introduction

Capturing long-range dependencies is a cornerstone of modern computer vision, typically achieved through self-attention or non-local neural networks. However, these methods often suffer from quadratic computational complexity and an "unconstrained graph" problem. Standard attention allows any pixel to interact with any other pixel, ignoring the intrinsic physical structure of deformable objects like human bodies or faces. These objects possess a strict underlying anatomy that remains consistent despite changes in pose or shape.

This paper introduces Structure-Regularized Attention (StRAttention), a novel module designed to factorize feature interactions into local and structural components. StRAttention significantly improves performance and computational efficiency while automatically learning interpretable object parts without explicit supervision.

Proposed Architecture: StRAttention

The StRAttention module replaces standard pixel-to-pixel attention with a two-stage structural factorization approach:

  1. Local Attention: This operation aggregates context within a local $K \times K$ neighborhood using a data-dependent softmask, focusing on fine-grained, adjacent textures.
  2. Mode Attention: This is the core novelty. The network projects feature maps into a predefined number of subspaces called "modes," representing distinct semantic parts (e.g., head, torso, limbs). The network calculates a "modal vector" (centroid) for each mode. Individual pixels then attend to these modes rather than every other pixel, drastically reducing the interaction space.
  3. Divergence Regularization: To ensure the modes represent distinct parts, a divergence loss function ($L_d$) is applied during training. This forces different modes to focus on spatially disjoint regions, facilitating unsupervised part discovery.
The StRAttention module architecture, illustrating the factorization into Local Attention and Mode Attention.

Experimental Evaluation

The authors evaluated StRAttention across several tasks requiring robust deformable object representation, including Person Re-Identification (Market1501), Face Recognition (VGGFace2), and Facial Expression Recognition (FER2013).

Performance and Efficiency

On the Market1501 dataset, a ResNet50 backbone equipped with StRAttention achieved 84.1% mAP, significantly outperforming the standard ResNet50 baseline (77.1% mAP) and standard Non-local attention networks (80.2% mAP).

Crucially, this performance boost comes with a reduction in computational cost. StRAttention required only 3.17G FLOPs, compared to 4.05G for the baseline ResNet50 and 7.28G for the Non-local network. This demonstrates that structural priors not only improve accuracy but also streamline computation by pruning irrelevant interactions.

Comparison of mAP vs. Number of Parameters on Market1501. StRAttention (ours) achieves superior accuracy with fewer parameters and lower computational overhead than competing attention models.

Conclusion and Future Work

StRAttention proves that explicitly modeling structural dependencies is highly beneficial for representing deformable objects. By routing attention through semantic "modes," the model achieves unsupervised part discovery, where heatmaps naturally align with distinct body parts without landmark supervision.

While the current implementation requires a predefined number of modes, future work may explore dynamic mode adjustment during training. The success of this structural factorization suggests it could be extended to disentangle other latent factors, such as age or emotion, in broader representation learning tasks.

Summary updated

BibTeX
@misc{zhang2021structure,
  author = {Shenao Zhang and Li Shen and Zhifeng Li and Wei Liu},
  title = {{Structure-Regularized Attention for Deformable Object Representation}},
  year = {2021},
  eprint = {2106.06672},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2106.06672},
}
Figure