Top Banner
A Matlab Tour on Some AIS A Matlab Tour on Some AIS Algorithms Algorithms BIC 2005: BIC 2005: International Symposium on Bio-Inspired Computing International Symposium on Bio-Inspired Computing Johor, MY, 10 Johor, MY, 10 th th September 2005 September 2005 Dr. Leandro Nunes de Castro [email protected] http://lsin.unisantos.b/lnunes Catholic University of Santos - UniSantos/Brazil
53

2005: A Matlab Tour on Artificial Immune Systems

Dec 15, 2014

Download

Technology

BIC 2005 (Biologically Inspired Computing Conference), Johor, Malaysia
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: 2005: A Matlab Tour on Artificial Immune Systems

A Matlab Tour on Some AIS A Matlab Tour on Some AIS AlgorithmsAlgorithms

BIC 2005: BIC 2005: International Symposium on Bio-Inspired ComputingInternational Symposium on Bio-Inspired Computing

Johor, MY, 10Johor, MY, 10thth September 2005 September 2005

Dr. Leandro Nunes de [email protected]

http://lsin.unisantos.b/lnunesCatholic University of Santos - UniSantos/Brazil

Page 2: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro2

CLONALG: A Clonal Selection Algorithm

aiNet: An Artificial Immune Network

ABNET: An Antibody Network Opt-aiNet: An Optimization

Version of aiNet Discussion

Outline

Page 3: 2005: A Matlab Tour on Artificial Immune Systems

CLONALG

A Clonal Selection Algorithm

Page 4: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro4

Increasing interest in biologically inspired systems

Systemic view of the immune system Main goals:

Provide a better understanding of the immune system

Solve engineering problems Study immune learning and memory

CLONALG

Page 5: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro5

Clonal Selection Principle

Proliferation(Cloning)

Differentiation

Plasma cells

Memory cellsSelection

Antigens

M

M

Page 6: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro6

Continuous Learning

Antigen A AntigensA + B

Primary Response SecondaryResponse

lag

Response toantigen A

Responseto antigen B

An

tibod

y co

nce

ntr

atio

n

Days

lag

Page 7: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro7

Affinity Maturation

The cells that are most stimulated by the antigens suffer a hypermutation process single point, short deletions and sequence exchange

The hypermutation is proportional to antigenic affinity

The higher the cell affinity with the antigen, the greater its probability of being selected for differentiation and memory, thus surviving longer

The mutation rate is proportional to antigenic affinity

The editing process promotes a better exploration of the possible antigenic receptors

Page 8: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro8

Hypermutation Editing

Antigen-binding sites

Aff

inity A

A1

C1

C

B

B1

Page 9: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro9

CLONALG: Block Diagram

Maturate

Pr

M

Select

Clone

Pn

C

C*

(1)

(2)

(3)

(4)

(5)

Re-select

Nd

(6)

Page 10: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro10

1) Generate a set (P) of candidate solutions, composed of the subset of memory cells (M) added to the remaining (Pr) population (P = Pr + M)

2) Determine the n best individuals of the population (Pn), based on an affinity measure

3) Clone (reproduce) these n best individuals of the population, giving rise to a temporary population of clones (C). The clone size is an increasing function of the affinity with the antigen;

4) Submit the population of clones to a hypermutation scheme, where the hypermutation is proportional to the affinity of the antibody with the antigen. A maturated antibody population is generated (C*);

5) Re-select the improved individuals from C* to compose the memory set. Some members of the P set can be replaced by other improved members of C*;

6) Replace d low affinity antibodies of the population, maintaining its diversity.

CLONALG: Algorithm

Page 11: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro11

Test Problem I Pattern recognition (learning)

Cross-reactivity (generalization capability)

Page 12: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro12

Pattern Recognition (Learning)CLONALG - Performance I

00 generations

10 generations

20 generations

50 generations

75 generations

100 generations

150 generations

200 generations

250 generations

Page 13: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro13

Optimization function maximization

Test Problem II200 individuals

randomly distributed

Page 14: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro14

Multimodal Optimization (Maximization) Comparison with the Standard Genetic Algorithm (GA)

CLONALG - Performance II

GA

CLONALG

Page 15: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro15

Optimization Travelling Salesman Problem (TSP)

Test Problem III

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

7

1

8

14

2

15

3

4

1112

13

17

23

27 30

26

19

2124

29

2825

22

20

18

166

9

10

5

TSP

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

7

1

8

14

2

15

3

4

1112

13

17

23

27 30

26

19

2124

29

2825

22

20

18

166

9

10

5

Cities Optimal Path (48872 um)

Page 16: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro16

Travelling Salesman (TSP) (Minimization)

CLONALG - Performance III

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

19

21

12

4

1127 30

26

24

29

28

205

10

22

257

1

8

14

2

3

15

6

9

16

18

13

17

23

TSP - 50 gen

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

10

5

7

1

8

14

2

15

3

1323

27 30

