Transformer-based stroke relation encoding for online handwriting and sketches
Jing-Yu Liu,Yan-Ming Zhang,Fei Yin,Cheng-Lin Liu
DOI: https://doi.org/10.1016/j.patcog.2023.110131
IF: 8
2023-11-29
Pattern Recognition
Abstract:Stroke classification for online handwriting and sketches, aimed at grouping strokes into different semantic categories, has drawn considerable attention due to its wide applications. This task is challenging since individual strokes look similar and are easily confused with each other. The key is to consider both the individual strokes and the contextual information jointly for making prediction. Previous methods are insufficient in modeling and exploiting complex contextual information of strokes. To overcome this limitation, we propose a Transformer-based model for Online Handwriting and Sketches (T-OHS), with novel relation encoding schemes to take advantage of temporal and spatial information in stroke sequence. Particularly, we introduce a coarse-to-fine hierarchical encoding approach based on the polar coordinate system for precisely modeling spatial relations between strokes. Experiments on three types of handwriting data, including online handwritten documents, diagrams, and sketches, demonstrate that our method is universal and provides state-of-the-art performance.
computer science, artificial intelligence,engineering, electrical & electronic