  Topological invariants allow to characterize Hamiltonians, predicting the
existence of topologically protected in-gap modes. Those invariants can be
computed by tracing the evolution of the occupied wavefunctions under twisted
boundary conditions. However, those procedures do not allow to calculate a
topological invariant by evaluating the system locally, and thus require
information about the wavefunctions in the whole system. Here we show that
artificial neural networks can be trained to identify the topological order by
evaluating a local projection of the density matrix. We demonstrate this for
two different models, a 1-D topological superconductor and a 2-D quantum
anomalous Hall state, both with spatially modulated parameters. Our neural
network correctly identifies the different topological domains in real space,
predicting the location of in-gap states. By combining a neural network with a
calculation of the electronic states that uses the Kernel Polynomial Method, we
show that the local evaluation of the invariant can be carried out by
evaluating a local quantity, in particular for systems without translational
symmetry consisting of tens of thousands of atoms. Our results show that
supervised learning is an efficient methodology to characterize the local
topology of a system.
