<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">JSEA</journal-id><journal-title-group><journal-title>Journal of Software Engineering and Applications</journal-title></journal-title-group><issn pub-type="epub">1945-3116</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/jsea.2016.97022</article-id><article-id pub-id-type="publisher-id">JSEA-68540</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  Neural Network in Computer Vision for RoboCup Middle Size League
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Paulo</surname><given-names>Rogério de Almeida Ribeiro</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Gil</surname><given-names>Lopes</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Fernando</surname><given-names>Ribeiro</given-names></name><xref ref-type="aff" rid="aff1"><sup>1</sup></xref></contrib></contrib-group><aff id="aff1"><addr-line>Department of Industrial Electronics, Robotics Group, Algoritmi Centre, University of Minho, Campus de Azurém, Guimar?es, Portugal </addr-line></aff><pub-date pub-type="epub"><day>18</day><month>07</month><year>2016</year></pub-date><volume>09</volume><issue>07</issue><fpage>319</fpage><lpage>325</lpage><history><date date-type="received"><day>5</day>	<month>April</month>	<year>2016</year></date><date date-type="rev-recd"><day>accepted</day>	<month>15</month>	<year>July</year>	</date><date date-type="accepted"><day>18</day>	<month>July</month>	<year>2016</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  Robot World Cup Initiative (RoboCup) is a worldwide competition proposed to advance research in robotics and artificial intelligence. It has a league called RoboCup soccer devoted for soccer robots, which is a challenge because robots are mobile, fully autonomous, multi-agents, and they play on a dynamic environment. Moreover, robots must recognize the game entities, which is a crucial task during a game. A camera is usually used as an input system to recognize ball, opponents, soccer field, and so on. These elements may be recognized applying some tools of computational intelligence, for example an artificial neural network. This paper describes the application of an artificial neural network on middle size robotic football league, where a multilayer perceptron neural network is trained with the backpropagation algorithm, to classify elements on the image. Each output neuron represents an entity and its output value depends on the current entity that is present on the image. The results show that an artificial neural network successfully classified the entities. They were recognized even when similar color entities were present on the image.
 
