Neural Network in Computer Vision for RoboCup Middle Size League

Robot World Cup Initiative (RoboCup) is a worldwide competition proposed to advance research in robotics and artiﬁcial intelligence. It has a league called RoboCup soccer devoted for soccer robots. Robotic soccer 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 ﬁeld, and so on. These elements may be recognized applying some tools of computational intelligence, for example an artiﬁcial neural network. This paper describes the application of an artiﬁcial 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. The results show that an artiﬁcial neural network successfully classiﬁed the entities. They were recognized even when similar color entities were present on the image.


Introduction
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) [1], consists of a scientific challenge that has been created to develop research in robotics and artificial intelligence through a standard worldwide problem, e.g.[2].Ribeiro, P. R. A et al 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.An 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 [3] 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.
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 [4]; it works with noisy data; minimum knowledge about the problem is required [5], as well as a minimum knowledge of the input statical distribution [6] is sufficient.As a proof of concept, this work classifies only three entities, namely: soccer field, ball and "other elements".
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 .

Robocup
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".
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.
Nowadays, the RoboCup is not only football but also other challenges namely RoboCupRescue 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 of 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.
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.
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.Figure 1 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.

Methodology
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 Figure 2.An ANN is used to classify some entities of the RoboCup middle size league.As a proof of concept, an ANN is trained with the backpropagation algorithm to recognize soccer field, ball and "other elements" present on the captured image.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.

Results
The application was implemented in C++ and QtCreator [7] using the library OpenCV [8], and was running under the operating system Ubuntu.The computer was a conventional notebook with a 2.2 GHz Core 2 Duo processor.Figure 3 shows the system developed to recognize the entities during data acquisition to train the ANN.For each input sample (numbered on Figure 3) a corresponding label for it is given -i.e.soccer field, ball, or others -on the left side of Figure 3. 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 Table 1.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.The developed system can classify an image sample or an entire image.Figure 4 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.Acceptable results were obtained with the system as shown on Figure 4. 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.

Parameters
The results with the paper cylinders are accurate, as shown on Figure 5, 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 Ribeiro, P. R. A et al 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.Figure 6 shows a tolerance value of 0.5 in order to show a misclassification between ball and road cone.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 image1 whereas the second one shows the classification for the whole image2 .

Conclusion
ANN have 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.
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.
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 produces [−1 1 −1] as the output of the ANN.

Figure 2 :
Figure 2: Omnidirectional vision system: parabolic/conic mirror facing downwards and a color camera facing the mirror.

Figure 3 :
Figure 3: System developed to recognize the entities during sample acquisition

Figure 4 :
Figure 4: System's output for an input sample (blue square) to recognize soccer field

Figure 5 :
Figure 5: Ball reliably classified (blue square) after an insertion of new elements

Figure 6 :
Figure 6: Example of misclassification between ball and road cone.

Table 1 :
Parameters used for the classification problem.