Hybrid evolutionary learning of fuzzy logic and genetic ... - Springer Link

9 downloads 0 Views 866KB Size Report
Table 1. Definition of a generic rule. IF ([X0 is i0]) and ([X1 is il]) and (IX2 is i2]) and ... the range (0 ~ 1023 for input and -10 ,-~ +10 for output) by ten equidistance.
Hybrid Evolutionary Learning of Fuzzy Logic and Genetic Algorithm* Sung-Bae Cho and Seung-Ik Lee Department of Computer Science, Yonsei University 134 Shinchon-dong, Sudaemoon-ku, Seoul 120-749, Korea

A b s t r a c t . This paper presents a hybrid method of fuzzy logic and genetic algorithm as promising model for evolutionary system, which controls a mobile robot effectively. The system obtains sensory information from eight infrared sensors and operates the robot with two motors driven by fuzzy inference based on the sensory information. Genetic algorithm has been utilized to robustly determine the shape and number of membership functions in fuzzy rules. Through the simulation with a simulated robot called Khepera, we assure ourselves that the evolutionary approach finds a set of optimal fuzzy rules to make the robot reach the goal point, as well as to solve autonomously several subproblems such as obstacle avoidance and passing-by narrow corridors.

1

Introduction

In the field of artificial intelligence (AI), there has been a long-term research of controlling mobile robot, especially in static environments a b o u t which the robot has an explicit representation. It would be rather easy to move the robot to the goal point by planning the optimal p a t h based on the representation. However, no one produces perfect mobile robot of even an insect's intelligence yet due to the lack of adaptability to ever-changing environments. As a reaction to this problem, a novel approach called behavior-based robotics [2, 3, 5, 13] has recently appeared. While conventional AI is more concerned with a high level definition of the environment and knowledge required by the system, it stresses the importance of continuous interaction between the robot and its own environment for the dynamic development of the control system and for the assessment of its performance [5]. It also emphasizes the autonomy of the system which should be completely self-contained and which should find the most appropriate solutions to satisfy simultaneously several goals. One of the key points of this approach is not to give the robot information a b o u t the movement but to let the robot find the knowledge by" itself. Within this approach, a number of researchers have successfully employed an evolutionary procedure [8] to develop the control system of simulated robots [1, 4, 10, 16]. The This work was supported in part by academic research grant of 1996 from Yonsei University.

207

rich variety of structures t h a t have been put under evolution and the large number of evolved behaviors have empirically demonstrated the power and generality of the evolutionary methodology. One of the shortcomings in this approach, however, is in the difficulty of analyzing the control system evolved, which prohibits the designer from giving some domain knowledge to design the control system by an evolutionary approach. This paper attempts to develop a fuzzy system for a behavior-based mobile robot, and presents an evolutionary approach to determine the parameters in the controller. The proposed system has also been applied to the simulated robot called Khepera. An analysis of the fuzzy rules obtained by evolution indicates the emergence of the strategies to optimally guide the robot to the goal position.

2

Khepera:

A Mobile

Robot

The Khepera robot employed in our experiment is circular, compact, and robust. This is a miniature robot which has a diameter of 55ram, is 3 0 r a m high, and weighs 70g. The robot is supported by two wheels and two small Teflon balls placed under its platform. The wheels are controlled by two DC motors with an incremental encoder (12 pulses per r n m of robot advancement) and can rotate in both directions. The geometrical shape and the motor l~yout of Khepera provide for easier negotiation of corners and obstacles when its control system is still immature. It is provided with eight infrared proximity sensors placed around its body which are based on emission and reception of infrared light. Each receptor can measure both the ambient infrared light and the reflected infrared light emitted by the robot itself. Several new single sensors and complete modules, such as a stereo-vision module and a gripper module, can be easily added, due to the hardware and software modularity of the system [15]. Dedicated to Khepera [14], the simulated mobile robot includes eight infrared sensors allowing it to detect by reflection (small rectangles) the proximity of objects in front of it, behind it, and to the right and the left sides of it. Each sensor returns a value ranging between 0 and 1023 represented in color levels. 0 means that no object is perceived while 1023 means that an object is very close to tile sensor (almost touching the sensor). Intermediate values may give an approximate idea of the distance between the sensor and the object. Each motor can take a speed value ranging between - 1 0 and +10. The experiment was aimed at explicitly evolving the ability to perform navigation from a start point to a goal point in the environment. The robot was put in an environment consisting of a sort of maze of which external size was 1 × 1 m 2 large. The robot can sense the walls with the IR proximity sensors. Since the corridors were rather narrow, some sensors were slightly active most of the time.

