A Lightweight Transformer for Pain Recognition from Brain Activity

arXiv cs.CV / 4/21/2026

📰 NewsDeveloper Stack & InfrastructureModels & Research

Key Points

  • The paper proposes a lightweight transformer model for automated pain recognition using brain activity measured by fNIRS.
  • It fuses multiple fNIRS signal views via a unified tokenization approach, allowing joint modeling of complementary modalities without modality-specific architectural changes.
  • A structured token/mixing strategy is used to preserve spatial, temporal, and time-frequency characteristics while controlling the granularity of local vs. global interactions.
  • Experiments on the AI4Pain dataset using stacked raw waveforms and power spectral density show competitive accuracy with low computational cost for near real-time inference on GPU and CPU.
  • The work aims to make reliable pain assessment more practical by combining performance with deployability on resource-constrained hardware.

Abstract

Pain is a multifaceted and widespread phenomenon with substantial clinical and societal burden, making reliable automated assessment a critical objective. This paper presents a lightweight transformer architecture that fuses multiple fNIRS representations through a unified tokenization mechanism, enabling joint modeling of complementary signal views without requiring modality-specific adaptations or increasing architectural complexity. The proposed token-mixing strategy preserves spatial, temporal, and time-frequency characteristics by projecting heterogeneous inputs onto a shared latent representation, using a structured segmentation scheme to control the granularity of local aggregation and global interaction. The model is evaluated on the AI4Pain dataset using stacked raw waveform and power spectral density representations of fNIRS inputs. Experimental results demonstrate competitive pain recognition performance while remaining computationally compact, making the approach suitable for real-time inference on both GPU and CPU hardware.