1 Introduction

In recent months, the term COVID-19 has been known worldwide. COVID-19 was first reported in Wuhan, China in November 2019 and then spread rapidly to other district of China by means of Spring Festival travel rush. Globalization further facilitates the transmission of the virus to the world. By 17 April 2020, the number of reported confirmed cases exceeded 2 million in 211 countries, territories or areas, and about 140,000 people died from the disease [1].

As a novel coronavirus, no drug and vaccine have been confirmed to be effective and applicable by clinical trials so far. To stop the spread of virus, governments and organizations have implemented and provided a series of policies and advice. For example, in order to cut off virus output, Wuhan city underwent a lockdown and travel restrictions [2]. For persons, the common advice includes staying home as much as possible, keeping social distancing and washing hands often [3,4,5].

Compared with keeping social distancing, staying home and even quarantine strategy, wearing masks is a more frequently adopted precautionary measure and has less influence on a society. Moreover, different from the perfect protection measures such as vaccination [6, 7], the masks can only reduce the risk of infection to some extent. In this paper, we investigate the effect of behavior of wearing masks on epidemic dynamics in the context of COVID-19. Inspired by game theory [8,9,10,11], the decision of each individual about whether to wear a mask or not depends on an evaluation of his/her potential costs and perceived risk of infection. The perceived risk mainly relies on two kinds of sources: local infection information and global infection information [12,13,14,15,16]. Herein, in calculating the risk of infection, we call the situation of local information and global information being involved as local awareness and global awareness, respectively. Furthermore, considering the protection of masks has the time-effectiveness, the individuals’ behavior is time-dependent. That is, the individuals may change their decisions as the disease evolves.

In the paper, two questions are attempted to be answered. One is that, can a population reach a herd-behavior? that is, the majority of the population choose to wear masks. And, which factor contributes to this phenomenon? The other one is that, what effect does global awareness have on epidemic dynamics? The results show that, when the cost of infection is high, the majority of the population trend to wear masks. The impact of global awareness includes two aspects. On the one hand, global awareness can motivate more individuals to wear masks, which is beneficial to epidemic control. On the other hand, once global awareness causes a herd behavior, fewer individuals with high risk of infection can obtain protection due to a limit on mask source, which may instead increase the disease outbreak.

The remaining part is organized as follows. In Sect. 2, we describe the complete epidemic dynamics, including epidemic spreading process and decision-making process. The main results are shown in Sect. 3. Finally, the work of the paper is summarized and its practical significance is discussed.

Fig. 1
figure 1

The time evolution of epidemic dynamics with local and global awareness under several values of \(c_0\). There are 50 stochastic simulations performed. The magenta and cyan squares represent the fraction of susceptible and quarantined individuals at each time, respectively, while the blue, green, red and yellow ones account for the fraction of individuals, who choose to wear masks, wear masks and have the symptomatic neighbors, wear masks and have no infectious neighbors, and, wear masks and have the infectious neighbors in the incubation period only, respectively. The black lines are the results averaged over 50 simulations. To reduce stochastic effect, the time is shifted: when \(t=0\), about 1% of the population has been infected. Consult [20] for more details. a \(c_0=50\); b \(c_0=100\); c \(c_0=200\); d \(c_0=500\). (Color figure online)

2 Model

As introduced above, the whole epidemic dynamics includes two processes: epidemic spreading and decision-making ones.

2.1 Epidemic spreading process

In this paper, we construct an susceptible-exposed-symptomatic-quarantined (SEMQ) model, adapted from the classical SEIR model, in discrete-time formalism to describe the transmission of COVID-19 in contact networks. The classical SEIR model is also the sample of up-to-date works of COVID-19 [17, 18]. The epidemic dynamics are described as follows. At each time step, one susceptible individual, say i, may get the infection from any of its infectious neighbors, who have the capability to infect others, with the baseline infection probability \(\lambda _1\) independently. Considering that some recent studies have suggested that a few people may have the infectivity in the incubation period [4], expect the symptomatic individuals, the infectious individuals also include a part of the exposed individuals, which has great significance for the following decision-making process. Once infected, the individual i will be transferred into the exposed compartment and some symptoms, such as, fever and cough, appear after \(e_i\) time steps. For the symptomatic individual i, there are \(m_i\) time steps used for self-observation. After that, the individual i chooses to go to hospital and finally is quarantined. The quarantined individuals have no chance of transmitting the virus. Here, for the sake of simplification, it is assumed that, before \(d_i\) time steps prior to the symptoms, the individual i becomes capable to infect others.

