MHAFF: Multi-Head Attention Feature Fusion of CNN and Transformer for Cattle Identification

Rabin Dulal, Lihong Zheng, Muhammad Ashad Kabir
1/9/2025
cs.CV

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

Convolutional Neural Networks (CNNs) have drawn researchers' attention to identifying cattle using muzzle images. However, CNNs often fail to capture long-range dependencies within the complex patterns of the muzzle. The transformers handle these challenges. This inspired us to fuse the strengths of CNNs and transformers in muzzle-based cattle identification. Addition and concatenation have been the most commonly used techniques for feature fusion. However, addition fails to preserve discriminative information, while concatenation results in an increase in dimensionality. Both methods are simple operations and cannot discover the relationships or interactions between fusing features. This research aims to overcome the issues faced by addition and concatenation. This research introduces a novel approach called Multi-Head Attention Feature Fusion (MHAFF) for the first time in cattle identification. MHAFF captures relations between the different types of fusing features while preserving their originality. The experiments show that MHAFF outperformed addition and concatenation techniques and the existing cattle identification methods in accuracy on two publicly available cattle datasets. MHAFF demonstrates excellent performance and quickly converges to achieve optimum accuracy of 99.88% and 99.52% in two cattle datasets simultaneously.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{dulal2025mhaff,
  title  = {MHAFF: Multi-Head Attention Feature Fusion of CNN and Transformer for Cattle Identification},
  author = {Rabin Dulal and Lihong Zheng and Muhammad Ashad Kabir},
  year   = {2025},
  eprint = {2501.05209},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2501.05209v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2501.05209.svg)](https://codeofpaper.com/paper/2501.05209)

Discussion