Hybrid Transformer for Early Alzheimer's Detection: Integration of Handwriting-Based 2D Images and 1D Signal Features

Changqing Gong, Huafeng Qin, Mounîm A. El‐Yacoubi

Abstract

Early detection of Alzheimer’s Disease (AD) is vital for effective intervention, yet traditional diagnostics are often invasive or subjective. Handwriting analysis offers a non-invasive alternative, capturing both cognitive and motor impairments. This paper presents HSDA-MS, a Multi-Scale Transformer utilizing Hybrid Similarity and Difference Attention to integrate 2D handwriting images with 1D kinematic signals. Evaluated on the DARWIN dataset, the model achieves a state-of-the-art accuracy of 90.91%, demonstrating the efficacy of combining spatial and dynamic features for AD screening.

Introduction

Early detection of Alzheimer’s Disease (AD) remains a significant clinical challenge. Current diagnostic methods, such as lumbar punctures for cerebrospinal fluid analysis or PET scans, are invasive and costly. Cognitive tests, while non-invasive, can be subjective. Handwriting is emerging as a powerful biomarker because it requires the complex coordination of cognitive and motor functions—systems that are among the first to degrade in AD patients.

Existing machine learning approaches often treat handwriting data as either static 2D images or dynamic 1D signals. However, unimodal models frequently fail to capture the intricate relationship between spatial patterns and kinematic irregularities. This study introduces the HSDA-MS Transformer, a multimodal architecture designed to bridge this gap by processing both 2D and 1D data streams simultaneously.

Methodology

The proposed HSDA-MS (Multi-Scale Transformer based on Hybrid Similarity and Difference Attention) framework follows a structured pipeline from raw data to classification.

Overview of the HSDA-MS pipeline, illustrating the stages of data preprocessing, multimodal feature extraction, dataset splitting with augmentation, and the final classification model.

Data Acquisition and Preprocessing

The study utilized the DARWIN-RAW dataset, containing handwriting samples from 174 participants (89 AD, 85 Healthy Controls). Data was collected at 200 Hz, capturing (x, y) coordinates and pen pressure across 25 tasks. Preprocessing steps included handling missing values, removing abnormal data points, and ensuring consistency across samples.

Model Architecture

The HSDA-MS model incorporates several key innovations:

  1. Multimodal Embedding: A convolutional "stem" module converts 2D images into embeddings, while an adaptive pooling module processes 1D signals, ensuring compatibility within the Transformer blocks.
  2. Hybrid Similarity and Difference Attention (HSDA): Unlike standard attention that focuses on global similarities, HSDA includes a "Difference Attention" mechanism. This uses a discrepancy weight model to highlight local variations and micro-tremors characteristic of AD.
  3. Multi-Scale Hybrid Block (MSH): To mitigate overfitting on small clinical datasets, 1D and 2D residual feedforward modules extract features at multiple scales.
  4. Template Contrastive Loss: A specialized loss function encourages the model to maximize the distance between AD and Healthy Control (HC) feature representations using learnable templates.

Results and Discussion

The HSDA-MS model achieved state-of-the-art (SOTA) performance on the DARWIN dataset. Specifically, in Task 8 (writing the letter 'L'), the model reached an accuracy of 90.91%, a precision of 100%, and an F1-score of 90.32%. These results represent a significant improvement over baseline architectures like VGG19 and standard Swin Transformers.

Visualization of 1D kinematic signals, including pressure, speed, acceleration, and angular speed, which provide critical dynamic features for the multimodal Transformer.

The integration of 1D signals (as seen in the figure above) with 2D spatial data proved crucial. The "Difference Attention" mechanism effectively identified the subtle, noisy signals in kinematic data that distinguish AD patients from healthy individuals.

Conclusion

The HSDA-MS Transformer demonstrates that combining spatial and dynamic handwriting features significantly enhances the accuracy of early Alzheimer’s detection. While the results are promising, future work will focus on improving model explainability for clinical use and expanding the dataset to include other neurodegenerative conditions.

Summary updated

BibTeX
@article{gong2025hybrid,
  author = {Changqing Gong and Huafeng Qin and Mounîm A. El‐Yacoubi},
  title = {{Hybrid Transformer for Early Alzheimer's Detection: Integration of Handwriting-Based 2D Images and 1D Signal Features}},
  journal = {IEEE J. Biomed. Health Informatics},
  year = {2025},
  doi = {10.1109/jbhi.2025.3585379},
}
Figure