Vikram Pudi

Simulating Infection Spread

Analytics, Visualization

It might seem obvious that reducing social movement will reduce the spread of infection. However, it is not obvious how much it will reduce. Will it be enough to stop the virus? Will it only slow it down? How long do we expect the virus to last in regions with differing population densities?

While there is a definite space for recent advances in AI and deep learning in tackling the current COVID-19 pandemic, such as in drug discovery, medical imaging and diagnosis, answering basic questions such as the above does not require a big hammer. It is important to be able to answer such questions with repeatable certainty, with interpretable tools that are simple, accessible and clear to the general public. In the age of information explosion, where the reliability of information is always questionable, and where it requires authority to convince, it would be pure and simple if the information presented can be directly tested by the viewer.

A simple simulation tool where end-users can change parameters and visualize the corresponding outcome fits this requirement perfectly. While simulations do not capture every detail of the real world, it is sufficient that they capture the essential aspects relevant to the questions we seek to answer.

Here, the end-users are not necessarily scientists or trained people. Otherwise, it would still require a time-consuming chain of authority to convince the general public of their strategies. The end-users should be everyone. The process of decision making should be such that everyone reaches the same consensus.

These criteria require the simulation tool to be accessible over the web, on both desktops and mobile phones, and be simple to use. This was the motivation to develop this “Viral Simulator”.

Experimenting with this simulator reveals significant insights:

1. By reducing our movement (as in social distancing and lock-downs), we can reduce infection spread significantly.

2. In most settings, the infection spread stops in a few months.

3. In unrestricted settings, the infection spreads exponentially, especially in dense populations, before it stops.

4. When we restrict movement, infection spread stops sooner and does not spread widely.

5. Even if the virus has already spread, it can still be contained by restricting movement.

While some of these insights may seem obvious on hind-sight, visualizations are visceral and intuitive. They educate us and make us aware of phenomena that are hard to put in words. Like poems, they tell us stories and interpretations about our situations, which even the original author may not have intended.

Interface and Parameters

The interface is as shown in the above figure. With the objective of simplicity, it is designed so that all parameters and controls are directly accessible on the same screen. Parameters that are unlikely to be set by the user are not presented to avoid clutter and complexity. The simulation window toggles full-screen on clicking / touching it.

The interface is as shown in the above figure. With the objective of simplicity, it is designed so that all parameters and controls are directly accessible on the same screen. Parameters that are unlikely to be set by the user are not presented to avoid clutter and complexity. The simulation window toggles full-screen on clicking / touching it.

As seen, the parameters that can be changed are:

Population Size: A default of 150 people represented as dots are uniformly distributed in the land-areas of the world. This does not represent the real-world distribution in any way. In this simulation, continents only represent regions that are somewhat cut off from each other requiring travel. Alternative models can used at the city, provincial, or national level.

Transmit Probability: The probability that infection is transmitted upon contact.

Transmit Distance: The contact distance within which infection is transmitted.

Travel Frequency: This represents a travel frequency multiplier. By default each person travels once in k months with an exponential distribution, where 1<=k<=6. The number of persons for each k is chosen so that the majority travel once in 6 months, and this reduces exponentially by a factor of 2 as k reduces. So, there will be a few frequent fliers who travel monthly.

Hover Distance: Normal radius of movement of people when they are not traveling.

Death Probability: After 15 days an infected person may become immune or not survive. Probability of death is set to a default of 5%.

The output parameters are shown at the bottom of the visualization and include the number of people who are healthy, infected, immune and expired and the number of days that have passed. The simulation speed can be varied or paused and the user can move frame by frame forwards.

Experimental Results

High Population Experiment

When population is high, infection can spread more easily. Playing with the tool shows that infection spreads exponentially, with not much chance of any slow-down, when population is high.

While there is nothing much that one can do to change the population of their neighborhood, this does give an indication of how the infection may spread in areas with different population densities. It tells us that we need to be much more careful and stricter with the interventions and policies we take when dealing with high population regions.

High Hover Distance

When people hover (i.e. move) around quite a lot in their neighbourhoods then, the infection spreads much more easily. By doubling the hover-distance parameter in the tool, you will notice that an entire continent gets infected quite rapidly. Then, due to travellers, other continents also get infected.

