Immune Cognition, Micro-evolution,
and a Personal Account on Immune Engineering



Leandro Nunes de Castro

Graduation and Research Institute (COPOP)

Catholic University of Santos (Unisantos)

Rua Dr. Carvalho de Mendonça, 144

CEP: 11070-906, Santos/SP, Brazil



© This paper is not for reproduction without permission of the author.





The immune system has a complexity sometimes compared to that of the brain. The vast and diverse number of molecules, cells and tissues, and their complicated pathways of communication (with each other and other bodily systems), endow the immune system with cognitive abilities capable of complementing nervous cognition. In addition, there are several processes and theories used to explain the immune functioning that bring to discussion several key aspects of biology and biologically-inspired computing. This paper thus provides two forms of studying the immune system. The first is more of an analytical approach; it presents some cognitive views of the immune system, the intrinsic evolutionary nature of an adaptive immune response, and how immunity influences the evolution of species. The second study is of a synthetic nature; it describes the immune engineering concept as a meta-synthetic process used for the design of computational intelligence approaches by borrowing inspiration from the immune systems. The latter discussion is a personal account, describing how I used ideas from the immune system to solve complex engineering problems. But these are supposed to provide the reader with some insights about the development of biologically-inspired systems.

1        Introduction

            In the history of immunology, several theories and principles have been proposed as attempts to explain how the immune system works. Among these proposals, some were of crucial importance for the development of the immune engineering concept, namely, the clonal selection and affinity maturation theory, formalized by Burnet (1959), and the immune network theory, introduced by Jerne (1974). In a simplified form, the immune engineering process corresponds to the extraction of ideas from the immune system and its many theoretical models for the design of novel problem solving techniques.

      The literature on artificial immune systems (Dasgupta, 1999; de Castro & Timmis, 2002a) is pervaded with proposals based on these two theories. While the clonal selection theory is acknowledged not to be sufficient for describing some important behaviors and characteristics of the immune system, (e.g., questions like why do mothers not reject their fetuses, and why do most of us have autoreactive lymphocytes without presenting autoimmune diseases cannot be answered by this theory), the immune network theory has difficulties in being accepted by the community (Langman & Cohn, 1986).

      New, not less controversial, theories about how the immune system works have been proposed (Matzinger, 1994), and have recently received some attention from the artificial immune systems community (Timmis et al., 2003). This paper brings a number of important discussions:

·       it presents the evolutionary nature of an adaptive immune response and how the immune system influences the evolution of species;

·       it provides some perspectives on immune cognition, based on a literature review; and

·       it introduces the immune engineering process from a personal and historical perspective.

To provide the reader with some background knowledge on immunology, an introductory section (Section 2) is provided emphasizing the clonal selection and immune network theories. Both were used in the original immune engineering proposal and will also be the basis for the evolutionary and cognitive discussions to be presented. In Section 3, a survey of works that explicitly discourse about immune cognition is provided, and in Section 4 the immune system is placed in the context of evolutionary biology. Section 5 provides a personal and historical account on immune engineering. The paper is concluded in Section 6.

2        Basic Concepts from Immunology

All living beings have the ability to present resistance to disease-causing agents, known as pathogens. These include viruses, bacteria, fungi, and parasites. The nature of this resistance varies from one species to the other, and is a function of the complexity of the organism. Mammals, in particular human beings, have developed a highly sophisticated immune system that acts together with several other bodily systems, such as the nervous and the endocrine system, to maintain life. The primary role of the immune system is to protect our bodies against infections caused by pathogens. Some good introductory-level textbooks on immunology are Janeway et al. (1999), Tizard (1995), Abbas et al. (1998), and Paul (1999).

The immune system can be divided into innate immune system and adaptive immune system, composed of diverse sets of cells, molecules and organs. The innate immune system is very important as a first line of defense against several types of pathogens and is also crucial for the regulation of the adaptive immune system. Cells belonging to the innate immune system are capable of recognizing generic molecular patterns (a type of molecular signature) that are only present in pathogens, and cannot be found in the cells of the host. Once a pathogen has been recognized by a cell of the innate immune system, this cell signals (through chemical messengers) other immune cells, including those of the adaptive immune system, to start fighting against the pathogen. For the most types of pathogens, the adaptive immune system cannot act without these co-stimulatory signals provided by the innate immune system. However, not all pathogens can be recognized by the innate immune system. Some specific pathogens are only recognized by cells and molecules of the adaptive immune system, also called specific immune system. Nowadays, it also believed that a third signal (danger signal) is necessary to promote an immune response (Matzinger, 1994), and this signal is provided by distressed or injured cells of the host organism.

2.1        Clonal Selection, Expansion and Affinity Maturation

When a pathogen invades our bodies, some of our immune cells that recognize this pathogen will start replicating, a process during which mutation occurs. One interesting aspect of the cellular reproduction (cloning) process in the immune system is that cells are subjected to error during cloning. In this case it is a mitotic process of cell division that may result in errors in the progeny cells generated. Also, the mutation rate is proportional to the affinity the immune receptor has with the pathogen recognized.

In summary, clonal selection and expansion together with affinity maturation occur as follows. Our immune system is composed of a huge number of cells presenting receptors on their surfaces. These receptors are responsible for binding with portions of pathogens, known as antigens, and signaling other immune cells to eliminate the marked (recognized) pathogens. But the invading pathogens replicate themselves inside our bodies thus increasing the amount of damage being caused to our organism. One way the immune system evolved to fight against infection was by replicating our immune cells so as to cope with the replicating pathogen. But the replication of immune cells is not perfect; errors occur with a rate proportional to the quality of the recognition between the immune receptor and the pathogen recognized. Those mutated cells with high affinity with the pathogen are then selected and maintained in a repertoire called memory. Figure 1 summarizes the clonal expansion and affinity maturation processes.


