Strategy learning for soccer

16
Strategy Learning of a Soccer Agent using Naïve Bayes Classifier Shaukat R.Abidi * , Saleha Raza * , Sajjad Haider * Artificial Intelligence, Faculty of Computer Science Institute of Business Administration, Karachi Abstract. This paper describes an implementation of Naive-Bayes classifier to predict the best move (locomotive action) of a soccer agent within context of RoboCup Soccer Simulation 3D. The target class of soccer agent is “Defender” whose objective in the game is not to give any opportunity to the opponents to score a goal. The classical approach of building an agent’s logic is through if-then-else rules. This, however, is not a suitable mechanism as in a dynamic situation like soccer since it is not easy to explicitly define all the rules and situations. The paper, therefore, shows how machine learning technique can be used to train a soccer agent and then how effectively it can be used during a soccer game. It must be stated that in the 3D league the performance of any classifier is also constrained by the underlying locomotion skill of the agent. Thus, despite providing a good proof of concept, the results reported in this paper can be improved once the locomotion skills are improved further. Key Words classifier, class variable, attributes, evidence, inference 1 Introduction RoboCup[15] is an international competition for promoting research, development and education in artificial intelligence with the stated goal that: “By mid-21st century, a team of fully autonomous humanoid robot soccer players shall win the soccer game, complying with the official rule of the FIFA, against the winner of the most recent World Cup.RoboCup has four major competition domains, in which each domain has different number of leagues and sub leagues. These four domains are named as RoboCup Soccer, RoboCup Rescue, RoboCup@Home and RoboCup Junior. RoboCup Soccer comprises of different leagues such as Humanoid, Standard Platform, Small-Size, Middle-Size, Simulation 2D and Simulation 3D. The implementation and experiments discussed in paper are conducted in the realm of RoboCup Soccer 3D Simulation league. The ideas presented in this paper, however, are applicable to other leagues as well. This paper focuses on development of strategies of a soccer agent (Defender) whose role is to prevent the opponents from scoring a goal. The classical approach to devise an agent’s strategy is through if-then-else rules. There are, however, problems in this approach as there are several possible situation in a soccer game. These situations change with the agent’s position, ball’s position, opponents’ position, ball’s velocity, velocity of opponent towards ball etc. Therefore, to reduce the complexity of strategy design, Naïve Bayes classifier is used which takes the input from the noisy environment of soccer field in vector form and predicts the best strategy for soccer agent at that particular time instant. It must be noted that in Soccer Simulation 3D, the execution of intelligent strategies depend primarily on the locomotion skill of soccer agent. The rest of the paper is organized as follows. Section 2 will summarize the work done by researchers similar to the problem stated in this paper. The domain description of RoboSoccer 3D Simulation and its challenges are provided in section 3. Section 4 provides the detailed technical description of Naïve Bayes classifier with the proposed methodology and implementation. The discussion on results is provided in Section 5 and Section 6 will conclude the paper.

description

Machine learning, cellular automata

Transcript of Strategy learning for soccer

Page 1: Strategy learning for soccer

Strategy Learning of a Soccer Agent using Naïve Bayes Classifier

Shaukat R.Abidi*, Saleha Raza

*, Sajjad Haider

*

Artificial Intelligence, Faculty of Computer Science

Institute of Business Administration, Karachi

Abstract. This paper describes an implementation of Naive-Bayes classifier to predict the best move (locomotive

action) of a soccer agent within context of RoboCup Soccer Simulation 3D. The target class of soccer agent is “Defender”

whose objective in the game is not to give any opportunity to the opponents to score a goal. The classical approach of

building an agent’s logic is through if-then-else rules. This, however, is not a suitable mechanism as in a dynamic situation

like soccer since it is not easy to explicitly define all the rules and situations. The paper, therefore, shows how machine

learning technique can be used to train a soccer agent and then how effectively it can be used during a soccer game. It must

be stated that in the 3D league the performance of any classifier is also constrained by the underlying locomotion skill of

the agent. Thus, despite providing a good proof of concept, the results reported in this paper can be improved once the

locomotion skills are improved further.

