Many processes in chemistry and physics take place on timescales that cannot be explored using standard molecular dynamics simulations. This renders the use of enhanced sampling mandatory. Here we introduce an enhanced sampling method that is based on constructing a model probability density from which a bias potential is derived. The model relies on the fact that in a physical system most of the configurations visited can be grouped into isolated metastable islands. To each island we associate a distribution that is fitted to a Gaussian mixture. The different distributions are linearly combined together with coefficients that are computed self consistently. Remarkably, from this biased dynamics, rates of transition between different metastable states can be straightforwardly computed.