samyyc.dev
LOC::Macau, China

..UTC+8

samyyc.dev

-- BPM

Fri Oct 13 2023

AI Notes - Biomimetic Algorithms

#91

/

samyyc

/

427 words

/

Updated 1148 days ago

/

[中文]

AI Notes - Biomimetic Algorithms

Biomimetics is a scientific approach to building technical systems by imitating the functions and behavior of biological systems

Biomimetic algorithms approximate results through many rounds of evolution, and that evolution follows a law of nature: the strong survive and the weak are eliminated; only the fittest survive

Examples of Biomimetic Algorithms

  • Genetic algorithm (simulates biological evolution)
  • Ant colony algorithm (imitates how ants find paths)
  • Artificial neural networks

Genetic Algorithm

A genetic algorithm is a search heuristic inspired by Darwin's theory of natural evolution

It reflects the process of natural selection, in which the fittest individuals are selected to reproduce and produce the next generation of offspring

Components

  1. Encoding (initialization)
  2. Fitness function
  3. Selection
  4. Crossover
  5. Mutation

Main Process

  1. Randomly generate an initial population
  2. Start the main loop (termination condition: the iteration count or fitness requirement is met)
    1. Run the strategy and calculate the fitness of every individual in the current population
    2. Select elites from the current population as parents for the next generation
    3. Pair the selected elite parents
    4. Mutate the offspring with a very small probability
    5. Add the offspring to the new population

Applications

Function optimization, combinatorial optimization

Optimization is the process of changing parameters to maximize or minimize an objective function

The set of all possible solutions (parameter values) forms the search space

Within this search space, there is a set of points that are the optimal solutions. The purpose of optimization is to find such a set of points in the search space

Pros and Cons

Pros: strong global search; unlikely to get stuck at a local optimum

Cons:

  • High computational cost
  • It is stochastic, so there is no guarantee that the solution will be optimal

Jigsaw Puzzle

The Puzzle's Genes

If we treat the 128 semi-transparent triangles as biological individuals, their appearance is determined by the triangles

Each triangle can be seen as a gene with different attributes

Factors that determine a triangle:

  • Color
  • Position: coordinates of the three vertices
  • Transparency

Randomly initialize 128 triangles

Inheritance and Mutation

New offspring are reproduced from parents

  • Inheritance
  • Mutation

Inheritance:

  • Copying: gene copying
  • Crossover: genes combine freely and cross over

Inheritance does not produce new shapes

Copying

Purpose: preserve the parent's own good genes

Method: copy the genes to the offspring unchanged

Crossover

Combine genes from both parents to produce new offspring

Mutation:

New genes are created by gene mutation

Triangle mutation: completely random mutation, or a slight change based on the original triangle

Fitness function: determines whether an individual should be eliminated