Key Words

classifier, class variable, attributes, evidence, inference

1 Introduction

RoboCup[15] is an international competition for promoting research, development and education in artificial

intelligence with the stated goal that: “By mid-21st century, a team of fully autonomous humanoid robot soccer

players shall win the soccer game, complying with the official rule of the FIFA, against the winner of the most

recent World Cup.”

RoboCup has four major competition domains, in which each domain has different number of leagues and sub

leagues. These four domains are named as RoboCup Soccer, RoboCup Rescue, RoboCup@Home and RoboCup

Junior. RoboCup Soccer comprises of different leagues such as Humanoid, Standard Platform, Small-Size,

Middle-Size, Simulation 2D and Simulation 3D. The implementation and experiments discussed in paper are

conducted in the realm of RoboCup Soccer 3D Simulation league. The ideas presented in this paper, however, are

applicable to other leagues as well.

This paper focuses on development of strategies of a soccer agent (Defender) whose role is to prevent the

opponents from scoring a goal. The classical approach to devise an agent’s strategy is through if-then-else rules.

There are, however, problems in this approach as there are several possible situation in a soccer game. These

situations change with the agent’s position, ball’s position, opponents’ position, ball’s velocity, velocity of

opponent towards ball etc. Therefore, to reduce the complexity of strategy design, Naïve Bayes classifier is used

which takes the input from the noisy environment of soccer field in vector form and predicts the best strategy for

soccer agent at that particular time instant. It must be noted that in Soccer Simulation 3D, the execution of

intelligent strategies depend primarily on the locomotion skill of soccer agent.

The rest of the paper is organized as follows. Section 2 will summarize the work done by researchers similar to

the problem stated in this paper. The domain description of RoboSoccer 3D Simulation and its challenges are

provided in section 3. Section 4 provides the detailed technical description of Naïve Bayes classifier with the

proposed methodology and implementation. The discussion on results is provided in Section 5 and Section 6 will

conclude the paper.

Page 2: Strategy learning for soccer

2 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

2 Related Work

Researchers have used different machine learning techniques to propose the solutions of complex problems

especially in the area of RoboCup Soccer. Its summary is given as follow:

Bustamante C. et al. [1] make use of Naïve Bayes classifier to learn successful ball passing mechanism. They

assess which player is most likely to receive a pass without ball being intercepted. The ball is ultimately passed to

the one with the highest probability of success.

Marsella S. et al. [2] summarizes the lessons learned from the comparison of RoboSoccer teams. They provide a

good overview of how the divide-and-conquer learning approach is used for designing different skills. In addition,

how the knowledge acquired from domain experts can be used for learning shots on goal from different angles.

Furthermore, reinforcement learning is used to train the agents for successful pass-interception.

Stone P. and Veloso M. [3] have discussed several robotics Multi Agent Systems including RoboCup Soccer.

They have highlighted how agents can learn and enhance their capabilities, such as keeping possession of ball,

through repeated trials.

Coradeschi S. and Karlsson L. [4] have addressed the issues faced in a multi-agent environment especially how to

respond in an uncertain environment. They make full use of domain experts’ knowledge for the behavior

specification and focuses on the role of agents as a group. They specify decision tress for each role to model

coordinated behavior.

The approach by Murray J. et al. [5] uses state charts to model complex actions and strategies effectively.

Stolzenburg F. et al. [6] have focused on the declarativity of approach, by developing a script language which

makes the strategies well understandable and concise for RoboCup Soccer agents. They suggest that the script

language can be smoothly translated into logic programs.

Floyd et al.[8] implemented the learning system of agents by mimicking the expert (learning by demonstration).

The authors compared the performance of their learning system using four techniques: case-based reasoning,

decision trees, support vector machines and Naïve-Bayes classifiers. In learning by demonstration, cases are

generated by observing the expert in a game. These cases are reproduced when the agent faces similar game states

during the match. The possible actions predicted by the above methods are kicking, dashing and turning.

The study of emergency in strategy games using classical machine learning algorithms is performed by Machado