Figure 1: Clonal selection, expansion and affinity maturation. The B-cells have receptors on their surfaces that allow them to recognize antigens. After recognition, some cells are stimulated to reproduce; a process subject to error. Some cells with improved receptors for recognition are selected to become memory cells, that is, cells with long life spans.

2.2          Immune Network Theory


Jerne (1974) formalized in 1974 what is to date known as the immune network theory. His great insight was that the immune system is not only a reactive system that remains at rest until an antigen invades the organism. He suggested that some portions (idiotopes) of the receptors of our immune cells could be recognized by other immune cells and molecules. This would result in an immune system that is always dynamic; that is, an immune system that does not wait for external stimulation in order to act.

One question that may be raised by this assertion is: “if the immune system recognizes our own cells, why does it not react to our own cells?” The suggestion proposed at that time was that a suppressive mechanism would control “self-recognition” while an activation mechanism would guide the immune response. However, these mechanisms were neither clearly accounted for in the theory nor clearly observed experimentally. The network theory generated a lot of debate within theoretical and experimental immunology.

In summary, the network theory suggested that the immune cells and molecules are capable of recognizing each other and antigens. This recognition results in variations in the concentration and affinity (DNA structure) of immune receptors. These variations are a function of several factors: 1) the network suppressive effects, 2) the network activation effects, 3) the death of unstimulated cells, and 4) the recruitment of new cells and molecules from the immune repertoire. Figure 2 illustrates the immune network theory as proposed by Jerne (1974).


Figure 2: Each immune receptor has two portions, p and i. The p portion is the one capable of recognizing other molecules, and the i portion is the one that can be recognized by other immune molecules.

3        Perspectives on Immune Cognition: A Literature Review

Historically, the expression cognitive was imported into immunology from psychology, where it refers to the superior functions of the brain, e.g., object recognition, identification of the organism and intentionality (Mitchison, 1994). The initial goal was to emphasize that the immune system knows what it is looking for when it encounters a pathogen, i.e., its internal organization endows it with a certain intentionality. N. Jerne (1974, 1984, 1985), with his immune network theory, is considered to be the true proponent of the cognitive model of the immune system (Tauber, 1997).

Several research schools investigate what is now called immune cognition under basically three different perspectives: 1) the self-recognition view; 2) the self-assertion view; and 3) the multi-systemic view. This section reviews some works from the immunology literature that explicitly discuss the immune cognition.

3.1          The Self-Recognition View


Under this perspective, immune cognition is based upon the principle that the immune system is capable of distinguishing between what belongs to the organism, known as self, and what does not belong to the organism, known as nonself; a principle called self/nonself discrimination. In this case the immune system is a recognition/action system that acts according to foreign (nonself) stimulation. This is the most orthodox view of the immune system still accepted by a large, maybe the largest, number of researchers in immunology. It came into the scene about the 1950s with Burnet’s formalization of the clonal selection principle (Burnet, 1959).

The recognition and classification of foreign elements to the organism implicitly requires that some immune components are performing this identification. Recognition is a perceptive event and, as such, it has to be sustained in some sort of cognitive apparatus (Tauber, 1997). This viewpoint reflects the richness hidden in terms like recognition, learning and memory, properties pertinent to the immune system (see Section 2). Actually, all these properties were brought into immunology based on the parallel with nervous cognition, which is even more striking under the network approach for the immune system, as will be discussed shortly.

To I. Cohen (1992a,b) a cognitive system is an intentional system; that is, one capable of extracting information from the environment by exploiting the knowledge contained in the system itself. Thus, a cognitive system is not a passive information processor or memory device, it is designed to manipulate particular information sensed from the environment (Cohen, 1992a). He also proposed the concept of an immunological homunculus as an internal image of the self, acquired by the early recognition of self. (In the original clonal selection model introduced by Burnet, it was proposed that self-reactive lymphocytes were deleted early in life.) The immunological homunculus is rooted on the idea that the immune system will be capable of performing its task more efficiently through the gathering and processing of information if it is endowed with an internal representation of the environment in which it is inserted. Pathogens are recognized as nonself because they are presented in a context that indicates their pathology. Under this viewpoint, self is no longer an entity; rather it emerges dynamically in a self-identification process that changes continuously along the lifetime of an individual.

The self-recognition perspective can also be found in most immunology textbooks. For instance, up to the third edition of their book, A. Abbas and his co-authors (Abbas et al., 1998) divided an adaptive immune response into three distinct phases: 1) cognitive phase, 2) activation phase, and 3) effector phase. The cognitive phase consisting of the recognition and binding of foreign antigens to the specific receptors on some immune cells (lymphocytes), prior to the pathogenic stimulation. Under this viewpoint, cognition was equated to recognition followed by binding. From the fourth edition of their book onwards, released in the year 2000, the authors changed from a cognitive to a recognitive view of the immune principles of recognition and binding. The adaptive immune response was now divided into recognition, activation and effector phases.

3.2        The Self-Assertion View


This view does not see the immune system as behaving distinctively with self and nonself or according to any dichotomy imposed a priori and from the outside (Bersini, 2002). In this case the immune system is viewed as a dynamic system that does not require foreign (nonself) stimulation to present activity. There is no fundamental difference between self and nonself. This is known as the self-assertion view of the immune system and is in most of its presentations rooted on the immune network theory.

A vast number of authors have discoursed about the cognitive nature of the immune network theory (Coutinho et al., 1984; Farmer et al., 1986; Varela et al., 1988; Vaz & de Faria, 1988; Coutinho, 1989; Bersini & Varela, 1994; Varela & Coutinho, 1991; Manderick, 1994; Stewart, 1994). The claim in most cases is that global cognitive properties of the immune system like learning, memory, adaptation, self-sustainability, etc., cannot be understood through the analysis of individual components. As the network theory suggests an immune system composed of sets of cells and molecules interconnected via communication (affinity) links, the network approach becomes quite suitable to the study and understanding of cognitive phenomena in the immune system.

