Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

44
Overview of Methods for Engineering Autonomic Self-Aware Systems Artificial Immune Systems Designed by Mark Read

description

Artificial Immune Systems by Mark read

Transcript of Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Page 1: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Overview of Methods for Engineering Autonomic Self-Aware

Systems

Artificial Immune Systems

Designed by Mark Read

Page 2: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

The immune system

• There are many features of the immune system that are attractive to engineers [2]:

– Distribution and self-organisation

– Learning, adaption and memory

– Pattern recognition

– Classification

– Homeostasis

Designed by Mark Read

Page 3: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

What is the immune system?

• Classic View: complex system of cellular and molecular components having the primary function of distinguishing self from not self and defense against foreign organisms or substances

• Cognitive View: The immune system is a cognitive system whose primary role is to provide body maintenance

• Danger View : The immune system recognisesdangerous agents and not non-self

Designed by Mark Read

Page 4: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Artificial Immune Systems (AIS)

• “AIS are adaptive systems inspired by theoretical immunology and observed immune functions, principles and models, which are applied to problem solving” [1]

• Several flavours of AIS have emerged based on immunological theory:– Clonal selection theory– Immune network theory– Negative selection– Danger theory

• … but new flavours are continually emerging

Designed by Mark Read

Page 5: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Clonal Selection AIS

• Clonal selection: competition for resource drives immune system cells to mutate and better recognize pathogens.

• This process drives the immune response from weakly recognising a pathogen and mounting an ineffective response, to being highly specific and effective.

Designed by Mark Read

Page 6: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Clonal Selection AIS

• Basic algorithm [4]:

• Clonal selection AIS are typically used for pattern recognition and classification problems [6]

Designed by Mark Read

Page 7: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Immune Network Theory AIS

• Cells of the IS recognize not only protein structures expressed by pathogens, but each other also

• Through this self-recognition the IS forms positive and negative feedback networks that modulate the immune response [3]

Designed by Mark Read

Page 8: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Immune Network Theory AIS

• Basic algorithm [4]:

• Used in data clustering and classification applications [6]

Designed by Mark Read

Page 9: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Negative Selection AIS

• Inspired by notions of central tolerance:• The random generation of receptors on IS cells

allows the IS to effectively cover the space of protein structures that fast-evolving pathogens use (often to evade immune detection).

• Central tolerance entails deleting IS cells that recognise proteins of the host, and thus prevents autoimmunity.

• Though negative selection is known to be imperfect – all healthy beings contain self-reactive cells – it has been effectively used in intrusion detection systems

Designed by Mark Read

Page 10: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Negative Selection AIS

Basic Algorithm [4]:

Used in intrusion detection systems

Designed by Mark Read

Page 11: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Danger Theory AIS

• Rather than detect the presence of non-host entities, the immune system recognisesdamage to tissues (danger) and associates the damage with what is found in the tissues [5]

• If there is no damage in the tissues, immune cells that recognise structures there are instead suppressed

Designed by Mark Read

Page 12: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Danger Theory AIS

• Basic algorithm:– Create pool of dendritic cells (DCs)– Use some DCs to sample available antigen, and perceive

danger/safe signals

• Has found extensive use in anomaly detection [6]

Designed by Mark Read

Page 13: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Engineering AIS

• How to engineer an AIS for a particular application domain [1]? :

Designed by Mark Read

Page 14: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Engineering AIS

• 1. decide on appropriate representation of the problem’s data. This facilitates mapping the problem onto immune concepts, which affects how the system finds solutions.

• 2. decide on appropriate affinity measures. These quantify how elements of the system interact with the problem environment, and with each other.

• 3. Select algorithm(s) to operate over immune elements of the system

Designed by Mark Read

Page 15: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Future directions in AIS

• Impasse, better capture natural system

• Modelling/conceptual framework

• Features of problem domains

Designed by Mark Read

Page 16: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

References

• [1] De Castro, L., Timmis, J. Artificial Immune Systems: A New Computational Intelligence Approach. Springer, 2002

• [2] Read, M., Andrews, P., Timmis, J. An Introduction to Artificial Immune Systems. The handbook of natural Computing, edited by Grzegorz Rozenberg, Thomas Back and Joost Kok. Springer, 2011

• [3] Niels K. Jerne. Towards a network theory of the immune system. Ann. Immunol. (Inst. Pasteur), 125C:373–389, 1974

• [4] Freitas, A., Timmis, J. - Revisiting the Foundations of ArtificialImmune Systems for Data Mining. IEEE Transactions on Evolutionary Computation 11(4) pp. 521-540 (2007)

• [5] Polly Matzinger. Tolerance, danger, and the extended family. Annual Review of Immunology, 12:991–1045, April 1994

• [6] E. Hart and J. Timmis. Application Areas of AIS: The Past, Present and the Future. Journal of Applied Soft Computing 8(1). pp.191-201. 2008