This is perhaps the most important parameter among the studied parameters in the tool. While there is nothing much that one can do about the population of their neighbourhood, they can easily change how much they move around. Seeing how much this impacts the spread of infection, hopefully this will inspire everyone to restrict their movement.

High Travel Probability

When people double their travel, we might expect the infection to spread a lot faster. When we try this in the tool, we can see this effect. However, it is not as dramatic as when we increase hover distance. One reason is that in the simulation, people travel in isolation, and so they are not affected and do not affect others during travel. This may not capture real-life very well.

However, in real life too, the number of people who travel at any point of time is much less than the number who do not travel. After the infection has reached a place, it is more important to restrict hover-distance than travel. Before infection has reached a place, it is much more meaningful to control travel.

Other Experiments

In real-life, we do not have much control over other parameters like:

Transmit probability: The probability that infection transmits upon contact.

Transmit distance: The distance within which infection can transmit.

Death probability: The probability that infection kills.

The values of these parameters are specific to the virus being simulated. The tool aims to be useful at simulating the spread of other communicable diseases by appropriately changing these parameters.

Related Work

The current COVID-19 pandemic has spurred a plethora of activity in a short time on ways to control the pandemic. The excellent survey in [1] highlights the ways in which AI and machine learning are being used against COVID-19. Broadly, it describes the recent evolution of approaches for patient diagnosis, patient outcome prediction and drug development. The survey also describes machine-learning approaches [2][3] for epidemiology modeling that forecast the spread of infection based on the locations of confirmed cases.

A detailed model of infection transmission and the potential impact of interventions was studied in [4]. The focus of all these works is on accurate forecast of infection spread, and not on the visualization aspect.

For visualization, the inspiration for the current tool was the Washington Post article at [5]. However, the visualizations in the article are not configurable by the end-user. To our knowledge, the current tool is unique in offering a configurable online simulation tool for end-users to visualize viral spread.

Conclusions and Future Work

The most important take away of the current experiments is that by reducing our movement, like in social distancing and lock-downs, we can significantly reduce infection spread. In most settings, the infection spread stops in a few months. These can be tested and visualized in the simulation tool that is designed to be highly available and easy to use.

When we reduce hover-distance to a quarter of its default value, we see that the virus does not spread much. There is a small chance that an infected person travels to a dense region and infects the people there. The chance that these infected people further move to other dense regions is small enough that the infection spread stops quite soon. One can also experiment by reducing the hover distance during simulation to see that further spread can be stopped even after the virus has already spread in the population.

Incorporating real data and maps in the tool can help estimate the number of infections, which can be extrapolated to determine the necessary capacity of hospital infrastructure in the region in terms of required number of beds, medicines and ventilators on different days. It is also worthwhile to study the impact of “micro” lock-downs – where lock-down and social-distancing are imposed only in a certain radius of known infections.


[1] J. Bullock , A. (S) Luccioni, et al.: Mapping the landscape of artificial intelligence applications against COVID-19., Mar 2020

[2] Zixin Hu, Qiyang Ge, et al. Artificial intelligence forecasting of COVID-19 in China. arXiv preprint arXiv:2002.07112, 2020b

[3] M.A.A. Al-qaness, A.A. Ewees, et al. Optimization method for forecasting confirmed cases of COVID-19 in China.Journal of ClinicalMedicine, 9(3):674, Mar 2020.

[4] N.M. Ferguson, D. Laydon et al. Impact of non-pharmaceutical interventions (NPIs) to reduce COVID-19 mortality and healthcare demand., Mar 2020

[5] H. Stevens: Why outbreaks like coronavirus spread exponentially, and how to “flatten the curve”,, Mar 2020

Blogger Profile

Vikram Pudi is an Associate Professor of Computer Science in the Data Science and Analytics Center at IIIT Hyderabad. His research focuses on learning interpretable models, interactive learning, recommendation systems and citation analysis. He has published extensively at leading venues such as ICDM, AAAI, IJCAI and PAKDD. He has served in the Organizing and Programme Committees for several editions of DASFAA, PAKDD, ICDE and COMAD. He holds a Ph.D. in computer science from Indian Institute of Science, Bangalore. He enjoys developing in python, javascript and C/C++.

Copyright @ 2020, Vikram Pudi, All rights reserved.