174

1112

6

9

16

19

26

24

29

2825

22

20

2118

TSP - 200 gen

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

1000

2000

3000

4000

5000

6000

7000

8000

9000

100004

1

15

20

6

11

28

16

18

26

27

22

24

25

102

199

7

21

30

3

8

17

13

14

23

29

5

12

TSP - 00 gen

0 1000 2000 3000 4000 5000 6000 7000 8000 9000 100000

1000

2000

3000

4000

5000

6000

7000

8000

9000

10000

1

2

5

10

9

616

2313

1211

15

3

417

27 30

26

19

21

20

22

2528

29

24

18

7

8

14

TSP - 150 gen

Page 17: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro17

CLONALG: Discussion

General purpose algorithm inspired by the clonal selection and affinity maturation processes

Capabilities: learning and maintenance of high quality memory optimization

Crude version GA CSA:

same coding schemes different sources of inspiration related sequence of steps

Page 18: 2005: A Matlab Tour on Artificial Immune Systems

aiNet

An Artificial Immune Network

Page 19: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro19

Immune Network Theory

1

2

3

Ag

A ctiva tion

S upp res s ion

p1

i1

p2

i2

p3

i3

Ag(epitope)

Dynamics of the Immune System

Foreign stimulus

Internal image

Anti-idiotypic set

Recognizingset

Page 20: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro20

aiNet: Basic Principles (I) Definition:

The evolutionary artificial immune network, named aiNet, is an edge-weighted graph, not necessarily fully connected, composed of a set of nodes, called cells, and sets of node pairs called edges with a number assigned called weight, or connection strength, specified to each connected edge.

0.1 0.5

0.1 0.1

0.3 0.4

0.1

1 5 2

3 4 6

7

8 9

Page 21: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro21

Features: knowledge distributed among the cells competitive learning (unsupervised) constructive model with pruning phases generation and maintenance of diversity

Growing: clonal selection principle

Learning: directed affinity maturation

Pruning: natural death rate (low stimulated cells)

aiNet: Basic Principles (II)

Page 22: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro22

aiNet: Training Algorithm

At each generation: For each Ag

Affinity with the antigen (Ai) Agi-Ab

Clonal selection (n cells) Ai

Cloning Ai

Directed maturation (mutation) 1/Ai

Re-selection (%) Ai

Natural death (d) 1/Ai

Affinity between the network cells (Dii) Ab-Ab

Clonal suppression (s) Dii : (m - memory)

Mt [Mt;m]

Network suppression (s) Dii : (M Mt) M [M;meta]

Page 23: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro23

(affinity)

(clonal selection)

(directed

mutation)

(Re-selection)

(self discrimination)

(clonal suppression)

Stopping criterion: or fixed number of generations

L

iii AgAbA

1

2)(

kkkkk ),(μ AgAbAbAb

L

iii AbAbD

1

2)(

nkk kk ,...1 ,maxarg AbAg

%ζ,...,1 ,maxarg kk kk AbAg

kkk AbAb minarg

aiNet: Arithmetic

δA

Page 24: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro24

Test Problem I

Five Linearly Separable Classes

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

1

x

y

Training Patterns

Page 25: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro25

aiNet - Performance I

Minimal Spanning Tree

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

Number of Clusters (Valleys)

1

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Page 26: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro26

0 0.2 0.4 0.6 0.8 1

0

0.2

0.4

0.6

0.8

1

1

2

3

4

5

6

7

8

9

10

11

12

13

14

Final Network Structure

aiNet - Performance I

Page 27: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro27

2-Donuts: 500 samples

Test Problem II

-2-1

01

2

-2

0

2

4-1.5

-1

-0.5

0

0.5

1

1.5

Page 28: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro28

1

0 5 10 15 20 25 30 350

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

Number of Clusters (Valleys)

Minimal Spanning Tree

aiNet - Performance II

Page 29: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro29

-1-0.5

00.5

1

-1

0

1

2

3-1

-0.5

0

0.5

1

1.5

Final Network Structure

aiNet - Performance II

Page 30: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro30

aiNet: Discussion

Iterative learning Robustness with low redundancy

(data compression) Clustering Related with neural networks User-defined parameters Gave rise to a number of other

algorithms

Page 31: 2005: A Matlab Tour on Artificial Immune Systems

ABNET

An Antibody Network

Page 32: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro32

ABNET

A single-layer feedforward neural network trained using ideas from the immune system

Constructive architecture with pruning phases

Boolean weights

Page 33: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro33

ABNET: Basic Functioning (I)

Ab population

Ab re-selection

Clone Death

Affinity maturation

Most stimulated cell Non-stimulated cell

Ab selection

Antigenic stimuli

Neurons (k)

Competition

Split Prune

Weightupdate

Winner Inactive neuron

Input patterns

Page 34: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro34

Affinity measure (Hamming distance):

Main loop of the algorithm Choose randomly an antigen (pattern) Determine the cell Abk with highest affinity Update the weight vector of this cell Increase the concentration level (j) of this

cell Attribute va = k

kkk AbAg maxarg

ABNET: Basic Functioning (I)

Page 35: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro35

ABNET: Growing

}1τ|{ where, maxarg

jjjOj

Os AbAb

Page 36: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro36

ABNET: Pruning

Page 37: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro37

ABNET: Weight Update

1 0 0 0 1 0 1 1

0 0 1 1 1 1 1 0

0 1 1 1 1 1 1 0

Ag

Abk (Affinity: 5)

Ag

Abk (Affinity: 6)

1 0 0 0 1 0 1 1

Updating ( = 1)

1 0 0 0 1 0 1 1

0 0 1 1 1 1 1 0

0 1 1 1 0 1 1 0

Ag

Abk (Affinity: 5)

Ag

Abk (Affinity: 7)

1 0 0 0 1 0 1 1

Updating ( = 2)

Page 38: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro38

01

23

45

0.4

0.3

0.2

0.1

020

40

60

80

100

Noise Tolerance - ABNET

Noise level

Cla

ssifi

catio

n (%

)

ABNET - Performance2) Cross-reactivity

