Parkinson's affects the motor system long before it is easy to diagnose, and the tremor and rigidity it causes show up in handwriting. This project takes that seriously as a classification problem: given a spiral or wave a patient has drawn, predict whether the hand that drew it belongs to someone with Parkinson's.
The interesting part is not the final model. It is that the first three approaches did not work well enough, and the notebook keeps all of them.
Approach
I started with classical features rather than raw pixels — a Histogram of Oriented Gradients descriptor at nine orientations, which captures the directional texture of a stroke and is a reasonable prior for a problem that is fundamentally about line quality. Those features fed a Random Forest and an XGBoost classifier, compared head to head on confusion matrices rather than accuracy alone, because the two error directions do not cost the same in a screening context.
From there I moved to learned features: a convolutional network built from scratch, stacking 100, 150 and 200-filter Conv2D layers into a dense head. Then ResNet50 transfer learning, on the reasoning that a network trained on natural images already knows edges and curvature.
The architecture I settled on uses dilated convolutions — 5×5 kernels at dilation rates of 4 and 2, stepping down to a 3×3 — with L2 regularization and Glorot normal initialization throughout. Dilation widens the receptive field without adding parameters, which matters on a dataset this small, and the regularization is there because a small dataset and a deep network is exactly the setup that memorizes.
What I took from it
The dataset is small enough that the gap between a model that works and a model that has memorized the training set comes down to how honestly you evaluate it. Reading confusion matrices instead of accuracy, and keeping four architectures instead of reporting one, are both responses to that.
My own note on the notebook at the time: this was my attempt at continuously trying to solve a problem, and although it took a long time, we finally came to a solution.