Designed by Mark Read

Page 17: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Overview of Methods for Engineering Autonomic Self-Aware

Systems

Evolutionary Algorithms

Designed by Gusz Eiben

Page 18: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

The Main EC Metaphor

EVOLUTION

Environment

Individual

Fitness

PROBLEM SOLVING

Problem

Candidate Solution

Quality

Quality chance for seeding new solutionsCV

Fitness chances for survival and reproduction

Fitness in nature: observed, 2ndary, EC: primary

Designed by Gusz Eiben

Page 19: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

General scheme of EAs

Population

ParentsParent selection

Survivor selection

Offspring

Recombination

(crossover)

Mutation

Intialization

Termination

Designed by Gusz Eiben

Page 20: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

EAs as problem solvers

• EAs fall into the category of “generate and test” algorithms

• They are stochastic, population-based algorithms

• Variation operators (recombination and mutation) create the necessary diversity and thereby facilitate novelty

• Selection reduces diversity and acts as a force pushing quality

• Traditionally seen as optimizers (also in data mining applications)

• Lately as the engine behind adaptation

Designed by Gusz Eiben

Page 21: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Two pillars of evolution

There are two competing forces

Increasing population

diversity by genetic

operators

mutation

recombination

Push towards novelty

Decreasing populationdiversity by selection

of parents

of survivors

Push towards quality

Designed by Gusz Eiben

Page 22: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Common model of evolutionaryprocesses

• Population of individuals

• Individuals have a fitness

• Variation operators: crossover, mutation

• Selection towards higher fitness

– “survival of the fittest” and

– “mating of the fittest”

Neo Darwinism:

Evolutionary progress towards higher life forms=

Optimization according to some fitness-criterion(optimization on a fitness landscape)

Designed by Gusz Eiben

Page 23: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Main EA components

• Representation

• Population

• Selection (parent selection, survivor selection)

• Variation (mutation, recombination)

• Initialisation

• Termination condition

Designed by Gusz Eiben

Page 24: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Representation

• Role: provides code for candidate solutions that can be manipulated by variation operators

• Leads to two levels of existence– phenotype: object in original problem context, the outside

– genotype: code to denote that object, the inside (chromosome, “digital DNA”)

• Implies two mappings:

– Encoding : phenotype=> genotype (not necessarily one to one)

– Decoding : genotype=> phenotype (must be one to one)

• Chromosomes contain genes, which are in (usually fixed) positions called loci (sing. locus) and have a value (allele)

Designed by Gusz Eiben

Page 25: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Genotype spacePhenotype space

Encoding

(representation)

Decoding

(inverse representation)

B 0 c 0 1 c d

G 0 c 0 1 c d

R 0 c 0 1 c d

Representation 2

In order to find the global optimum, every feasible solution must be represented in genotype space

Designed by Gusz Eiben

Page 26: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Evaluation (fitness) function

• Role:– Represents the task to solve, the requirements to adapt to (can be

seen as “the environment”)– enables selection (provides basis for comparison)– e.g., some phenotypic traits are advantageous, desirable, e.g. big ears

cool better, hese traits are rewarded by more offspring that will expectedly carry the same trait

• A.k.a. quality function or objective function• Assigns a single real-valued fitness to each phenotype which

forms the basis for selection– So the more discrimination (different values) the better

• Typically we talk about fitness being maximised– Some problems may be best posed as minimisation problems, but

conversion is trivial

Designed by Gusz Eiben

Page 27: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Population

• Role: holds the candidate solutions of the problem as individuals (genotypes)

• Formally, a population is a multiset of individuals, i.e. repetitions are possible

• Population is the basic unit of evolution, i.e., the population is evolving, not the individuals

• Selection operators act on population level

• Variation operators act on individual level

Designed by Gusz Eiben

Page 28: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Population 2

• Some sophisticated EAs also assert a spatial structure on the population e.g., a grid

• Selection operators usually take whole population into account i.e., reproductive probabilities are relative to current generation

• Diversity of a population refers to the number of different fitnesses / phenotypes / genotypes present (note: not the same thing)

Designed by Gusz Eiben

Page 29: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Selection

Role: • Identifies individuals

– to become parents

– to survive

• Pushes population towards higher fitness

• Usually probabilistic– high quality solutions more likely to be selected than low quality

– but not guaranteed

– even worst in current population usually has non-zero probability of being selected

• This stochastic nature can aid escape from local optima

Designed by Gusz Eiben

Page 30: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Example: roulette wheel selection

fitness(A) = 3

fitness(B) = 1

fitness(C) = 2

A C

1/6 = 17%

3/6 = 50%

B

2/6 = 33%

Selection mechanism example

In principle, any selection mechanism can be used for

parent selection as well as for survivor selection

