May 3, 2023

Why I love immunology (and why you should, too)

The enigma that underpins death and disease

A killer T cell inspecting and attacking a cancerous cell, something that might be happening in your body while you read this blog post–without you ever noticingA killer T cell inspecting and attacking a cancerous cell, something that might be happening in your body while you read this blog post–without you ever noticing

If you were to die today, there’s a high chance you would die because of a failure in your immune system.

Of all the people who will die in the United Kingdom in 2023, roughly half of them will die as a direct consequence of an immune system malfunction (e.g. cancers and infections), and in another 43%, the immune system has secondary involvement. That’s almost 95% of all deaths.1

Since 2020, 69.9% of the world population has been vaccinated to reduce the risk of severe illness and death from the SARS-CoV-2 virus. 13.37 billion COVID-19 vaccine doses have been administered worldwide so far, and even now, in April 2023, an additional 257,000 doses are being administered daily.2

Yet, very few people have much familiarity with how the immune system works, and an even smaller number are actively engaged in understanding and improving it so that as a species we can live longer healthier lives.

In my free time over the last few months, I’ve been studying immunology, and not only do I find it mind-numbingly fascinating and endlessly thought provoking, but also full of opportunities for multi-discipline collaboration–especially between computer scientists and immunologists–leading to significant progress in the field, and ultimately longer healthier lives for all human beings.

In summary, I love studying immunology for the following reasons, which I’ll expand on one by one in the remainder of this rather long article.

  1. It’s a part of my day-to-day life. I have Crohn’s Disease which is the result of an immune system malfunction leading to it mistakenly attacking the lining of my gut as if it were an enemy. To avoid losing all/chunks of my intestine to this broken process, every 8 weeks I’m injected with a lab-grown antibody which prevents my immune system from attacking my own body. It works wonders.
  2. It’s the key to understanding and eventually defeating death and disease. If you exclude accidents, the immune system is involved in pretty much all other causes of death and plays a direct role in about half of them. If we want to beat death, which I think we should and will, we gotta understand how the immune system works.
  3. It’s computationally sophisticated. Just like the brain, the immune system is a complex information processing system. It’s the most complex and most comprehensive threat surveillance and mitigation system to have ever existed and has invented many computational constructs such as 2-factor authentication long before humans did. Looking at it through this lens helps us come up with better therapies and inspires us to develop systems that borrow ideas from the immune system–just like how the original artificial neural networks were inspired by neurons of the brain.
  4. It’s a lucrative market opportunity. In 2021, $350bn worth of therapies were sold to cure a range of diseases such as infections, cancers and autoimmune conditions–a deep understanding of the immune system is at the heart of these therapies. Moderna which was founded only in 2010, generates about $20bn in annual revenues while saving millions of lives.
  5. It’s mind-numbingly complex and fascinating and studying it not only helps us appreciate the beauty and the complexity of our existence but also equips us with new mental models and principles that we can apply elsewhere.

Ok, ok, I’m sold. Where do I begin?

I’m glad you asked! I’d like to insert the “so what?” section of this post here before I dive into each of the 5 reasons listed above in detail.

A very gentle starting point for studying immunology is the book Immune by Kurzgesagt. It’s written in a story-like language, which frankly makes putting it down difficult. Not to mention the stunning illustrations. If you have 10 minutes to spare, watch this 10 min animation style intro to the book–you won’t regret it.

A diagram showing the various cell types in our immune system and how they interact with each other (Source: Immune by Philipp Dettmer)A diagram showing the various cell types in our immune system and how they interact with each other (Source: Immune by Philipp Dettmer)

Once you’ve read Immune, I recommend completing the “Fundamentals of Immunology” course series on Coursera by Dr Alma Moon Novotny of Rice University. It’s intended for pre-med students so it doesn’t spare too much detail, but it’s still gentle enough that anyone with some basic understanding of biology and the immune system can complete it. Plus, you get one of those cool certificates after completing each part. I’ve completed parts 1 & 2 on innate immunity, B and T cells and signalling and I’m currently going through parts 3 & 4.

Finally, there are several well-known reference books for immunology. My favourite one is Janeway’s Immunobiology which covers all there is to know about the immune system at a general, undergrad level. It too has an engaging layout structure and illustrations, although unlike Immune it’s not meant to be read cover to cover.