A.F.V. et al.[9]. They tested their results using C4.5 decision tree learner, Naïve Bayes and M5P decision tree

learner.

Faria B.M et al. [10] compared different machine learning algorithms to classify the robotic soccer formation.

Opponent identification was the other phase of their research. Training data was gathered from the simulated

robots of 2D Simulation League. Algorithms used for comparison were Artificial Neural Network, Kernel Naïve

Bayes, K-Nearest Neighbor and Support Vector machine.

Page 3: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Ball D. et al. [11] implemented behavior modeling and prediction system (BPS). The experiments were performed

on real robots. The goal of BPS is to predict the behavior of opponent in the following steps: classifying the

current behavior, modeling the classified behavior into sub-behaviors and then predicting the future behavior. The

authors used Naïve Bayes algorithm to predict the current behavior of opponent in real time (Step 1 of

experiment).

In the domain like RoboCup Soccer 3D, the data obtained from the sensors of agent is continuous. In order to

apply implement the learning system, it might be useful to discretise the continuous data. Bustamante C. et al.

[12] implemented Fuzzy and Gaussian Naïve Bayes classifier for the pass evaluation skill of soccer agent. The

authors compared the performance of implemented classifiers in the decision making process of ball passing

between the soccer agents.

Similar to the works reported above, this paper also aims to develop the strategy of a soccer agent. It uses Naïve

Bayes classifier to predict the next move an agent should take. Unlike [1] which uses Naïve Bayes for ball

passing, this paper learns the complete strategy which includes moving in a particular direction in anticipation to

block the ball, going backward if the ball has gone beyond the agent, kicking the ball if it is within the range, and

so on and so forth. As is the case with many other approaches, the strategy/behavior of a RoboCup Soccer agent is

dependent upon its underlying locomotion capabilities. The implementation done for this experiment has discrete

set of skills such as moving forward, backward, sideways (both left and right), turning and kicking.

The work done in [2,5,6,8,10] used 2D Simulation League as their test bed while the work performed in [1,12]

was validated in the environment of 3D Simulation league . This paper presents the implementation of machine

learning algorithm in 3D Simulation league. The following section will discuss the environment and challenges of

3D Simulation League.

3 Domain Description

This section will give a brief introduction to the description of RoboCup Soccer Simulation 3D, its environment

and challenges.

3.1 RoboCup Soccer Description

This paper uses 3D Soccer Simulation environment as its test bed. Robot model of 3D Simulation league is the

simulated version of robot model used in Standard Platform League.

Page 4: Strategy learning for soccer

4 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Figure 4. Soccer field’s axis diagram

In Standard Platform,Fig.1, all the teams compete with identical robot called NAO (developed by Aldebaran

Robotics[13]). These physical robots interact with other similar robots in real world environment. Typically, this

league emphasizes upon low level control of the robots.

Robocup 2D Simulation league, Fig. 2, lays stress on the high level challenges of Robot Soccer like agent

collaboration and co-ordination. 3D Simulation league, Fig. 3, amalgamates the low-level control with high-level

behaviors to develop a team of simulated biped robots.

3.2 Simulation 3D’s Environment and its Challenges

The Simulation 3D environment is based on Simspark[7], which is a multi-agent simulator system for the agents

in 3D-environment. Soccer Agents are connected to server[16], while the simulated environment is rendered on

monitor[17].

The ground size in this league is 21 meters by 14 meters. The center point of the field is considered as origin (0,0).

The home goal line is at -10.5 on X-axis, and the opponent’s goal line is at 10.5 on X-Axis. On Y-Axis, the

maximum value of the above defined goal-lines is +7 while the minimum value is -7. The pictorial representation

of field’s geometry with Axes direction is demonstrated in Fig 4.

Agent receives the noisy information about environment (relative positions of observed flags, goal-posts,

opponents and messages etc) through vision and auditory sensors. They are also fitted with noisy gyroscope,

accelerometers and force-resistance perceptors(in each foot) . The complete robot model is given in [18]. In order

to design intelligent strategies, it is necessary to use the information from environment to localize the agent in the

soccer field. After localization, the agent should be able to reach the target positions on the field smoothly, which

