42
Artificial Immune Systems EXTRA READING: Papers: An interdisciplinary perspective on artificial immune systems J. Timmis, P. Andrews, N. Owens, E. Clark (2008) The Evolution of Emergent Organization in Immune System Gene Libraries by Hightower, Forrest and Perelson (1995) An Immunological Approach to Change Detection by D’haeseleer, Forrest and Helman (1995) The Baldwin effect in the immune system: learning by somatic hypermutation by Hightower, Forrest and Perelson (1996) Artificial Immune Systems: Part 1 – Basic Theory and Applications by Leandro Nunes de Castro and Fernando Von Zuben (1999) An Evolutionary Immune Network for Data Clustering by Leandro Nunes de Castro and Fernando Von Zuben (2000)

Artificial Immune Systems - UCL

  • Upload
    others

  • View
    10

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Artificial Immune Systems - UCL

Artificial Immune Systems

EXTRA READING: Papers: •  An interdisciplinary perspective on artificial immune systems J. Timmis, P. Andrews, N. Owens, E. Clark (2008) • The Evolution of Emergent Organization in Immune System Gene Libraries by Hightower, Forrest and Perelson (1995) • An Immunological Approach to Change Detection by D’haeseleer, Forrest and Helman (1995) • The Baldwin effect in the immune system: learning by somatic hypermutation by Hightower, Forrest and Perelson (1996) • Artificial Immune Systems: Part 1 – Basic Theory and Applications by Leandro Nunes de Castro and Fernando Von Zuben (1999) • An Evolutionary Immune Network for Data Clustering by Leandro Nunes de Castro and Fernando Von Zuben (2000)

Page 2: Artificial Immune Systems - UCL

Human Immune Systems

•  Like our brains, the human immune system is one of the most advanced in the animal kingdom.

•  Brains inspired computational techniques known as neural networks. Immune systems have also (much more recently) inspired computational techniques.

•  Before we can look at artificial immune systems, we need some knowledge of how our immune systems work.

•  It’s extremely complicated, but we don’t need to look at everything – just the important parts.

•  We’ll start by looking at the terminology.

Page 3: Artificial Immune Systems - UCL

Terminology •  Pathogen: a foreign invader such as a virus, bacterium, fungus, or

parasite. •  B cell, helper T cell, killer T cell, macrophage, memory cell,

plasma cell: the main cells in our adaptive immune system (also known as white blood cells).

•  Stem cells: general purpose cells in our bone marrow that make all the cells in our blood.

•  Self cells: all the normal cells that make up ‘self’ (you). •  Lymphatic network: the collection of lymph vessels throughout our

bodies that collect “leakage” of blood from the capillaries. •  Lymph nodes: small organs under our arms, chins, chest and groin

that are used as “security stations”. •  Thymus: an organ in which B cells that produce antibodies harmful to

self cells are removed. •  Antibody: a protein made by B cells to mark pathogens as harmful. •  Antigen: a protein on the surface of pathogens that is used by other

cells for identification. •  Gene library: evolved fragments of DNA within each B cell used as

building blocks to produce its antibody.

Page 4: Artificial Immune Systems - UCL

An Overview of the Human Immune System

•  Our immune systems protect us from harmful pathogens in our environment.

•  Without it, we would quickly die, for we come into contact with hundreds of new pathogens every day.

•  Our immune systems work in two ways: •  the innate immune system (a cauldron of chemicals and proteins that

make our bodies inhospitable to most pathogens) and •  the adaptive immune system (the more recently evolved part of our

immune system that actively tries to learn, fight and remember pathogens).

Page 5: Artificial Immune Systems - UCL

Innate Immune System

•  The innate immune system comprises a massive set of cells and proteins designed to make life difficult for pathogens.

•  Macrophage cells (meaning “big eaters”) – and other dendritic cells - go around eating everything. They eat our dead cells, viruses, bacteria – everything.

•  When a macrophage eats a pathogen, its internal chemicals (MHC molecules) strip off the antigen protein that belongs to that pathogen.

•  This is then presented like crumbs of its meal, to other cells, including those of the adaptive immune system.

Page 6: Artificial Immune Systems - UCL

Adaptive Immune System

•  Helper T cells “read” the chemical crumbs and trigger B cells to mature in the lymph nodes.

•  Mature B cells then produce antibodies that match the antigen. These stick to all of the other copies of the pathogen.

•  And then the macrophages (who like eating things with antibodies on them, most of all) go around eating all of the pathogens.

Page 7: Artificial Immune Systems - UCL

Adaptive Immune System

Lymph nodes in the upper body

T-cell

A macrophage consuming bacteria

Page 8: Artificial Immune Systems - UCL

Human Immune System

•  That was the easy bit. In a little more detail, there are three or four important processes in the immune system you need to know about.

