Symmetry-protected topological (SPT) phases are short-range entangled phases of matter with a non-local order parameter which are preserved under a local symmetry group. Here, by using unsupervised learning algorithm, namely the diffusion maps, we demonstrate that can differentiate between symmetry broken phases and topologically ordered phases, and between non-trivial topological phases in different classes. In particular, we show that the phase transitions associated with these phases can be detected in different bosonic and fermionic models in one dimension. This includes the interacting SSH model, the AKLT model and its variants, and weakly interacting fermionic models. Our approach serves as an inexpensive computational method for detecting topological phases transitions associated with SPT systems which can be also applied to experimental data obtained from quantum simulators.