Fitness function

From HandWiki
Revision as of 23:35, 6 February 2024 by WikiEd2 (talk | contribs) (fixing)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A fitness function is a particular type of objective function that is used to summarise, as a single figure of merit, how close a given design solution is to achieving the set aims. Fitness functions are used in evolutionary algorithms (EA), such as genetic programming and genetic algorithms to guide simulations towards optimal design solutions.[1] In the field of EAs, each design solution is commonly represented as a string of numbers (referred to as a chromosome). After each round of testing, or simulation, the idea is to delete the n worst design solutions, and to breed n new ones from the best design solutions. Each design solution, therefore, needs to be awarded a figure of merit, to indicate how close it came to meeting the overall specification, and this is generated by applying the fitness function to the test, or simulation, results obtained from that solution.[2]

Two main classes of fitness functions exist: one where the fitness function does not change, as in optimizing a fixed function or testing with a fixed set of test cases; and one where the fitness function is mutable, as in niche differentiation or co-evolving the set of test cases.[3][4] Another way of looking at fitness functions is in terms of a fitness landscape, which shows the fitness for each possible chromosome. In the following, it is assumed that the fitness is determined based on an evaluation that remains unchanged during an optimization run.

A fitness function does not necessarily have to be able to calculate an absolute value, as it is sometimes sufficient to compare candidates in order to select the better one. A relative indication of fitness (candidate a is better than b) is sufficient in some cases,[5] such as tournament selection or Pareto optimization.

Requirements of evaluation and fitness function

The quality of the evaluation and calculation of a fitness function is fundamental to the success of an EA optimisation. It implements Darwin's principle of "survival of the fittest". Without fitness-based selection mechanisms for mate selection and offspring acceptance, EA search would be blind and hardly distinguishable from the Monte Carlo method. When setting up a fitness function, one must always be aware that it is about more than just describing the desired target state. Rather, the evolutionary search on the way to the optimum should also be supported as much as possible (see also section on auxiliary objectives), if and insofar as this is not already done by the fitness function alone. If the fitness function is designed badly, the algorithm will either converge on an inappropriate solution, or will have difficulty converging at all.

Definition of the fitness function is not straightforward in many cases and often is performed iteratively if the fittest solutions produced by an EA is not what is desired. Interactive genetic algorithms address this difficulty by outsourcing evaluation to external agents which are normally humans.

Computational efficiency

The fitness function should not only correlate closely with the designer's goal, but it also should be computationally efficient. Speed of execution is very important, as a typical genetic algorithm must be iterated many times in order to produce a usable result for a non-trivial problem.

Fitness approximation[6][7] may be appropriate, especially in the following cases:

  • Fitness computation time of a single solution is extremely high
  • Precise model for fitness computation is missing
  • The fitness function is uncertain or noisy.[8]

Alternatively or also in addition to the fitness approximation, the fitness calculations can also be distributed to a parallel computer in order to reduce the execution times. Depending on the population model of the EA used, both the EA itself and the fitness calculations of all offspring of one generation can be executed in parallel.[9][10][11]

Multi-objective optimization

Practical applications usually aim at optimizing multiple and at least partially conflicting objectives. Two fundamentally different approaches are often used for this purpose, Pareto optimization and optimization based on fitness calculated using the weighted sum.[12]

Weighted sum and penalty functions

When optimizing with the weighted sum, the single values of the [math]\displaystyle{ O }[/math] objectives are first normalized so that they can be compared. This can be done with the help of costs or by specifying target values and determining the current value as the degree of fulfillment. Costs or degrees of fulfillment can then be compared with each other and, if required, can also be mapped to a uniform fitness scale. Without loss of generality, fitness is assumed to represent a value to be maximized. Each objective [math]\displaystyle{ o_i }[/math] is assigned a weight [math]\displaystyle{ w_i }[/math] in the form of a percentage value so that the overall raw fitness [math]\displaystyle{ f_{raw} }[/math] can be calculated as a weighted sum:

[math]\displaystyle{ f_{raw} = \sum_{i=1}^O{o_i \cdot w_i} \quad \mathsf{with} \quad \sum_{i=1}^O{w_i} = 1 }[/math]