Lastly, the Immunity podcast by Microbe.TV is a great way of staying on top of the latest research in immunology.

The above will get you to an undergrad-level understanding of the immune system. From there you can specialise in one of its many sub-branches.

Reason #1: It’s a part of my day-to-day life

Every 8 weeks I get injected with 0.8 grams of a monoclonal antibody called Infliximabto keep my Crohn’s under control and prevent it from attacking and destroying my intestinesEvery 8 weeks I get injected with 0.8 grams of a monoclonal antibody called Infliximabto keep my Crohn’s under control and prevent it from attacking and destroying my intestines

I was diagnosed with Crohn’s Disease in 2005 when I was 18, after several months of non-stop fever, weight loss and hair loss. Countless doctor visits, tests and a lot of emotional stress, and finally a gastroenterologist diagnosed me with Crohn’s.

Crohn’s is an autoimmune disease which together with Ulcerative Colitis forms a family of diseases called Inflammatory Bowel Disease (IBD). In autoimmune conditions, the immune system wrongly targets our own cells–in the case of IBDs, the lining of the gut.

The impact of this misled targeting is inflammation in the intestinal walls, which depending on what part of the digestive tract is affected, can result in a variety of symptoms such as diarrhoea, strictures, bowel obstruction, fistulae, weight loss, and wide range of systemic symptoms related to the skin, the joints, and so on.

In the long run, the constant tissue damage-repair cycle could lead to colorectal cancer. In addition, many people with Crohn’s used to require surgeries to remove the affected part(s) of their intestines. However, with advances in biologic therapies over the last 2 decades, most patients thankfully live (mostly) normal and healthy lives.

The pathogenesis of Crohn’s Disease by Boyapati et alThe pathogenesis of Crohn’s Disease by Boyapati et al

Before we talk about biologic therapies, let’s briefly review the sequence of events that take place in our bodies that leads to Crohn’s, or the so-called “pathogenesis” of the disease. It basically goes like this:

  1. The soldiers of your immune system are wired to attack anything in your body that looks foreign–like viruses, bacteria, parasites, even some chemicals (like tattoo ink!)–or is malfunctioning, like cancer cells.
  2. Under normal circumstances, your immune soldiers undergo heavy scrutiny that prevents them from attacking your own cells. To survive, your most capable immune soldiers (T cells) must prove that they can kill the bad guys and none of the good guys (i.e. your own cells). If they fail to prove this, they undergo apoptosis and die before they get a chance to cause damage to your body.
  3. But if you’re unlucky, a combination of specific genetic mutations (in the case of Crohn’s in the NOD2 gene and others) as well as environmental factors (such as stress, smoking, or use of antibiotics), sometimes triggered by an infection, can result in a dysregulation of the immune response, ultimately resulting in your immune cells attacking your own otherwise healthy tissues in an endless loop. Not good.

Immune dysregulation is a big topic. We’ve all seen supplements that claim to “boost” the immune system. In reality, there’s no such thing as boosting the immune system, as like most systems in the human body, the immune system exists in a very delicate equilibrium: If it overreacts to a threat, it can easily kill you. If it doesn’t react strongly enough to a threat, you could develop cancer. And if it fails to stop attacking a pathogen when it should, you might develop an autoimmune disease. So you can’t just tweak one aspect of the immune system without impacting the rest of it, and this makes the absolute notion of a “strong immune system” meaningless.

Immune responses can be beneficial (white) or harmful (red), depending on the nature of the antigen. (source: Janeway’s Immunobiology)Immune responses can be beneficial (white) or harmful (red), depending on the nature of the antigen. (source: Janeway’s Immunobiology)

The 3 steps I mentioned above provide a fairly standard description of an autoimmune condition at a high level, even though each autoimmune condition has its own intricacies:

Some common autoimmune diseases listed in order of prevalence (source: Janeway’s Immunobiology)Some common autoimmune diseases listed in order of prevalence (source: Janeway’s Immunobiology)

Enter biologic therapies (aka *mAbs)

The golden standard of treatment today for many autoimmune conditions is a form of immunomodulation using biologic therapies.

