Cosine-Normalized Attention for Hyperspectral Image Classification

Muhammad Ahmad, Manuel Mazzara
4/2/2026
cs.CV

No confident code implementation found for this paper. 1 possible match can be shown below.

Abstract

Transformer-based methods have improved hyperspectral image classification (HSIC) by modeling long-range spatial-spectral dependencies; however, their attention mechanisms typically rely on dot-product similarity, which mixes feature magnitude and orientation and may be suboptimal for hyperspectral data. This work revisits attention scoring from a geometric perspective and introduces a cosine-normalized attention formulation that aligns similarity computation with the angular structure of hyperspectral signatures. By projecting query and key embeddings onto a unit hypersphere and applying a squared cosine similarity, the proposed method emphasizes angular relationships while reducing sensitivity to magnitude variations. The formulation is integrated into a spatial-spectral Transformer and evaluated under extremely limited supervision. Experiments on three benchmark datasets demonstrate that the proposed approach consistently achieves higher performance, outperforming several recent Transformer- and Mamba-based models despite using a lightweight backbone. In addition, a controlled analysis of multiple attention score functions shows that cosine-based scoring provides a reliable inductive bias for hyperspectral representation learning.

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. 1 weaker match is 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{ahmad2026cosinenormalized,
  title  = {Cosine-Normalized Attention for Hyperspectral Image Classification},
  author = {Muhammad Ahmad and Manuel Mazzara},
  year   = {2026},
  eprint = {2604.01763},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2604.01763v1}
}

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/2604.01763.svg)](https://codeofpaper.com/paper/2604.01763)

Discussion