208

Table 1. Definition of a generic rule.

IF ([X0 is i0]) and ([X3 is i3]) and ([X6 is is]) and THEN ]70 is o0 and YI

3

Genetic

Fuzzy

([X1 is il]) and (IX2 is i2]) and (IX4 is i4]) and ([X~ is in]) and ([X7 is iv]) is ol

Controller

In order to operate the robot introduced at the previous section, we have developed a fuzzy controller of which the internal parameters are adapted with genetic algorithm. In this section we shall describe them in detail. 3.1

Fuzzy Controller

A fuzzy system is basically an expert system which uses fuzzy logic for inferring outputs [12]. F~azzy logic can be regarded as being an extension of classical logic, the central tenet being that a member of a fuzzy set may have a numerical degree of membership anywhere in the interval [1, 0] as opposed to either 1 or 0 with no intermediate value allowed. Fuzzy systems were originally used in controllers because of their power at representing linguistic concepts, such as FAR and NEAR, and their subsequent ability to model the expertise of trained human process controllers. An alternative view is to regard a fuzzy system as a function or control surface approximation. In this sense, the individual sets cannot be meaningfully given linguistic labels, particularly if they are designed using some optimization algorithm. Rules in the fuzzy control system are represented by IF (condition) THEN (action), where condition part specifies the condition of parameters encoded by fuzzy membership with eight inputs and action part with two outputs. The generic definition of a rule is shown in Table 1. The fuzzy sets for input and output parameters are summarized in Table 2. Triangle shapes specify the membership function. A parameter value divides the range (0 ~ 1023 for input and - 1 0 ,-~ +10 for output) by ten equidistance segments. Fig. 1 shows the membership functions used for input and output values, respectively. Correlation minimum method is used for fuzzy inference, and centroid defuzzification method is adopted [9]. 3.2

Genetic A l g o r i t h m for Adjusting Fuzzy Rules

Genetic algorithm (GA) is considered as an effective method for optimization [7, 18], and several hybrid methods with fuzzy logic have been recently proposed. For instances, Lee and Takagi flll attempted to optimize fuzzy system using

209

Table 2. Fuzzy sets for input and output values.

Input : 8 values from infrared sensors (0 ~ 1023) Fuzzy set : I = {VF, F, C, VC} VF (Very Far) F (Far) C (Close) VC (Very Close) Output : 2 values from motors (-10 ~ +10) Fuzzy set : O = {BH, B, F, FH} BH (Backward High) B (Backward) F (Forward) FH (Forward High)

co

c,

c,

c,

V:F

c,

c,

E

-10 :

c,

c,

C

~

ca

c, VC

::

i +10

(~) co

c,

c,

c,

c,

BH

-lo

!

c,

c,

c,

B

g

i

i

c

z~ F/~

:: +10

(b) Fig. 1. Membership functions for (a) input; (b) output.

210

genetic algorithm, and adjust the internal parameters in genetic algorithm with the optimized fuzzy system. Fhkuda et. al [6, 17] utilized genetic algorithm to optimize fuzzy system with RBF membership functions. Evolution is a remarkable problem-solving machine [7]. First proposed by John Holland in 1975, GAs as one of computational implementations are an attractive class of computational models that mimic natural evolution to solve problems in a wide variety of domains. A genetic algorithm emulates biological evolutionary theories to solve optimization problems. A GA comprises a set of individual elements (the population) and a set of biologically inspired operators defined over the population itself. According to evolutionary theories, only the most suitable elements in a population are likely to survive and generate offspring, thus transmitting their biological heredity to new generations. In computing terms, a genetic algorithm maps a problem onto a set of strings, each of which represents a potential solution. The GA then manipulates the most promising strings in its search for improved solutions. A GA operates through a simple cycle of stages: 1. 2. 3. 4.

creation of a population of strings, evaluation of each string, selection of best strings, and genetic manipulation to create the new population of strings.

