Associative memory in artiﬁcial immune systems

– The paper concentrates on analyzing associative properties of Artiﬁcial Immune Systems, especially on immunological memory, which is a member of a class of sparse and distributed associative memories [18]. This class of memories derives its associative and robust nature by sparsely sampling the input space and distributing the data among many independent agents [16]. Immunological memory is one of the deﬁning characteristics of the adaptive immune system [4]. This memory is able to store and recall patterns when it is required, and can easily categorize new input data [11]. Immunological memory is distributed among the cells in the AIS memory population, and is robust, because when a portion of the memory population is lost, the remaining memory cells persist to produce a response. The major principle behind vaccination procedures in medicine and immunotherapy takes its source from associative properties of immunological memory [13]. Associative recall is a general phenomenon of immunological memory [18].


Introduction
During the last few decades, computer scientists and engineers have increased their interests in seeking inspiration from nature to solve many difficult, complex or intractable problems. More recently a significant attention has been given to Artificial Immune Systems (AIS), called Fig. 1. B-cells with their receptors recognizing the epitopes on an antigen (the picture is based on the information provided in [8]). evaluated via a distance or similarity measure (called affinity measure, degree of match, degree of interaction or complementarity).
Assuming various types of attribute strings to represent the generalized shapes of molecules in the immune system, each of these types requires a particular class of affinity measure. Realvalued shape-spaces require affinity measures that deal with real valued vectors; Integer shapespaces require affinity measures that deal with integer strings [9]; etc.
For real-valued shape-spaces the most common affinity measures are the Euclidean or Manhattan distance. In such case the generalized shape of a molecule (m), either an antibody (Ab) or an antigen (Ag), can be represented by a sequence of real-valued coordinates m =< m 1 , m 2 , . . . , m L >, which can be regarded as a point in an L-dimensional real-valued space (m ∈ S L ⊆ L , where S represents the Euclidean or Manhattan shape-space and L its dimension) [9]. The following equations depict the Euclidean and Manhattan distances respectively: For the Hamming shape-spaces the Hamming distance can be used to evaluate the affinity between two cells. In this case the molecules are represented as sequences of symbols over a finite alphabet of length k. The Hamming distance used to evaluate the affinity between two attribute strings of length L in a Hamming shape-space -is depicted by the following equation: If binary strings (called bit-strings) are used to represent molecules (k ∈ 0, 1), then we have the binary Hamming shape-space (for k=3, we have ternary shape-space, and so on) [9]. In the Hamming shape-space (i.e. in bit-string universe), molecular binding takes place when antibody and antigen bit-strings match each other in a complementary fashion. The affinity between an antibody bit-string and an antigen bit-string is the number of complementary bits, as depicted in Fig. 3. As shown in this picture, the affinity can be computed by applying the exclusive-or operator (XOR) [9]. The expected affinity between two randomly chosen bitstrings is equal to half of their length (if they are the same length). Shape-spaces that measure contiguous complementary symbols are more biologically appealing. There are many other rules available for complementarity [8].  In AIS cells and molecules capable of recognizing a certain pattern, can recognize not only this specific pattern, but also any structurally related pattern [8].
In the symbolic shape-spaces, the attribute strings that represent the components of the artificial immune system are composed of at least one symbolic attribute. Fig. 4 illustrates a Symbolic shape-space in which two shown antibodies contain fragments of a certain database.  In AIS, an attribute string represents the genetic information of the immune cells and molecules. This string is compared with the patterns of antigens received from the environment. (If there is an explicit antigenic population to be recognized, all or some antigens are usually presented to the whole or parts of the AIS. At the end of the learning or recognition phase, each component of the AIS should recognize some of the input patterns [9].) Under the shape-space formalism, each component of the AIS interacts with other cells or molecules whose complements lie within a small surrounding region, characterized by affinity threshold (ε -in Fig. 5). Recognition occurs if the shapes of a B-or T-cell receptors and that of an antigen are approximately complementary. In this case the lymphocyte recognizing the antigen binds to it, at the same time activating the immune response [7]. In Fig. 5 it can be seen that the immune B-cells do recognize not only perfectly matching antigens but are also capable of recognizing foreign agents within the region of complementarity (called the ball of recognition [7]). Fig. 4. An antibody Ab (here illustrated by a big black dot) can recognize any antigen (here illustrated by a triangle), whose complement is positioned within its affinity threshold distance (ε) (the picture has been based on the information provided in [10]).
The degree of recognition between a given antibody and a given antigen (i.e. presented input pattern) can be determined by checking the binding value [10]. There are several activation functions adopted, which define the binding value between two molecules, like a sigmoid matching activation function or a simple threshold function. For the threshold function a bond is established only when the value of the match score is greater than L -ε (see Fig. 6 (a)). The sigmoid function can be used in a continuous case, and the value of ε would be connected with the position of the inflexion point of the curve (see Fig. 6 (b)) [10]. Fig. 6 (b) implies that a match score greater than 8 will produce a high binding value, while a match score of 5 corresponds to a binding value of approximately zero.
In the Hamming shape-space the set of all possible antigens is considered as a space of points, where antigenic molecules with similar shapes occupy neighbouring points in the space. The total number of unique antigens and antibodies is given by k L , where k is the size of the alphabet and L the bit-string length. A given antibody molecule recognizes a set of antigens and therefore covers some portion of the shape-space (see Fig. 5). The affinity threshold (ε) determines the coverage provided by a single antibody [10]. If ε = 0, i.e., a perfect match is required: an antibody can only recognize the antigen that is its exact complement. The number of antigens covered by one antibody within this antibody region of stimulation is given by: where C is the coverage of the antibody, L the length of the bit-string and ε the affinity threshold [10]. Based on the above equation, a given bitstring of length L and an affinity threshold ε, the minimum number of antibody molecules (N ) necessary for the complete shape-space coverage can be defined as: where ceil is the operator that rounds the value in the parenthesis towards its nearest upper integer [10].