These are mind-blowing treatments that have come into existence in the last couple of decades and have worked wonders for people with autoimmune conditions. Their mechanism of action is as fascinating as their results are miraculous. In a nutshell, they try and intercept the chain of events that leads to a chronic autoimmune condition, but how they do this varies a lot based on the disease they’re used for and the pathways specific to that condition.

When you think of a drug, you normally think of a chemical compound produced in a factory via a chemical process, also called a small molecule drug. Biologic drugs, on the other hand, are produced by living animals and tend to be comprised of much larger molecules.

A biologic drug is typically a monoclonal antibody that gets injected into the body at home or in a hospital with a regular cadence, such as every 8 weeks. Let’s break down what we mean by a “monoclonal antibody”:

Monoclonal antibody drugs typically have names that end with “mab”– short for, you guessed it, monoclonal antibody. Pembrolizumab, Infliximab, Adalimumab–the list goes on and on.

OK, so what is the specific treatment for Crohn’s and how does it work?

Infliximab (sold under the brand name Remicade) and Adalimumab (sold as Humira) are two popular biologic drugs for Crohn’s. Combined, they generate about a whopping $30bn in sales each year, the same amount as all YouTube Ads or Amazon Prime revenues.

The way they work in simple terms is that they bind to a pro-inflammatory cytokine (a messenger molecule) called TNF-α, produced as a result of the mistargeted attack of the immune system on your own body, which results in a reduction in inflammation and alleviation of symptoms. Basically, they break the vicious cycle caused by immune dysregulation.

There are other biologic treatments for Crohn’s too, which intercept the vicious autoimmune cycle at different points.

I am so grateful to live in an age and a country where I have free access to biologic treatments such as Infliximab. A disease like mine that used to significantly worsen one’s quality of life is now merely a nuisance.

However, biological therapies are expensive and thus not accessible to all patients globally. Even in some of the developed world like in the US, biologic treatments are still extremely expensive and inaccessible. Companies like Mark Cuban’s Cost Plus Drugs company are trying to solve this by removing the middlemen from the drug manufacturing and distribution chains.

A Reddit user with Crohn’s Disease holding a Stelara pen, which cost them $30,000A Reddit user with Crohn’s Disease holding a Stelara pen, which cost them $30,000

Reason #2: It’s the key to understanding death and most diseases

It’d be awesome if we didn’t die.

There is no reason why we can’t eradicate most causes of death and essentially make dying optional rather than mandatory and it’s perfectly compatible with the laws of physics. The path that will get us there passes through immunology without a doubt.

1 in 2 people will develop some form of cancer during their lifetime, and 1 in 5 will die from it.3

The table below shows the leading underlying causes of death in the UK for 20214. I’ve added 2 columns showing the high-level category of each cause of death (such as “Cancer” or “Cardiovascular Diseases”) as well as the involvement of the immune system (primary, secondary or irrelevant) in that particular disease.

Here’s a summary of what this table tells us:

The immune system is directly responsible for more than half of all deaths, and indirectly involved in another 43%. So while not sufficient, it’s a necessary component for understanding and curing most diseases.

To master death and diseases, we have to understand the immune system and get a stronger handle on how to modify and improve it. Immunotherapies, mRNA vaccines, biologic treatments, gene editing, and de novo protein design have all opened up new possibilities for intervening and tweaking different aspects of the immune system.

Reason #3: It’s computationally sophisticated

After the brain, our immune systems are the most complex system that we know of.

But unlike the brain, the immune system is not/does not have a central organ. It’s a decentralised, self-organising network of various cell types, circulating throughout the body in the blood or lymphatic vessels, or residing in different tissues. That said, there are interesting resemblances between neurons and immune cells. The immune system does not appear to be conscious, but it’s certainly intelligent.

Immune cells constantly communicate with each other–sometimes via close contact and sometimes using messengers that travel around the body to carry information or promote certain behaviour. For instance, when you cut your finger, the immune cells residing underneath your skin will start emitting cytokines which will recruit additional immune cells to the site of the battle.

Meanwhile another group of immune cells such as dendritic cells, survey and sample the battlefield by collecting things such as small parts of viruses and bacteria, and travelling to other parts of the body such as lymph nodes to provide context to the rest of the immune system, and recruit more soldiers.