Fig. 2 shows how the fuzzy system adjusts the fuzzy rules by genetic algorithm. One of the key issues in using the genetic algorithm is to adopt a gene coding scheme appropriate to the problem at hand. In this paper, we should incorporate the input and output membership functions and the rules as a gene code, as shown in Fig. 3. A membership function for each input or output parameter requires six bits as shown in Fig. 4, resulting in 60 bits to represent the input and output parts in a gene code. Tile coding scheme for the rule part is naturally derived from that of the membership function for input and output parameters. Fig. 5 depicts how each rule is encoded. A rule has eight input parameters and two output parameters, each of which can represent one of four fuzzy sets. Including flags to specify whether the parameter is used or not, a rule can be fully described by 29 bits. The other key issue in using the genetic algorithm is to determine the fitness measure and in this paper we define it as follows: fitness = a × no. of collisions + fl × distance moved + 7 x no. of rules + a x no. of membership functions + e × no. of check points reached, where a, 7 and 5 are positive, while fl and e are negative.

211

Itlill lira tW

1

1

V

mutation

FuzzySystem

H~i~iti!!iilitii!1 7 Liiitil lltllllillll i{il{iitTi~l~~!1 7 I

crossover

"(

i Low

< Fitness•

High"

L I

KheperaS i m u l a t o r

Selection Fuzzy System Tunning

Fig. 2. Schematic diagram of genetic adjustments for fuzzy system. 8 input-vars

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

2 output-vars

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

chromosome

10 rules

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Fig. 3. Gene code for encoding the fuzzy system.

4

Simulation

Results

The Khepera simulator has been written in C + + [14], and the simulation was conducted in SUN Sparc 10 workstation. We initialized 200 chromosomes at random, each of which was developed to a fuzzy controller for the robot. Each robot can move in the limit of 5000 unit time, producing the fitness value. The robot learned to navigate in less than 100 generations (see Fig. 6). It can be seen that the fitness is radically increased at the beginning stage, but there is nearly no change after 90 generations. Around the 67th generation the best individuals already exhibited a near optimal behavior. Since their navigation was extremely smooth, they never bumped into walls and corners, and succeeded in maintaining a straight trajectory when possible. They could perform complete

212

¢.0

cl

¢2

c3

c5

¢4

c,6

q7

C,8

c9

i

Variable

.--.

0

,.°-..

il)

2

4

5

[ 6)

7

~coding~

0

0

.................

1

1

.

1

"--. ...............

centerl

Encoded variable

0

,,s

center2

Fig. 4. Encoding method for a membership function.

, ......

.

,,--

",,

,.-

.

.,.-

-,...---

--.

f;~o,[oi, :i,o oi;i, ol~ oi,io, ~oi,~o~,i,~,~,Io~,i, ~,l,l Fig. 5. Encoding method for a rule.

moves from the start point to the goM point without turning on themselves (Fig. 7). These results are highly reliable and have been replicated in m a n y runs of the experiment. In the beginning of the evolution the individuals evolved a frontal direction of motion, corresponding to the side where more sensors are available. Those individuMs t h a t moved in the other direction got stuck in a corner without being able to detect it, and soon disappeared from the population. Note t h a t the robot finds out several useful rules, such as right-turn, left-turn and 180-turn, even though no specific rules for t h e m were given explicitly. The controller for

213

Fitness C h a n g e 180000 160000

ij'

140000 120000 W

100000

C

80000

Best Fitness

]

Average Fitness J

60000 40000 20000 0 1

10

19 20 37 46 55 64 73 82 91 100 t 0 9 1 t 8 127 136 145 generalion

Fig. 6. Fitness change.

this robot consists of only seven effective rules, which are generated through the evolutionary process, as shown in Table 3.

5

Concluding Remarks

in this paper, we have proposed a fllzzy system to control a mobile robot, and utilized genetic algorithm to optimize the internal parameters in the system. A successful controller generated consists of only seven effective rules, which shows the evolution finds out the optimal set of rules to control the robot. Therefore, we can assert that the evolutionary concept can be an effective vehicle to develop a fuzzy system with many parameters for mobile robot control.

References 1. Beer, R.D., Gallagher, J.C.: Evolving dynamical neural networks for adaptive behavioL Adapt. Beh. 1 (1992) 91-122 2. Brooks, R.A.: A robust layered control system for a mobile robot. IEEE Trans. Robotics and Automation. 2 (1986) 14-23

214

F I : lllllllllllllll =

"--i r-]

=_:=-i

i

II l-'r r",

i l_C7_~ ,~-I Ill~

---,I

'qllIPl

~--I

,irr~..!_

~

,- ....

! i__

, iI ~-"~

"--I I

j [ '......I~! [1----t''ll

_

|

t,

....... l

I ! I

,ml,l

............ ~ 1

i~,m

I:t:rl;!

JL

i ~ll

:,JI

.

.

.

.

.

II

(d)

Fig. 7. The trajectories of the robot; (a) right-turn; (b) left-turn; (c) 180-turn; and (d) final status.

3. Brooks, R.A.: Intelligence without representation. Artif. Intell. 47 (1991) 139-159 4. Cliff, D., Harvey, I., Husbands, P.: Explorations in evolutionary robotics. Adapt. Beh. 2 (1993) 73 110 5. Dorigo, M., Schnepf, U.: Genetic-based machine learning and behavior based robotics: A new synthesis. IEEE Trans. Syst. Man~ Cybern. 23 (1993) 141-154 6. Fukuda, T., Kawamoto, A., Shimojima~ K.: Acquisition of swimming motion by RBF fuzzy neuro with unsupervised learning. Proc. 1995 Int. Workshop BiologicMly Inspired Evolutionary Systems. (1995) 118-123 7. Goldberg, D.E.: Genetic Algorithms in Search Optimization ~z Machine Learning. Addison-Wesley. (1989) 8. Holland, J.H.: Adaptation in Natural and Artificial Systems. Ann Arbor. M]: The Univ. of Michigan Press. (1975) 9. Kosko, B.: Neural Networks and Fuzzy Systems. Prentice-Halt. (1992)

215

T a b l e 3. The final set of rules evolved.

(X2 = C) and (X~ = VF) and (X~ THEN (Y0 = BH) and (Y1 = B) IF (X4 = YF) THEN (Y0 = FH) and (}I1 = F) IF (X1 = VC) and (X2 = F) and (X4 THEN (Yo = BH) and (Y1 = B) IF (X~ = F) and (X3 = F) and (X6 = THEN (Yo = F) and (Y1 = FH) IF (X~ = v c ) THEN (Yo = BH) and (Y1 = F) IF (X2 = VF) and (X, = F) and (X6 THEN (}I0 = F) and (Y1 = F H ) IF (Xo = VE) and (X4 = F) and (X5 THEN (Yo = BH) and (Yt = F)

(Rule 1) IF (Rule 2) (Rule 3) (Rule 4)

(Rule 5) (Rule 6) (Rule 7)

= VC)

= C) and (X7 = VC)

VC)

= VC) = C)