Designed by Gusz Eiben

Page 31: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Survivor selection

• A.k.a. replacement

• Most EAs use fixed population size so need a way of going from (parents + offspring) to next generation

• Often deterministic (while parent selection is usually stochastic)

– Fitness based : e.g., rank parents+offspring and take best

– Age based: make as many offspring as parents and delete all parents

• Sometimes a combination of stochastic and deterministic (elitism)

Designed by Gusz Eiben

Page 32: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Variation operators

• Role: to generate new candidate solutions

• Usually divided into two types according to their arity(number of inputs):– Arity 1 : mutation operators

– Arity >1 : Recombination operators

– Arity = 2 typically called crossover

– Arity > 2 is formally possible, seldomly used in EC

• There has been much debate about relative importance of recombination and mutation– Nowadays most EAs use both

– Variation operators must match the given representation

Designed by Gusz Eiben

Page 33: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Mutation

• Role: causes small, random variance

• Acts on one genotype and delivers another

• Element of randomness is essential and differentiates it from other unary heuristic operators

• Importance ascribed depends on representation and historical dialect:– Binary GAs – background operator responsible for preserving and

introducing diversity

– EP for FSM’s/ continuous variables – only search operator

– GP – hardly used

• May guarantee connectedness of search space and hence convergence proofs

Designed by Gusz Eiben

Page 34: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

before

1 1 1 0 1 1 1after

1 1 1 1 1 1 1

Mutation example

Designed by Gusz Eiben

Page 35: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Recombination

• Role: merges information from parents into offspring

• Choice of what information to merge is stochastic

• Most offspring may be worse, or the same as the parents

• Hope is that some are better by combining elements of genotypes that lead to good traits

• Principle has been used for millennia by breeders of plants and livestock

Designed by Gusz Eiben

Page 36: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

1 1 1 1 1 1 1 0 0 0 0 0 0 0

Parents

cut cut

Offspring

Recombination example

1 1 1 0 0 0 0 0 0 0 1 1 1 1

Designed by Gusz Eiben

Page 37: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Initialisation / Termination

• Initialisation usually done at random, – Need to ensure even spread and mixture of possible allele values

– Can include existing solutions, or use problem-specific heuristics, to “seed” the population

• Termination condition checked every generation – Reaching some (known/hoped for) fitness

– Reaching some maximum allowed number of generations

– Reaching some minimum level of diversity

– Reaching some specified number of generations without fitness improvement

Designed by Gusz Eiben

Page 38: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

What are the different types of EAs

• Historically different flavours of EAs have been associated with different data types to represent solutions– Binary strings : Genetic Algorithms

– Real-valued vectors : Evolution Strategies

– Finite state Machines: Evolutionary Programming

– LISP trees: Genetic Programming

• These differences are largely irrelevant, best strategy – choose representation to suit problem

– choose variation operators to suit representation

• Selection operators only use fitness and so are independent of representation

Designed by Gusz Eiben

Page 39: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Typical behaviour of an EAStages in optimising on a 1-dimensional fitness landscape

Early stage:

quasi-random population distribution

Mid-stage:

population arranged around/on hills

Late stage:

population concentrated on high hills

Designed by Gusz Eiben

Page 40: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Typical run: progression of fitness

Typical run of an EA shows so-called “anytime behavior”

Best fitn

ess in p

opula

tion

Time (number of generations)

Designed by Gusz Eiben

Page 41: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Evolutionary Algorithms in context

• There are many views on the use of EAs as robust problem solving tools

• For most problems a problem-specific tool may:– perform better than a generic search algorithm on most

instances,

– have limited utility,

– not do well on all instances

• Evolutionary Algorithms:– Provide rather stable performance over a range of problems and

instances

– Can be easily ported from one problem to another one

– Can be hybridized with existing problem specific heuristics

Designed by Gusz Eiben

Page 42: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Scale of “all” problems

Perf

orm

ance o

f m

eth

ods o

n p

roble

ms

Random search

Special, problem tailored method

Evolutionary algorithm

EAs as problem solvers: Goldberg view (1989)

Designed by Gusz Eiben

Page 43: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Summary

Evolutionary Algorithms:• Are population-based, stochastic search methods

• Can be used for optimization and as “adaptive engine”

• Can be hybridized with problem specific heuristics

• Well suited for parallel execution

• Can be easily ported to new problems

An EA is the second best solver for any problem

Designed by Gusz Eiben

Page 44: Academic Course: 05 Overview of Methods for Engineering Autonomic Self-Aware Systems

Further reading

• A.E. Eiben, Evolutionary computing: the most powerful problem solver in the universe?, Dutch Mathematical Archive (NederlandsArchief voor Wiskunde), vol. 5/3, nr. 2, 126-131, 2002

• Eiben-Smith book

Designed by Gusz Eiben