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
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
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
http://lsin.unisantos.b/lnunesCatholic University of Santos - UniSantos/Brazil
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
CLONALG
A Clonal Selection Algorithm
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
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
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
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
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
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)
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
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro11
Test Problem I Pattern recognition (learning)
Cross-reactivity (generalization capability)
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
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro13
Optimization function maximization
Test Problem II200 individuals
randomly distributed
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
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro15
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
aiNet
An Artificial Immune Network
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
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
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)
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]
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
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
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
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
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
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
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
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
ABNET
An Antibody Network
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
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
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)
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro35
ABNET: Growing
}1τ|{ where, maxarg
jjjOj
Os AbAb
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro36
ABNET: Pruning
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)
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%
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
Opt-aiNet
An Optimization version of aiNet
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
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
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
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
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro45
Simulation Results (I)
Multi Function
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro46
Simulation Results (II)
Roots Function
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro47
Simulation Results (III)
Schaffer’s Function
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
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
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
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
BIC 2005 - A Matlab Tour on Some AIS - Dr. Leandro Nunes de Castro52