A violation of [math]\displaystyle{ R }[/math] restrictions [math]\displaystyle{ r_j }[/math] can be included in the fitness determined in this way in the form of penalty functions. For this purpose, a function [math]\displaystyle{ pf_j(r_j) }[/math] can be defined for each restriction which returns a value between [math]\displaystyle{ 0 }[/math] and [math]\displaystyle{ 1 }[/math] depending on the degree of violation, with the result being [math]\displaystyle{ 1 }[/math] if there is no violation. The previously determined raw fitness is multiplied by the penalty function(s) and the result is then the final fitness [math]\displaystyle{ f_{final} }[/math]:[13]

[math]\displaystyle{ f_{final}= f_{raw} \cdot \prod_{j=1}^R{pf_j(r_j)} = \sum_{i=1}^O{(o_i \cdot w_i)} \cdot \prod_{j=1}^R{pf_j(r_j)} }[/math]

This approach is simple and has the advantage of being able to combine any number of objectives and restrictions. The disadvantage is that different objectives can compensate each other and that the weights have to be defined before the optimization.[12] In addition, certain solutions may not be obtained, see the section on the comparison of both types of optimization.

Pareto optimization

A solution is called Pareto-optimal if the improvement of one objective is only possible with a deterioration of at least one other objective. The set of all Pareto-optimal solutions, also called Pareto set, represents the set of all optimal compromises between the objectives. The figure below on the right shows an example of the Pareto set of two objectives [math]\displaystyle{ f_1 }[/math] and [math]\displaystyle{ f_2 }[/math] to be maximized. The elements of the set form the Pareto front (green line). From this set, a human decision maker must subsequently select the desired compromise solution.[12] Constraints are included in Pareto optimization in that solutions without constraint violations are per se better than those with violations. If two solutions to be compared each have constraint violations, the respective extent of the violations decides.[14]

It was recognized early on that EAs with their simultaneously considered solution set are well suited to finding solutions in one run that cover the Pareto front sufficiently well.[14][15] Besides the SPEA2,[16] the NSGA-II[17] and NSGA-III[18][19] have established themselves as standard methods.

The advantage of Pareto optimization is that, in contrast to the weighted sum, it provides all alternatives that are equivalent in terms of the objectives as an overall solution. The disadvantage is that a visualization of the alternatives becomes problematic or even impossible from four objectives on. Furthermore, the effort increases exponentially with the number of objectives.[13] If there are more than three or four objectives, some have to be combined using the weighted sum or other aggregation methods.[12]

Comparison of both types of assessment

Relationship between the Pareto front and the weighted sum. The set of feasible solutions [math]\displaystyle{ Z }[/math] is partially bounded by the Pareto front (green).[13]
Example of a non-convex Pareto front[13]

With the help of the weighted sum, the total Pareto front can be obtained by a suitable choice of weights, provided that it is convex.[20] This is illustrated by the adjacent picture on the left. The point [math]\displaystyle{ \mathsf{P} }[/math] on the green Pareto front is reached by the weights [math]\displaystyle{ w_1 }[/math] and [math]\displaystyle{ w_2 }[/math], provided that the EA converges to the optimum. The direction with the largest fitness gain in the solution set [math]\displaystyle{ Z }[/math] is shown by the drawn arrows.

In case of a non-convex front, however, non-convex front sections are not reachable by the weighted sum. In the adjacent image on the right, this is the section between points [math]\displaystyle{ \mathsf{A} }[/math] and [math]\displaystyle{ \mathsf{B} }[/math]. This can be remedied to a limited extent by using an extension of the weighted sum, the cascaded weighted sum.[13]

Comparing both assessment approaches, the use of Pareto optimization is certainly advantageous when little is known about the possible solutions of a task and when the number of optimization objectives can be narrowed down to three, at most four. However, in the case of repeated optimization of variations of one and the same task, the desired lines of compromise are usually known and the effort to determine the entire Pareto front is no longer justified. This is also true when no human decision is desired or possible after optimization, such as in automated decision processes.[13]

Auxiliary objectives

Example of two schedules of an order consisting of the five work steps a to e that should meet a latest completion time[21]

In addition to the primary objectives resulting from the task itself, it may be necessary to include auxiliary objectives in the assessment to support the achievement of one or more primary objectives. An example of a scheduling task is used for illustration purposes. The optimization goals include not only a general fast processing of all orders but also the compliance with a latest completion time. The latter is especially necessary for the scheduling of rush orders. The second goal is not achieved by the exemplary initial schedule, as shown in the adjacent figure. A following mutation does not change this, but schedules the work step d earlier, which is a necessary intermediate step for an earlier start of the last work step e of the order. As long as only the latest completion time is evaluated, however, the fitness of the mutated schedule remains unchanged, even though it represents a relevant step towards the objective of a timely completion of the order. This can be remedied, for example, by an additional evaluation of the delay of work steps. The new objective is an auxiliary one, since it was introduced in addition to the actual optimization objectives to support their achievement. A more detailed description of this approach and another example can be found in.[21]

