Enhancing IMU-Based Online Handwriting Recognition via Contrastive Learning with Zero Inference Overhead
Li, Jindong, Zanca, Dario, Christlein, Vincent, Hamann, Tim, Barth, Jens, Kämpf, Peter, Eskofier, Björn
–arXiv.org Artificial Intelligence
Online handwriting recognition from inertial measurement units enables handwriting on paper as input for digital devices. Running recognition on edge hardware improves privacy and lowers latency, but entails memory constraints. To address this, we propose Error-Aware Contrastive-Enhanced Handwriting Recognition (ECHWR), a trainingtime contrastive learning framework designed to improve recognition accuracy without increasing inference costs. During training, ECHWR utilizes a temporary auxiliary branch that aligns IMU signal embeddings with semantic text embeddings in a shared space. This is enforced with a dual objective: (i) an in-batch contrastive loss that aligns IMU and text embeddings, and (ii) a hard-negative contrastive loss that uses synthetically perturbed text targets. The auxiliary branch is discarded after training, which allows the deployed model to keep its original, efficient architecture. Experiments on the OnHW-Words500 dataset show that ECHWR significantly outperforms state-of-the-art baselines, reducing character error rates by up to 7.4% on the writer-independent split and 10.4% on the writer-dependent split. Ablations indicate that the hard-negative objective is particularly effective for generalization to unseen writing styles, making our approach well-suited for online handwriting recognition on unseen users.
arXiv.org Artificial Intelligence
Jun-23-2026