requires stable locomotion skills. After these tasks, agent would be able to play soccer in collaboration with other

agents intelligently. The strategies of agents are typically designed by using classical if-else conditions. This paper

proposes a way to learn the strategy for several game situations using Naïve Bayes classifier.

Figure 1. Standard Platform

League

Figure 3. 3D Simulation League

+X

+Y

Ho

me

Sid

e Op

po

ne

nt

Side

Figure 2. 2D Simulation League

Agent (Ax,Ay)

Ball (Bx,By)

d

Page 5: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

The design and implementation of Naïve Bayes classifier, to predict the best move at particular instant, is

discussed in the following section.

4 Strategy Learning Using Naïve Bayes

This section provides the technical details about the design of Naïve Bayes classifier within the context of Soccer

Simulation 3D League. The process of classifier design needs the identification of important features constituting

strategies. Once the features are identified, preparation of data set is required to train the classifier. After the

preparation of data set, a classifier is trained which is then incorporated inside the agent’s decision mechanism.

The agent sends input (in the form of vector) to the classifier and receives the best action according to the current

game situation.

The defender’s primary role is to defend the goal and to clear the ball away from the home goal. It starts making

use of NaïveBayes classifier once the ball is in the danger zone(The area after X=-3, see fig 3.). Before a Naïve

Bayes classifier can be used for strategy prediction, it needs to be trained. Thus, the following steps are required

for the successful implementation of the process.

4.1 Features Identification

Initially, six features (Agent’s and Ball’s Co-ordinates, Agent’s distance with ball and the orientation of Agent in

soccer field) were identified that could be used as the basic elements for designing strategy. From the human

intuition, two new features were added to increase the parameters for making decision. These features were: the

angle of agent with ball and the distance of ball with goal post. After the identification of features, we discretized

these features for the sake of simplicity.

Features identification(Section 4.1)

Discretizing the Features(Section 4.2)

Training data generation(Section 4.3)

Model learning(Section 4.4)

Usage of Naïve Bayes as Strategy Controller in real practice matches i.e. Prediction (Section 4.5)

Page 6: Strategy learning for soccer

6 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

4.2 Discretizing the Features

The information from the sensors of agent is continuous in nature. The agent uses this information to create a

world model. Therefore, to make the computation simpler, all continuous attributes were further discretized and

retained as nominal variables. The description of discretized states is given below:

4.2.1 Distance with ball

Distance with ball(d) is Euclidean distance between Agent(Ax,Ay) and the Ball(Bx,By) as shown in Fig 4.If the

distance of agent and ball (d) is less than 3 units, then this attribute is recorded as “Small”. If the distance (d) is

greater than or equal to 3 units, then this attribute is recorded as “NotSmall”.

4.2.2 Ball’s X-Location

If the ball’s X-Location (Bx) is between 0 and -3, then its state is recorded as “Start”. If Bx is between -3 and -7,

its state is recorded as “Middle”. If Bx has the value less than -7, then its state becomes “Close”.

4.2.3 Ball’s Y-Location

If the ball’s Y-Location (By) is greater than 0, then its state is recorded as “Positive” otherwise “Negative”.

4.2.4 Agent’s X-Location

If the agent’s X-Location (Ax) is between 0 and -3, then its state is recorded as “Start”. If Ax is between -3 and -7,

its state is recorded as “Middle”. If Ax has the value less than -7, then its state becomes “Close”.

4.2.5 Agent’s Y-Location

If the agent’s Y-Location (Ay) is greater than 0, then its state is recorded as “Positive” otherwise “Negative”.

4.2.6 Distance of ball with goal post

If the ball is within the region of semi-circle, drawn in Fig. 4, having center (-10.5,0) and radius 5 Units, then the

state of this attribute is recorded as “Small” otherwise “NotSmall”.

Page 7: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Figure 5. Graphical Representation of Feature Vector

4.2.7 Orientation

The states of orientation are recorded as “Front”, “Left”, “Back” and “Right”. Its mathematical boundaries are

described in Table 1.

4.2.8 Angle with ball