A key aspect of the network theory is illustrated in Figure 3. This picture shows the receptor molecules that exist either attached to a lymphocyte surface or free in solution. The immune network theory proposes that portions, called idiotopes, of the receptor molecules located in and around their variable regions can be recognized by the paratopes on other receptors. As a result, cells and molecules from the immune system can recognize each other. Note, from Figure 3(b), that the paratope on receptor 1 can recognize the antigen and the idiotope of receptor 3. Therefore, receptor 3 is known to be an internal image of the antigen Ag. Under this perspective, the immune system is composed of a universe of “internal images” of all possible antigens, which are only recognized for they are expressed in a language known to the system, and the immune system becomes self-defined; that is, it is designed to know itself. These are the two roots of the cognitive view of the network theory.




Figure 3: Basic concepts of the immune network theory. (a) Antibody molecule illustrating its paratope and idiotope. In reality, the idiotopes might be located in or around the paratopes. (b) Positive and negative responses as results of the interaction between a paratope and an idiotope or an epitope. (Reproduced with permission from © de Castro & Timmis, 2002a)

3.3        The Multi-Systemic View


The immune system is a vital system integrated with other bodily systems, and, as such, it does share recognition, activation, effector and adaptation mechanisms. There are increasing evidences of the interdependence between the immune system and other systems through messenger molecules, neurotransmitters and hormones. Besides, there are functional analogies between the immune system and other systems. For instance, the immune and the nervous systems perceive and recognize the environment, and then decide what mechanisms to put into action in order to operate. This is the multi-systemic perspective on immune cognition.

Blalock (1994) approached the immune system as a sensorial system, such as the nervous system, but he attributed cognition only as a process resulting from stimuli like physiological, emotional, etc. He proposed that the immune system is capable of recognizing and responding to stimuli that cannot be perceived by the nervous system like bacteria, viruses and tumors. These stimuli would go unnoticed if not for the immune system. A virus cannot be seen by a naked eye, it cannot be smelt or tasted, it makes no noise, but it can be perceived by the symptoms it causes. This occurs through the recognition of this stimulus by immune cells, which convert it into chemical information such as hormones, neurotransmitters and cytokines. These signals are received by the neurvous and the endocrine systems resulting in psychological and physiological changes. Apparently, the sensorial operation of the immune system imitates the neuroendocrine system in the sense that a specific stimulus promotes a particular response that results in a physiologic response. Due to this capability of recognizing and responding to stimuli that cannot be perceived by our sensorial systems, Blalock (1994) suggested the immune system is our sixth sense.

Besendovsky & del Rey (1996) followed the same approach as Blalock (1994) arguing that the intercommunication between the immune and the neuroendocrine systems implies that the immune system is a receptor sensorial system (see Figure 4). However, the sensory function of the immune system does not imply that the central nervous system will always react to signals derived from immune cells. A neuroendocrine response to immune signals occurs in a threshold-dependent manner, and only seldom do such responses become cognitive. A cognitive sensation is expected to be more often related to stimuli that occur as a consequence of the disease rather than to the elicited immune response itself. The authors also suggested another interesting phenomenon that might reflect the reception of signals from immune cells at the central nervous system level: the behavior condition of certain immune responses. It implies that the immune system is capable of informing the brain about the effect of the stimuli, and the brain, in turn, would mediate the conditioned stimulation or inhibition of the immune response.


Figure 4: Neuro-immune-endocrine interactions. According to Besendovsky & del Rey (1996) the immune system, (IS), the nervous system (NS), and the endocrine system (ES) share receptors and molecules, and respond to actions taken by the other systems.


With a slightly different viewpoint, T. Tada (1997) introduced the term “supersystem” to designate highly integrated vital systems, like the nervous and immune systems. The many elements of a supersystem are interrelated through mutual adaptation and co-adaptation, producing a self-regulated and self-organized dynamic system. The system is also self-contained, but open to environmental stimuli that can be translated into internal messages for the self-regulation and expansion processes. A supersystem is characterized by its self-regulation, generation of its many components through stochastic processes following selection and adaptation (consequences of self-organization), individuality and decision making as a response to endogenous and exogenous stimuli.

4        Evolution and the Immune System

Evolutionary biology is a science concerned, among other things, with the study of the diversity of life, the differences and similarities among organisms, and the adaptive and non-adaptive characteristics of organisms. Its importance is manifold, from the health sciences to the understanding of how the living organisms adapt to the environment they inhabit. For instance, evolutionary biology helps in the understanding of disease epidemics, population dynamics, and the production of improved species and cultures.

The word evolution is originated from the Latin evolvere, which means to unfold or unroll. Broadly speaking, evolution is a synonym for “change”. But what type of change? The word evolution is not usually employed to refer to the changes undergone by an individual during its lifetime. Instead, an evolving system corresponds to the one in which there is a descent of entities over time, one generation after the other, and in which characteristics of the entities differ across generations (Futuyma, 1998). Therefore, evolution can be broadly defined as descent with modification, and often with diversification. Many systems can be classified as evolutionary: languages, cellular reproduction in immune systems (see Section 2.1), cuisines, automobiles, and so on.

·       Any evolutionary system presents a number of features:

·       population(s): in all evolutionary systems there are populations, or groups, of entities (organisms, cells, molecules, etc.), generally termed individuals;

·       variation: there is variation in one or more characteristics of the individuals of the population(s);

·       hereditary similarity: parent and offspring individuals present similar characteristics. Over the course of generations, there may be changes in the proportions of individuals with different characteristics within a population; a process called descent with modification; and

