Spreading depolarizations (SD) in the cerebral cortex are a novel mechanism of lesion development and worse outcomes after acute brain injury, but accurate diagnosis by neurophysiology is a barrier to more widespread application in neurocritical care. Here we developed an automated method for SD detection by training machine-learning models on electrocorticography data from a 14-patient cohort that included 1,548 examples of SD direct-current waveforms as identified in expert manual scoring. As determined by leave-one-patient-out cross-validation, optimal performance was achieved with a gradient-boosting model using 30 features computed from 400-s electrocorticography segments sampled at 0.1 Hz. This model was applied to continuous electrocorticography data by generating a time series of SD probability [P