A network can be described by an adjacency matrix \(A_{N \times N}\), where N denotes the size of network. If \(A_{ij}=1\), then node i is connected to node j; otherwise, \(A_{ij}=0\). In this paper, we consider undirected networks and self-loops are not discussed, i.e., \(A_{ij}=A_{ji}\) and \(A_{ii}=0\), \(\forall \ i,j=1,\ldots ,N\).

Fig. 2
figure 2

The time evolution of epidemic dynamics in the presence of local awareness only. See the other statements in Fig. 1. From the figure, we see that, there is tiny change in the choices of individuals, based on local awareness only, with varying \(c_0\), and, thus, in the final fraction of quarantined individuals. (Color figure online)

2.2 Decision-making process

At each time t, every susceptible individual chooses whether to wear a mask or not in the next time step. One choice is to take the measure with payoff \(-c\), the cost of mask. In return, it results in a decrease in the infection probability by a ratio \(\lambda _2\) with respect to \(\lambda _1\), that is, the probability that a susceptible individual, who wears a mask, is infected by each of its infectious neighbors becomes \(\lambda _1\lambda _2\). The other choice is not to take the measure with payoff 0. Under each choice, the susceptible individuals still have the possibility of being infected with payoff \(-c_0\), the cost of drugs, cures and so on. The decision depends on the difference in the average expected payoffs for two choices, denoted by \(\pi _i^Y\) and \(\pi _i^N\) for node i. To be more specific, each susceptible individual i chooses to wear a mask with probability

$$\begin{aligned} \varPhi _i(t)=\frac{1}{1+\mathrm {exp}^{[-\beta (\pi ^Y_i-\pi ^N_i)]}}, \end{aligned}$$
(1)

at time t, where \(\beta \) represents the strength of choice with \(\beta \ll 1\) random choice and \(\beta \gg 1\) strong choice. From (1), we see that, if \(\pi _i^Y>\pi _i^N\), then \(\varPhi _i>1/2\); otherwise, \(\varPhi _i<1/2\). Here, the form (1) refers to the Fermi-like rule, which widely used in imitation dynamics [8,9,10,11]. The average expected payoffs are given based on the corresponding risk perception functions. Therefore, we first introduce the risk perception function. Taking individual i as an example, the risk perception functions, \(p_i(t)\) and \(q_i(t)\), for two choices, i.e., the perceived probabilities that the individual i will get the infection in the next time step, are given by,

$$\begin{aligned} p_i(t)=1-(1-\lambda _1\lambda _2)^{d_i^{p}}, \end{aligned}$$
(2)

and

$$\begin{aligned} q_i(t)=1-(1-\lambda _1)^{d_i^{p}}, \end{aligned}$$
(3)

respectively, where

$$\begin{aligned} d_i^{p}={\sum _{j=1}^{N}A_{ij}X_j(t)+\sum _{j=1}^{N}A_{ij}\varDelta Q(t)/N} \end{aligned}$$
(4)

represents the perceived number of infectious neighbors. Here, \(X_j=1\) denotes that the node j is symptomatic; \(X_j=0\) otherwise. \(\varDelta Q(t)=Q(t)-Q(t-1)\) accounts for the increased number of quarantined individuals in the last time step. In formula (4), the first term represents the number of the known infectious neighbors, i.e., the symptomatic neighbors, while the second term approximately describes the number of the potential infectious neighbors, that is, the infectious neighbors in the incubation period. The two terms correspond to local awareness and global awareness, respectively. Based on the risk perception functions, \(p_i\) and \(q_i\), the average expected payoffs for two choices then read as

$$\begin{aligned} \pi ^Y_i=-(c+c_0)p_i-c(1-p_i), \end{aligned}$$
(5)

and

$$\begin{aligned} \pi ^N_i=-c_0 q_i, \end{aligned}$$
(6)

for node i.

Fig. 3
figure 3

The time evolution of epidemic dynamics under the limit mask source. The other descriptions are the same as Fig. 1. \(l=0.4\). From the figure, it can be seen that, with \(c_0\) increasing, the phenomenon of the need of masks exceeding the limit appears. (Color figure online)

Fig. 4
figure 4

Boxplot of the final fraction of quarantined individuals in three cases. From left to right, the panels correspond to the cases of local awareness and global awareness, local awareness only, and, local awareness and the global awareness with limited mask source, respectively. The signs from “1” to “4” represent the cases of \(c0=50\), \(c0=100\), \(c0=200\), and \(c0=500\), respectively. On each box, the central mark indicates the median, and the bottom and top edges of the box indicate the 25th and 75th percentiles, respectively. The whiskers extend to the most extreme data points not considered outliers, and the outliers are plotted individually using the “+” symbol. (Color figure online)

3 Results