·       sorting of variations: among the sorting processes, it can be emphasized chance (random variation in the survival or reproduction of different variants), and natural selection (consistent, non-random differences among variants in their rates of survival and reproduction).

Adaptation as a result of variation plus natural selection leads to improvement in the function of an organism and its many component parts. “Biological or organic evolution is change in the properties of populations of organisms, or groups of such populations, over the course of generations.” (Futuyma, 1998; p. 4) Note that according to this definition of evolution, individual organisms do not evolve, and the changes of a population of individuals that are assumed to be evolutionary are those resultant from inheritance, via the genetic material, from one generation to the other.

The history of evolutionary biology is marked by a number of hypotheses and theories about how life on earth appeared and evolved. The most influential theory to date is the natural selection theory proposed by Charles Darwin and formalized in his book On the Origins of Species by Means of Natural Selection, or the Preservation of Favoured Races in the Struggle for Life (Darwin, 1859). Historically, Alfred Wallace is also one of the proponents of the theory of evolution by means of natural selection, but it was Darwin’s book, with its hundreds of instances and arguments supporting natural selection, that acted as the landmark for the theory of evolution.

There is a strong relationship between the immune system (immunology) and evolutionary biology. First, the immune system contributes to the natural selection of species by influencing the reproduction capability of an individual, and by reducing the survival likelihood of an infected organism that eventally becomes a threat to its species. Second, some patterns of immune response, via clonal selection for example, assume the shape of an evolutionary process.

An important aspect of most disease-causing agents is that they use the host organism as a medium to survive and spread the disease to other organisms. As a consequence, the infected organism may become a potential threat to the other members of the community in which it lives or even to the species as a whole. In some cases, although with a fully operative immune system, an individual cannot cope with a certain disease because the longer this individual survives, the greater the threat to the species. Although this is rarely the case, it was demonstrated that some cytokines, rather than the products of the infectious agents that cause the disease, are responsible for the promotion of a series of deleterious nervous, endocrine and metabolic derangements that will lead to the death of the individual (Besendovsky & del Rey, 1996). In addition, the immune system can contribute to evolution by associating immune and reproductive functions. The inhibitory effects of certain cytokines on reproductive functions may serve to impede the transmission of microorganisms to the progeny via the placenta or the milk. Cases where the development of the immune system is deficient are usually associated with sexual insufficiency (Besendovsky & Sorkin, 1974). There seems to be an association between the function of some immune organs that control the development of the immune system and the reproductive capability of the organism. And this operates as a selective force to impede the reproduction of immunodefficient organisms, while favoring the reproduction of individuals capable of developing a fully operative immune system.

As discussed previously, one form the immune system developed to cope with pathogenic invaders is by reproducing (cloning) those cells capable of appropriately recognizing specific pathogens. During the proliferative phase of the immune cells, they are subjected to a controlled mutation event with high rates, termed somatic hypermutation. Those mutated offspring cells that have increased their capability of recognizing a specific pathogen are then selected for survival and further reproduction. This whole mutational process followed by selective events is called affinity maturation of the immune response, because it allows the immune system to increase its capability to recognize (affinity with) pathogens. A population of immune cells that reproduce under the effects of mutation and then suffer (natural) selection is a remarkable example of the evolutionary nature of an adaptive immune response. What is important to note, however, is that there is a microevolutionary process within our organisms that occurs in a time scale orders of magnitude faster than the evolution of species. And this is crucial for our day-by-day battle for survival against disease-causing agents.

5        Immune Engineering: A Personal Account

After discussing immune cognition and the relationship between evolutionary biology and the immune system, it is now time to turn the attention to a computational perspective of the immune system; the so-called artificial immune systems (Dasgupta, 1999; de Castro & Timmis, 2002a).

Artificial immune systems (AIS) compose a new computational intelligence approach inspired by theoretical and experimental immunology with applications to problem solving. Like all new approach, such as swarm intelligence (Bonabeau et al., 1999; Kennedy et al., 2001), the field still lacks a more formal description and better theoretical foundations. However, some new insights were provided in a recently released book by myself and Jon Timmis (de Castro & Timmis, 2002a).

This book, titled “Artificial Immune Systems: A New Computational Intelligence Approach”, covers a number of topics in various domains, from biology to computing. There are dedicated chapters about immunology, neuroscience and endocrinology, always with a view of how these are important for the development of computational tools for solving complex problems. The book also brings an almost comprehensive survey of the literature on AIS and hybrids of AIS with other techniques such as artificial neural networks, fuzzy systems, evolutionary algorithms, and others.

Chapter 2 of the book reviews the biological immune system of vertebrates and Chapter 3 introduces the process of immune engineering, which is the main focus of this section. The term immune engineering was coined by Fernando Von Zuben and myself around five years ago, and was formalized in my Ph.D. thesis early in 2001. It refers to “…a meta-synthesis process that is going to define the tool for solving a given problem based upon the features of the problem itself, and then apply it to obtain the solution to the problem. Instead of trying to create accurate models of the immune system, the immune engineering develops and implements pragmatic models inspired by the immune system. These must preserve some of the essential properties of the immune system which demonstrate to be implementable and efficient for the development of engineering tools.” (de Castro, 2001; p. 44)

Several parts of the immune engineering definition were underlined for they focus on a number of important concepts and ideas. First, is the concept of meta-synthesis. My background knowledge is in Electrical Engineering with emphasis on Intelligent Systems, particularly artificial neural networks (ANN). For my Ph.D. project, we considered using ideas gleaned from the immune system to develop new constructive and pruning techniques to design ANN.

