We investigate the use of persistent homology, a tool from topological data analysis, as a means to detect and quantitatively describe center vortices in $\mathrm{SU}(2)$ lattice gauge theory in a gauge-invariant manner. We provide evidence for the sensitivity of our method to vortices by detecting a vortex explicitly inserted using twisted boundary conditions in the deconfined phase. This inspires the definition of a new phase indicator for the deconfinement phase transition. We also construct a phase indicator without reference to twisted boundary conditions using a simple $k$-nearest neighbours classifier. Finite-size scaling analyses of both persistence-based indicators yield accurate estimates of the critical $\beta$ and critical exponent of correlation length $\nu$ of the deconfinement phase transition.