</p></abstract><kwd-group><kwd>RoboCup</kwd><kwd> Computer Vision</kwd><kwd> Artificial Neural Network</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Robotic soccer is a challenge since its robots are mobile, fully autonomous, multi-agents, and they play on a dynamic environment. Its main competition, Robot World Cup Initiative (RoboCup) [<xref ref-type="bibr" rid="scirp.68540-ref1">1</xref>] , consists of a scientific challenge that has been created to develop research in robotics and artificial intelligence through a standard worldwide problem, e.g. [<xref ref-type="bibr" rid="scirp.68540-ref2">2</xref>] .</p><p>Movement control and planning, and vision system are relevant research areas for this problem. For example, a precise perception of the soccer field, ball and other entities of the game are important tasks since several decisions rely on these information. A usual approach to recognize these elements is through an algorithm applied on images grabbed by a camera. Some tools of computational intelligence have been applied to solve this recognition problem [<xref ref-type="bibr" rid="scirp.68540-ref3">3</xref>] considering their high classification rate. However, some of these algorithms have a high processing time to recognize the entities and this time during a game is important as the classification rate. An ideal approach must find a compromise between the shortest processing time and the highest rate of correct classification.</p><p>Thus, this work proposes to apply an Artificial Neural Network (ANN) to recognize entities―such as soccer field, lines, ball, players―for RoboCup middle size league. An ANN was chosen because: it can approximate any function [<xref ref-type="bibr" rid="scirp.68540-ref4">4</xref>] ; it works with noisy data; minimum knowledge about the problem is required [<xref ref-type="bibr" rid="scirp.68540-ref5">5</xref>] , and also a minimum knowledge of the input statistical distribution [<xref ref-type="bibr" rid="scirp.68540-ref6">6</xref>] is sufficient. As a proof of concept, this work classifies only three entities, namely: soccer field, ball and “other elements”.</p><p>This paper is organized as follows: On Section 2, the Robocup competition is described; Section 3 reports the methodology applied for this work; Section 4 shows the obtained results; and Section 5 presents the conclusion and directions for further works.</p></sec><sec id="s2"><title>2. RoboCup</title><p>As stated by the RoboCup federation on its website, the main objective of RoboCup challenge is “By the middle of the 21st century, a team of fully autonomous humanoid robot soccer players shall win a soccer game, complying with the official rules of FIFA, against the winner of the most recent World Cup”.</p><p>RoboCup intends to promote research on Artificial Intelligence and robotics in general, with a world known rules challenge like football, and therefore, teams from all around the world are building mobile and autonomous robotic platforms able to play football, and refereed by a human. In order to make it possible, the challenges have been split into several different leagues, to tackle different problems separately. The RoboCup Soccer is divided into Simulation League, Small Size Robot League, Middle Size Robot League, Humanoid League, and Standard Platform League. Each one of these leagues tackle different aspects of the challenge. While simulation concentrates more on the strategy of the game itself, the small size league teams do research on cooperation and fast moving, the Middle Size League sorts out most the physical problems with hardware/kicking devices, etc. However, the middle size league is the one with robots playing most similar to humans, regarding speed, weight and size, strategy, ball pass, kick strength, field characteristics, and so on.</p><p>Nowadays, the RoboCup is not only football but also other challenges namely RoboCup Rescue and RoboCup@Home. The Rescue league involves a physical space called arena that simulates a destroyed environment (like an earthquake) and the robots have to find out victims through sound, temperature or movement. The @home league consists of a physical space similar to a real home and each robot has to perform domestic tasks like taking the bin outside, turning on a TV, following one person, picking up objects from a table or from inside a fridge, etc. This league is becoming more and more attractive to teams due to its usefulness and because it consists of only one robot per team.</p><p>The RoboCup Middle Size Robot League football (or soccer in USA) challenge involves many problems to be sorted by researchers and the most important ones are described here: 1) it is a dynamical environment where each robot is a different entity and never on the same place; 2) since cameras grab images at 60 frames per second and some teams move at speeds of up to four meters per second a real time system is crucial; 3) the information available by each robot is incomplete, i.e. the information rapidly becomes out dated and each robot cannot see the whole field or perceive all information from all opponents and team mates, therefore some assumption has to be carried out; 4) The sensor reading is non symbolic and since each robot team has a non standard shape it is difficult to grab information about opponents; 5) the control is not centralized, i.e., each robot has his own computer/processor and takes his own decisions, and therefore a lot of communication needs to be used, which is sometimes hard to achieve because there are hundreds of communication devices on the pavilion.</p><p>Robots that participate on the middle size league must have their own data acquisition system. The video camera is one of the most important sensors on this league, and can be used for the localization and obstacle avoidance tasks. However, these tasks can be seriously affected due to the vision system that is disturbed during light conditions changes. Algorithms for image processing and computer vision must be robust against several conditions such as fast moving robots, light conditions variations, vibrations, image occlusion and so on. <xref ref-type="fig" rid="fig1">Figure 1</xref> shows a game for the RoboCup middle size league where some entities of the game can be seen, such as soccer field, robots and ball.</p><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> Soccer robots―RoboCup middle size league</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x6.png"/></fig></sec><sec id="s3"><title>3. Methodology</title><p>The image is obtained by an omnidirectional vision system. This system uses a parabolic/conic mirror facing downwards and a color camera facing the mirror to obtain a 360˚ view, as demonstrated on <xref ref-type="fig" rid="fig2">Figure 2</xref>. An ANN is used to classify some entities of the RoboCup middle size league. As a proof of concept, a feedforward ANN is trained with the backpropagation algorithm to recognize soccer field, ball and “other elements” present on the captured image.</p><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Omnidirectional vision system: parabolic/conic mirror facing downwards and a color camera facing the mirror</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x7.png"/></fig><p>ANN’s input is a window with the three color channels, i.e. red, green and blue channel of the image. Each output neuron represents an entity and its output value depends on the current entity that is present on the image. Thus, there are 3 neurons on the output layer: the first neuron for the soccer field, the second one is for the ball, and the third one is for “other elements”. In order to recognize one element the output value should be 1 for its output neuron whereas the other output neurons should be −1, i.e. a soccer field as an input sample should lead to ANN’s output such as [1 −1 −1] whereas a ball as an input sample shall produce [−1 1 −1] as the output of the ANN. <xref ref-type="fig" rid="fig3">Figure 3</xref> depicts a schematic representation of the feedforward ANN used on this work. It has 75 input neurons once a 25 window size was used and there are 3 channels (red, green, and blue); 2 hidden layers, and 3 output neurons and their output values depend on the current input of the ANN.</p><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> Schematic diagram for the feedforward ANN</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x8.png"/></fig></sec><sec id="s4"><title>4. Results</title><p>The application was implemented in C++ and QtCreator [<xref ref-type="bibr" rid="scirp.68540-ref7">7</xref>] using the OpenCV library [<xref ref-type="bibr" rid="scirp.68540-ref8">8</xref>] , and was running under the operating system Ubuntu. The computer was a conventional notebook with a 2.2 GHz Core 2 Duo processor. <xref ref-type="fig" rid="fig4">Figure 4</xref> shows the system developed to recognize the entities during data acquisition to train the ANN. For each input sample (numbered on <xref ref-type="fig" rid="fig4">Figure 4</xref>) a corresponding label for it is given―i.e. soccer field, ball, or others―on the left side of <xref ref-type="fig" rid="fig4">Figure 4</xref>.</p><p>Several combinations of ANN architectures were tested, such as number of neurons in the hidden layers, values of leaning rate and momentum term, as well as the number of samples to train and epochs. The best obtained parameters for this case are shown on <xref ref-type="table" rid="table1">Table 1</xref>. The input layer has 75 neurons once the used window had 25 pixels and the number of input neurons is equal to the window size multiplied by 3, which is the number of color channels. The activation function was a sigmoid function.</p><p>The developed system can classify an image sample or an entire image. <xref ref-type="fig" rid="fig5">Figure 5</xref> depicts the process to classify an image sample, where on the right side an input sample (blue square on the image grabbed by the camera) is shown and on the left side it displays the ANN’s output (on a table) for this input sample. The average time to recognize a sample (size 5 by 5 pixels) is 0.007 seconds whereas for a full image its required time is approximately 0.1 seconds.</p><p>Acceptable results were obtained with the system as shown on <xref ref-type="fig" rid="fig5">Figure 5</xref>. Thus, new elements were placed on the soccer field to check system’s reliability, namely large paper cylinders and road cones. Paper cylinders were used since these are used in real games as team markers. Road cones were used due to its color similarity with the ball.</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> System developed to recognize the entities during sample acquisition</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x9.png"/></fig><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> System’s output for an input sample (blue square) to recognize soccer field</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x10.png"/></fig><p>The results with the paper cylinders are accurate, as shown on <xref ref-type="fig" rid="fig6">Figure 6</xref>, i.e. it shows no confusion between the ball and paper cylinders. On the other hand, the system was not so conclusive to distinguish between the ball and road cone. This was mainly due to the road cone’s color, which is very similar to the ball color. An input sample containing the road cone may generate an ANN’s output as [−1 1 −1] rather than [−1 −1 1] as expected, once it has to be classified as “other elements”. A tolerance value, which is the difference between the desired output and the current ANN’s output, was used to solve this misclassification. Several experiments demonstrated an ideal tolerance value of 0.3. <xref ref-type="fig" rid="fig7">Figure 7</xref> shows a tolerance value of 0.5 in order to show a misclassification between ball and road cone.</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Parameters used for the classification problem</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Parameters</th><th align="center" valign="middle" >Value</th></tr></thead><tr><td align="center" valign="middle" >Number of input neurons</td><td align="center" valign="middle" >75</td></tr><tr><td align="center" valign="middle" >Number of hidden neurons―first layer</td><td align="center" valign="middle" >60</td></tr><tr><td align="center" valign="middle" >Number of hidden neurons―second layer</td><td align="center" valign="middle" >40</td></tr><tr><td align="center" valign="middle" >Number of output neurons</td><td align="center" valign="middle" >3</td></tr><tr><td align="center" valign="middle" >Learning rate</td><td align="center" valign="middle" >0.00004</td></tr><tr><td align="center" valign="middle" >Momentum term</td><td align="center" valign="middle" >0.07</td></tr><tr><td align="center" valign="middle" >Desired error</td><td align="center" valign="middle" >0.0001</td></tr><tr><td align="center" valign="middle" >Epochs</td><td align="center" valign="middle" >99999</td></tr></tbody></table></table-wrap><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Ball reliably classified (blue square) after an insertion of new elements</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x11.png"/></fig><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Example of misclassification between ball and road cone</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/1-9302217x12.png"/></fig><p>Two short movies were recorded to show the software working on a real environment, the first video shows the classification of some parts of the image<sup>1</sup> whereas the second one shows the classification for the whole image<sup>2</sup>.</p></sec><sec id="s5"><title>5. Conclusions</title><p>ANN has been widely used to recognize objects in several different applications. This work shows an application of ANN for RoboCup middle size league. The results show that the use of ANN for this task is successful. The entities were completely recognized, even when similar color entities like paper cylinders and road cones are present on the image.</p><p>Considering that a soccer robot acquires between 25 and 30 frames per second, the time to classify a full image is considered high; therefore, an alternative is to use an ANN only in some parts of the image and only after image segmentation. For further work it is recommended to use a K-means to segment the image, in order to reduce classification time.</p></sec><sec id="s6"><title>Acknowledgements</title><p>The authors wish to thank all members of the Laborat&#243;rio de Automa&#231;&#227;o e Rob&#243;tica, at University of Minho, Guimar&#227;es. Also special thanks to the ALGORITMI Research Centre for the opportunity to develop this research.</p></sec><sec id="s7"><title>Cite this paper</title><p>Paulo Rog&#233;rio de Almeida Ribeiro,Gil Lopes,Fernando Ribeiro, (2016) Neural Network in Computer Vision for RoboCup Middle Size League. Journal of Software Engineering and Applications,09,319-325. doi: 10.4236/jsea.2016.97022</p></sec><sec id="s8"><title>NOTES</title></sec></body><back><ref-list><title>References</title><ref id="scirp.68540-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">RoboCup (2016) http://www.robocup.org/</mixed-citation></ref><ref id="scirp.68540-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Budden, D., Wang, P., Obst, O. and Prokopenko, M. (2015) RoboCup Simulation Leagues: Enabling Replicable and Robust Investigation of Complex Robotic Systems. IEEE Robotics &amp; Automation Magazine, 22, 140-146. 
http://dx.doi.org/10.1109/MRA.2015.2446911</mixed-citation></ref><ref id="scirp.68540-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Kashanipour, A., Kashanipour, A.R., Milani, N.S., Akhlaghi, P. and Boukani, K.K. (2008) RoboCup 2007: Robot Soccer World Cup XI Chapter Robust Color Classification Using Fuzzy Reasoning and Genetic Algorithms in RoboCup Soccer Leagues. Springer Berlin Heidelberg Berlin, Heidelberg, 548-555.  
http://dx.doi.org/10.1007/978-3-540-68847-1_59</mixed-citation></ref><ref id="scirp.68540-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Haykin, S. (1999) Neural Networks: A Comprehensive Foundation. 2nd Edition, Prentice Hall, Upper Saddle River.</mixed-citation></ref><ref id="scirp.68540-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">Egmont-Petersen, M., deRidder, D. and Handels, H. (2002) Image Processing with Neural Networks—A Review. Pattern Recognition, 35, 2279-2301. http://dx.doi.org/10.1016/S0031-3203(01)00178-9</mixed-citation></ref><ref id="scirp.68540-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Amoroso, C., Chella, A., Morreale, V. and Storniolo, P. (2000) RoboCup-99: Robot Soccer World Cup III Chapter A Segmentation System for Soccer Robot Based on Neural Networks. Springer Berlin Heidelberg Berlin, Heidelberg, 136-147. http://dx.doi.org/10.1007/3-540-45327-X_10</mixed-citation></ref><ref id="scirp.68540-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Rischpater, R. (2013) Application Development with Qt Creator. Packt Publishing Limited.</mixed-citation></ref><ref id="scirp.68540-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">Kaehler, A. and Bradski, G. (2015) Learning OpenCV 3: Computer Vision in C++ with the OpenCV Library. O’Reilly Media.</mixed-citation></ref></ref-list></back></article>