The immune system has the great potentiality of being able to build up repertoires of cells and molecules to combat invading disease-causing elements, known as pathogens (e.g., viruses, bacteria and fungi). By modifying the molecular structure of immune receptors and increasing the concentration of particular cells and molecules in the blood and lymph, the immune system can also become increasingly better at recognizing and destroying these pathogens. Therefore, the immune system is inherently capable of defining its own architecture and adjusting its “parameters” so as to appropriately cope with invading elements. Our claim was that, by studying how the immune system fights against pathogens, we could use some of these immune principles and processes to design new types of learning algorithms for neural networks.

Another important issue raised by the definition of immune engineering was that of creating accurate models. From an engineering perspective, it is important to bear in mind how accurate a model should be in relation to its usefulness as a problem solving technique. The application of mathematical analysis and modeling to immunology may result in outcomes such as a deeper and more quantitative description of how the immune system works, a more critical analysis of hypothesis, it can assist in the prediction of behaviors and the design of experiments, and so forth. Note here that the goal of these accurate immune models is considerably different from the goal of designing problem solving techniques inspired by the immune system. As suggested in the definition for immune engineering, the main concern is to keep the model pragmatic and useful as an engineering tool, though one has to be careful not to stretch the metaphor too much.

5.1        Engineering the Clonal Selection Principle


In the vertebrate immune system, the clonal selection and expansion processes together with affinity maturation, are clear examples of a meta-synthetic process. It was very interesting to realize that the meta-synthesis idea is completely incorporated into the clonal selection and affinity maturation processes. Not only the structure of the immune repertoire is going to be adjusted to the “problem” (and by the problem) – pathogen – being faced by the immune system, but also the structure of individual molecules will be fine-tuned by (somatic) mutation followed by selection. These processes thus served the purposes of using ideas from the immune system to develop automatic design and learning algorithms for neural networks. The question that remained was how to use them in a neural network context. It was thus one of the very first steps of my Ph.D.

Certainly these are not the only interesting features of clonal selection for information processing, but these served the purposes I was looking for at that time. For instance, it is known that the immune response (clonal selection) is local; that is, the response does not involve the whole immune repertoire of a given cell type, only a sample of cells are involved. Other researchers have developed different clonal selection models using these ideas (e.g., Forrest et al., 1993) with applications in other domains such as multimodal search.

As proposed in the immune engineering definition, the idea is to “develop and implement pragmatic models inspired in the immune system”. Thus, the basic mechanisms of clonal selection discussed above were sufficient “for the development of engineering tools”.

In a very lengthy paper, some hints on how to use ideas from the immune system to design novel neural network structures and learning algorithms were presented (de Castro et al., 2003). A growing Boolean neural network was proposed based on tese ideas. Given a set of input data and another set of Boolean artificial neurons, i.e., neurons with binary weight vectors, the problem was how to determine an appropriate network architecture and weight set(s) based upon the problem and so that the problem was satisfactorily solved? The idea was quite simple having clonal selection and affinity maturation in mind.

Starting with a network composed of a small number of neurons, select the one with highest affinity to a given input pattern. The input patterns are presented sequentially to the network. The selected neuron is cloned (reproduced with a smalll mutation) and the offspring neuron with highest affinity with the input pattern is selected to replace the parent or to be added to the network. Affinity in this case corresponds to a smaller distance to the input pattern and also to a high concentration of antigens, i.e., input patterns. The idea is thus to reproduce those network neurons capable of recognizing a larger number of patterns and presenting a small distance to these patterns. Network neurons that are not reinforced by any input pattern tend to be removed from the network, thus mimicking the death of unstimulated cells in the immune system.

Although these ideas could be used for any type of self-organized network, the original implementation was restricted to Boolean networks. Given the animal data set of Figure 5(a), one network, named ABNET for antibody network, generated by the algorithm described above is depicted in Figure 5(b). Note that the final network was capable of grouping the two major classes of mammals and birds contained in the data set using no information about how the data set is organized.








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


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


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




Two legs

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

Four legs

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


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


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


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


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


Likes to


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


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


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


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



Figure 5: The ABNET (antibody network) when applied to the animals data set. (a) Animals’ data set. (b) One of the networks generated by the algorithm inspired in the clonal selection theory of antibody responses.


The clonal selection principle is not only useful to design neural networks, which would already be a great contribution to the computational intelligence research. Any reader familiar with the theory of evolution and/or evolutionary algorithms would find clonal selection very compatible with an evolutionary process. Indeed clonal expansion, selection, and affinity maturation are processes akin to a micro-evolutionary process, as discussed previously. Clonal expansion is a process of reproduction, and affinity maturation corresponds to genetic variation plus selection.

There are a few differences however, between macro- and micro-evolution. Macro-evolution in whole organisms involves different sequence of steps and genetic variation processes when compared with micro-evolution. For instance, there is no crossover during cell division, and the rate of mutation of whole organisms is not proportional to their fitness; the rate of reproduction is proportional to fitness in organisms, but not the rate of mutation.

Another important aspect about the clonal selection principle is the fact that it allows the immune system to learn the antigenic patterns presented. Actually this is the principle of vaccination. The organism is inoculated with a weakened or dead sample of a given pathogenic agent so that it builds up an immune repertoire of cells and molecules capable of recognizing the known pathogen before it starts causing harm to the body. The problem with the immune response via clonal selection is that it takes some time, on the order of days, so that a sufficient number of cells and molecules is produced to fight the infection. This might result in the presentation of symptoms until the pathogen is eliminated. If the immune system is primed with this weakened or dead sample of the pathogen, then there will be a “lag” phase short enough so that the symptoms of the disease do not manifest.

With this view of recognition via immune receptors and learning according to clonal selection, I realized that another algorithm for solving pattern recognition problems could be engineered. This was one next step in my research; to implement a clonal selection algorithm, later known as CLONALG, to perform a pattern recognition and learning. This algorithm is conceptually simple and involves the basic mechanisms described above (de Castro & Von Zuben, 2000):

·       Generate a set of candidate solutions (corresponding to the repertoire of immune cells and molecules);