See also

External links

References

  1. Eiben, A.E.; Smith, J.E. (2015). "Evaluation Function (Fitness Function)" (in en). Introduction to Evolutionary Computing. Natural Computing Series (2nd ed.). Berlin, Heidelberg: Springer. pp. 30. doi:10.1007/978-3-662-44874-8. ISBN 978-3-662-44873-1. http://link.springer.com/10.1007/978-3-662-44874-8. 
  2. Eiben, A.E.; Smith, J.E. (2015). "What Is an Evolutionary Algorithm?". Introduction to Evolutionary Computing. Natural Computing Series. Berlin, Heidelberg: Springer. pp. 25–48. doi:10.1007/978-3-662-44874-8. ISBN 978-3-662-44873-1. http://link.springer.com/10.1007/978-3-662-44874-8. 
  3. Popovici, Elena; Bucci, Anthony; Wiegand, R. Paul; De Jong, Edwin D. (2012), Rozenberg, Grzegorz; Bäck, Thomas; Kok, Joost N., eds., "Coevolutionary Principles" (in en), Handbook of Natural Computing (Berlin, Heidelberg: Springer Berlin Heidelberg): pp. 987–1033, doi:10.1007/978-3-540-92910-9_31, ISBN 978-3-540-92909-3, http://link.springer.com/10.1007/978-3-540-92910-9_31, retrieved 2023-01-08 
  4. Eiben, A.E.; Smith, J.E. (2015). "Coevolutionary Systems". Introduction to Evolutionary Computing. Natural Computing Series. Berlin, Heidelberg: Springer Berlin Heidelberg. pp. 223–230. doi:10.1007/978-3-662-44874-8. ISBN 978-3-662-44873-1. http://link.springer.com/10.1007/978-3-662-44874-8. 
  5. Bäck, Thomas, ed (2000-11-20) (in en). Evolutionary Computation 2: Advanced Algorithms and Operators. Taylor & Francis. doi:10.1201/9781420034349. ISBN 978-0-7503-0665-2. https://www.taylorfrancis.com/books/9781420034349. 
  6. Jin, Y. (January 2005). "A comprehensive survey of fitness approximation in evolutionary computation" (in en). Soft Computing 9 (1): 3–12. doi:10.1007/s00500-003-0328-5. ISSN 1432-7643. http://link.springer.com/10.1007/s00500-003-0328-5. 
  7. Jin, Yaochu; Wang, Handing; Chugh, Tinkle; Miettinen, Kaisa (June 2019). "Data-Driven Evolutionary Optimization: An Overview and Case Studies". IEEE Transactions on Evolutionary Computation 23 (3): 442–458. doi:10.1109/TEVC.2018.2869001. ISSN 1089-778X. https://linkinghub.elsevier.com/retrieve/pii/S2210650211000198. 
  8. Eiben, A.E.; Smith, J.E. (2015). "Nonstationary and Noisy Function Optimisation". Introduction to Evolutionary Computing. Natural Computing Series (2nd ed.). Berlin, Heidelberg: Springer. pp. 185–194. doi:10.1007/978-3-662-44874-8. ISBN 978-3-662-44873-1. http://link.springer.com/10.1007/978-3-662-44874-8. 
  9. Sudholt, Dirk (2015), Kacprzyk, Janusz; Pedrycz, Witold, eds., "Parallel Evolutionary Algorithms" (in en), Springer Handbook of Computational Intelligence (Berlin, Heidelberg: Springer): pp. 929–959, doi:10.1007/978-3-662-43505-2_46, ISBN 978-3-662-43504-5, http://link.springer.com/10.1007/978-3-662-43505-2_46, retrieved 2023-02-27 
  10. Khalloof, Hatem; Mohammad, Mohammad; Shahoud, Shadi; Duepmeier, Clemens; Hagenmeyer, Veit (2020-11-02). "A Generic Flexible and Scalable Framework for Hierarchical Parallelization of Population-Based Metaheuristics" (in en). Proceedings of the 12th International Conference on Management of Digital EcoSystems. Virtual Event United Arab Emirates: ACM. pp. 124–131. doi:10.1145/3415958.3433041. ISBN 978-1-4503-8115-4. https://dl.acm.org/doi/10.1145/3415958.3433041. 
  11. Jähne, Paul (2016). Mayr, Heinrich Christian. ed (in en). Overview of the current state of research on parallelisation of evolutionary algorithms on graphic cards. Bonn: Gesellschaft für Informatik, FRG. ISBN 978-3-88579-653-4. OCLC 962381748. https://subs.emis.de/LNI/Proceedings/Proceedings259/2163.pdf. 
  12. 12.0 12.1 12.2 12.3 Miettinen, Kaisa (2008). "Introduction to Multiobjective Optimization: Noninteractive Approaches". in Branke, Jürgen (in en). Multiobjective Optimization: Interactive and Evolutionary Approaches. Lecture Notes in Computer Science. 5252. Berlin, Heidelberg: Springer. pp. 1–26. doi:10.1007/978-3-540-88908-3. ISBN 978-3-540-88907-6. http://link.springer.com/10.1007/978-3-540-88908-3. 
  13. 13.0 13.1 13.2 13.3 13.4 13.5 Jakob, Wilfried; Blume, Christian (2014-03-21). "Pareto Optimization or Cascaded Weighted Sum: A Comparison of Concepts" (in en). Algorithms 7 (1): 166–185. doi:10.3390/a7010166. ISSN 1999-4893. 
  14. 14.0 14.1 Deb, Kalyanmoy (2008). "Introduction to Evolutionary Multiobjective Optimization". in Branke, Jürgen (in en). Multiobjective Optimization: Interactive and Evolutionary Approaches. Lecture Notes in Computer Science. 5252. Berlin, Heidelberg: Springer. pp. 58–96. doi:10.1007/978-3-540-88908-3. ISBN 978-3-540-88907-6. http://link.springer.com/10.1007/978-3-540-88908-3. 
  15. Fonseca, Carlos M.; Fleming, Peter J. (1995). "An Overview of Evolutionary Algorithms in Multiobjective Optimization" (in en). Evolutionary Computation 3 (1): 1–16. doi:10.1162/evco.1995.3.1.1. ISSN 1063-6560. https://direct.mit.edu/evco/article/3/1/1-16/733. 
  16. Eckart, Zitzler; Marco, Laumanns; Lothar, Thiele (2001). "SPEA2: Improving the strength pareto evolutionary algorithm" (in en). Technical Report, Nr. 103. Computer Engineering and Networks Laboratory (TIK) (ETH Zürich 2001). doi:10.3929/ethz-a-004284029. 
  17. Deb, K.; Pratap, A.; Agarwal, S.; Meyarivan, T. (2002). "A fast and elitist multiobjective genetic algorithm: NSGA-II". IEEE Transactions on Evolutionary Computation 6 (2): 182–197. doi:10.1109/4235.996017. https://ieeexplore.ieee.org/document/996017. 
  18. Deb, Kalyanmoy; Jain, Himanshu (2014). "An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point-Based Nondominated Sorting Approach, Part I: Solving Problems With Box Constraints". IEEE Transactions on Evolutionary Computation 18 (4): 577–601. doi:10.1109/TEVC.2013.2281535. ISSN 1089-778X. https://ieeexplore.ieee.org/document/6600851. 
  19. Jain, Himanshu; Deb, Kalyanmoy (2014). "An Evolutionary Many-Objective Optimization Algorithm Using Reference-Point Based Nondominated Sorting Approach, Part II: Handling Constraints and Extending to an Adaptive Approach". IEEE Transactions on Evolutionary Computation 18 (4): 602–622. doi:10.1109/TEVC.2013.2281534. ISSN 1089-778X. https://ieeexplore.ieee.org/document/6595567. 
  20. Miettinen, Kaisa (1998). Nonlinear Multiobjective Optimization. International Series in Operations Research & Management Science. 12. Boston, MA: Springer US. doi:10.1007/978-1-4615-5563-6. ISBN 978-1-4613-7544-9. http://link.springer.com/10.1007/978-1-4615-5563-6. 
  21. 21.0 21.1 Jakob, Wilfried (2021) (in en), Applying Evolutionary Algorithms Successfully: A Guide Gained from Real-world Applications, Karlsruhe, Germany: Karlsruhe Institute of Technology (KIT), doi:10.5445/ir/1000135763, https://publikationen.bibliothek.kit.edu/1000135763