10. Koza, J.R.: Genetic Programming: Oil the Programming of Computers by Means of Natural Selection. Cambridge. MA: MIT Press. (1992) 1t. Lee, M.A., Takagi, H.: Dynamic control of genetic algorithms using fuzzy logic techniques. Proc. Fifth Int. Conf. Genetic Algorithms. (1993) 76 83 12. Leitch, D., Probert, P.: Genetic algorithms for the development of fuzzy controllers for mobile robots. Lecture Notes in Artificial Intelligence 1011. Springer. (1995) 14~172 13. Maes, P.: Behavior-based artificial intelligence. From Animals to Animats II: Proc. Second Int. Conf. on Simulation of Adaptive Behavior. (1993) 14. Michel, O.: Khepera Simulator Version 1.0 User Manual. (1995) 15. Mondada, F., Franzi, E., Ienne, P.: Mobile robot miniaturization: A tool for investigation in control algorithms. Proc. Third Int. Symp. on Experimental Robotics. Kyoto, Japan. (1993) 16. Parisi, D., Cecconi, F., Nolfi, S.: Econets: Neural networks that learn in an environment. Network. 1 (1990) 149d68 17. Shimojima, K., Fukuda, T., ArM, F., Ha.segawa, Y.: Unsupervised/supervised learning for RBF-fuzzy inference-adaptive rules membership flmction and hierarchical structure by genetic algorithm. Proc. 1994 IEEE/Nagoya Univ. W W W on Fuzzy Logic and Neural Networks/Genetic Algorithms. Nagoya. (1994) 97 104 18. Srinivas, M., Patnaik, L.M.: Genetic algorithms: A survey. IEEE Computer. (June 1994) 17-26