Neurons form synapses by extending axons to other neurons. This is the mechanism that allows the 86 billion neurons in our brains to communicate and form a complex network for processing information. This has been the inspiration for one of the most important paradigms (if not the most important) in computing: artificial neural networks (ANNs). ANNs are and are likely to remain the foundation of most Artificial Intelligence.

Even though the nervous system and the immune system are very different, they’re both sophisticated information processing systems.

An immunological synapse between a T cell (green) and a B cell (blue). Source: WikipediaAn immunological synapse between a T cell (green) and a B cell (blue). Source: Wikipedia

The immune system has come up with its own multi-factor authentication (MFA), just like how your Netflix or bank account require you to provide not only your username and password but also a code sent to your mobile phone, to make sure it’s really you.

Your most dangerous weapons, such as killer T cells, require 2 or more signals to activate fully and kick off their rampage. This is to ensure they’re not accidentally activated and cause harm to your own body. Moreover, the number of activation signals required correlates with the destructiveness of the attack.

A T cell encountering a dendritic cell (DC) carrying an antigen it recognises–the first signal. Co-stimulation by additional receptors subsequently fully activates the T cell. Source: Immunology.orgA T cell encountering a dendritic cell (DC) carrying an antigen it recognises–the first signal. Co-stimulation by additional receptors subsequently fully activates the T cell. Source:

The informatics aspect of the immune system is quite fascinating too. Viruses and to an extent bacteria are constantly evolving–even inside our bodies. While they might still express constant characteristics that allow the “static” or innate part of your immune system to identify and eliminate them, sometimes they mutate in ways that effectively make them invisible to your defences. This is where adaptive immunity kicks in.

How did evolution solve this problem? By creating an evolutionary environment in the immune system inside our bodies. We generate immune cells with a random affinity for what they can recognise, eliminate the ones that can attack our own cells, and let the rest loose on potential enemies. We then watch to see what happens and promote the immune cells that turn out to be useful and get rid of the less useful ones.

The way this works in practice is quite complex, but in a nutshell, our B cells and T cells–whose targeting is based on a lock-and-key interaction pattern between their receptors (BCR and TCR) and a pathogen (like a piece of a bacteria)–are capable of randomly shuffling DNA to create new keys for binding antigen (locks). This is called VDJ recombination and essentially consists of each new B or C cell picking a random V, D and J segment from parts of the DNA that code for receptors.

This enables huge diversity. In fact, you may have already had a B or T cell in your body capable of recognising SARS-CoV-2 long before the pandemic started. Similarly, your immune soldiers are already capable of recognising the first pandemic to happen on Mars 100 years from now.

B and T cell receptors consist of a variable and a constant region. The variable regions, which recognise and bind to antigens, are unique in each cell and are the result of random recombination of V, D and J segments. (Source: Janeway’s Immunobiology)B and T cell receptors consist of a variable and a constant region. The variable regions, which recognise and bind to antigens, are unique in each cell and are the result of random recombination of V, D and J segments. (Source: Janeway’s Immunobiology)

This creates a huge amount of diversity in our B and T cells (roughly 3*10¹¹ possible combinations), which means no matter what the threat, you probably already have immune soldiers who can identify and attack it. And again, the winning immune cells will proliferate and create millions of copies of themselves, each of which might have its own unique mutations, and this process recursively continues and never stops.

So there is a never-ending, fast-paced evolutionary race happening inside your body–viruses, bacteria and cancer cells on one side, your immune soldiers on the other side.

Computational models of the immune system enable us to come up with new therapies, such as vaccines, and predict how a patient might respond to a particular pathogen at much faster speeds. Thanks to computational immunology, once the SARS-CoV-2 virus was sequenced, it took Moderna 3 days to come up with its mRNA vaccine candidate.

If you’d like to dig deeper and understand this better, watch this video from the amazing MiXCR team which demonstrates how we can predict a patient’s response to an infection such as Covid-19 using nothing but a few blood samples, sequencing equipment and Python.

Computational models in conjunction with wet lab data are also used to better understand why individuals react differently to infections, say with Coronavirus how some cases were asymptomatic and some unfortunately fatal.

The computational aspects of the immune system can be a great source of inspiration for building more robust and effective threat surveillance and mitigation systems. Antiviruses and firewalls are obvious examples.