·       Determine the n best individuals of the population based on their affinity with the input pattern (corresponding to the antigens);

·       Reproduce (create copies of) these n best individuals proportionally to their affinity (corresponding to the clonal expansion phase);

·       Mutate these copies (clones) according to affinity; the higher the affinity, the smaller the mutation rate, and vice-versa (corresponding to somatic mutation);

·       Re-select the mutated individuals according to their affinity (selection in the affinity maturation process).

Note that this algorithm is indeed a new type of evolutionary algorithm inspired by the immune system. It embodies the three main evolutionary processes of reproduction, genetic variation and selection. There are also similarities with evolution strategies and genetic programming techniques. Despite the similarities, the sequence of steps is not the same, and most interestingly the performance is qualitatively different.

The immune system has to cope with a number of different types of antigens; although it can privilege the recognition of an antigen in detriment of others, all deadly antigens have to be eliminated (otherwise we would be dead!). This suggests that an immune algorithm, such as the CLONALG described above, has to be capable of generating a repertoire of cells that covers most of the peaks of a conceptual affinity landscape. One would expect this type of performance as far as a minimum level of inspiration was taken from the immune system in the development of the algorithm. This is just what the immune engineering approach proposes.

With few modifications this algorithm was adapted to perform multimodal search. And, as expected, was very good at determining and maintaining several optima of the affinity (fitness) landscape. In contrast, standard evolutionary algorithms do require the use of mating restriction schemes, fitness sharing, crowding mechanisms or other processes to provide such a broad coverage of multiple peaks of the fitness landscape. Figure 3 illustrates the typical behavior of CLONALG when applied to continuous optimization of multimodal functions.


Figure 6: The clonal selection algorithm applied to multimodal search. Note the presence of individuals in several peaks of the landscape.

5.2        Engineering the Immune Network Theory


The immune network theory sounds very appealing for any researcher on computational intelligence and engineering background (and many others). First, it suggests a dynamic system capable of presenting interactions with the system itself and the external environment. Secondly, the capability of adjusting the system (network) structure to the environmental challenges and adjusting the parameters of the system to this environment is interesting from an engineering perspective.

The network theory corresponds to another inspiration from the immune system to engineer a computational tool for problem solving. It is most natural to view the immune system as a sort of pattern recognition device; as was the first version of the clonal selection algorithm. The same may happen with the immune network theory. The idea was thus to implement an “artificial immune network” to perform pattern recognition. This was also a natural step for a researcher with background on neural networks, for ANN are known to be good at solving pattern recognition and function approximation problems.

Theoretical immunologists had already been modeling the immune network using ordinary differential equations (ODEs) to account for the variations in concentration and sometimes affinity of immune cells. But this was not exactly the type of approach I pursued. The idea was to develop an immune network more akin to neural networks, that is, adapted (trained) according to an iterative procedure of adaptation. This would result in a discrete immune network model. Nevertheless, the dynamics of most immune network models, including the one I proposed, are known to contain some basic steps:


Rate of population variation



Network stimulation



Network suppression




of new




Death of unstimulated elements


An artificial immune network model was thus proposed incorporating all the steps described in the equation above. The algorithm can be summarized as follows (de Castro & Von Zuben, 2001a):


1.     Initialization: create an initial random population of cells;

2.     Antigenic presentation: for each input (antigenic) pattern, do:

-          Clonal selection and expansion: for each network cell, determine its affinity with the input (antigen) presented. Select a number of high affinity cells and reproduce (clone) them proportionally to their affinity;

-          Affinity maturation: mutate each clone inversely proportional to affinity. Re-select a number of highest affinity clones and place them into a clonal memory set;

-          Death of unstimulated elements: eliminate all memory clones whose affinity with the antigen is less than a pre-defined threshold;

-          Clonal interactions: determine the network interactions (affinity) of all the elements of the clonal memory set;

-          Clonal suppression: eliminate those memory clones whose affinity with each other is less than a pre-specified threshold;

-          Network construction: incorporate the remaining clones of the clonal memory with all network cells;

3.     Network interactions: determine the similarity between each pair of network cells;

4.     Network suppression: eliminate all network cells whose affinity is less than a pre-specified threshold;

5.     Influx of new elements: introduce a number of new randomly generated cells into the network;

6.     Cycle: repeat Steps 2 to 5 until a pre-specified number of iterations is reached.


Some features of this algorithm deserve comments. First, note that the clonal selection and affinity maturation algorithms are incorporated in Steps 2.2 and 2.3, respectively. Furthermore, the network interactions, from Step 2.4 to Step 4, allow the network to control its number of cells.

This algorithm has been demonstrated efficient in performing data compression. Together with a very simple (though powerful) graph theoretical procedure, namely the minimal spanning tree – MST (Zahn, 1971), it has also demonstrated usefulness in determining a suitable number of clusters for a variety of problems. Without the aid of the MST, the algorithm has successfully been applied to automatically determine the number and location of radial basis functions for RBF neural networks (de Castro & Von Zuben, 2001b). Some variations of the standard algorithm have also been applied to multimodal function optimization (de Castro & Timmis, 2002b). Figure 7(a) and (b) illustrates the network performance when used in combination with an RBF neural network to perform classification, and when it is applied to an optimization problem, respectively.


(a)                                                                                    (b)

Figure 7: An artificial immune network model applied to define the centers for radial basis function neural networks (a), and to solve multimodal optimization tasks (b).

5.3        Diversity in the Immune System


Another problem studied during my Ph.D. thesis was that of diversity. One issue that might intrigue many people who study the immune system is related to how, with a limited number of cells and molecules, is the immune system capable of detecting an almost limitless number of antigens? There is not a single answer to this question. First, each antigen has a number of features that allow it to be recognized by more than one immune cell receptor. Second, although all the receptors of a given immune cell have the same specificity (i.e., recognize a single type of antigen), the diversity of cell receptors is great in the immune system. But this intrinsic diversity of immune receptors brings out another question: how are these receptors generated? It is known that the cell receptors are generated by randomly recombining DNA segments from DNA libraries.

