Introduction
Airwriting represents a significant leap in touchless Human-Computer Interaction (HCI), allowing users to "write" characters in free space using motion-sensing wearables like smart-bands or rings. However, the practical deployment of airwriting systems is often hindered by significant variability in how different individuals write and how different hardware sensors capture that motion. This paper introduces SCLAiR, a framework designed to overcome these challenges through Supervised Contrastive Learning (SCL), achieving state-of-the-art performance and robust generalization across users and devices.
The Challenge of Variability
The primary obstacles in airwriting recognition are two-fold:
- Inter-subject variability: No two people write the same way. Differences in speed, stroke order, character size, and personal style create a high degree of noise for traditional classification models.
- Device dependency: Wearable devices vary significantly in their sensor specifications, including sampling rates, noise levels, and dynamic ranges. A model trained on one device often fails when deployed on another.
Most existing solutions are either user-dependent or require extensive labeled data for every new device. SCLAiR addresses these by learning a representation that captures the fundamental "essence" of a character's motion, independent of the specific user or sensor.
Methodology: The SCLAiR Framework
The core of SCLAiR is a two-stage training strategy centered on Supervised Contrastive Learning (SCL).
Stage 1: Feature Learning via Contrastive Loss
In the first stage, an encoder (such as a CNN or BiLSTM) and a projection head are trained using a supervised contrastive loss function. Unlike standard cross-entropy loss, which maps inputs directly to labels, SCL focuses on the relationships between samples. It pulls representations of the same letter (e.g., 'A' written by different people) closer together in a high-dimensional latent space while pushing representations of different letters (e.g., 'A' vs. 'B') further apart. This process naturally performs "hard mining," focusing on distinguishing between similar motion patterns like 'D' and 'P'.
Stage 2: Classification
Once the latent space is well-structured, the projection head is removed, and the encoder's weights are frozen. A simple linear classifier is then trained on top of these robust features using standard Cross-Entropy loss. This ensures that the classifier benefits from a feature space that is already optimized for character discrimination.
Experimental Setup and Architectures
The researchers evaluated several neural architectures, including 1DCNN, LSTM, BiLSTM, and hybrid models. The 1DCNN-BiLSTM hybrid emerged as the top performer, effectively combining the spatial feature extraction capabilities of CNNs with the temporal sequence modeling of BiLSTMs.
To test generalization, the system was evaluated across three datasets:
- Source Dataset: 55 subjects using a Microsoft Band 2 (62 Hz).
- Target Dataset 1: 20 subjects using a Noraxon Ultium EMG sensor (downsampled to 62 Hz).
- Target Dataset 2: 10 subjects using a high-frequency (400 Hz) device.
Key Results and Discussion
SCLAiR demonstrated superior performance in both supervised and unsupervised settings. On the source dataset, it achieved a mean recognition accuracy of 88.05%, a significant improvement over the previous state-of-the-art of 83.2%.
In unsupervised domain adaptation scenarios—where the model is trained on one device and tested on another without additional labels—SCLAiR maintained an accuracy of approximately 80-81%. This outperformed standard cross-entropy models and established domain adaptation techniques like DANN. The robustness of the learned latent space allows the model to ignore sensor-specific noise and focus on the underlying motion trajectory.
Confusion analysis revealed that the most common errors occurred between characters with highly similar trajectories, such as 'D' vs. 'P' and 'F' vs. 'I'. These "hard" pairs remain a challenge for future refinement.
Conclusion
SCLAiR provides a robust framework for airwriting recognition that generalizes across different users and hardware platforms. By prioritizing the learning of high-quality representations through supervised contrastive learning, the system achieves high accuracy and resilience to domain shifts. Future work will explore explicit bias removal techniques to further refine the latent embeddings and expand the system's vocabulary to include lowercase letters and cursive script.
Summary updated