Anali PAZU - Letnik 3, leto 2013, številka 1 8 Immune systems in computer science Imunski sistemi v računalništvu Karin Ljubič 1, *, Iztok Fister Jr. 2 in Iztok Fister 3 1 Medical student / University of Maribor, Faculty of Medicine, Taborska 8, 2000 Maribor 2 Technical staff / University of Maribor, Faculty of Electrical Engineering and Computer Science, Smetanova 17, 2000 Maribor 3 Assistant professor / University of Maribor, Faculty of Electrical Engineering and Computer Science, Smetanova 17, 2000 Maribor E-Mails: lifeisforliving1@gmail.com ; iztok.fister2@uni-mb.si; iztok.fister@uni-mb.si Abstract: A simplified description of the immune system is as follows: this is an organic system intended for protecting the host organism from the threats posed to it from pathogens and toxic substances. The architecture of the immune system is such that a series of defensive layers protect the host. Once the pathogen makes it inside the host, it must contend with the innate and adaptive immune system. These two immunological sub-systems are comprised of several types of cells and molecules produced by specialized organs and processes to address the self non-self problem. Artificial Immune Systems (AIS) are computational models, based on natural immune systems. They tend to solve specific problems in computer science by resembling the natural mechanisms. These systems are more widely applied within problem domains like clustering, pattern recognition, classification, optimization, and machine learning. Modern AIS are inspired by one of three sub-fields: clonal selection, negative selection, and immune network algorithms. In computer science, the clonal selection pattern can be used for pattern matching and optimization. The negative selection algorithm was designed for change detection, novelty detection, and intrusion detection. Immune network algorithms are inspired by the immune network theory of the acquired immune system and it is an upgrade of the clonal selection theory. The objective of the immune network process is to prepare a repertoire of discrete pattern detectors for a given problem domain, where better performing solutions suppress low affinity solutions within the same network. This is an interactive process of exposing the pattern to external information to which it responds. This article explains the biological background, the mechanisms of AIS, and presents their real-world applications. It presents an overview of those important applications of AIS for solving problems from problem domains like data analysis, anomaly detection, intrusion detection, and others. Key words: natural immune system, artificial immune system, antigen, antibody, algorithm, somatic hyper-mutation. Povzetek: Poenostavljeno opredelimo imunski sistem kot organski sistem, ki je namenjen za zaščito gostiteljevega organizma pred patogeni in toksičnimi snovmi, ki ga ogrožajo. Sestava imunskega sistema temelji na vrsti obrambnih plasti, ki ščitijo gostitelja. Ko patogen uspe prodreti v organizem, se mora spopasti s prirojeno in pridobljeno imunostjo. Ta dva podsistema sestojita iz mreže medsebojno sodelujočih celic in molekul, ki jih proizvajajo specializirani organi, in procesov, ki pomagajo organizmu razlikovati lastne molekule od tujih. Umetni imunski sistemi so računalniški modeli, ki temeljijo na naravnih imunskih sistemih. Z refleksijo naravnih mehanizmov so sposobni reševati kompleksne probleme v računalništvu. Tovrstni sistemi so široko aplicirani znotraj različnih problemov, kot so razvrščanje, optimizacija, strojno učenje in razpoznavanje vzorcev. Moderni imunski sistemi so narejeni po zgledu treh področij:klonalna selekcija, negativna selekcija in algoritmi imunskih mrež. Mehanizmi klonalne selekcije so uporabni pri optimizaciji in razpoznavanju vzorcev. Algoritmi negativne selekcije so bili zasnovani za zaznavanje sprememb in vdorov v sisteme. Algoritmi imunskih mrež predstvljajo nadgradnjo teorije klonalne selekcije in so zasnovani na modelu pridobljenega imunskega sistema. Nadgradnja teorije imunskih mrež v primerjavi s klonalno selekcijo je v dejstvu, da so rešitve z boljšimi rezultati sposobne zavreti rešitve, ki dajejo slabši rezultat pri reševanju določenega problema oz. imajo slabo afinteto prepoznavanja specifičnih vzorcev. Gre za interaktivni proces izpostavljanja sistema zunanjim informacijam, na katere se odzove. Članek pojasnjuje biološko ozadje umetnih imunskih sistemov in navaja možnosti njihove aplikacije v resničnem svetu. Predstavlja pregled pomembnih aplikacij umetnih imunskih sistemov na različnih Anali PAZU - Letnik 3, leto 2013, številka 1 9 področjih, kot so analize podatkov, odkrivanje anomalij, zaznavanje vdorov in drugi. Ključne besede: biološki imunski sistem, umetni imunski sistem, antigen, protitelo, algoritem, somatska hipermutacija. 1. Introduction The following article presents the usages of immune system concepts in computer science. Immunology is a relatively new science. Its origins have been attributed to Edward Jenner, who in 1796 discovered that by introducing a small amount of vaccine in an animal would induce protection against the often lethal disease smallpox. When Jenner discovered the process of vaccination, very little was known about the functioning of the immune system. In the 19 th century the discoveries of Koch and other researchers contributed to the development of the science of immunology, and this development is still continuing. Artificial Immune Systems (AIS) is a sub-field of Computational Intelligence (CI) motivated by Immunology which emerged during the early 1990s [1] [2] . It is based on a proposal for applying theoretical immunological models to automated problem solving and machine learning [3] . The first attempts were inspired by immune network theoretical models and were applied to machine learning, control, and optimization problems. The more successful attempts were those that proposed the immune systems as analogies for information protection systems within the field of computer security. The two prominent examples include Forrest et al.'s Computer Immunity [4] and Kephart's Immune Anti-Virus [5] . Immune systems are inspired by one of three sub-fields: clonal selection, negative selection, and immune network algorithms. The techniques are commonly used for clustering, pattern recognition, classification, optimization, and other similar machine learning problem domains. This article analyses the concepts of modern artificial immune systems. Chapter 2 explains their biological background and the basics of immune systems. The chapter is divided into innate and adaptive immune systems for providing the basic biological explanations of those mechanisms which are used within the field of artificial immune systems. Chapter 3 focuses on artificial immune systems and their differentiation and principles. The correlations between the natural and artificial immune systems are explained as to how and where they work. Chapter 4 upgrades the previous chapter by presenting applications of immune-based algorithms in practice. It also includes some new fields by considering immune system investigations that might be important in the future. 2. Biological basics of immune systems The immune system can be divided into two basic components, the innate and adaptive immune systems. [6] The innate immune system lacks the specificity. Therefore it is also called non-specific response. The adaptive immune system adapts its response during an infection and improves its recognition of a pathogen after the first encounter. This improved response is then retained in the form of an immunological memory. The immunological memory allows the adaptive immune system to act much quicker and stronger when there is a second encounter with the same pathogen [7] . Table 1 presents the basic differences between the innate and adaptive immune system. Table 1. The two basic components of the immune system. The table shows two basic distinctions of the immune system and the differences between them. The adaptive immune system is present only in jawed vertebrates and has many advantages over the innate immune system, e.g., antigen specific response, lag time, and immunological memory. 2.1. Innate immune system The innate immune system provides a non-specific response, which is maximal even at the first encounter with an intruder. It is not able to adapt its response. This means that at any encounter with the same pathogen, the response will be the same. The innate immune system relies on four important characteristics: surface barriers, inflammation factors, complement system, and some specially designed cells. Innate immune system Adaptive immune system Non-specific response Antigen specific response Exposure leads to immediate maximal response Lag time between exposure and maximal response No immunological memory Immunological memory after exposure In nearly all forms of life Only in jawed vertebrates Anali PAZU - Letnik 3, leto 2013, številka 1 10 The surface barriers provide chemical, mechanical, and biological protection against intruders. Human skin, the flushing actions of tears and urine, and the surface of a respiratory tract secreting mucus are all good examples of surface barriers. Inflammation factors include eicosanoids and cytokines, which are released by injured or infected cells. They are important for the production of fever and dilatation of the blood vessel associated with inflammation. Common cytokines include chemocines that promote chemotaxis (directed movement of cells) [8] . The third important part of the innate immune reaction is the complement system. This is an important cascade of molecules that attack the surfaces of foreign cells. It contains over 20 different proteins and is a major component of the innate immune response [9] . This catalytic cascade that works in a positive feedback mechanism opsonizes (coats) in the surface of a pathogen and marks it for destruction. Lastly, specially designed cells also take part in innate response. These cells are macrophages, dendritic cells, mast cells, neutrophils, eosinophils, basophils, and natural killer cells. These cells of innate immunity play an important role in activating and shaping the adaptive immune response upon activation of their innate immunity receptors. Before the discovery of special receptors on these cells, called Toll-like receptors (TLRs), innate immunity was seen as a crude and unsophisticated part of the immune system. TLR receptors are a class of single membrane- spanning receptors and they recognize structurally conserved molecules derived from microbes. After the activation of TLRs, immune cells produce cytokines. Cytokines are involved in cellular activation and therefore we can say that the innate immunity is responsible for triggering the adaptive immunity [10] . Dendritic cells are antigen-presenting cells with a unique ability to induce and control the development of adaptive immune response. They capture and transfer information from the outside world to the cells of the adaptive immune system. Their main function is to process antigens and present it to the specific clones of lypmhocytes, thus inducing their proliferation and expansion. They are antigen-presenting cells and act as messengers between the innate and adaptive immune system [11] . They have many spine-like projections and are mainly located in the skin, nose, lungs, stomach, and intestines. Macrophages are also phagocytocis cells. Basophils, neutrophils and eosinophils secrete chemical mediators that are involved in defending against pathogens (Figure 1) [8] . Figure 1. Neutrophils, eosinophils, and basophils. Collectively they are referred to as granulocytes because of the small granules inside which contain chemical mediators. 2.2. Adaptive immune system The adaptive immune system remembers a pathogen by its signature. This signature is called the antigen and so this is an antigen-specific response. Antigen is a part of pathogen or self-molecules that evokes the adaptive, antigen-specific immune response, be it the production of antibodies or T-cell mediated immunity. Each antibody or T-cell receptor binds to a specific antigen by way of an interaction similar to the fit between a lock and a key. There is a lag-time between exposure and the production of antibodies, and during this lag-time the immunological memory is formed and the response is upgraded. The two main parts of the adaptive immune system are lymphocytes B and T. We will describe some important mechanisms of an adaptive immune response which have inspired computer science. Central tolerance is the mechanism by which lymphocytes B and T mature. B-cell maturation occurs in bone marrow and T-cell maturation occurs in thymus. These developing B and T cells are first exposed to positive selection to self-antigens. The positive selection selects for survival of those cells which can respond through their receptors. Those that do not respond, fail to survive [12] . In the next stage, developing B and T lymphocytes are exposed to self- antigens in the process called negative selection. The negative selection deletes the clones which respond to self antigens strongly. The affinity part seems to play an important role, since those clones that still respond, but with a lower affinity, will be regulatory clones which spread the tolerance to self signals (Figure 2) [8] [13] [14] . Anali PAZU - Letnik 3, leto 2013, številka 1 11 Figure 2. The clonal selection and the negative selection principle. Some lymphocytes carry the receptors that bind to self-antigens. They are eliminated during the early phase of development before they are able to perform and attract an immune response. This process leads to self-tolerance and is called ‘negative selection’. When the foreign antigen interacts with the receptor within a mature lymphocyte, the cell is activated and commences proliferating. This is the ‘clonal selection principle’. The clone will arise and differentiate between effector and memory cells. During the differentiation these cell undergo changes called ‘somatic hyper-mutation’. Lymphocytes B produce antibodies. Antibodies are their way of detecting antigens. Each antibody produced by lymphocyte B has its own unique variable region which allows an antibody to recognize its matching antigen. When an antibody binds to an antigen, this antigen/antibody complex is taken up by B lymphocytes and processed by proteolysis into small particles, peptides. 3. Artificial immune systems Artificial immune systems simulate the basic concepts of natural immune systems in order to solve real-world problems. Immunology is the researching of immune systems and the body's protection against viruses, bacteria, cancer and other intruders. Nowadays, artificial immune systems are based on three important types, as follows: - clonal selection algorithm, - negative selection algorithm, - immune network algorithm. The clonal selection algorithm is inspired by the clonal selection theory of acquired immunity [15] [16] . This theory proposes that when a lymphocyte binds to an antigen, it starts to proliferate, making many more thousands of copies of itself and differentiates into different cell types (Figure 2). The important feature of the theory is that when the cell proliferates, it goes through the process of small copying errors [17] .This causes the changes in the genome and these changes are called ‘somatic hyper- mutation’ [18] . The result of this process is the change of the shape of the expressed receptors and subsequent antigen recognition capabilities. In other words, starting with the initial repertoire of general immune cells, the system is able to change itself in composition and density. The general model of the clone selection algorithm involves the selection of antibodies (possible solutions) and these selected antibodies are subjected to cloning (proliferation) and hyper- mutation. The goal is to produce antibodies which have the highest affinity to a certain antigen pattern. The resultant clonal set competes with the existent antibody population for membership in the next generation. In addition, all low affinity population members are replaced by randomly generated antibodies. The result is antibodies which express the highest affinity for a certain pattern. As seen from the description, the clonal selection pattern in computer science can be used for pattern matching and optimization [19] . A negative selection algorithm is inspired by the process of negative selection described earlier in this article. This self-nonself discriminatory behavior is responsible for the fact that only the cells selected for potentially harmful and foreign material in the body are included in the ongoing proliferation (Figure 2). In this way, self-reactive immune cells are destroyed. The negative selection algorithm was designed for change detection, novelty detection, and intrusion detection [15] . This is achieved by building a model of changes, anomalies or unknown data by generating patterns which do not match with an existing corpus of available (self or normal) patterns. After that this prepared abnormal model is used to monitor the existing normal data or streams of new data by seeking matches to the abnormal patterns [20] . Anali PAZU - Letnik 3, leto 2013, številka 1 12 Immune network algorithms are inspired by the immune network theory of the acquired immune system. This is an upgrade of the clonal selection theory. A concern of this theory is that it presumes that immune cells remain idle when there are no pathogens to which to respond [20] . The immune network theory proposes that immune cells are not at rest in the absence of pathogen, instead the antibody and immune cells recognize and respond to each other [21] . Antibodies, both free-floating and surface-bound, possess surface features to which the receptors of other antibodies can bind. As a result of this interaction, antibodies both excite and inhibit each other within complex regulatory networks (chains of receptors) [22] . Regarding this principle, in addition to a cell which reacts directly with pathogen, there are cells that interact with those reactive cells. The objective of the immune network process is to prepare a repertoire of discrete pattern detectors for a given problem domain, where better performing cells suppress low affinity cells within the same network [23] . This is an interactive process of exposing the population to external information to which it responds. 4. Applications of AIS Currently, the negative selection algorithm is the most popular in computer applications. The purpose of negative selection is to provide tolerance for self-cells. The pseudo-code of this AIS algorithm is presented in Pseudo-code 1. Pseudo-code 1: Algorithm AIS with negative selection 01: 02: 03: 04: 05: 06: 07: 08: 09: 10: 11: 12: 13: Input: S = set of known self samples Output: D = set of collected detectors repeat Randomly generate potential set of detectors pP  ; Determine the affinity of each member pP  with each member of the set sS  ; if At least one element sS  match a detector pP  then Discard pP  ; else Add pP  to detector set D ; endif until Termination condition has been met; As can be seen from Pseudo-code 1, let us assume an input set of seen known self-samples, while the set of generated detectors is obtained. In main loop (lines 03.13), the algorithm randomly generates a potential set of detectorspP  . Then the determining of the affinities of each number inpP  against each member ofsS  , needs to be performed (line 04). Finally, detection stage (lines 07-12) is conducted in order to verify whether at least one element in sS  matches the detectorpP  . In that case, the detector is rejected while, in contrast, it is added to the set of available detectors D. The principle of this detection stage is illustrated in Figure 3. Figure 3. Principle of the detection stage. The detection stage consists of two input sets: the set of detectors pP  and the set of self samplessS  . If any element sS  matches the detector pP  this is rejected, otherwise it is added to the set of available detectors   D D p  . Table 2 represents some important applications of AIS algorithms. For more profound knowledge about an application of AIS in real-world, readers are invited to follow references as proposed in this table. As can see from the tables, the AIS applications can be found within many computational domains as well as in real- world practice. As many sources have suggested, AIS is very useful for intrusion [24] or anomaly detection [25] . In line with this, some AIS applications are used for computer virus detection too. On the other hand, very interesting applications also focus on the optimization. For example, Gong et al. [30] applied AIS to numerical optimization. Moreover, Freschi and Repetto [29] solved multi-objective optimization problems with AIS. On the other hand Coello [26] applied AIS to job shop scheduling which is a well-known problem of combinatorial optimization. Some tests have also showed that AIS provides promising results by data analysis [27] and also by clustering [31] . From these facts, Anali PAZU - Letnik 3, leto 2013, številka 1 13 it can be concluded that AIS is a suitable method for data mining. Actually, data mining is currently one of the hottest areas of research in computer science. Nowadays, AIS is also a proven tool in industrial [28] as well as control system [32] domains. Table 2. Applications of algorithms based on AIS Application Author Intrusion detection Aickelin et. al. [24] Anomaly detection Greensmith et. al. [25] Numerical optimization Gong et. al. [30] Multi-objective optimization Freschi and Repetto [29] Job shop scheduling Coello et. al. [26] Data analysis Timmis [27] Dociment clustering Tang and Vemuri [31] Industrial applications Dasgupta and Forrest [28] Control systems Wei and Zhang [32] AIS are still under development and further improvement. In the future, we can expect more real- world applications using AIS for solving hard problems. Therefore, many novel variants and hybrids of AIS will come out in the following years. 5. Conclusion This paper presented the principles of the natural immune system which in turn inspire artificial algorithms for solving complex problems in computer science. The immune system is a remarkable natural defense mechanism that exhibits capabilities like learning, memory, and adaptation. In line with this, it is hoped that this article has served to convince the reader that the immune system is worthy of study from a computational point of view. This article exhibited three main types of AIS: clonal selection, negative selection, and immune networks. The goal of AIS in the future should be to further extract what can be considered as inspiration from the components and processes from the immune system for creating effective and powerful computational systems. A significant number of concepts could be (or currently are being) used in the development of AIS. Some of these concepts are clonal expansion and affinity maturation, cross-reactivity, epitope, idiotope, paratope, B-cell and BCR, T-cell and TCR, network structure, dynamics and meta-dynamics, etc. It can be seen that the possibilities of extracting useful metaphors and constructing new AIS theories are still wide-open. References 21. H. Bersini and F. Varela, "Hints for Adaptive Problem Solving Gleaned from Immune Networks", in Lecture Notes, Computer Science, 1990. 22. Y. Ishida, "Fully distributed diagnosis by PDP learning algorithm: towards immune network PDP models", in IJCNN International Joint Conference on Neural Networks, 1990. 23. G. W. Hoffmann, "A Neural Network Model Based on the Analogy with the Immune System", Journal of Theoretical Immunology, 1986. 24. S. Forrest and A. S. Perelson and L. Allen and R. Cherukuri, "Self-Nonself Discrimination in a Computer", in Proceedings of the 1992 IEEE Symposium on Security and Privacy, 1994. 25. J. O. Kephart and G. B. Sorkin and W. C. Arnold and D. M. Chess and G. J. Tesauro and S. R. White, "Biologically inspired defenses against computer viruses", in Proceedings of the 14th International Joint Conference on Artificial Intelligence, 1995. 26. Roitt, Brostoff, Male, Immunology, 5 th Edition, Mosby, 1998 27. M. Vozelj, Medsebojno spoznavanje in sodelovanje celic, Ljubljana 1989 28. M. Vozelj, Temelji imunologije, UL MF, Ljubljana 2000 29. L. V. Kozlov, O.O. Burdelev, S.V. Bureeva, A.P. Kaplun, Artificial inhibition of the complement system, Russian Journal of Bioorganic Chemistry, Volume 33, Issue 5, 2007 30. L. A. O´Neill, D Golenbock, AG Bowie, The history of Toll-like receptors-redefining innate immunity, Nature Reviews Immunology, 2013 Anali PAZU - Letnik 3, leto 2013, številka 1 14 31. J. Banchereau, F. Briere, C Caux, J. Davoust, S Lebecque, Y. Liu et. all. Immunobiology of dendritic cells, Annual review of Immunology, 2000, 18: 767-811 32. S. C. Jameson, KA Hogquist, M. J. Bevan, Positive selection of thymocytes, Annual review of Immunology 1995,13: 93-126 33. S. Sakaguchi, Naturally arising CD 4+ regulatory T-cells for immunologic self-tolerance and negative control of immune responses, Annual review of Immunology 2004, 22: 531-562 34. T. K. Starr, SC Jameson, K. A. Hogquist, Positive and negative selection of T-cells, Annual review of Immunology 2003, 21:139- 176 35. F. M. Burnet, A modification of Jerne´s theory of antibody production using the concept of antibody selection, Australian Journal of Science, 1957 36. F. M. Burnet, The clonal selection theory of aquired immunity, Vanderbilt University Press, 1959 37. L. N. de Castro, J.F. Von Zuben, Artificial Immune Systems – Part I: Basic Theory and Applications, State University of Campinas, 1999 38. D. L. French, R. Laskov, M. D. Scharff, The role of somatic hypermutation in the generation of antibody diversity, Science 1989 39. L. N. de Castro, F. J. Von Zuben, Learning and optimization using the clonal selection principle, IEEE Transactions on Evolutionary Computation, 2002 40. S. Forrest, S. A. Hofmeyr, A. Somayaji, T .A. Longstaff, A Sense of Self for Unix Processes, Proceedings of the 1996 IEEE Symposium on Security and Privacy, 1996 41. J. Brownlee, Clever Algorithms: Nature - Inspired Programming Recipes, Lulu Enterprises, 2011 42. J. T. Jacobsen, E. Lunde, V Sunvold-Gjerstad, L. A. Munthe, B.Bogen, The cellular mechanism by which complementary Id+ and anti-Id antibodies communicate: T cells integrated into idiotypic regulation, Immunology and cell biology, 2010 43. N. K. Jerne, Idiotypic networks and other preconceived ideas, Immunological Reviews, 1984 44. Aickelin et al., Artificial Immune Systems, Immune system approaches to intrusion detection-a review, Springer, 2004 45. Greensmith et. al., Artificial Immune Systems, Introducing dendritic cells as a novel immune- inspired algorithm for anomaly detection, Springer, 2005 46. Coello et. al., Artificial Immune Systems, Use of an artificial immune system for job scheduling, Springer, 2003 47. Timmis et. al., Artificial immune systems: a novel data analysis technique inspired by the immune network theory, University of Wales, 2000 48. Dasqupta and Forrest, Artificial Immune Systems in Industrial Apllications, Intelligent Processing and Manufacturing of Materials, IEEE, 1999 49. F. Freschi, M. Rapetto, Artificial Immune systems, Multiobjective optimization by a modified artificial immune system algorithm, Springer, 2005 50. Gong et. al., A population based artificial immune system for numerical optimization, Neurocomputing, Volume 72, Elsevier 2008 51. Tang and Vemuri, Proceedings of the 2005 ACM symposium on Applied computing, An artificial immune system approach to document clustering, ACM, 2005 52. W. Wei and G. Zhang, Artificial Immune Systems and Its Applications in the Control System, Control Theory and Applications, volume 2, 2002