Similarly, in my professional field of risk monitoring and management in particular for anti-money laundering and fraud detection/prevention where fraudsters are coming up with new strategies all the time, there is much to be inspired by within the immune system.

For instance, innate immunity translates well to a static set of rules and patterns that are always bad news. Adaptive immunity on the other hand is a stochastic, constantly refined generation of potential defences, that get activated and upregulated should they ever happen to match a threat. For the data scientist reading this, if innate immunity is a rules-based classifier, adaptive immunity is an unsupervised or reinforcement learning system whose sole goal is to eliminate the “other” and keep the “self” alive.

We’ve seen how successful computational paradigms based on biology can be. Neural networks and genetic algorithms are prominent examples. Similarly, I’m hoping that our studying of the immune system could result in new paradigms for computation that result in a better, safer world.

Reason #4: It’s a lucrative business opportunity

The top 50 best-selling pharmaceuticals generated approximately $350bn in 2021; biologics were 66% of that.

50 best-selling pharmaceuticals in 2021 — source: DrugDiscoveryTrends.com50 best-selling pharmaceuticals in 2021 — source:

Moderna was only founded in 2010 and its revenues in 2020 were close to $20bn. In 2019, Moderna whose focus is mRNA vaccines and therapies, had 7 vaccines in its pipeline. In 2022 it had 32.

Much of this growth is owed to Covid-19 vaccine sales, and a near-perfect mixture of preparation, opportunity and execution that put Moderna in the ideal spot to not only save millions of lives but also generate significant profits that it can invest in R&D for its future vaccines, such as vaccines for HIV and several cancers.

Moderna’s vaccine pipeline (source: Moderna annual R&D day 2022 slides, video)Moderna’s vaccine pipeline (source: Moderna annual R&D day 2022 slides, video)

I strongly suspect we will see many more Modernas coming into existence over the next decade, and transforming our lives for the better.

As an entrepreneur, this is hugely encouraging for me. The opportunity to not only build a large and fast-growing business but also to contribute to society in a very real way.

It’s hard to say whether Moderna’s mission is more important for humanity than Google’s or Tesla’s, but at a simplistic level, I’d rather not die from cancer and never watch YouTube again than the other way around. Luckily soon we may not have to pick. But given YouTube’s many alternatives and Moderna’s very few, it appears humanity hasn’t optimised its portfolio of investments sufficiently yet. This is in part due to a lack of sufficient focus on biology and immunology in our education system.

Reason #5: It’s endlessly nuanced and fascinating

Take the story of a killer T cell, which is one of your key defences against most infections and cancers. Basically, a crucial part of what keeps you alive and healthy as you navigate through a biologically hostile world.

In simple terms, the journey goes like this:

  1. Hematopoietic stem cell: The T cell journey starts in the bone marrow with a hematopoietic stem cell, which has the potential to become different types of blood cells.
  2. Thymus: The immature T cell, called a thymocyte, travels to the thymus, a chicken wing-sized organ in the chest, to develop further. In the thymus, the thymocyte undergoes a series of changes to ensure it can recognise and respond to foreign substances, called antigens, and not attack the body’s own cells. This process kills up to 98% of the immature T cells before they “graduate”.
  3. T cell receptor (TCR) rearrangement: During development in the thymus, the thymocyte rearranges its T cell receptor (TCR) genes, creating a unique receptor that allows it to recognise specific antigens. This is the VDJ recombination process we touched on earlier.
  4. Positive selection: Thymocytes that can weakly recognise self-peptides presented by major histocompatibility complex (MHC) molecules on thymic cells are positively selected to survive. Basically, is it good for anything? Yes? Great, carry on.
  5. Negative selection: Thymocytes that strongly recognise self-peptides or self-MHC molecules are eliminated through a process called negative selection, preventing autoimmunity. Basically, is there a chance they could destroy our own cells? No? Great, carry on.
  6. Maturation: The surviving thymocytes become either CD4+ T cells (helper T cells) or CD8+ T cells (cytotoxic or killer T cells) and leave the thymus as mature, naĂŻve T cells, ready to respond to foreign antigens.
  7. Activation: When a pathogen, like a virus or bacteria, enters the body, antigen-presenting cells (APCs) such as dendritic cells, engulf the pathogen and display its antigen on their surface. NaĂŻve T cells with matching TCRs bind to the presented antigen, becoming activated.
  8. Clonal expansion: The activated T cell rapidly divides, creating many copies of itself to mount a robust immune response. We’ve found “the one”–why not copy it many times?
  9. Elimination of the pathogen: The activated T cells perform their specific functions. Helper T cells stimulate other immune cells, such as B cells and macrophages, to destroy the pathogen. Cytotoxic T cells directly kill infected cells, and they’re quite good at it.
  10. Contraction: Once the pathogen is eliminated, the majority of the activated T cells undergo programmed cell death, called apoptosis, to prevent an overactive immune response.
  11. Memory T cell formation: A small number of activated T cells survive and become memory T cells. These cells persist in the body and can quickly respond to the same antigen if the pathogen is encountered again, providing long-lasting immunity.

