LiquidGAN for Handwriting-Based Detection and Severity Classification of Extrapyramidal Symptoms
Erandhi M. Liyanage, Chun-Hung Lee, Wen-Yen Chang, Andrew An-Zhe Lee, Guan-Hsiung Liaw, Wu-Chuan Yang, Yu-Hsin Liu, Kun-Chan Lan, Sai Ho LingExtrapyramidal symptoms (EPS) are motor side effects commonly induced by antipsychotic medications and can lead to measurable changes in handwriting patterns. These symptoms affect both the spatial and temporal characteristics of writing, including stroke thickness, direction and the rate of directional change. To model these complex variations, we propose a novel Liquid Generative Adversarial Network (LiquidGAN), which combines the adaptive dynamics of liquid neural networks with the data generation capability of GANs. Handwriting data were collected from 94 patients with confirmed EPS and 30 healthy controls using Archimedean spiral patterns drawn with both hands. A total of 211 images were processed for both binary and multiclass classification using a pretrained ResNet50 model. The pretrained ResNet50 achieved 92% accuracy and 97% precision in the binary classification task; however, its performance dropped significantly to 57% accuracy in multiclass classification, indicating limited capability in capturing fine-grained EPS severity variations. In contrast, the proposed LiquidGAN demonstrated excellent performance in the binary classification task, achieving 97% accuracy and 98% precision. More importantly, LiquidGAN substantially outperformed the baseline in the more challenging multiclass setting, achieving 70% accuracy and precision across four classes (mild, moderate, severe, and control). This shows that the diverse dataset from the liquidGAN significantly improves the HOG-ANN classification and effectively captures complex and subtle handwriting variations associated with different EPS severity levels that conventional models such as ResNet50 fail to distinguish. In addition, LiquidGAN generated diverse and realistic synthetic handwriting samples, yielding improved Fréchet Inception Distance (FID), precision, and recall compared with style GAN. These findings demonstrate that handwriting biomarkers, when analyzed through dynamic generative learning, offer an effective and non-invasive approach for monitoring extrapyramidal side effects in clinical settings.