•  First process: Generation of Diversity

•  As we’ve heard, B cells produce antibodies tailored to specific antigens (which belong to pathogens).

•  Each B cell makes a specific antibody, which is expressed from the genes in its gene library.

•  But the gene library is not able to contain genes that define antibodies for every possible antigen.

Page 9: Artificial Immune Systems - UCL

Human Immune System

•  Instead, gene fragments from special regions in the gene library of a parent cell are randomly recombined in every new B cell.

•  Because the gene libraries of B cells have been randomised, together they can produce a massively diverse range of different antibodies.

Page 10: Artificial Immune Systems - UCL

Human Immune System

•  Evolution is not able to produce DNA for every antibody that might be needed in us.

•  So it evolved useful fragments that are randomly recombined in new cells, allowing such a diverse range antibodies.

•  And these have to be so diverse, because new antigens appear all the time – our immune system needs to be able to make the right kind of antibody for antigens it has never encountered before.

Page 11: Artificial Immune Systems - UCL

Human Immune System

•  Second process: Negative Selection

•  Because B cells produce antibodies from a randomised template (in their gene libraries), sometimes they might produce the wrong thing.

•  This is common to all adaptive immune responses – they all have the potential to attack self cells by mistake.

•  So the immune system has a special mechanism to prevent this: negative selection.

•  In organs such as the Thymus, immature B cells develop.

•  These organs are designed to be free of pathogens, so as the immature B cells mature, they only ‘see’ other self cells.

Page 12: Artificial Immune Systems - UCL

Human Immune System

•  While immature, if a B cell produces antibodies harmful to anything, it is killed.

•  This leaves only B cells that produce antibodies which are not harmful to self.

•  When they mature, these B cells will now produce a wide diversity of antibodies that attack everything other than self. They only attack non-self.

•  Because a large diversity is produced, most of the ‘space of non-self’ should be covered by antibodies, while almost none of the ‘self space’ should be covered.

•  Negative selection is like an anomaly detector – it ensures anything abnormal (different from self) is detected.

Page 13: Artificial Immune Systems - UCL

Human Immune System

•  Third process: Clonal selection

•  When a pathogen invades and multiplies within us, our immune system is able to make huge numbers of exactly the right kind of B cell, that produce the right kind of antibody, to help kill that pathogen.

•  It does this through clonal selection.

•  Most B cells will make the wrong kind of antibody, but because there are so many, there will usually be one that produces the right kind (or nearly right kind) of antibody.

•  And these B cells are triggered to clone themselves when they produce the right kind of antibody.

•  So there will quickly be large numbers of the right kind of B cell in your body, all producing the right antibody.

Page 14: Artificial Immune Systems - UCL

Human Immune System

•  But it’s also cleverer that this: when B cells clone themselves they do two things.

•  First, they use somatic hypermutation to vary the gene libraries and ensure that some of the new B cells produce slightly different versions of the parent’s antibody. This allows evolution to fine-tune B cells: if even better ones are created, they will make even more clones of themselves. Worse B cells will make less clones.

•  So our B cells evolve within us to ensure they make exactly the right kind of antibody.

•  The second thing they do is occasionally make memory cells. These hang around in your body for years, ready to produce new B cells should you ever be infected by the same pathogen again.

•  Memory cells give you immunity to a pathogen.

Page 15: Artificial Immune Systems - UCL

Human Immune System

•  So the main processes we are interested in here are: generation of diversity, negative selection and clonal selection.

•  There are also two other processes that we must also look at, even though they are controversial:

•  The Network Theory of the immune system.

and

•  The Danger Theory of the immune system.

Page 16: Artificial Immune Systems - UCL

Human Immune System (network theory)

•  Because antibodies are produced via a randomised process, it was thought that other immune cells might mistake some antibodies as non-self.

•  So some cells might be triggered into activating an immune response when antibody meets antigen (cloning) and some cells might be triggered into activating an immune response against that response – they might suppress it, by attacking the antibodies.

•  So the idea was that a balanced immune response to a pathogen comprised both activation and suppression of cells and antibodies, by other cells and antibodies.

•  Although this may happen a little in other ways, the original theory is now discredited and not recognised by immunologists as an accurate model of our immune systems. (But this does not prevent its use in Computer Science as we shall see.)

Page 17: Artificial Immune Systems - UCL

Human Immune System (danger theory)

•  How does the immune system know what is self and what is non-self? It’s a hard question when you remember all the bacteria that live in our guts, and the growth of genetically-different babies in the womb.

•  Danger threatens living organisms every day of their lives. Intuitively, one might therefore suppose that a successful strategy in our immune systems would be to detect danger instead of relying solely on an ability to detect the antigens that identify specific pathogens.

