Artificial intelligence (AI)-based tools are widely employed, but their use for diagnosis and prognosis of neurological disorders is still evolving. Here we analyse a cross-sectional multicentre structural MRI dataset of 696 people with epilepsy and 118 control subjects. We use an innovative machine-learning algorithm, Subtype and Stage Inference, to develop a novel data-driven disease taxonomy, whereby epilepsy subtypes correspond to distinct patterns of spatiotemporal progression of brain atrophy.In a discovery cohort of 814 individuals, we identify two subtypes common to focal and idiopathic generalized epilepsies, characterized by progression of grey matter atrophy driven by the cortex or the basal ganglia. A third subtype, only detected in focal epilepsies, was characterized by hippocampal atrophy. We corroborate external validity via an independent cohort of 254 people and confirm that the basal ganglia subtype is associated with the most severe epilepsy.Our findings suggest fundamental processes underlying the progression of epilepsy-related brain atrophy. We deliver a novel MRI- and AI-guided epilepsy taxonomy, which could be used for individualized prognostics and targeted therapeutics.