Identification of brain activity by stochastic algorithms