Few questions in condensed matter science have proven as difficult to unravel as the interplay between structure and dynamics in supercooled liquids. To explore this link, much research has been devoted to pinpointing local structures and order parameters that correlate strongly with dynamics. Here we use an unsupervised machine learning algorithm to identify structural heterogeneities in three archetypical glass formers—without using any dynamical information. In each system, the unsupervised machine learning approach autonomously designs a purely structural order parameter within a single snapshot. Comparing the structural order parameter with the dynamics, we find strong correlations with the dynamical heterogeneities. Moreover, the structural characteristics linked to slow particles disappear further away from the glass transition. Our results demonstrate the power of machine learning techniques to detect structural patterns even in disordered systems, and provide a new way forward for unraveling the structural origins of the slow dynamics of glassy materials