In this section, a mass of stochastic simulations is performed to show the effect of behavior of wearing masks on epidemic dynamics. Before that, it is necessary to make some statements. First, we use BA network as an approximate representation of contacts between individuals of a population [19]. Initially, we introduce \(m_0=200\) nodes. The new nodes continue to be linked to the network with each \(m=5\) links until the size of network reaches \(N=10^4\). Consequently, the network obtained has the mean degree \(\langle k \rangle =4.9\). In stochastic simulations, for each node i, time steps \(e_i\), \(d_i\), and \(m_i\) are randomly chosen from the Poisson distribution with the corresponding parameters \(m_e\), \(m_d\), and \(m_s\), respectively. It is also worth mentioning that, in principle, it should be satisfied that \(d_i \le e_i\), which means that the time of the individual i being able to infect others is not earlier than the one of the individual i being infected. If not, \(d_i\) is modified to equal to \(e_i\). Unless otherwise specified, we assume \(m_e\)=3, \(m_d=1\), and \(m_s=2\). Moreover, \(c=1\), \(\beta =5\), \(\lambda _1=0.1\), and \(\lambda _2=0.6\).

First, we focus on the effect of infection payoff \(c_0\) on epidemic dynamics. From Fig. 1, it can be seen that, as \(c_0\) increases, the fraction of individuals who wear masks grow remarkably (see the blue squares). In particular, when \(c_0=500\), almost all susceptible individuals choose to wear masks soon after the epidemic begins to spread. It is expected, since, compared to the high cost for infection, cheap masks have a greater advantage. However, we also see that, the final fraction of quarantined individuals drops slightly with \(c_0\) increasing. This is because, the susceptible individuals with the infectious neighbors only can benefit from precautionary measure. According to our mechanism described in Sect. 2, the large value of \(c_0\) does not bring about the obvious change in the decisions of the individuals who have the symptomatic neighbors (see the green squares), while, due to a small decrease in the total infection probability by precautionary measure, the majority of the increased individuals, who wear masks and have the infectious neighbors in the incubation period only, cannot escape from infection in the end (see the yellow squares).

To make it clear that which role global awareness plays in epidemic dynamics, we plot the case that only local awareness is discussed in Fig. 2. By comparison of Figs. 1 and 2, we can see that, compared with local awareness, global awareness has little influence on the choices of the individuals who have the symptomatic neighbors. The significance of global awareness is in reinforcing the choices of the individuals who have no symptomatic neighbors (see the red squares and yellow squares in Fig. 1). In addition, Figs. 1 and 2 also show that, due to the introduction of global awareness, the final fraction of quarantined individuals decreases at the cost of the considerable mask source. The result can also be obtained from Fig. 4.

As shown in Fig. 1, the introduction of global awareness easily results in a herd-behavior phenomenon in a population. For this enormous need of masks, a society cannot often afford. So, it is necessary to discuss the case of the limited supply of mask source. Figure 3 shows the time evolution of epidemic dynamics under the limited mask source. At each time, a fraction l of individuals can obtain masks at most. Once the total need exceeds the limit, the fraction l of individuals are chosen from the individuals who intend to wear masks at random and obtain masks. In Fig. 3, we see, with \(c_0\) increasing, the time scale that the need is restricted increases. Compared with the case of no limit, the fraction of the individuals, who wear masks and have the symptomatic neighbors, decreases, while the final fraction of quarantined individuals increases, and, is even greater than the one in the case of local awareness only, see Fig. 4.

4 Conclusion

In this paper, we simulate the transmission of COVID-19 in BA networks under a precautionary measure. At each time, every susceptible individual has to choose whether to take the measure or not, according to an evaluation of his/her potential costs and perceived risk of infection, involving local awareness and global awareness. The simulation results show that, when \(c_0\) is large, global awareness stimulates more individuals to take the measure, particularly the ones who have no symptomatic neighbors, and, thus, the final fraction of quarantined individuals decreases. On the other hand, due to the limit of mask source, it is likely that the individuals with high infection risk cannot get protection against the infection from precautionary measure and is infected. Therefore, global awareness has twofold effect: positive and negative one.

The practical significance of these observations is that, on the one hand, when global awareness has little influence, some additional measures can be made to enhance the usage of precautionary measure; on the other hand, once global awareness causes the shortage of mask source, more masks should be allocated to the individuals with high risk of infection. Another feasible alternative is to reduce the cost of infection by subsidy policy [9, 11].

In this paper, the decision-making process is dominated by self-interest. In real life, the process may be complex. For example, except self-interest, the imitation behavior also exists in the process. For another example, it is unlikely that all individuals know the infection information of their neighbors. One solution to this is to introduce multiplex networks [21, 22]. Besides, different from the individual’ choice, the research of the population’ choice is also worth attention [23, 24].