Associative properties of secondary and cross-reactive immune responses
A primary response is provoked when the immune system encounters an antigen for the first time [19]. In response to the infection, the immune system produces antibodies, to help eliminate the antigen from the body.
The immune response in fighting a disease begins by reproducing the cells able to recognize and bind with the antigens -i.e. activated B-cell with the highest affinity -which are selected to replicate and mutate (clonal expansion). The clones then undergo high mutation rates (hypermutation). The cells obtained through this process, having greater affinity for the antigen, live longer so as to be still in the organism in the case a future attack occurs (memory cells). While the cloning proliferation rate is directly proportional to the affinity for the antigen, the hypermutation rate is inversely proportional to such an affinity [19]. The nearer Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 22/05/2022 05:00:16 U M C S the cell is to antigen complementarity, the lower is the hypermutation rate. On the other hand, if a cell's antigen affinity is very low, high hypermutation rates are applied in hope to raise the affinity values quickly. This process is called affinity maturation while the composition of antigen recognition, clonal expansion and memory cell creation, is called clonal selection [19].
At the end of an immune response, when the antigen is cleared, the B cell population decreases (leaving a persistent sub-population of memory cells), until the time when the antigen is encountered again 1 . The persistent population of memory cells is the mechanism by which the immune system remembers [19]. A second exposure to the same antigen (or a related antigen), restimulates the memory population inducing an associative recall, in which the memory population of the immune system quickly produces a massive number of B-cells (or CTLs) (through a process called clonal selection) and often the antigen is cleared before it causes disease. This secondary immune response is said to be specific to the antigen that first initiated the immune response. The reason that it is faster than the primary one is attributed to the memory cells remaining in the immune system, so that when the antigen, or a similar antigen, is encountered, new immunity does not need to be built up, it is already there [18]. This means that the body is ready to combat any re-infection (see Fig. 7).
If the secondary antigen is slightly different from the primary one (for example the antigen Ag1' in Fig. 7), the region that this antigen activates may overlap part of the memory population raised by the primary antigen. Memory cells in the overlap bind the antigen and produce B-cells and/or CTLs. It is a cross-reactive response, but people who work with associative memories would call it associative recall [18]. The strength of the secondary immune response is approximately proportional to the number of memory cells in the region that this antigen activates. If a subset of the memory population is stimulated by a related antigen (e.g. Ag1'), then the response is weaker [8].
Cross-reactivity is usually modelled using the affinity threshold. Any pattern lying in a 'neighborhood' of a known pattern can be recognized by the same component of the AIS that recognizes the known pattern. Thus, a component of the AIS can generally recognize any other element whose affinity for is greater than the value of L -ε (as it can be seen in Fig. 7) [10]. In addition to cross-reactivity, some immunologists speculate that antibodies can also be multispecific, in the sense that they can recognize antigens of relatively different structures, as far as enough interactions are established between them. Therefore, multispecificity contributes to the generalization capability of AIS [10,14]. 1 The mechanism(s) by which memory cells persist is not fully understood. One theory is that memory cells live for a long time [6]. Another is that memory cells are restimulated at some low level. A number of mechanisms for restimulation have been proposed. Jerne [15] proposed the idiotypic network theory in which cells co-stimulate each other in a way that mimics the presence of the antigen. Another theory is that small amounts of the antigen are retained in the lymph nodes [18]. Still another is that the related environmental antigens provide cross-stimulation [17]. The idiotypic network theory has been proposed as a central aspect of the associative properties of immunological memory [18].  6. Primary, secondary and cross-reactive immune responses. Ag1 infects the system and a lag phase occurs -before a primary immune response is initiated. The host is then re-infected with Ag1. A fast secondary response is elicited against Ag1. At some time in the future the host is infected with Ag1', which is a slight variation in Ag1. Due to the generalist capability of the immune system, a secondary response is elicited against the antigen (the picture has been based on the information provided in [8]).

