Detecting stress through the brain’s electrical activity is an intimate affair: EEG signals are sensitive biometric data, demanding extreme caution, especially in clinical or corporate settings. Sending them to the cloud for automated analysis often triggers regulatory and trust risks. A new proposal aims to keep everything on-device: I²RiMA, a neural network that blends Riemannian geometry with temporal attention, capable of identifying mental stress with fewer than 2 million parameters.

The cross-subject detection challenge is well known: stress patterns vary from person to person and reside in specific frequency bands. Conventional Riemannian methods model spatial covariance mainly in the time domain, overlooking the neural oscillations critical for decoding higher cognitive states, while standard temporal tokenizers tend to break coherence between successive time slices. I²RiMA sidesteps both issues. It constructs spatial covariance matrices independently at each frequency point and maps them onto the tangent space of symmetric positive-definite matrices, preserving channel-wise geometry along with frequency-specific discriminative cues. Then, frequency cluster aggregation selects informative spectral components and reduces redundancy, forming compact clusters aligned with EEG rhythms. Finally, an intra-inter slice attention module adaptively integrates local slice-level dynamics and global temporal context across the sequence.

The computational footprint is remarkably small: 1.60 million parameters and 31.95 million FLOPs for inference. In practice, this means the model can run on a CPU without specialized hardware, on mid-to-high-end microcontrollers, or on common edge devices. No GPU, no remote servers. Balanced accuracy reaches 82.78% on the three tested datasets, outperforming five baseline models while keeping complexity at bay.

This architectural lightness opens scenarios beyond academic research. In occupational health, for example, an EEG wristband could analyze stress levels in real time, on site, without transmitting signals outside and without any cloud infrastructure. For enterprises, GDPR compliance and data sovereignty become easier to demonstrate when processing stays within the corporate perimeter. It is not just a privacy matter: it is an architectural choice that reduces dependence on third-party networks and services, lowers latency, and simplifies the system’s total cost of ownership.

Of course, the road from algorithm to real product is still long. Larger and more diverse population validations are needed, reliable certified sensors must be integrated, and long-term field reliability must be tested. Still, I²RiMA proves that geometric rigor and numerical efficiency can coexist in a model that, from its design, appears built for local inference. It is a signal – indeed, a whole spectrum – that on-device processing of biometric data is no longer just an ideological banner, but a concrete possibility, measured in just a few megabytes of memory.