Several researchers have used evolutionary algorithms to study the effects of evolution in the genetic encoding of DNA for the synthesis of antibodies (e.g., Hightower et al., 1995; Perelson et al., 1996; Oprea, 1999). I wanted to study diversity in populations of individuals to test it in the initialization phase of feedforward neural networks, among other things. Therefore, instead of studying diversity using binary strings or amino-acids (A,C,T,G) I wanted to use real-valued vectors to represent the immune cells and molecules. One solution to create diversity in a population of real-valued vectors was using the simulated annealing algorithm (Kirkpatrick et al., 1987) and to define an energy measure capable of indicating the diversity of the matrix composed of the initial vectors to be used to train the feedforward neural networks. The results presented were very encouraging (de Castro & Von Zuben, 2001c). See Figure 8 for the average performance of the method proposed (INIT) when compared to other methods applied to several benchmark and real-world problems.

This last application of ideas extracted from the immune system to develop computational tools for problem solving, though more loosely inspired in the immune system, was still motivated by the diversity of immune cells and molecules in the immune system.


Figure 8: Average performance of the diversity generation algorithm when compared with 5 other initialization algorithms for feedforward neural networks. Only three out of the five algorithms presented the best average results when applied to 3 benchmark problems and to other 3 real-world problems. In 49% of the cases, the algorithm proposed, named INIT, presented an average performance superior to the others. (c.f. de Castro & Von Zuben, 2001c)

6        Discussion

The complexity of the immune system can be compared to that of the brain. There is a vast number of cells, molecules, and organs that compose the immune system, and these have to act in concert, and together with other vital systems, so as to promote and maintain life. Neither can the immune system act in isolation to maintain life, nor can a higher organism live without an immune system.

Focusing mainly on two theories from immunology, this paper has argued that an adaptive immune response has an evolutionary-like behavior. Most importantly, this evolutionary pattern of immune response allows the immune system to contribute to the natural selection of species. An important conclusion is that there is a micro-evolutionary process running in parallel with (or within) the evolution of the species. Not only the species evolve, but individual organisms evolve as well.

Another discussion brought about in this paper concerns the immune cognition. Several works from theoretical immunology have proposed that the immune system is a cognitive system. This paper reviewed most of these works and identified the many perspectives on immune cognition. The immune system is a cognitive system that deals with the search for a context (when to act), the extraction of information from a context (in what to focus), and how to act (what to do). In addition, the immune system can also act directly upon (or be acted by) other systems by sending and receiving chemical and physiological signals to and from them. But the immune system does much more than detecting and destroying pathogens, it complements some cognitive abilities by recognizing stimuli, such as viruses, bacteria and fungi, that cannot be perceived by any other bodily system.

Section 5 of this paper changed from a more philosophical discussion to a computational perspective of the immne system. It presented my personal account about immune engineering, a term coined to refer to the process of extracting ideas and metaphors from the immune system to develop computational tools for problem solving. A discussion of what is immune engineering and how I have used it in the desing of several artificial immune systems was presented. Some simulation results of the tools I developed were included for illustration. I hope the reader can see beyond my personal experience how one can study a natural system aiming at extracting ideas and principles from nature to build engineering tools for problem solving.




The author thanks CNPq (Profix, Proc. n. 540396/01-0) for financial support.




Abbas, A. K., Lichtman, A. H. & Pober, J. S. 1998. Cellular and Molecular Immunology. W, B, Saunders Company.

Bersini, H. & Varela, F. J. 1994. The Immune Learning Mechanisms: Reinforcement, Recruitment and Their Applications, In R. Paton (ed.), Chapman & Hall. Computing with Biological Metaphors, pp. 166-192.

Bersini, H. 2002. Self-Assertion versus Self-Recognition: A Tribute to Francisco Varela. Proc. of the Int. Conf. on Artificial Immune Systems, pp. 107-112.

Besendovsky, H. O. & del Rey, A. 1996. Immune-Neuro-Endocrine Interactions: Facts and Hypotheses. Endocrine Reviews 17(1), pp. 64-102.

Besendovsky, H. O. & Sorkin, E. 1974. Involvement of the Thymus in Female Sexual Maturation. Nature 249, pp. 356-358.

Blalock, E. J. 1994. The Immunec System Our Sixth Sense. The Immunologist 2/1, pp. 8-15.

Bonabeau, E., Dorigo, M. and Théraulaz, G. 1999. Swarm Intelligence from Natural to Artificial Systems. Oxford Unviersity Press.

Cohen, I. R. 1992a. The Cognitive Principle Challenges Clonal Selection. Imm. Today 13(11), pp. 441-444.

Cohen, I. R. 1992b. The Cognitive Paradigm and the Immunological Homunculus. Imm. Today 13(12), pp. 490-494.

Coutinho, A. 1989. Beyond Clonal Selection and Network. Imm. Rev. 110, pp. 63-87.

Coutinho, A., Forni, L., Holmberg, D., Ivars, F. & Vaz, N. 1984. From an Antigen-Centered, Clonal Perspective of Immune Responses to an Organism-Centered, Network Perspective of Autonomous Activity in a Self-Referential Immune System. Imm. Rev. 79, pp. 152-168.

Darwin, C. 1859. On the Origin of Species by Means of Natural Selection. 6th Edition, [Online Book]

Dasgupta, D. (ed.) 1999. Artificial Immune Systems and Their Applications. Springer-Verlag.

de Castro, L. N. & Timmis, J. I. 2002a. Artificial Immune Systems: A New Computational Intelligence Approach, Springer-Verlag, London.

