The introduction of trust-based approaches in social scenarios modeled as multi-agent systems (MAS) has been recognized as a valid solution to improve the effectiveness of these communities. In fact, they make interactions taking place in social scenarios much fruitful as possible, limiting or even avoiding malicious or fraudulent behaviors, including collusion. This is also the case of multi-layered neural networks (NN), which can face limited, incomplete, misleading, controversial or noisy datasets, produced by untrustworthy agents. Many strategies to deal with malicious agents in social networks have been proposed in the literature. One of the most effective is represented by Eigentrust, often adopted as a benchmark. It can be seen as a variation of PageRank, an algorithm for determining result rankings used by search engines like Google. Moreover, Eigentrust can also be viewed as a linear neural network whose architecture is represented by the graph of Web pages. A major drawback of Eigentrust is that it uses some additional information about agents that can be a priori considered particularly trustworthy, rewarding them in terms of reputation, while the non pre-trusted agents are penalized. In this paper, we propose a different strategy to detect malicious agents which does not modify the real reputation values of the honest ones. We introduce a measure of effectiveness when computing reputation in presence of malicious agents. Moreover, we define a metric of error useful to quantitatively determine how much an algorithm for the identification of malicious agents modifies the reputation scores of the honest ones. We have performed an experimental campaign of mathematical simulations on a dynamic multi-agent environment. The obtained results show that our method is more effective than Eigentrust in determining reputation values, presenting an error which is about a thousand times lower than the error produced by Eigentrust on medium-sized social networks.