Each of these simplified steps has a virtually infinite level of detail hidden within them. And to make it even more fascinating, you have 4*10¹¹ (400 billion — about 1% of all your cells) of these cells in your body at any given time, each of which has gone through the process successfully–and many more billions which didn’t pass the quality control tests and got eliminated.

Zoom in on any of these steps, and you’ll see an endless number of layers of detail and complexity until eventually all that’s left is chemistry and then physics.

The lifecycle of a T cell from its origination as a Hematopoietic Stem Cell (HSC) until its conversion to a memory T cell (source: Velardi et al)The lifecycle of a T cell from its origination as a Hematopoietic Stem Cell (HSC) until its conversion to a memory T cell (source: Velardi et al)

As someone who has mainly worked with computers throughout my life, I understand that the modern computing stack, from the hardware layer including CPUs and GPUs all the way up to the application layer is quite complex too. And with time we’ve not only added more and more layers but also each layer has evolved to be more and more complex, to the point where it’s nearly impossible for one person to understand all the nuances and intricacies of let’s say an Nvidia H100 GPU and that of JavaScript. Or similarly, in a large language model like GPT-4 with 1 trillion parameters, there is a degree of complexity that no one human can truly fathom or explain.

So like biology, manmade complexity is also beyond our reach now. A theoretical infinity, at least for any one human.

That said, there are fundamental differences between how biology solves problems and how humans solve them.

One way of looking at our bodies and the human genome is as an old messy code base, written in an obscure language by millions or billions of coders who were blindly trying to fix whatever issue our species or our ancestor species were dealing with at the time. And we’ve been around for quite a while–3.7bn years.

Biological systems are much more redundant. As part of evolution, biology comes up with new solutions to problems over time, and sometimes there’s a winning paradigm that survives and kicks out the other ones, but other times several overlapping solutions might survive because they’re each good at their job. Within the immune system, for instance, some components were developed millions of years ago that we still carry with us. One example of this is the complement system which was likely developed around 500 million years ago and is still in use today. In fact, it’s identified as one of the contributors to severe COVID.

Biological processes are fuzzy. When we write computer code, it’s usually quite deterministic and follows logic. If this thing happens, then do that–although this is rapidly evolving with the advent of large neural networks. Biological processes on the other hand are bound to many more variables that could impact their outcome. For instance, in the immunology context, a newborn B or T cell gets a limited number of chances to rearrange its genes because sometimes it works, and sometimes it doesn’t, and if it doesn’t work, the cell will just kill itself as there’s only so much genetic material in a given cell.

I think it’s important and interesting for computer scientists to study how biological systems work and take inspiration from nature for how to build more robust and versatile software and systems, especially now that a wider than ever spectrum of human intelligence can be modelled using AI systems.

Final words

This was quite a long read! If you made it this far, I hope you enjoyed it and got some value out of it.

I would love to hear your thoughts either way. Please feel free to reach out via comments or drop me an email:





  4. Deaths registered in England and Wales — source:↩︎

Previous post Revisiting the Simulation Hypothesis (With a Side of Solipsism) Recent advances in technologies like AI, VR and BCIs tell a much more plausible story about the origin and nature of life than most other Next post Stuff I’ve built — Semantic Web plugins for Gmail and WordPress (2010) Lifetime revenue: $0 Collaborator(s): Soheil Alavi Stage: Prototype Technologies: Scala for APIs and NLP, OpenLink Virtuoso (graph DB to store