de Castro, L. N. & Timmis, J. I. 2002b. An Artificial Immune Network for Multimodal Function Optimization. Proc. of the IEEE Congress on Evolutionary Computation 1, pp. 699-674.

de Castro, L. N. & Von Zuben, F. J. 2000. The Clonal Selection Algorithm with Engineering Applications, Proc. of GECCO’00 (Workshop Proceedings), pp. 36-37

de Castro, L. N. & Von Zuben, F. J. 2001a. aiNet: An Artificial Immune Network for Data Analysis, capítulo do livro intitulado: Data Mining: A Heuristic Approach, H. A. Abbas, R. A. Sarker & C. S. Newton (eds.), Idea Group Publishing, Capítulo XII, pp. 231-259.

de Castro, L. N. & Von Zuben, F. J. 2001b. Automatic Determination of Radial Basis Function: An Immunity-Based Approach. International Journal of Neural Systems, Special Issue on Non-Gradient Learning Techniques, 11(6), pp. 523-535.

de Castro, L. N. & Von Zuben, F. J. 2001c. An Immunological Approach to Initialize Feedforward Neural Network Weights, Proc. of ICANNGA’01, pp. 126-129.

de Castro, L. N. 2001. Immune Engineering: Development of Computational Tools Inspired in Artificial Immune Systems, Ph.D. Thesis (in Portuguese), DCA – FEEC/UNICAMP, Campinas/SP, Brazil, 286 p.

de Castro, L. N., Von Zuben, F. J., & de Deus Jr., G. A. 2003. The Construction of a Boolean Competitive Neural Network Using Ideas From Immunology, 50C, pp. 51-85.

Farmer, J. D., Packard, N. H. & Perelson, A. S. 1986. The Immune System, Adaptation, and Machine Learning. Physica 22D pp. 187-204.

Forrest, S., Javornik, B., Smith, R. E. & Perelson, A. S. 1993. Using Genetic Algorithms to Explore Pattern Recognition in the Immune System. Evolutionary Computation 1(3), pp. 191-211.

Futuyma, D. J. 1998, Evolutionary Biology, Sinauer Associates, Inc.

Hightower R. R., Forrest, S. A & Perelson, A. S. 1995. The Evolution of Emergent Organization in Immune System Gene Libraries. Proc. of the 6th Int. Conference on Genetic Algorithms, L. J. Eshelman (ed.), Morgan Kaufmann, pp. 344-350.

Timmis, J., Bentley, P. & Hart, E. 2003. Artificial Immune Systems, Proceedings of the International Conference on Artificial Immune Systems (ICARIS 2003), LNCS 2787, Springer-Verlag.

Janeway, C. A., P. Travers, Walport, M. & Capra, J. D. 1999. Immunobiology: The Immune System in Health and Disease, 4th Ed., Garland Publishing.

Jerne, N. K. 1974. Towards a Network Theory of the Immune System. Ann. Immunol. (Inst. Pasteur) 125C, pp. 373-389.

Kennedy, J., Eberhart, R. and Shi. Y. 2001. Swarm Intelligence. Morgan Kaufmann Publishers.

Kirkpatrick, S., Gelatt Jr., C. D. & Vecchi, M. P. 1987. Optimization by Simulated Annealing. Science 220(4598), pp. 671-680.

Langman, R. E. & Cohn, M. 1986. The ‘Complete’ Idiotype Network is an Absurd Immune System. Imm. Today 7(4), pp. 100-101.

Manderick, B. 1994. The Importance of Selectionist Systems for Cognition, In: Computing with Biological Metaphors, R. Paton (ed.), Chapman & Hall.

Matzinger, P. 1994. Tolerance, Danger, and the Extended Family. Annual Review of Immunology, 12, pp. 991-1045.

Mitchison, N. A. 1994. Cognitive Immunology. The Immunologist 2/4, pp. 140-141.

Oprea, M. 1999. Antibody Repertoires and Pathogen Recognition: The Role of Germline Diversity and Somatic Hypermutation, Ph.D. Dissertation, University of New Mexico, Albuquerque, New Mexico, EUA.

Paul, W. E. (ed.) 1999. Fundamental Immunology 4th Ed., Lippincott-Raven Publishers.

Perelson, A. S., Hightower, R. & Forrest, S. 1996. Evolution and Somatic Learning in V-Region Genes. Research in Immunology 147, pp. 202-208.

Stewart, J. 1994. Cognition without Neurons: Adaptation, Learning and Memory in the Immune System, CC AI, 11, pp. 7-30Tada, T. 1997. The Immune System as a Supersystem. Ann. Rev. Imm. 15, pp. 1-13.

Tauber, A. I. 1994. The Immune Self: Theory or Metaphor. Imm. Today 15(3), pp. 134-136.

Tauber, A. I. 1997. Historical and Philosophical Perspectives on Immune Cognition, Journal of the History of Biology 30, pp. 419-440.

Tizard, I. R. 1995. Immunology An Introduction, 4th Ed, Saunders College Publishing.

Varela, F. J. & Coutinho, A. 1991. Second Generation Immune Networks. Imm. Today 12(5), pp. 159-166.

Varela, F. J., Coutinho, A. Dupire, E. & Vaz, N. N. 1988. Cognitive Networks: Immune, Neural and Otherwise, Theoretical Immunology Parte Dois, A. S. Perelson (ed.), pp. 359-375.

Vaz, N. M. & de Faria, A. M. 1988. Cognitive Aspects of the Immune Activity, Ciência e Cultura (in Portuguese), 40(10), pp. 981-986.

Zahn, C. T. 1971. Graph-Theoretical Methods for Detecting and Describing Gestalt Clusters, IEEE Trans. on Computers, C-20(1), pp. 68-86.