(generalization)

(a) 13.75%

Noise tolerance:

(b) 13.75%

Page 39: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro39

ABNET: Discussion

Performs clustering (data reduction) Easily implemented in hardware Robust to solve binary tasks Adapted to solve real-valued problems,

both clustering and classification

Page 40: 2005: A Matlab Tour on Artificial Immune Systems

Opt-aiNet

An Optimization version of aiNet

Page 41: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro41

Introduction

The algorithm for opt-aiNet is an adaptation of a discrete artificial immune network usually applied in data analysis

Features of opt-aiNet: population size dynamically adjustable exploitation and exploration of the search-

space capability of locating multiple optima automatic stopping criterion

Page 42: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro42

Immune Networks

N. Jerne suggested that immune cells and molecules present antigenic peptides

p1

i1

p2

i2

p3

i3

Ag(epitope)

Molecular interactions in the immune system

Foreign stimulus

Internal image

Anti-idiotypic set

Recognizing set

i1

px

Non-specific set

Page 43: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro43

opt-aiNet

1. Randomly initialize a population of cells (initial number not relevant)

2. While not [constant memory population], do2.1Calculate the fitness and normalize the vector of fitnesses.2.2Generate a number Nc of clones for each network cell.2.3Mutate each clone proportionally to the fitness of its parent cell, but

keep the parent cell.2.4Determine the fitness of all individuals of the population.2.5For each clone, select the cell with highest fitness and calculate the

average fitness of the selected population.2.6 If the average fitness of the population is not significantly

different from the previous iteration, then continue. Else, return to step 2.1

2.7Determine the affinity of all cells in the network. Suppress all but the highest fitness of those cells whose affinities are less than the suppression threshold s and determine the number of network cells, named memory cells, after suppression.

2.8Introduce a percentage d% of randomly generated cells and return to step 2.

3. EndWhile

Page 44: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro44

Related Strategies

CLONALG: encoding, static population size, no inter-

cell interaction, different mutation scheme Evolution Strategies

equal to ( + )-ES, where = N and = Nc; both use Gaussian mutation, but with different standard deviations, static population size, no diversity introduction, no direct interaction within the population

Page 45: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro45

Simulation Results (I)

Multi Function

Page 46: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro46

Simulation Results (II)

Roots Function

Page 47: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro47

Simulation Results (III)

Schaffer’s Function

Page 48: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro48

Opt-aiNet: Discussion

The algorithm is an adaptation of an immune network model designed to perform data analysis

Features: Exploration and exploitation of the search-

space Double-plastic search Automatic convergence criteria

Adapted to solve combinatorial and dynamic optimization

Page 49: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro49

Final Comments

Biological Inspiration utility and extension improved comprehension of natural phenomena

Example based learning, where different pattern categories are represented by adaptive memories of the system

An iterative artificial immune network

Page 50: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro50

CLONALG high degree of parallelism by controlling the hipermutation rate an

initial search for most general characteristics can be performed, followed by the search for smaller details

trade off between the clone size and the convergence speed

possibility of using heuristics to obtain global optima for problems like TSP

Final Comments

Page 51: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro51

aiNet Models continuous spaces without the need of

integration Iterative model dynamic models (DE) Robustness with low redundancy Clustering without a direct measure of

distance* RNA: knowledge distributed along the

connections aiNet: knowledge distributed in the cells large amount of user defined parameters Specific cells general cells

ABNET clustering, or grouping of similar patterns capability of solving binary tasks

Final Comments

Page 52: 2005: A Matlab Tour on Artificial Immune Systems

BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro52

Final Comments

Opt-aiNet ;lsdkasdkj

Page 53: 2005: A Matlab Tour on Artificial Immune Systems

[email protected]

Questions? Comments?