Associative memory in the Artificial Immune Systems
Memory in a physical system refers to the ability of the system to preserve information about the state of the universe (including the system itself) at some previous time [12]. Its important biological example is the biological immune system (BIS). Memory in BIS consists of clonally expanded populations of diverse cells. The attribute strings representing the repertoire(s) of immune cells and molecules, and their respective numbers, constitute most of the knowledge contained in an artificial immune system [9]. Furthermore, the parameters like the affinity threshold can be also considered part of the memory of AIS. In artificial immune network models, the connection strengths among units also carry endogenous and exogenous information, i.e., they quantify the interactions of the elements of the AIS between themselves and also with the environment [9]. In most cases, this memory is content-addressable and distributed.
After an immune response to a given antigen (i.e. after the immune system fights off an infection), some sets of cells and molecules (a fraction of the antibody-producing B-cells) are endowed with the increased life spans in order to provide faster and more powerful immune responses to future invasions by the same or similar antigens [19]. This process, known as the maturation of the immune response, allows the maintenance of those cells and molecules successful at recognizing antigens. So the major principle behind vaccination procedures in medicine and immunotherapy takes its source from associative properties of immunological memory [13]. A weakened or dead sample of an antigen (e.g., a virus) is inoculated into Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 22/05/2022 05:00:16 U M C S an individual so as to promote an immune response (with no disease symptoms) in order to generate memory cells and molecules to that antigen (see Fig. 7).
The duration of memory is limited by numbers of cell divisions. In man memory can persist over many years or even decades, but the average lifespan of memory clones in humans is not known [4]. Senescence of individual clones is controlled by numerous factors. Immunological memory is one of the defining characteristics of the adaptive immune system, although it is not entirely straightforward to define either memory or memory cells [4]. A functional definition of memory is the ability to respond more effectively to a second or subsequent exposure to an antigen than to the initial encounter (Fig. 7) [4]. In the case of B-lymphocytes, continued production of antibodies maintains a state of enhanced protection while for T-cells the increased numbers of cells capable of rapid effector responses are retained [4]. For both cell types, memory is generated by the expansion of clones of antigen reactive cells during priming to generate a higher frequency of cells capable of responding to subsequent exposure to the antigen. Therefore memory consists of cells that belong to the clones that have been expanded following encounter with antigen.