•  A hotly debated hypothesis in immunology known as the Danger Theory proposes just this. This theory suggests that the human immune system can detect danger in addition to antigens in order to trigger appropriate immune responses.

•  The Danger Theory states that the appropriate immune responses produced by the immune system emerge from the balance between the concentration of danger and safe signals within the tissue of a body, not from the discrimination of self from non-self.

Page 18: Artificial Immune Systems - UCL

From Human to Artificial Immune Systems

•  This theory is not the whole story of the immune system but we have shown in our own research that the innate immune system does respond to so-called “danger signals”

•  Dendritic cells are sensitive to such signals, which has led to other artificial immune algorithms as we’ll see…

•  The field of Artificial Immune Systems is based around the processes we have heard about. There are many algorithms that have been developed for computers.

•  Generally, most are inspired by one or more of: diversity generation, negative selection, clonal selection, the network theory or the danger theory.

•  Each is good at different things, and each is very similar to evolutionary algorithms or neural networks. We will start by looking at algorithms based on the process of diversity generation.

Page 19: Artificial Immune Systems - UCL

Diversity Generation Immune Algorithms

•  See paper: The Evolution of Emergent Organization in Immune System Gene Libraries by Hightower, Forrest and Perelson (1995)

•  Some of the first work to explore diversity generation from gene libraries was performed by Stephanie Forrest and her colleagues.

•  They used a genetic algorithm to evolve gene libraries, which then produced antibodies, which were used to detect antigens.

•  This is similar to natural evolution, which evolved our DNA, some of which is used as gene libraries, from which novel B cells are generated, that produce antibodies to detect antigens.

Page 20: Artificial Immune Systems - UCL

Diversity Generation Immune Algorithms

•  Stephanie set up a genetic algorithm as shown above.

•  Each individual genome comprised four separate gene libraries. To generate an antibody, a random segment was picked from each library and joined together. This was then compared to a set of antigens and an antigen matching score assigned to each antigen based on how well the antibody matched each one. This process was repeated many times for many different antibodies.

Page 21: Artificial Immune Systems - UCL

Diversity Generation Immune Algorithms

•  Stephanie set up a genetic algorithm as shown above.

•  Each individual genome comprised four separate gene libraries. To generate an antibody, a random segment was picked from each library and joined together. This was then compared to a set of antigens and an antigen matching score assigned to each antigen based on how well the antibody matched each one. This process was repeated many times for many different antibodies.

Page 22: Artificial Immune Systems - UCL

Diversity Generation Immune Algorithms

•  Finally, the fitness of an individual was calculated as the average of all antigen matching scores.

•  The results were very interesting.

•  The genes in the gene libraries were evaluated very indirectly: not all were expressed and tested.

•  Nevertheless, evolution constructed gene libraries that were capable of producing sufficiently diverse antibodies, that all the antigens were detected.

•  An emergent effect was the organisation of the four gene libraries:

•  They evolved to be very different from each other.

Page 23: Artificial Immune Systems - UCL

Diversity Generation Immune Algorithms

•  So we can evolve libraries that generate very diverse antibodies.

•  Why is this useful?

•  It can be useful in two ways:

•  First, it is possible to use such libraries to generate very diverse initial populations for a genetic algorithm. (Remember that GAs work well with an initially random population that even samples the search space.) So making the initial population more diverse can improve evolution to better solutions.

•  Alternatively, antibodies can be thought of as solutions to a problem, and so generating diverse solutions helps search the space.

•  Some researchers have used this idea to optimise functions.

Page 24: Artificial Immune Systems - UCL

Negative Selection Algorithm

•  See paper: An Immunological Approach to Change Detection by D’haeseleer, Forrest and Helman (1995)

•  Again, Stephanie Forrest and her colleagues were the first to create an algorithm based on negative selection.

•  The algorithm is very simple:

•  Random strings are generated, if they match self strings they are deleted, otherwise they are added to the detector set.

Page 25: Artificial Immune Systems - UCL

Negative Selection Algorithm

•  Then the detector set is compared to new strings.

•  If any detectors match, then a “non self” pattern has been detected.

•  This is an anomaly detector. It throws away any detectors for self, meaning that the remaining detectors match non-self.

Page 26: Artificial Immune Systems - UCL

Negative Selection Algorithm

Page 27: Artificial Immune Systems - UCL

Negative Selection Algorithm

•  Matching is performed by a simple r-contiguous matching function (which counts the number of identical bits in two strings).

•  To estimate how many detectors should be generated in order to cover “non self space” and provide a reasonable accuracy, the following equations were devised.

•  Appropriate number of detectors:

•  Total number of trials to generate these detectors:

•  Where the false negative error, , is fixed •  Number of self strings: •  Matching probability between a detector string and a randomly chosen

self string:

Nr =− ln PfPm

Nr0 =− ln Pf

