The Mirror Self-recognition for Robots iCubSim at the mirror Andrej Lucny Department of Applied Informatics FMFI, Comenius University Bratislava, Slovakia lucny@fmph.uniba.sk Abstract—We introduce a simple example of artificial system system emerge from the parallel course of simpler modules and which aims to mimic the process of the mirror self-recognition - from their mutual interactions. Agent-Space Architecture is a ability limited to very few species. We assume that evolution of software tool for building modular control systems of robots, the species is reflected in the structure of the underlying control running in real-time. It is strongly based on ideas of Brooks' mechanism and design modules of the mechanism, concerning its subsumption architecture [1] and Minsky's society model of incremental development. On this example, we also demonstrate mind [6] [4]. Within the framework we define operation of modular architecture suitable for such task. It is based on individual modules and connect various module outputs to decentralization and massive parallelism and enables incremental various module inputs (many:many) regardless the fact that building of control system which is running in real-time and each module can operate at different pace. Such combining of easily combines modules operating at different pace. either really slow or really fast processes is possible due to all Keywords—the mirror self-recognition; robot iCubSim; Agent- data produced by a module (producer) being written onto a space architecture blackboard (called space) and processed later, when another module (consumer) is ready to process them. These written data remain on the blackboard until they are rewritten by the I. INTRODUCTION same or another producer, or their time validity expires. Finally Seeing in the mirror, we recognize ourselves. However the data exchange supports also hierarchical control and its child less than eighteen months old is rather looking for incremental development, e.g. module has to define sufficient another person behind the mirror. In nature, the mirror self- priority for written data – otherwise it would not be able to recognition is present only in exceptional cases, for instance rewrite their previous value already written on the blackboard. chimpanzees recognize themselves in the mirror, while cats do not. Can a robot recognize itself in the mirror? And what is the IV. MECHANISMS origin of the self-recognition ability? We follow Scassellati and Hart [3], who suppose that a robot should recognize itself in the Now we can try to implement the system, using which we mirror due to perfect correlation between body movement and are able to evaluate correlation between own body movement the image seen in the mirror. Unlike them and like Takeno [8] and the seen image movement. We aim to implement a we use a very simplified body model. working demo following biological relevancy of our approach, based on knowledge about the above-mentioned species. II. TESTBED A. Body model (proprioception) Using the simulator of the humanoid robot iCub [7] we The body model is provided by the iCubSim simulator, thus added a camera shooting the area in the front of the monitor we need to implement just its control and monitoring from the with the robot rendered image, we create a control system on blackboard. We implement a module motor which reads an which we can examine how the mirror self-recognition intended joint position intention from the blackboard, emerges from basic mechanisms. This enables us to establish communicates with the simulator (via yarp rpc protocol) and as interaction between the virtual robot and human sitting at the a result, it writes proprioception to the blackboard which monitor and later between the robot and its image reflected to represents a real joint position (Fig. 1). In parallel, the added the camera by the mirror. The simulator has almost perfect camera regularly provides a new image to the blackboard. model of the robot body. However for our purposes we intend to simplify it, thus we move a single joint – the joint moving head from side to side. In this way the body model is simplified B. Mirroring to a single number – the angle of the robot head inclination. As we aim to compare the body model (i.e. value proprioception) with the image captured by the camera, we III. ARCHITECTURE need to get an analogical model from the image. This approach is still biologically relevant since several species are proven to For examination of mechanisms underlying the mirror self- obtain such ability (mirror neurons). (How such ability has recognition process, we employ a modular framework (Agent- emerged and evolved, is not the subject of our exploration – it Space Architecture [5]) which enables us to let the control is only limited to the implementation of this ability.) Since we Proceedings of EUCognition 2016 - "Cognitive Robot Architectures" - CEUR-WS 46 take into account both interaction between the robot and human implement the active part of imitation, which can be called the and interaction between the robot and its image in the mirror, invitation to imitation and obtains a higher priority than the we combine two specific methods which output the same data passive imitation and occasionally generates side to side onto the backboard – the model of the seen image (the model movement of the robot’s head when the body seen does not value in Fig. 1). move. However we found out that even slight inaccuracies in the model evaluation are sufficient to induce the imitation process. D. Social modelling Imitation process provides us with the data of correlation between the body owned and the body seen. When an individual lives within a society, it is important for him to categorize the data and associate them with the image seen. When such individual meets the mirror, it possibly creates a Fig. 1. The modular structure of the mirror self-recognition system new category and finds out that the corresponding correlation is unusually high. In fact, it is so high that the image seen can not only be associated with the body model seen, but also with its own body, meaning that it sees itself. Instead of modelling the society, for our purposes, it is sufficient to record the data produced by the two models since the aim of the study is to differentiate the data created when robot encounters human and when robot sees its own image in the mirror. V. CONCLUSION As a result of implementation of the above mentioned mechanisms, when iCubSim's image is reflected into the external camera by a mirror, robot invites himself to imitation and it stays in an interaction with itself for certain amount of time (Fig. 2). Thus correlation between the body model (proprioception) and the model of the image seen (model) can be evaluated and its unusually high value indicates that the robot sees itself in the mirror. Thus the designed structure of Fig. 2. The iCumSim robot following its own image in the mirror the mirror self-recognition process is partially verified. For the iCubSim image processing (we rotate a printed As a teaser video can be viewed here: picture of iCubSim in front of the camera) we employ the http://www.agentspace.org/mirror/iCubSimAtTheMirror.mp4 SURF method. SURF provides projection of given template to the image seen from which we can easily calculate inclination REFERENCES of the template. For the processing of human image (interacting person is moving his head in front of the camera) we use [1] Brooks, R. (1999). "Cambrian Intelligence". The MIT Press, Cambridge, MA combination of Haar face detector and CamShift tracking: the [2] Gallup, G. G., Jr. (1970). Chimpanzees: Self Recognition. Science, 167, Haar detector detects face in the upright position and sets up 86-87. template for CamShift to track. The projection of the template [3] Hart, J. W. Scassellati, B. (2012). Mirror Perspective-Taking with a to the seen image calculated by CamShift provides us with the Humanoid Robot. In Proceedings of the 26th AAAI Conference on required head inclination. All algorithms employed are Artificial Intelligence (AAAI-12). Toronto, Canada. available in OpenCV library (www.opencv.org). [4] Kelemen, J. (2001). "From statistics to emergence - exercises in systems modularity". In: Multi-Agent Systems and Applications, (Luck, M., C. Imitation Marik, V., Stepankova, O. Trappl, R.), Springer, Berlin, pp. 281-300 [5] Lucny, A. (2004). "Building complex systems with Agent-Space The correlation of these two comparable models can only be architecture". Computing and Informatics, Vol. 23, pp. 1001-1036 evaluated by their changes through time therefore both robot [6] Minsky, M. (1986). The Society of Mind. Simon&Schuster, New York and human have to be put in motion. One of the mechanisms, [7] Sandini, G. - Metta, G. - Vernon, D. (2007). The iCub cognitive that can provide it, is imitation. Due to the utilized mirroring, humanoid robot: an open-system research platform for enactive cognition. In: 50 years of artificial intelligence, pp. 358-369, Springer- a passive imitation can be implemented by direct copying of Verlag, Berlin values of the body model seen (i.e. the model value) into the [8] Takeno, J. (2008). A Robot Succeeds in 100% Mirror Image Cognition. robot’s body model (i.e. the intention value). As a result, INTERNATIONAL JOURNAL ON SMART SENSING AND iCubSim imitates side to side movement of one’s head when INTELLIGENT SYSTEMS, Vol. 1, No. 4, December 2008 moving in front of the camera. Optionally we can also Proceedings of EUCognition 2016 - "Cognitive Robot Architectures" - CEUR-WS 47