Advances in Engineering Software 31 (2000) 251–262 www.elsevier.com/locate/advengsoft
Optimization of fuzzy rules design using genetic algorithm S.V. Wong, A.M.S. Hamouda* Department of Mechanical and Manufacturing Engineering, Universiti Putra Malaysia, 43400 Serdang, Malaysia Received 1 March 1999; received in revised form 11 May 1999; accepted 17 October 1999
Abstract Fuzzy rules optimization is a crucial step in the development of a fuzzy model. A simple two inputs fuzzy model will have more than ten thousand possible combinations of fuzzy rules. A fuzzy designer normally uses intuition and trial and error method for the rules assignment. This paper is devoted to the development and implementation of genetic optimization library (GOL) to obtain the optimum set of fuzzy rules. In this context, a fitness calculation to handle maximization and minimization problem is employed. A new fitness-scaling mechanism named as Fitness Mapping is also developed. The developed GOL is applied to a case study involving fuzzy expert system for machinability data selection (Wong SV, Hamouda AMS, Baradie M. Int J Flexi Automat Integr Manuf 1997;5(1/2):79–104). The main characteristics of genetic optimization in fuzzy rule design are presented and discussed. The effect of constraint (rules violation) application is also presented and discussed. Finally, the developed GOL replaces the tedious process of trial and error for better combination of fuzzy rules. q 2000 Elsevier Science Ltd. All rights reserved. Keywords: Fuzzy-rules optimization; Genetic algorithms; Genetic optimization; Fitness mapping
1. Introduction Fuzzy logic, initially introduced in Zadeh’s pioneering work in mid-1960s [2], and later explored by Mamdani to control a simple laboratory steam engine [3], has established itself as a suitable solution to a range of challenging industrial problems [4]. Fuzzy logic is a mathematical theory of inexact reasoning that allows us to model the reasoning process of humans in linguistic terms. It is suitable in defining the relationship between the system inputs and the desired system outputs. Fuzzy logic is one of the most successful of today’s technologies for developing sophisticated control systems. It is also popular, as its capability for developing rule-based expert systems. Fuzzy controllers and fuzzy reasoning have found particular applications in industrial systems that are very complex and cannot be modeled precisely even under various assumptions and approximations [1]. The control of such systems by experienced human operators was proven to be in many cases more successful and efficient than by classical automatic controllers. The human controllers employ experiential rules that can be cast into the fuzzy logic framework. These observations inspired many investigators to work in this area with
* Corresponding author. Tel.: 1603-948-6101; fax: 1603-948-8939. E-mail address:
[email protected] (A.M.S. Hamouda).
result being the development of the so-called fuzzy logic and fuzzy rule-based control. Munakata and Jani reported in Ref. [5] that over a thousand commercial and industrial fuzzy systems have been successfully developed in the last few years. The main reason behind this lies on the unique characteristics of fuzzy logic. There are two general methodologies for generating fuzzy model. The first one requires expert information to construct the model, whereas the second lets the system adjust the fuzzy components from representative numerical samples. The first approach requires a prior expert knowledge about the system. It has been a good form to collect expert information from experienced experts, as it is much nearer to human normal communication. The main drawbacks of this approach are subjectivity and dependence on expert’s knowledge, which might not be the best at most of the time. The second method has been applied to construct a fuzzy model from the available input–output results. A lot of works has been carried out to adjust and/or to generate input membership functions, output membership functions, and/or fuzzy rule sets [6–9]. Tang et al. suggested hierarchical genetic algorithms to minimize the number of fuzzy memberships and fuzzy rules in Ref. [10]. The main drawback of this approach is that the representative data is not really representative in an overall manner. Besides that, almost all the systems in reality are non-linear and subjected to many unknown variables, which are normally ignored
0965-9978/00/$ - see front matter q 2000 Elsevier Science Ltd. All rights reserved. PII: S0965-997 8(99)00054-X
252
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
during idealization of the problem. Thus, the so-called representative data is not always representative. Fuzzy rules design is never an easy task especially subjected to complex real world problems. Fuzzy if-then rules were derived from human experts in most fuzzybased systems. Each fuzzy model described in Ref. [1] will have more than 2 × 1029 possible sets of fuzzy rules. A simple two-inputs-one-output fuzzy model normally has more than ten thousand possible combinations. Although applying common sense and expert knowledge would normally narrow down the scope, but the selected fuzzy rules are normally not the best fitted. Recently, several approaches were suggested for generating the fuzzy rules from the numerical data automatically. Wang and Mendel have described a general method to generate fuzzy rules from the numerical data in Ref. [11]. Jang [12] and Berenji and Khedkar [13] have proposed selflearning methods for adjusting membership functions of fuzzy sets in fuzzy if-then rules. According to the authors’ opinion, automatically generating fuzzy rules will lose one of the most important features in fuzzy logic. One of the main features of fuzzy logic is its ability of describing the system in a linguistics term. This enables the design of such system with more human-like reasoning, especially with the fuzzy if-then rules. Genetic algorithm (GA) is now a very popular tool for solving optimization problems. It has been used to effectively find optimal solutions for a variety of problems (e.g. operations research, hybrid techniques, image processing, etc.). Genetic algorithms are based on the mechanics of natural selection and natural genetics. With GA’s capabilities, it has been extended to be a novel optimization algorithm. GA has been applied in solving mathematical problems, medical problems, engineering problems and even political science problems [14–17]. Genetic algorithms have been employed for generating and/or adjusting membership functions of fuzzy sets. Karr [6] adjusted fuzzy membership functions and Nomura et al. [18] determined fuzzy partition of input spaces by genetic algorithms. In this paper, the authors use the genetic algorithm approach in fuzzy rules design. The genetic optimization replaces the tedious process of trial and error for better combination of fuzzy rules. Representative data are used from real world or reliable resources for genetic optimization. Studies are carried out based on fuzzy models from Refs. [1,19]. Both newly suggested algorithms, chromosome-length independent mutation operation and Fitness Mapping mechanism, are described and discussed.
2. Development of GOL There are two main classes in GOL. The first one is named as Chrom, containing all the necessary information about a chromosome that belongs to an individual member
of a population. The second class is called “Population”, consists of all individuals as its members. 2.1. Chrom class In microbiological world, chromosomes are composed of genes, which may take on some number of values called alleles. The Chrom class only stores a series of such coded information, in reality. Designation of allele has to be carried out before hand by the designer. In natural world, the data or information mentioned is referring to the feature carried with the particular value of the allele, such as brown eyes. The definition of the alleles is not provided in the Chrom class, as it is common for the entire population (similar individual or member of the population). All the information carried by an individual is collected in the chromosome in a standard sequence, which can be defined freely by the user of the GOL. All the information stored in the chromosome is in bit form, means a series of ‘1’ and ‘0’ are used for representation of an individual’s characteristics or features. The data has been arranged in such a way as to cope up with different types of information representation. It could be a Boolean, an integer or even a real number. The user of the GOL has all the flexibility to define his/her own definitions for every single allele. In the present work, the authors have chosen binary numbering, as it is the most fundamental in computing world. It can represent any kind of information, ranging from its own binary data to real number. In addition, it will gain more efficient computer resources utilization. The user has to define the length of every single allele for the chromosome. The user has to bear in mind that, all the individuals in the population are similar, thus share similar chromosome pattern. In addition, the user has to decide the length of every individual allele in advance. The calculated fitness and penalty factors are stored as member variables in Chrom class as well. A series of member functions are created to abstract and to store allele information from and into the chromosome. The implementation of these functions requires providence of predetermined initial position and ending position of the allele in a chromosome. 2.2. Population class Population class consists of two generations, new generation and present generation. Each generation consists of corresponding individuals (chromosomes) of same kind and each individual carries a series of genes. New generation is breed from the present generation. All the chromosomes belong to Chrom class, thus carrying all the Chrom class features and functions. Population class carries a number of member variables. They can be divided into two main groups, which are static and dynamic, respectively. The static variables are predetermined or calculated at the initialization stage and used for the rest of the following processes. While on the contrary, dynamic variables are altered in every generation.
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
253
Table 1 Important member variables of Population class Static variable
Description
Dynamic variable
Description
Imember
Number of individuals / chromosomes in a generation Number of allele in a chromosome Length of a particular allele in a chromosome, in term of binary unit Probability of occurring cross over Probability of occurring mutation
AvgFitness
Average fitness of the present generation
MaxFitness FitChrom
Maximum fitness of the present generation Chromosome which has the highest fitness
Ncross NMutation
Number of cross over occurrence Number of mutation occurrence
Iallele LengthAllele pCross pMutation
Table 1 shows crucial static and dynamic member variables of the Population class. Several member functions are included in the Population class. These member functions are used to implement what is shown in Fig. 1. Some of them are standard and are used within the GOL. The inheritance and polymorphism of OOP enable overriding and customizing of the member functions to cope with different needs. Some of the common functions are reproduction, select, mutation, crossover, fitness calculation, etc. Common genetic operations are crossover and mutation. They are handled by crossover function and mutation function in Population class. The user can select single bit point crossover or double bit point crossover. Whole allele instead
of bit crossover is available. While for mutation operation, a user can choose bit mutation or allele mutation, a single bit of the whole chromosome will be altered to its reverse in bit mutation. While, the whole allele will be altered arbitrary to any possible value within the allele length in terms of bits in allele mutation. User of GOL can even override the operations to have his/her custom made genetic crossover and mutation operation. Fitness calculation is a problem-oriented process. It has to be overridden by the user according to the requirement of the system. Fitness of an individual is calculated in terms of real number. Fitness calculation is generally grouped into two main purposes, maximizing and minimizing the solution. The nature of GOL is for maximization fitness, means, the evolution of generations tends towards maximizing the fitness of the entire population. Minimizing problems can be solved with the following general equation FitnessFinal K 2 FitnessTrial
1
Fitness Trial is calculated before hand based on a minimizing problem consideration. The final fitness, Fitness Final, is calculated with Eq. (1) with a constant value K. The value of K must be greater than the worst predicted value of Fitness Trial. In solving a maximizing problem, Fitness Final is equal to Fitness Trial. Constraints (or penalty for rules violation) can be applied in the process of genetic optimization. Penalty factor of each individual is stored in respective object, an instance of Chrom class. When a constraint or a rule is violated, a certain amount of penalty is applied towards the final fitness calculation. Penalty treatments are carried out either with single collection or accumulative collection. In single collection, the penalty factor is applied once only, no matter how many constraints is violated. Thus, penalty will be the same regardless the violating degree. On the contrary, with accumulative collection, each violation will cause a certain amount of penalty. At the end, all the penalties are summed up for the final fitness calculation. Eq. (2) shows the fitness calculation for minimizing problem with accumulative penalty collection. X PFi
2 FitnessFinal K 2 FitnessTrial 2 Fig. 1. Genetic optimization flow chart.
PFi is the penalty factor of an individual i. Constraint(s) or rules violation implementation is useful
254
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
Table 2 Inputs fuzzy expression First input (material hardness)
Second input (depth of cut)
Abbreviation
Expression
Abbreviation
Expression
VS S MD H VH
Very soft Soft Medium Hard Very hard
VS S MD D VD
Very shallow Shallow Medium Deep Very deep
especially in fuzzy rules design. It incorporates expert knowledge into the optimization process. Penalty factor calculation should be overridden for customization purpose. The penalty value must not be too small, which will not cause significant effect. It must not be too large as well, which will cause the whole optimization P process inefficient. The summation of all penalty values ( PFi in Eq. (2)) must not be greater than the difference between the value of K and the mean of all absolute error percentages. To reduce the unwanted effects from value K, Eq. (3) is suggested …FitnessFinal 2 min
FitnessFinal AdjFitnessi FitnessFinal i 0 n21
3 AdjFitnessi is the adjusted final fitness value for a particular member i of the population. Fitnessi is the value calculated from Eq. (2) for member i. …FitnessFinal min(FitnessFinal 0 n21 ) is a function which will to FitnessFinal yield the minimum value from FitnessFinal 0 n21 : The value n is the size of the population. 2.3. Implementation of GOL Fig. 1 shows a flow chart of a typical genetic optimization algorithm. It starts with static variable initialization. All the static and dynamic variables are initialized in the GOL constructor. The GOL uses bit-wise interpretation, which
Index representation for both inputs
0 1 2 3 4
means, the length of a particular allele is expressed in terms of bit. If an allele carries a possible value from 0 to 7 (or 8 possible features), the length of the allele is then three. Calculations are then being carried out for some other static variables, such as the length of a chromosome. Initial individuals or chromosome of the members in a population have to be defined. They can be generated randomly, supplied by the user or partially generated randomly with partial user input. Fitness of initial chromosomes is calculated with the overridden fitness calculation function, including the penalty factor calculation. The Reproduction’s main function is to generate the new generation from the present generation. It consists of selection, mutation and crossover operations. With analogy to the biological world, stronger individual stands higher chance in natural selection for breeding. Thus, individual with better fitness will stand higher chance to be selected in the selection operation. Stochastic sampling with replacement method is used. Crossover and mutation may happen while breeding. The success of crossover and mutation process is depending on the pre-defined mutation probability and crossover probability, respectively. The breeding of new generation is continuing until the population size reaches its limit. All the new generation will replace the present generation in the generation change process. Then the global population information is updated. The whole processes are repeated for the desired number of generation.
Table 3 Output fuzzy expression for cutting speed fuzzy model (cutting speed) Abbreviation
Expression
Index representation
EVS ES VVS VS S QS AS MD AF QF F VF VVF EF EVF
Extremely very slow Extremely slow Very very slow Very slow Slow Quite slow A bit slow Medium A bit fast Quite fast Fast Very fast Very very fast Extremely fast Extremely very fast
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
3. GOL application GOL has successfully optimized the fuzzy models used in Refs. [1,19]. Tables 2 and 3 show the fuzzy expressions for the inputs and output memberships, respectively. While Table 4 shows the minimum–maximum range of the fuzzy membership functions for four different tool types. The fuzzy models are common in inputs and output membership pattern, but different in range. The inputs and output memberships are equal-sided triangle in shape and well distributed. Different set of fuzzy rule is assigned for each respective tool. Table 5 shows fuzzy rules for highspeed tool fuzzy model. The fuzzy rules design was based on intuition with trial and error for fine-tuning.
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
255
Table 4 Min–max range of fuzzy membership functions for cutting speed fuzzy model Tool type
High-speed steel Uncoated brazed carbide Uncaoted indexable carbide Coated carbide
First input material hardness (BHN)
Second input depth of cut (mm)
Output cutting speed (m/min)
Min
Max
Min
Max
Min
Max
85 85 85 85
275 275 275 275
0 0 0 0
16 16 16 16
16 60 63 105
59 172 225 336
3.1. Fuzzy set handling class A simplified fuzzy set handling class (FSH class) has been developed and incorporated into the optimization process described in this paper. The FSH class is developed using C11 programming language. The members of the FSH store the properties of a fuzzy membership. The simplified FSH class can only handle triangle and truncated triangle fuzzy shapes. Some common operations like truncation and truth degree calculation are also included. All the calculations described in this paper are based on Max–Min Inference Method. In order to save processing time, Weighted Centroid Output Defuzzification method has been used. The use of Weighted Centroid Output Defuzzification compared to Union Centroid Output Defuzzificaiton has proven to cause an insignificantly small difference as reported in Ref. [19]. 3.2. GOL initialization The fuzzy models consist of five fuzzy memberships in the input and fifteen in the output. The system required 25 fuzzy rules with 15 possibilities each. Thus, the total number of possible fuzzy rules combination will be 1525 2:525 × 1029 : For initialization, 25 alleles were required and the length of each allele is 4 bits in order to cope with 15 possible values. Index representations in Tables 2 and 3 are used. In addition, the initialization of the alleles, the probability of crossover, the probability of mutation, and the size of the population are needed. The proper size of the population and probabilities will yield better optimization results. In this study, the population consists of 80 individuals (sets of fuzzy rule), the crossover probability and the mutation
probability are set as 0.6 and 0.009, respectively. Single bit point crossover operation and allele mutation operation are used. The fuzzy rules from Ref. [1] are assigned as one of the initial members. The rest of the rules are generated automatically and randomly. Basically, the size of a population is fixed. Each individual has its own chromosome, which consists of certain fixed-number of alleles. The genetic optimization processes are repeated for 10 000 generations. 3.3. Fitness calculation Calculation of an individual’s fitness involves extracting data from the individual’s chromosome, translating the value of all the alleles and assigning the represented fuzzy rules into the FSH class. Then fuzzy operations are performed with the predetermined inputs (work piece material and depth of cut) to yield the output (cutting speed). The number of predetermined sets of inputs is 80. Forty sets of representative data are extracted from Machining Data Handbook [20]. Additional 40 sets for uncovered region are obtained through linear interpolation. Calculation of absolute error percentage compared to the result from the above mentioned 80 sets of data is carried out. The operations iterate until finished assessing all the predetermined sets of inputs. The mean of all the individual absolute error percentage is calculated. The mean of absolute error percentage is a suitable fitness representation of the particular member (chromosome) in the population. Orientation of fitness consideration in the developed GOL is, higher the value of fitness the better. To cope with this scenario, the fitness is obtained through Eq. (4) n X
Table 5 Fuzzy rules for high-speed steel fuzzy model (with abbreviation indication)
Fitness K 2
Material hardness
where 0 # i # n
VS S MD H VH
Depth of cut VS
S
MD
D
VD
EVF F F QF MD
MD QS S S ES
AS S S VS ES
QS VS VVS VVS ES
VS VVS VVS ES EVS
abs_error%i
i0
n11
2
X
penalty_factor
4
Penalty factor is for rules violation (or constraints). The value K is an arbitrary selected positive value. K is defined as 1000 for the purpose of this application. Generally, lower mean absolute error percentage, higher fitness value and nearer to K. For the final consideration of the fitness in the competition of reproduction selection, Eq. (4) is employed.
256
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
Fig. 2. Mean absolute error percentage versus generation with power trend-lines.
3.4. Pattern violation (constraint) penalties
4. GOL characteristics and operations discussion
The genetic optimization class allows the control of fuzzy rules pattern, means, the designer can provide his/her expert knowledge in specifying the relationship between the inputs and the outputs. For the purpose of this paper, the authors have included four general constraints for the fuzzy rules, which are:
General characterization of fuzzy rules genetic optimization is carried out with the high-speed steel fuzzy model from literature [1] as test media. As a typical situation, a genetic model with relatively huge chromosome is involved. The example fuzzy model requires 25 alleles in a chromosome, and each allele consists of 4 bits. As for characterization tests, no constraint (penalty) is applied. Initial individuals in the initial population are generated randomly.
• • • •
harder the workpiece material, faster cutting speed; softer the workpiece material, slower cutting speed; shallower the depth of cut, faster cutting speed; deeper the depth of cut, slower cutting speed.
Constraints are applied with accumulative penalty collection. Each violation will cause a penalty value of 25 in the summation of error factor in Eq. (4). Thus, more number of violations will cause lower fitness. Pattern validation is carried out during the assignment of fuzzy rules into the FHS class from the value of alleles. The penalty value must not be too small, which will not cause any significant effect. It must not be too large as well, which will make the whole optimization process inefficient. The summation of all penalty values must not be greater than the difference between the value of K and the mean of all absolute error percentages.
3.5. Results of GOL implementation Better results from the trial and error fuzzy rules with genetic optimization are achieved. Table 7 shows the summary of validation results, comparing the genetic optimized fuzzy model from the literature [1,19]. Note that all the fuzzy models in the literatures were fine-tuned through trial and error. Significantly improved fuzzy rules are suggested after genetic optimization for each fuzzy model.
4.1. Efficiency and repeatability Ten independent runs are carried out to verify genetic optimization’s performance in fuzzy rules design. The number of generation is set to be 200. All the runs share the same genetic parameters, such as the number of individuals in the population and mutation probability, but have different random seeds. The random seed is used to generate random number. Fig. 2 shows a chart P based on the mean absolute error percentage, which is (abs_error%)/(n 1 1) in Eq. (4). Generation average, generation the best and overall the best are shown in terms of mean absolute error percentage. They are calculated as the mean value from the ten independent runs. Trend-lines are inserted in Fig. 2 assuming negative power relationship between mean absolute error percentage with the number of generation. Randomly generated initial fuzzy rules have an average value of 40% in mean absolute error percentage with standard deviation of 1.5. The algorithms have significantly narrowed down the search and led to a reduction in the average mean absolute error percentage to around 20% in the first 10 generations. The performance of the genetic optimization reduces when evolving for finer solution. The value only improved 1.26% in the second 100 generations. Smaller improvement degree is experienced when the
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
257
Fig. 3. Performance comparison between random generated population and single strong individual.
whole population evolves further. This shows that genetic optimization is performing with excellent phase initially, and the improvement deteriorates from generation to generation till it reaches its optimum point. 4.2. Importance of initial population A good initial population will improve the optimization process. A strong individual in fitness is placed in the initial population, which consists of 79 other individuals that generated randomly. The strong individual is selected from the corresponding sets of fuzzy rules from Ref. [1]. Averages of generation, average mean absolute error percentage, and the best mean absolute error percentage are calculated from three independent runs under the same environment. Comparison has been made with 80 randomly generated individuals. Fig. 3 shows that there is a significant improvement in performance by having a single strong indi-
vidual in the initial population. The points shown in Fig. 3 are the average value of mean absolute error in the respective generation. The optimization reduced in mean absolute error percentage from more than 40–8% in the first 10 generations, whilst comparing the randomly selected model, only reduced to 20%. Fig. 3 shows that the single individual-selected population starts staggering from the 50th generation. In the 200th generation, random model achieved 4.3% in mean absolute error percentage while 3.2% with the other model. 4.3. Crossover, mutation and population size Good genetic algorithm performance requires the choice of a high crossover probability, a low mutation probability (inversely proportional to the population size), and a moderate population size. De Jong [21] suggested crossover probability of 0.6. Later, Grefenstette [22] proved that higher
Fig. 4. Performance comparison with different crossover probabilities.
258
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
Fig. 5. Performance comparison with different mutation probabilities.
crossover rates are better when the stochastic errors of sampling are reduced through the use of more accurate selection procedures. Genetic optimization with large chromosome is having the same characteristic in selecting crossover probability especially at the initial evolutions. This is illustrated in Fig. 4. As for high crossover probability, the chance of an individual surviving (with same chromosome pattern) for the next generation is low. Thus, maintaining the strong individual in evolution process is hard with stochastic sampling with replacement selection. In this study, Elitist selection model is applied to overcome the problem [17]. Mutation probability controls the rate of mutation in the process of reproduction. Chance of mutating allele is higher with huge chromosome. Thus, mutation probability should be lower in huge chromosome. Too low probability will cause insufficient diversity for continued improvement.
Fig. 5 shows change in performances affected by different mutation rates. A mutation rate around 0.01 is recommended. The basic mutation operation is defined as number of mutation over number of allele involved in reproduction [16]. To solve the chromosome-length dependent mutation operation, the authors suggest a new mutation operation. Mutation rate is defined as the number of mutation over the number of generated individuals. If a mutation is ‘decided’ to take place on an individual, an allele of the individual is selected randomly. Thus, the mutation rate is independent from the size of the chromosome. From the recommended mutation rate, 0.01 mutation per allele, probability for an individual to experience a mutation is 0:01 × 25 0:25: Thus, chromosome-length independent mutation rate is 0.25. This means, every reproduction of four individuals, one of them will get mutated in one of the alleles. The
Fig. 6. Performance comparison with different population sizes.
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
259
Fig. 7. Performance comparison with Fitness Mapping and random generated initial population.
new length-independent mutation operation prohibits more than one allele mutation of an individual at one time, which may occur with the conventional mutation operation. De Jong [21] has shown the relationship between population size and optimization performance for off-line system. He reported that bigger the population size, better the optimization performance, however, more computation effort is required. Fig. 6 shows the fuzzy rules genetic optimization in particular and huge chromosome genetic optimization in general follows the pattern. Larger population size requires more computation efforts to reproduce a generation. In addition, too large a population will cause reduction in the optimizing performance, as shown in Fig. 6 and Ref. [19]. 4.4. Fitness adjustment Eq. (4) alone will lead to inefficiency selection operation during reproductions. The fitness calculated is high in value and difference between minimum fitness and maximum fitness is small compared to the fitness value. The value of K in Eq. (3) leads to such phenomena. In order to improve the efficiency of the genetic optimization, the authors have introduced Eq. (5) to eliminate the effect of K. The authors have also found that Eq. (4) is not efficient enough. The optimization process reaches the premature staggering region without any further improvement. While the population evolves, the average generation fitness is moving closer to the best of generation fitness, as shown in Fig. 2. Thus, no significant advantage of an individual with maximum fitness compares to an average individual. As a result, selection for improvement becomes a random walk among the mediocre. To overcome such a situation, a few methods have been suggested [17,18,21,22]. The process is called fitness scaling. The common scaling mechanism is linear scaling. Sigma truncation and power law scaling are among the others. The authors have developed their own fitness scaling
mechanism, named Fitness Mapping. There are three main objectives to be achieved: • No extraordinary individuals would take over a large proportion of the finite population in a single generation, which may cause of premature convergence. With the conventional (common) scaling method, this could happened when an outfitted individual suddenly turn up in the population at the beginning of the evolution, where the average fitness is near to the lowest fitness. • Minimize the effects from random walk when the average fitness is near to the maximum fitness. • Eliminate the effects from huge fitness value. In Fitness Mapping, fitness of an individual is mapped to a range from 0 to1, where 0 will be the weakest representation and 1 will be the strongest representation. The average fitness will be mapped to 0.5. Linear interpolation is used for mapping at present for simplicity purpose. Complex relationships such as quadratics can be used. Eq. (5) is suggested as follows: MappedFitnessi
8 > > >
> > : 0:5 1
Fitnessi # Fitnessavg
Fitnessmax 2 Fitnessi ; Fitnessi . Fitnessavg 2
Fitnessmax 2 Fitnessavg
5 Fitnessi is the individual final fitness calculated by using Eq. (3). Fitnessmin, Fitnessmax, and Fitnessavg are the generation weakest fitness, generation the best fitness and generation average fitness, respectively. Figs. 7 and 8 are plotted to illustrate the effectiveness of linear fitness mapping algorithms. Fig. 7 shows the results using normal fitness calculation and mapped fitness calculation with random generated initial population. It can be seen that there is a significant improvement with Fitness Mapping. The Fitness Mapping mechanism enables the population to evolve further compared to the conventional fitness scaling
260
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
Fig. 8. Performance comparison with Fitness Mapping and single strong individual in initial population.
Table 6 Results summary Tool material
Mean absolute error percentage 40 Checking points
High-speed steel Uncoated brazed carbide Uncoated indexable carbide Coated carbide
80 Checking points
Union centroid [1]
Weighted centroid [19]
Weighted centroid
Weighted centroid with genetic optimization
4.208 3.330 3.836 2.950
4.068 3.138 3.790 2.971
5.812 4.194 5.759 3.081
4.946 3.866 4.511 2.946
calculations. With a strong individual in the initial population, the system will reach its optimum stage faster where the generation average fitness starts to stagger. Fig. 8 shows the efficiency of Fitness Mapping compared to the conventional fitness scaling with a single good individual in the initial population. The Fitness Mapping demonstrates improvements even in the region where normal fitness starts staggering. Fitness Mapping not only provides better genetic optimization result at the rough searching stage, also in the staggering region where significant improvement is hardly found with the conventional fitness scaling. Other common scaling mechanisms such as linear scaling are not capable of handling huge size fitness with stochastic sampling (with replacement). Fitness Mapping efficiency compared to other scaling mechanisms is beyond the discussion of this paper.
optimization with the constraints and optimization without constraint are carried out. The high-speed steel fuzzy model is selected for the comparison tests. Better fuzzy rules recommended after 100 generations, which improved the mean absolute error percentage from 5.8 to 3.7%. A 36.2% improvement was achieved and Table 7 shows the corresponding fuzzy rules. The bolded fuzzy rules do not obey the predetermined constraints. Fig. 9 shows the relationship between the cutting speed and the depth of cut for high-speed steel. The bolded trend line is within Table 7 Optimized fuzzy rules for high-speed steel fuzzy model, without constraint application (with abbreviation indication) Material hardness
4.5. Fuzzy rules constraints (rules violations) The results shown in Table 6 are bound to the constraints described in Section 3.4. Capability of constraint application in GOL is useful for a fuzzy designer. To show its efficiency and effectiveness, comparison study between
VS S MD H VH
Depth of cut VS
S
MD
D
VD
VF QF AF AF AS
AF QS MD VS VS
QS VVS S VVS ES
QS VS S VVS ES
VS ES VS EVS EVS
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
261
Fig. 9. Cutting speed against depth of cut (data from Machining Data handbook) with polynomial trend-lines.
the bolded fuzzy rules’ region. The bolded trend line shows a continuous increase from negative slope in 8mm depth of cut to positive in 16-mm depth of cut. The rest of the trend lines do not show this pattern. The bolded trend line has crossed the 175–225 BHN trend line, where the constraints mentioned in Section 3.4 are violated. The violation region in the graph (bolded trend line, 8–16 mm depth of cut) is the same to the corresponding violated region in the fuzzy rules (bolded fuzzy rules in Table 6). This explained the reason that raised the violation of the constraints in the fuzzy rules. It shows the general ‘rules’, described in Section 3.4 which lead to the development of the constraints, do not work well in all regions. This also gives some idea to the fuzzy designer that his/her expert knowledge does not work in a specific region. Better relationships or fuzzy rules are suggested through the optimization processes. This paper showed the possibility of developing new rules of thumb in cutting, which are as follows: • • • • •
harder the workpiece material, faster cutting speed; softer the workpiece material, slower cutting speed; shallower the depth of cut, faster cutting speed; deeper the depth of cut, slower cutting speed; the first four relationships are valid for very soft and very hard materials; • the first four relationships are valid for very shallow to medium depth of cut; • the first four relationships are valid for very deep depth of cut;
• the first four relationships are no longer valid for medium hardness materials with deep depth of cut. The above mentioned relationships are purely based on the genetic optimized fuzzy models. Further investigation has to be carried out for verification of the relationships. 5. Conclusions An optimization method for fuzzy rules is presented. The method is called Genetic Optimization Library (GOL) and is incorporated into the fuzzy expert system previously developed by the authors [1]. The validity and versatility of the developed GOL have been demonstrated by application to machinability data selection problem. Four improved fuzzy models have been developed for four different types of cutting tools. The developed models are validated with data from the literature. The effect of varying, checking point density, initial population, crossover-rate, and mutation rate are examined and discussed. A new mutation operation and a new fitness scaling mechanism (Fitness Mapping) are also presented and discussed. The developed fitness mapping was found to be more superior compared to other conventional scaling methods. Genetic optimization as a post-fuzzy rules design tool has yielded better fuzzy rules combinations and succeeded in replacing the trial and error process. Both expert knowledge and representative data are included in the designing of the
262
S.V. Wong, A.M.S. Hamouda / Advances in Engineering Software 31 (2000) 251–262
fuzzy rules, which conventionally involves only expert knowledge.
[11]
References
[12]
[1] Wong SV, Hamouda AMS, El Baradie MA. Development of a fuzzybased expert system for metal cutting data selection. Int J Flexi Automat Integr Manuf 1997;5(1/2):79–104. [2] Zadeh LA. Outline of a new approach to the analysis of complex systems and decision processes. In: Yager RR, Ovchinnikov S, Tong RM, Nguyen HT, editors. IEEE transactions systems, man, cybernetics. SMC-3. Fuzzy sets and applications, 1973. p. 28–44. [3] Mamdani EH. Applications of fuzzy algorithms for simple dynamic plants. Proc IEE 1974;121:1585–8. [4] Bonissone PP, Badami V, Chiang KH, Khedkar PS, Marcelle KW, Schuten MJ. Industrial applications of fuzzy logic at general electric. Proc IEEE 1995;83(3):450–65. [5] Munakata T, Jani Y. Fuzzy systems: an overview. Commun ACM 1994;37(3):69–76. [6] Karr CL. Design of an adaptive fuzzy logic controller using a genetic algorithm. Proceedings of the Fourth International Conference on Genetic Algorithms, San Diego, 13–16 July 1991:450–7. [7] Karr CL, Gentry EJ. Fuzzy control of pH using genetics algorithms. IEEE Trans Fuzzy Systems 1993;1(1):46–53. [8] Ishibuchi H, Nozaki K, Yamamoto N, Tanaka H. Selecting fuzzy ifthen rules for classification problems using genetic algorithms. IEEE Trans Fuzzy Systems 1995;3(3):260–5. [9] Pernel C, Themlin JM, Renders JM, Acheroy M. Optimization of fuzzy expert systems using genetic algorithms and neural networks. IEEE Trans Fuzzy Systems 1995;3(3):300–12. [10] Tang K, Man K, Liu Z, Kwong S. Minimal fuzzy memberships and
[13]
[14] [15] [16] [17] [18]
[19]
[20] [21]
[22]
rules using hierarchical genetic algorithms. IEEE Trans Ind Electron 1998;45(1):162–9. Wang LX, Mendel JM. Generating fuzzy rules by learning from examples. IEEE Trans Systems, Man, Cybern 1992;22(6):1414– 27. Jang JRS. Self-learning fuzzy controllers based on temporal back propagation. IEEE Trans Neural Networks 1992;3(5):714–23. Berenji HR, Khedkar P. Learning and tuning fuzzy logic controllers through reinforcements. IEEE Trans on Neural Networks 1992;3(5):724–40. Barricelli NA. Numerical testing of evolution theories. ACTA Biotheor 1962;16:69–126. Fraser AS. Simulation of genetic systems. J Theor Biol 1962;2:329– 45. Holland JH. Genetic algorithms and the optimal allocation of trials. SIAM J Comput 1973;2(2):88–105. Goldberg DE. Genetic algorithms in search, optimization, and machine learning, Reading, MA: Addison-Wesley, 1989. Nomura H, Hayashi I, Wakami N. A self-tuning method of fuzzy reasoning by genetic algorithms. Proc 1992 Int Fuzzy Systems Int Contr Conf, Louisville, 16–18 March 1992:236–45. Wong SV, Hamouda AMS. A fuzzy logic based expert system for machinability data-on-demand on the Internet. In: Hamouda AMS, editor. Proceedings of the Fourth International Conference Advances in Material Processing and Technology, Kuala Lumpur, Malaysia, 24–28 August, 2. 1998. p. 1048–58. Metcut Research Associates Inc. Machining Data Handbook, 3rd edition, vols 1 and 2, Cincinnate, 1980. De Jong KA. An analysis of the behavior of a class of genetic adaptive systems, (Doctoral dissertation, University of Michigan) Dissertation Abstracts International, 1975;36(10):5140B. Grefenstette JJ. Optimization of control parameters for genetic algorithms. IEEE Trans Systems, Man, Cybern 1986;16(1):122–8.