Pm × 1 − Pm( )NS

Pf

Ns

Pm

Page 28: Artificial Immune Systems - UCL

Negative Selection Algorithm

•  For example, this table shows the number of required detectors, and number of trials to generate the required number of detectors, when the false negative error, , and the threshold r of the r-contiguous matching function are given.

•  These numbers are calculated with a self string length, l = 33, an alphabet cardinality, m = 10 and the number of self strings, = 192.

Nr

Nr0

Pf

NS

Page 29: Artificial Immune Systems - UCL

Clonal Selection Algorithm

•  See paper: The Baldwin effect in the immune system: learning by somatic hypermutation by Hightower, Forrest and Perelson (1996)

•  Clonal selection works in our bodies to evolve better B cells, that make antibodies tailored to new antigens.

•  Stephanie Forrest and her colleagues created a new evolutionary algorithm inspired by these ideas.

•  Although they created it by building on top of the diversity generator algorithm we saw earlier, here we will look at the algorithm in isolation.

Page 30: Artificial Immune Systems - UCL

Clonal Selection Algorithm

•  The basic algorithm looks exactly like a GA – the difference is in the evaluation and reproduction:

•  We maintain populations of detectors.

•  A random sub-group of detectors is picked and compared to a random sub-group of antigens.

•  The best matching detector has its fitness increased.

•  This process is repeated until every detector has a fitness.

•  The fittest detectors then clone themselves, with mutation to create random variation, the least fit die.

•  And then we pick random sub-groups of detectors and compare to antigens again, and so on.

Page 31: Artificial Immune Systems - UCL

Clonal Selection Algorithm

Page 32: Artificial Immune Systems - UCL

Clonal Selection Algorithm

•  Other work has attempted to make the algorithm even more biologically plausible by inclusion of maturation stages and memory cells:

•  Such algorithms are very good at learning the difference between self and non-self, even when the data is constantly changing.

Page 33: Artificial Immune Systems - UCL

Fugue

Page 34: Artificial Immune Systems - UCL

Immune Network Algorithm

•  See paper: Artificial Immune Systems: Part 1 – Basic Theory and Applications by Leandro Nunes de Castro and Fernando Von Zuben (1999).

•  Other work is based on the alternative theory of how immune systems function.

•  Instead of algorithms resembling GAs, this work has created algorithms resembling neural networks.

•  There are many variations of immune network algorithm. Here we will look at just one:

•  De Castro and von Zuben’s aiNET: “an evolutionary artificial immune network”

Page 35: Artificial Immune Systems - UCL

aiNET algorithm:

•  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.

•  A number called weight or connection strength, is assigned to each connected edge.

•  A matrix of connection strengths is defined to measure affinities among the cells of the network.

•  aiNET is said to be evolutionary because strategies based on genetic variation and selection are used to control the network dynamics and plasticity.

Page 36: Artificial Immune Systems - UCL

aiNET algorithm:

•  Example of a data set with three clusters and the resultant immune network with their connection weights

Page 37: Artificial Immune Systems - UCL

aiNET algorithm:

•  So this algorithm creates random cells in a space, deletes those not close to data points and clones those that are.

•  It also stops huge numbers of cells being created by suppressing them (i.e. deleting a proportion of the better ones, leaving only a few of the best to represent a cluster).

•  By applying a rule based on minimum spanning trees to cut up resultant graphs, separate independent networks can be extracted.

•  Each sub-network defines the shape and location of a data cluster.

Page 38: Artificial Immune Systems - UCL

aiNET algorithm:

In each iteration: For each antigen (data item) i Measure the affinity (distance) to all network cells Select the best n% Clone them (with better affinity = more copies) Increase affinity of clones by moving them closer to i Move best m% of highest affinity cells to Memory Matrix and delete those with an affinity lower than a threshold Calculate network cell-cell affinity in Memory Matrix and delete cells with affinity lower than a threshold Add cells from Memory Matrix to the full network Calculate whole network cell-cell affinity and delete cells with affinity lower than a threshold Replace r% of the worst cells with random ones.

Page 39: Artificial Immune Systems - UCL

aiNET algorithm:

In more detail:

Page 40: Artificial Immune Systems - UCL

Dendritic cell algorithm:

•  There have been several algorithms based on the danger theory of the immune system. One that has become popular is known as the dendritic cell algorithm (DCA)

•  This introduces the notion of danger signals, safe signals and PAMP signals which all contribute to the context of a data signal at any given time.

•  This context is integrated via a process inspired by the role of dendritic cells (a specialised APC of the innate immune system).

•  This removes the need to define what self is, but adds the necessity to define the danger, safe and PAMP signals.

Page 41: Artificial Immune Systems - UCL

Dendritic cell algorithm:

Page 42: Artificial Immune Systems - UCL

End of lecture!