Sparse Distributed Associative Memories and their Relationship to AIS Memory
Smith et al. have shown that immunological memory is a member of a class of sparse and distributed associative memories [18]. Another type of memory typical of this class is Kanerva's Sparse Distributed Memory (SDM) [18]. The SDM class of associative memories appears to fall into the danger-model camp of immune system models, as it is capable of recognizing and storing all data present in a given environment, and not just data that falls into either the 'self' or the 'non-self' categories [8].
The Kanerva's model of Sparse Distributed Memory is a form of memory which can be written to by providing an address and data, and then read from by providing an address and getting an output. The SDM is specifically designed to function with enormous address spaces, in which it would be impossible to physically instantiate all of the possible address locations. For example, SDM can cope with addresses of 1000 bits, and therefore 21000 potential address-data locations. An SDM instantiates a small and random subset of these locations, which are referred to as hard locations, and are said to sparsely cover the input space [18]. (For comparison -with respect to the human immune system -an individual has the genetic material and a randomizing mechanism able to express 1010 distinct B-cell receptors, and the number of possible distinct antigens is thought to be in the range 1012 to 1016 at any time [18]). The analogy between the immune system and the SDM class of associative memories is detailed in Table 1, taken from [18].
Immunological memory appears to be distributed among the cells in the memory population, and because of this is robust, as even when a portion of the memory population is lost, the remaining memory cells persist to produce a response. The entire AIS is highly robust due mainly to the presence of populations or networks of components. These elements, cells and molecules can act collectively, co-operatively, and competitively to accomplish their particular tasks. As knowledge is distributed over many components of the system, damage or failure to individual elements might not significantly deteriorate the overall performance [19]. The Artificial Immune System is also highly flexible, noise tolerant and self-tolerant. There is inherent distribution within the immune system. There is no one point of overall control; each immune cell is specifically stimulated and responds to new antigens that can invade the organism in any location. The immune system population is controlled by local interactions and not by a central point of control. As the immune system is distributed throughout the organism, only those cells located closer to the site of infection are recruited for combat. More cells from the neighbourhood can be recruited, but not all immune cells are involved in an adaptive immune response. After a disease has been successfully combated by the immune system, it returns to its normal steady state, until it is needed in response to another antigen (it is a type of self-regulatory mechanism) [19]. The immune system is constantly creating new cells and molecules, and eliminating those that are too old or are not being of great use. There is a process of continuous production, recruitment and death of immune cells and molecules. So at each iteration, time step or interval, the state of an AIS simulating the immune system actions, corresponds to the concentration of the immune cells and molecules, and/or their affinities. In the case of immune network models, the connection strengths among units are also part of the current state of the system [19].

Conclusions
Immunological memory is an associative and robust memory that belongs to the class of sparse distributed memories [18]. It is also a vital component of the immune system, allowing it to remember infections and successfully respond to future invasions by pathogenic microorganisms, and to ensure the survival of its host. It constitutes an emergent property of the antibody population and its dynamics. A second exposure to the same antigen or a related antigen, restimulates the memory population inducing an associative recall [18]. Immunologists refer to associative recall as a cross-reactive response. Many important properties of the immunological memory, and especially its associative, distributed and dynamic character, its robustness, adaptability, ability to generalize data, ability to build associations between novel items presented and those existing in own memory pool, and Pobrane z czasopisma Annales AI-Informatica http://ai.annales.umcs.pl Data: 22/05/2022 05:00:16 U M C S overall unbelievable efficiency -makes the immunological memory a never ending source of many inspirations, research, and new models of engineering artificial immune systems, as a memory which can store and recall data -is the key in any system implementation [21].