Reproduce “MHAFF: Multi-Head Attention Feature Fusion of CNN and Transformer for Cattle Identification” on OpenResearch

Turn your favorite coding agents into research agents that review literature, develop hypotheses, and run experiments.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Rabin Dulal, Lihong Zheng, Muhammad Ashad Kabir

MHAFF combines local CNN and global transformer features for cattle muzzle identification using multi-head attention, with ViT features as query and value and ResNet features as key. It achieves validation accuracy of 99.88% on Cattle-1 and 99.52% on Cattle-2, exceeding addition and concatenation on both datasets. These results apply to validation splits and do not establish recognition of unseen cattle.

Key insights

  • Multi-head attention can effectively learn and leverage contextual relationships between local features (from CNNs) and global features (from Transformers), creating a more discriminative representation.
  • Deriving Query and Value from global (ViT-t) features and Key from local (Res-t) features optimizes the attention mechanism for comprehensive feature interaction in this specific task.
  • The MHAFF approach leads to more focused and precise attention maps, indicating an improved ability to prioritize discriminative muzzle patterns over irrelevant background.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.