The states of this attribute are recorded as “Narrow”, “Left”, “Back Left”, “Right” and “Back Right”. Its

mathematical boundaries are described in Table 1.

The complete list of the retained feature is given in Table 1. The second column list the feature’s name while the

third and fourth columns list states of the corresponding variables and their underlying ranges, respectively. The

defenders close to goal receive all the necessary data from environment on the basis of which they have to decide

the best possible action when the ball enters their region.

Once the features(attributes) are identified, they will be joined together to form a complete feature vector. The

combination of feature vector will form the training data set which will be used to train the classifier.

Page 8: Strategy learning for soccer

8 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Table 1.

Discretising Attributes into states

4.3 Training Data generation

The training of classifier requires data set. The data set is the collection of feature vectors. The feature vector ,

depicted in fig. 5, is in the form:

Feature vector = (Attribute#1 , Attribute#2, .. Attribute#8,Target Class)

The target class (of classifier) which we want to learn is the locomotion action that is, moving forward, backward

and sideways left and sideways right.

The collection of feature vector generates the training data set. The data set for training was generated by creating

different game situations (placement of balls, defender, opponent agents, etc.) randomly, thus producing a distinct

feature vector, and getting the opinion of a human expert about the ideal move. The human judgment was treated

as the best action for our soccer agent. The process was repeated for 200 hundred feature vectors (game

situations).

# Attribute's Name States Mathematical

Boundary

1 Distance with ball Small <3 units

NotSmall >=3 units

2 Ball's X-

Location(BallX)

Start -3<X<0

Middle -7<X<-3

Close X<-7

3 Ball's Y-

Location(BallY)

Positive Y>0

Negative Y<0

4 Agent's X-Location

(MyX)

Start -3<X<0

Middle -7<X<-3

Close X<-7

5 Agent's Y-Location

(MyY)

Positive Y>0

Negative Y<0

6 Distance of Ball with

Goalpost(BDWithG)

Small Circle(radius=5) at (-10.5,0)

NoSmall Out of above circle

7 Orientation(orient)

Front 330<ort<30

Left 30< ort <170

Back 170< ort <210

Right 210< ort <330

8 Angle with

Ball(AngleWBall)

Narrow Absolute(angle)<15

Left 15<angle<60

Back Left angle>60

Right -60<angle<-15

Back Right ang<-60

Page 9: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

+X

+Y H

om

e

Sid

e

Op

po

ne

nt

Side

Figure 6. Random game situation

O1

Consider the game situation, Fig 6, generated randomly for preparing a feature vector. The agent of opponent

team (O1) is modeled by red circle, while the agent of home team (H1) is modeled by blue circle. The ball is

denoted by white circle. The arrows on circle are showing the orientation of agents in soccer field. In the case

described above, H1 needs to defend the goal of home side. At this particular instant, H1 needs to decide the best

move in order to defend its team. For preparing a feature vector for the given game condition, all of the attributes

are recorded by taking into account the respective game situation (Fig.6). The best move in the given scenario is

predicted by the human expert, which will be recorded in Target Class of the feature-vector.

Similarly, 200 random game situations were generated to prepare the data-set manually. This data-set (collection

of feature vectors) was used to train the classifier.

4.4 Model learning

Once the data-set was generated with the help of human expert, it was used to train the Naïve Bayes classifier.

The conditional probabilities for classifier were learnt through GeNIe1. These conditional probabilities were used

to design the classifier for agent in soccer field.

4.5 Prediction

Once the Naïve Bayes classifier is learned, as described above, it is used in an actual game situation to test the

applicability and accuracy of the proposed technique.

1 GeNIe can be downloaded from http://genie.sis.pitt.edu/downloads.html

H1

Page 10: Strategy learning for soccer

10 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Figure 7. Defender using Naïve Bayes classifier. Roboviz[14] is used as a monitor

Figure 8. Illustrated example from Genie showing the

predicted action probabilities

Using GeNIe1, a table of conditional probabilities of predicted actions against the game situation is obtained. In

order to design the Naïve Bayes Classifier, these probabilities are incorporated into the real time executing

environment. During a game, the classifier continuously receives input from the agent’s perception and suggests it

the next intelligent move.

The danger zone is identified after X=-3 till X=-10.5 on soccer field. When the ball enters this region, the

defender gives the required evidences to the model(in the form of vector), and receives the intelligent decision

based on the highest probable action at that instant.

Fig. 7 is the snapshot of an instant when the defender (colored Blue) is trying to defend the attack made by the

agent (colored Red). At this particular instant, agent sends the input vector to the classifier. The classifier predicts

the best move and the defender executes the move predicted by classifier

The list of inputs for the scenario pictured in Fig. 7 is shown in Fig. 8. This list includes agent’s position, ball’s

position and orientation, angle with ball, etc whose details are given in Table 1. The values of these

attributes/inputs are entered as evidence/fact to the classifier and the posterior probabilities of the all actions are

computed. For the current implementation of classifier, four actions are taken into consideration, that is, forward

walk (fw), back walk (bw), side walk left (swl) and side walk right (swr). The simplified process of strategy

prediction is presented in Fig 10.

Based on the results from classifier, shown in Fig. 8, there is only a 15% chance that walking in forward direction

is the best strategy, 22% chance for backwalk, 6% chance for side walk in right direction and 58% chance for side

walk in left direction.

Page 11: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Figure 10. Flow diagram for Strategy Prediction

0

0.2

0.4

0.6

0.8

Forward Walk(FW) BackWalk(BW) SideWalkLeft(SWL) SideWalkRight(SWR)

Ou

pu

t P

rob

abili

tie

s

Locomotion Skill

Locomotion Skill VS Classifier's Output

Figure 9. Plot of resulting probabilities from classifier

(Y-Axis) against their respective locomotion skill(X-

Axis)

In Fig. 9, the resulting probabilities from classifier (Y-Axis) are plotted against their respective locomotion skill

(X-Axis). The bar indicating the highest probability is selected as the best move. Thus, side walk in left direction

would be suggested as the best strategy(for the defender in blue color) under the given circumstances (the game

situation described in Fig 7.).

5 Results

The proposed methodology has been tested in real games and its performance against different teams is recorded.

Although a real RoboCup Soccer Simulation 3D match has 9 players from each team, we have only considered

two defenders and one goalie of the home team and the two attackers of opponent team. For the sake of

simplicity, the number of attackers and defenders are kept constant to test the proposed approach.

During the attack, home team was supposed to defend with two defenders. For a proof of concept, we trained two

defenders and analyze their performance against the attack of opponents. The results obtained were encouraging

Page 12: Strategy learning for soccer

12 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Table 2.

Evaluation of defender in different matches with

training data containing 100 records(Records were

prepared manually)

Table 3.

Evaluation of defender in different matches with

training data containing 200 records(Records were

prepared manually)

which validated the idea to train more defenders for different modes of strategies against different number of

attackers.

Both defenders of the home team used the proposed technique for strategy identification during the match. The

opponent teams are selected from the binaries released after IranOpen 2011. The standard server[16] and

monitor[14,17](used officially in RoboCup matches) are used for the matches.

The results of the experiments are presented in Table 2 and Table 3. Table 2 contains the results when the agent

was trained with 100 records while Table 3 shows the results when the agent was trained with 200 records.

In Table 2 and Table 3, the 2nd

column, labeled Opponent’s path blocked, lists the number of times defender

blocked the path of attacker and as a result attacker was prevented to score a goal.

The 5th column, labeled ball cleared by defender, lists the instances when the ball is kicked by opponent towards

our goal and the ball reaches the danger zone (area between -3 to -10.5 on x-axis). At this moment, if our defender

runs towards the ball and clear it away from the danger zone then a count is added to this column. In this way an

attacker is prevented to gain the possession of ball in our goal-area(D-area).

Time(t) Opponent’s

path

blocked

Total

attack by

opponent

Goal

scored by

opponent

Ball

cleared by

defender

VS Naoth(2 Defenders vs 2 Attacker)

1st Half 1 4 2 1

2nd Half 1 4 1 2

VS Nexus3D(2 Defenders vs 2 Attacker)

1st Half 2 6 2 2

2nd Half 1 5 3 1

VS Strive3D(2 Defenders vs 2 Attacker)

1st Half 1 6 3 2

2nd Half 1 7 3 3

VS Apollo3D(2 Defenders vs 2 Attacker)

1st Half 0 6 4 2

2nd Half 0 5 5 0

VS CIT3D(2 Defenders vs 2 Attacker)

1st Half 1 8 6 1

2nd Half 1 8 6 1

Time(t)

Opponent’s

path

blocked

Total

attack by

opponent

Goal

scored by

opponent

Ball

cleared by

defender

VS Naoth(2 Defenders vs 2 Attacker)

1st Half 2 8 1 5

2nd Half 2 3 0 1

VS Nexus3D(2 Defenders vs 2 Attacker)

1st Half 3 7 0 4

2nd Half 3 10 1 6

VS Strive3D(2 Defenders vs 2 Attacker)

1st Half 2 7 2 3

2nd Half 2 5 1 2

VS Apollo3D(2 Defenders vs 2 Attacker)

1st Half 3 7 2 2

2nd Half 3 9 4 2

VS CIT3D(2 Defenders vs 2 Attacker)

1st Half 2 9 6 1

2nd Half 1 6 5 0

Page 13: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

Table 4. Comparing agent’s performance

by increasing training records

It is evident from Table 3 that the overall performance of the proposed approach is quite decent when considering

the fact that the opponent teams are among the best teams in the world and our agent’s locomotion skill was

considerably weaker than them. Thus, even if the strategy correctly says that move in the right direction, the

movement itself was not fast enough to stop the attack. Nevertheless, except against CIT3D, the performance is

quite satisfactory and encourages further development along this research direction in addition to enhancement in

the locomotion skill set.

Table 4 summarizes the performance of defenders in five matches against the teams listed in Table 2 and Table 3.

It is evident from the table that the defenders of the home team performed better when they were trained with 200

training records as compared to 100 training records. It proves the fact that this approach can be used in

conjunction with classical if-else method for predicting strategies in different situations and locations on the field.

Training

Records

Opponent’s

path

blocked

Attack by

Opponent

Goal

Scored

by

Opponent

Ball

Cleared

by

Defender

100 9 59 35 15

200 23 71 22 26

6 Conclusion

This paper presented a machine learning based approach to learn the strategy of a Soccer agent in context of

Robocup Soccer Simulation 3D. The proposed method provides a better alternative to traditional if-then-else rules

based techniques which fail to capture all the situations that may arise during a soccer game. This designed system

for strategy prediction can be merged with classical If-Else mechanism, which will start functioning on the failure

of later approach (If-Else). Even though the paper focused on the strategy of a defender, the suggested technique

is easily applicable to other roles too, such as goalie, attacker, etc.

Page 14: Strategy learning for soccer

14 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

In order to design the Naïve Bayes classifier for strategy prediction, it needs to pass through certain processes. It

was shown how to discretize relevant features with mathematical boundaries, generating the feature vector,

combining the feature vectors to produce training data-set and finally training the classifier.

The suggested procedure in this paper trains the soccer agent according to the advices given by human expert.

Since this approach uses the opinion of human expert in different game situations, therefore the process of

generating data-set was worked out manually. The manual preparation of data–set was very time consuming

(because for each feature vector, a random situation is generated and the advice from an expert is incorporated

into the data-set ) due to which we tested this approach first with 100 records and then with 200 records.

The results shown in Table 4 proved that the approach has a lot of promise. The limitations observed were mainly

due to the weakness of the locomotion skill set and unavailability of exhaustive data set. If data set consisting of

hundreds of records (based on many real match situations) is available along with human expert opinion then the

accuracy of the approach can be improved further. Both tasks are part of the future research directions of this

work.

References

[1] Carlos Bustamante, Leonardo Garrido, and Rogelio Soto. Fuzzy naive bayesian classification in robosoccer

3d: A hybrid approach to decision making. In Gerhard Lakemeyer, Elizabeth Sklar, Domenico Sorenti, and

Tomoichi Takahashi, editors, RoboCup-2006: Robot Soccer World Cup X, Berlin, 2006. Springer Verlag.

[2] Stacy Marsella, Jafar Adibi, Yaser Al-Onaizan, Gal A. Kaminka, Ion Muslea, Marcello Tallis, and Milind

Tambe. On being a teammate: Experiences acquired in the design of robocup teams. In Proceedings of the Third

International Conference on Autonomous Agents (Agents-99), Seattle, WA, 1999. ACM Press.

[3] Peter Stone and Manuela Veloso. Multiagent systems: A survey from a machine learning perspective.

Autonomous Robots, 8(3):345–383, July 2000.

[4] Silvia Coradeschi and Lars Karlsson. A role-based decision-mechanism for teams of reactive and coordinating

agents. In Hiroaki Kitano, editor, RoboCup-97: Robot Soccer World Cup I, pages 112–122. Springer Verlag,

Berlin, 1998.

[5] Jan Murray, Oliver Obst, , and Frieder Stolzenburg. Towards a logical approach for soccer agents engineering.

In Peter Stone, Tucker Balch, and Gerhard Kraetszchmar, editors, RoboCup-2000: Robot Soccer World Cup IV,

pages 199–208. Springer Verlag, Berlin, 2001.

Page 15: Strategy learning for soccer

Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

[6] Frieder Stolzenburg, Oliver Obst, Jan Murray, and Bjorn Bremer. Spatial agents Implemented in a logical

expressible language. In Veloso, Pagello, and Kitano, editors, RoboCup-99: Robot Soccer World Cup III

(LNAI 1856). Springer-Verlag, 2000.

[7] “About Simpspark”. Retrieved 28 Apr 2012, from http://simspark.sourceforge.net/wiki/index.php/About_SimSpark

[8] Michael W. Floyd and Babak Estefandiari. Comparison of classifiers for use in a learning by demonstration

system for a situated agent. In Workshop on Case-Based Reasoning for Computer Games in ICCBR 2009, 2009.

[9] Machado, A. F. V., Clua, E. W. and Zadrozny B. (2010) “A Method for Generating Emergent Behaviours

using Machine Learning to Strategy Games”. In: SBGames.

[10] Brigida Monica Faria, Luis Paulo Reis, Nuno Lau and Gladys Castillo. Machine Learning algorithms applied

to the classification of robotic soccer formations and opponent teams (2010), IEEE Conference on Cybernetics

and Intelligent Systems, CIS 2010, pp. 344-349.

[11] [Ball and Wyeth, 2003] Ball, D. and Wyeth, G. (2003). Classifying an Opponent’s Behaviour in Robot

Soccer. In Proceedings of the 2003 Australasian Conference on Robotics and Automation (ACRA).

[12] Carlos Bustamante, Leonardo Garrido, and Rogelio Soto. Comparing fuzzy naive bayes and gaussian naive

bayes for decision making in robocup 3d. In Alexander F. Gelbukh and Carlos A. Reyes Garc´ıa, editors, MICAI

2006: Advances in Artificial Intelligence, volume 4293 of Lecture Notes in Computer Science, pages 237–247.

Springer, 2006.

[13] “Aldebaran Robotics”. Retrieved 28 April 2012, from http://www.aldebaran- robotics.com/

Page 16: Strategy learning for soccer

16 Shaukat R.Abidi*, Saleha Raza*, Sajjad Haider*

[14] “RoboViz”. Retrieved 28 April 2012, from http://sites.google.com/site/umroboviz/

[15] “About RoboCup”. Retrieved 30th May 2012, from http://www.robocup.org/about- robocup/

[16] “Server”. Retrieved 30th May 2012, from http://simspark.sourceforge.net/wiki/index.php/Server

[17] “Monitor”. Retrieved 30th May 2012, from http://simspark.sourceforge.net/wiki/index.php/Monitor

[18] “Model”. Retrieved 30th May 2012, from http://simspark.sourceforge.net/wiki/index.php/Models