  Self/other distinction and self-recognition are important skills for
interacting with the world, as it allows humans to differentiate own actions
from others and be self-aware. However, only a selected group of animals,
mainly high order mammals such as humans, has passed the mirror test, a
behavioural experiment proposed to assess self-recognition abilities. In this
paper, we describe self-recognition as a process that is built on top of body
perception unconscious mechanisms. We present an algorithm that enables a robot
to perform non-appearance self-recognition on a mirror and distinguish its
simple actions from other entities, by answering the following question: am I
generating these sensations? The algorithm combines active inference, a
theoretical model of perception and action in the brain, with neural network
learning. The robot learns the relation between its actions and its body with
the effect produced in the visual field and its body sensors. The prediction
error generated between the models and the real observations during the
interaction is used to infer the body configuration through free energy
minimization and to accumulate evidence for recognizing its body. Experimental
results on a humanoid robot show the reliability of the algorithm for different
initial conditions, such as mirror recognition in any perspective, robot-robot
distinction and human-robot differentiation.
