Cognitive Attention Map: Semantic Tokenization of Source Code via OCR-Based AOI Identification across Performance Levels
Abstract
Understanding how visual attention is attended by programmers is critical to progress in the field of programming education. Conventional eye-tracking studies typically employ basic and coarsely defined Areas of Interest (AOIs), which fail to capture the underlying semantic content of source code. We present an automated system that produces Cognitive Attention Maps using Optical Character Recognition (OCR) technology-based AOIs and semantic tokens. Our system extracts bounding boxes from rendered code, enabling the alignment of gaze data with semantically relevant code components, such as identifiers, operators, keywords, and literals. The proposed framework facilitates multi-dimensional visual attention profiling (frequency and duration). Our framework, tested on programming tasks, reveals visual attention and performance-based differences that are not possible with conventional AOIs. Our study offers an in-depth and sophisticated perspective on programmer cognition. Future work will aim to enhance scanpath prediction by improving the semantic tokens’ integration to achieve more precise visual behavior prediction.
- Venue
- ETRA 2026
- Volume
- Proceedings of the 2026 Symposium on Eye Tracking Research and Applications
- DOI
- 10.1145/3797246.3806014
- https://dl.acm.org/doi/pdf/10.1145/3797246.3806014
- Anthology ID
2026.etra-short.85
Cite
@inproceedings{yang-etal-2026-cognitive,
title = {{Cognitive Attention Map: Semantic Tokenization of Source Code via OCR-Based AOI Identification across Performance Levels}},
author = {Wudao Yang and Mohammad Asaduzzaman Rasel and Seng Yue Wong and Unaizah Obaidellah},
booktitle = {Proceedings of the 2026 Symposium on Eye Tracking Research and Applications},
isbn = {9798400725197},
year = {2026},
publisher = {Association for Computing Machinery},
address = {New York, NY, USA},
doi = {10.1145/3797246.3806014},
url = {https://doi.org/10.1145/3797246.3806014},
abstract = {Understanding how visual attention is attended by programmers is critical to progress in the field of programming education. Conventional eye-tracking studies typically employ basic and coarsely defined Areas of Interest (AOIs), which fail to capture the underlying semantic content of source code. We present an automated system that produces Cognitive Attention Maps using Optical Character Recognition (OCR) technology-based AOIs and semantic tokens. Our system extracts bounding boxes from rendered code, enabling the alignment of gaze data with semantically relevant code components, such as identifiers, operators, keywords, and literals. The proposed framework facilitates multi-dimensional visual attention profiling (frequency and duration). Our framework, tested on programming tasks, reveals visual attention and performance-based differences that are not possible with conventional AOIs. Our study offers an in-depth and sophisticated perspective on programmer cognition. Future work will aim to enhance scanpath prediction by improving the semantic tokens’ integration to achieve more precise visual behavior prediction.}
}