# COVID-19 Epidemic Analysis in India with Multi-Source State-Level Datasets

Authors: Qirui Wang
Journal: BioMed Research International
 (2022)

---

## Abstract

The COVID-19 pandemic has been a global crisis affecting billions of people and causing countless economic losses. Different approaches have been proposed for combating this crisis, including both medical measures and technical innovations, e.g., artificial intelligence technologies to diagnose and predict COVID-19 cases. While there is much attention being paid to the USA and China, little research attention has been drawn to less developed countries, e.g., India. In this study, I conduct an analysis of the COVID-19 epidemic in India, with datasets collected from different sources. Several machine learning models have been built to predict the COVID-19 spread, with different combinations of input features, in which the Transformer is proven as the most precise one. I also find that the Facebook mobility dataset is the most useful for predicting the number of confirmed cases. However, I find that the datasets from different sources are not very effective when predicting the number of deaths caused by the COVID-19 infection.


---

## Body

## 1. Introduction

Reoccurring outbreaks of the COVID-19 epidemic in the world remind us that the coronavirus is becoming more dreadful. Especially the various variants, which are threatening the current protection systems and affecting the reliability of vaccination. Among various variants, Delta and Delta-plus, which were first discovered and initially spread in India, showed breathtaking infectivity. On May 5, over 400 thousand people have been confirmed in a day in India.Compared with other countries, the consistency of coronavirus in India is purer, and the related studies have a higher value as the reference for Indian and other governments preventing the Delta and Delta-plus variant. This is a merit chance to disclose more information about the new variants, including whether the current government’s controlling methods still work, could the mobility data still be helpful for predicting the trend of epidemic, or determine the effect of Indian vaccination for the new situation. However, there is little research on the Indian epidemic and rarely adopts complex and state-of-art machine learning models. One of the reasons for the situation is insufficient public or complete Indian epidemic datasets. Some related institute in India does not public the historical data but daily data, and it will be time-costing to collect data by researchers. The missing values in the collection of the epidemic datasets also disturb the researches. Also, the short of attention of the Indian epidemic is also a problem.In this research, I mainly did the following contributions: (I) Collecting an Indian with the statewise COVID-19 dataset covering from October 1, 2020, to July 15, 2021, with medical statistics, population mobility, and census data. Considering the complex situation of Indian society and geography, a statewise dataset will be beneficial for evaluating the importance of features and show the influences at the geography level. The dimensions of my dataset are much more than previous, and the dataset will be public on GitHub (the website of data:http://github.com/vividricky/IndiaCovid19StateDataset) and convenient for the following researchers. (II) Six different models have been implemented and compared in the research, including traditional statistic models, logistic regression, and multiple linear regression, the data-driven time-series machine learning models: LSTM, Transformer, DeepAR, and TCN for predicting the trend of COVID-19 in India. Specified notes that up to the research finished, few studies have tried the last three models in the Indian epidemic. This work fills the gap of state-of-art time-series machine learning in this field. According to the experiment, the Transformer model showed the best performance during six models, and mobility data contributes most in predicting the trend of the epidemic.Based on my observations, I demonstrate that the collection of multisource datasets is valuable for the prediction and further control of the COVID-19 epidemic, although its cost is a new burden for the government. The second corollary is that human mobility does contribute significantly to the spread of viruses, including COVID-19 and other influenza and diseases. Maintaining social distance and lockdown policies are necessary even with the potential economic losses.The rest of this paper is organized as follows. Related work is discussed in Section2. Multi-source datasets are described in Section 3. The models used in this study are discussed in Section 4. The experimental results are presented in Section 5. A short conclusion is given in Section 6.


## 2. Related Work

Since the first break out of the COVID-19 epidemic in India, many researchers have contributed to identifying factors that may influence the spread of COVID-19 and constructing models to predict the number of confirmations, deaths, and recoveries in India. These models cover medical, mathematical, and machine learning types. Also, some studies for other countries provide a good reference for studying the situation in India.Mele and Magazzino investigated the relationship between economic growth, air pollution, and transmission of COVID-19 in India [1]. They first used stationarity and Toda-Yamamoto causality to prove that PM2.5, CO2, and NO2 increase with the development of cities. Then, a D2C algorithm is adopted to verify a casual line between PM2.5 and the number of deaths of COVID-19. Roy et. al did the disease risk analysis of Indian states [2]. They forecast the risk of COVID-19 using Autoregressive Integrated Moving Average (ARIMA). They introduce the GIS data of India into the model, including the population density and regional status. ARIMA captures the pattern in two parts, in which AR calculates based on the past values and MA computes the difference of current and previous knowledge. However, ARIMA only considered the time-dependent data and cannot understand the breaking events, such as community infections. Kumari et al. built a multiple linear regression model of social policies to predict the spread, recovery, and deaths in India [3]. Multiple linear regression is an explained method that can tell the importance of factors by showing weights. Moreover, autoregression and autocorrelation have been imported to the model to increase the accuracy of the model and finally generate a good performance. As shown in the research of [3], the lockdown and social distance policies contribute the most to slow the spread of the virus.Besides the traditional mathematic models, medicinal models and machine learning models are also widely used in related studies. Ghosh and Malavika’s teams successively used the logistics regression model to predict the trend of COVID-19 [4, 5]. Ghosh et al. separately developed a logistic regression model and an exponential regression model [4]. They used the exponential regression model as the upper bound and a linear combination model of the above two models with DIR value as the lower bound to predict the range of confirmed numbers in India. Foy et al. focused on the priority group of vaccination. They considered the age structure and implemented the SEIR model to simulate [6]. As the result, the elder, who are the most vulnerable to COVID-19, should be inoculated immediately. Malavika et al. used a modified logistic growth model, which involved the population of the region to predict the number of confirmed, achieving a good performance. Shrivastav and Jha discussed the impact of temperature and humidity on the transmission of COVID-19 [7]. They constructed a gradient boosting model (GBM) with maximum and minimum temperature and humidity data of Indian states to forecast. In addition, they also provided ANOVA analysis of atmospheric data and COVID-19 data. Chandra et al. implemented the LSTM models to predict the trend based on the time-series data [8]. According to experiments, LSTM had a better performance than ED-LSTM and BD-LSTM with limited data, and the authors also believed that the model can be improved by introducing more data. Moreover, their work also shows the possibility for the long-term prediction of Indian epidemic situation.According to related studies, on the one hand, the prediction of the spread of the COVID-19 is a complex task involving multiple aspects of society. Based on this understanding, introducing more features in the model may contribute to the accuracy and stability of the model [1–3, 6, 7]. In my study, more medical, population density, and population mobility data were collected for the model, which are more direct to the spread of the virus. These characteristics were introduced for the first time in the COVID-19 outbreak in India before the study was completed. On the other hand, the previous researches have proved the feasibility of their selecting models but have their own limitations. Traditional mathematical models are interpretable, but lack the ability to effectively predict epidemic trends [1–3]. The time-series deep learning models describe the spread of COVID-19 [8] better than regression models [3–5]. However, there are few studies addressing related research. In this study, a more advanced time-series deep learning model will be implemented to fill the gap of these studies for the Indian epidemic. Moreover, previous researchers have collected data only for some cities or the whole country. It did not take into account the complexities of Indian society, and with the advancement, my study does experiments at the national level.


## 3. Data Collection and Processing

### 3.1. Raw Data Sources

This study analyzed and constructed models using multiple sources, including medical statistics, population mobility, and census data under COVID-19. Considering the reliability of the data sources, the datasets selected for this study meet at least one requirement: (1) data collected and published by official agencies (MoHFW Vaccines and Indian Census 2011) and (2) research datasets that are widely cited in academic papers (COVID-19 India, Google mobility, and Facebook mobility).The medical statistics consist of two datasets. As shown in Figure1, the COVID-19 India dataset records the number of confirmations, recoveries, and deaths per state per day, with each state abbreviated, e.g., ap a for Andhra Pradesh. As shown in Figure 2, the Ministry of Health and Family Welfare vaccination data is derived from the daily data published by the Ministry of Health and Family Welfare (MoHFW), Government of India. It contains the cumulative number of vaccinated beneficiaries, including first, second, and total doses. Special note, data became available on February 24.Figure 1
The COVID-19 India dataset read in CSV format.Figure 2
The sample of MoHFW Vaccination data.Population mobility data includes Google mobility and Facebook mobility data. Google community mobility collects trends in population mobility in parks, workplaces, bus stops, retail, entertainment, grocery stores, pharmacies, and residences. Meanwhile, the Facebook Data for Good project quantifies mobility trends and residency values in the area.The Indian census 2011 dataset (Data source website:http://www.census2011.co.in/district.php) contains the related information of India census 2011 which will be used to calculate the immune rate and state-level mobility in 3.2 part.The range of dates is mainly covering from October 1, 2020, to July 15, 2021, and the time period is day. All data are collected from available public sources.The raw data sources are shown in Table1.Table 1
Raw data sources.
Raw data sourcesCOVID-19 IndiaaMoHFW VaccinationbIndian census 2011Google mobility [9]Facebook mobility [10]aData source website: http://www.covid19india.org/. bMinistry of Health and Family Welfare: https://www.mohfw.gov.in/.Please note that the website of MoHFW does not record the historical data. The daily data need to be crawled by the user. The crawled data in this study will also be shared in the GitHub later.The raw dataset description is given in Table2.Table 2
Raw dataset description.
Raw data sourcesCOVID-19 IndiaLevelStateStorage formatJson/csvMoHFW VaccinationLevelStateStorage formatPDFIndian census 2011LevelDistrictStorage formatWebsiteVariableDescriptionDistrictThe name of districtStateThe state which the district belongs toPopulationThe population number of the districtGrowthThe growth of population number since last censusSex rationThe ratio of number of male and femaleLiteracyThe percentage of literacy in the stateGoogle mobilityLevelStateStorage formatCSVVariableDescriptionGrocery and pharmacyMobility trends for places like grocery marketsParksMobility trends for parksTransit stationsMobility trends for public transport hubsRetail and recreationMobility trends for retail and recreationResidentialMobility trends for places of residenceWorkplacesMobility trends for places of workFacebook mobilityLevelDistrictStorage formatCSVVariableDescriptionall_day_bing_tiles_visited_relative_changePositive or negative change in movement relative to baselineall_day_ratio_single_tile_usersPositive proportion of users staying put within a single location


### 3.2. Data Preprocessing

Standardization and merging of datasets is challenging due to the diverse data sources and complex social conditions in India. Finally, the following issues were addressed in the pre-processing process: (i) standardized the storage format as CSV. For the MoHFW Vaccination data, I imported the Tabula package to convert the data from PDF to CSV format. Also, I added a step to verify the correction of converting by checking the equality of the sum of the first dose number and second dose number to the total dose number. (ii) Second is the standardized the state names through different data sources. (iii) Third is the standardized the district names. Special notes that some districts in India do not have a sole office spell. My dataset has standardized the district names by referring to the office Indian directory website (http://www.goidirectory.gov.in/). (iv) Fourth is by adding the new districts created after the 2011 to Indian census 2011 dataset, the population numbers were estimated based on original regions. The whole workflow of preprocessing can refer in Figure 3.Figure 3
Procedure of data preprocessing.In the state-level Facebook mobility, since the target dataset is focused on the state level but Facebook mobility records the data at the district level, we need to aggregate these data for further handling. In this case, the district contributes mobility values based on the ratio of the district’s population to the state’s population. The state population is calculated based on the grouping of districts in the India 2011 Census dataset. This is shown in the following equation:(1)S=∑i=1αiMi,where S represents the State’s mobility and Mi and αi separately represent the ith district’s mobility and ratio population of the state.In handing the missing value, the dataset contains two types of missing values. (1) Part of the features cannot cover the whole-time range which is vaccination data in this case. Considering the limited ratio of beneficiaries vaccinated in the starting. I used 0 to fill these missing values. (2) Some missing values are generated by statistical work and data collection. For the gaps which are small, the data would be filled with the previous time step data to fulfill the missing value. For the gaps which are obvious, the current districts or states’ data will be dropped.


### 3.3. Data Description

The final dataset holds data for each of the 33 states or union territories, covering the dates from October 1, 2020, to June 30, 2021. The four union territories of Andaman and Nicobar Islands, Dardala and Nagar Haveli, and Ladakh and Lakshadweep have huge gaps in data collection and will not be used for model construction. Although Telangana has been separated from Andhra Pradesh, these two states will be recorded together in order to minimize errors in manual division of data.Each state data has 273 rows with 14 columns. The detailed information of features is explained in Table3.Table 3
Feature explained.
VariableDescriptiondateymdThe date of tuple of dataconfirmedThe number of daily confirmedrecoveredThe number of daily recovereddeathsThe number of daily deathsDose1The cumulative ratio of population injected first vaccinationDose2The cumulative ratio of population injected second vaccinationGrocery & pharmacyMobility trends for places like grocery marketsParksMobility trends for parksTransit stationsMobility trends for public transport hubsRetail & recreationMobility trends for retail and recreationResidentialMobility trends for places of residenceWorkplacesMobility trends for places of workvisitPositive or negative change in movement relative to baselinestayingPositive proportion of users staying put within a single location


### 3.4. Shortage of Dataset

Except four union territories data has not been recorded, the population of some districts created after 2011 may also been calculated repeated. These new districts’ population are estimated based on the original region’s population that are statistic in 2011, and these regions may belong to different districts before they are independent. It may lead to double counting in the sum of population. Meanwhile, the Telangana also covers some region past belong to other state but not only Andhra Pradesh. However, the sum of these potentially confounding population is smaller than the three percent of the country population, which can generate limited effect to the model.


## 3.1. Raw Data Sources

This study analyzed and constructed models using multiple sources, including medical statistics, population mobility, and census data under COVID-19. Considering the reliability of the data sources, the datasets selected for this study meet at least one requirement: (1) data collected and published by official agencies (MoHFW Vaccines and Indian Census 2011) and (2) research datasets that are widely cited in academic papers (COVID-19 India, Google mobility, and Facebook mobility).The medical statistics consist of two datasets. As shown in Figure1, the COVID-19 India dataset records the number of confirmations, recoveries, and deaths per state per day, with each state abbreviated, e.g., ap a for Andhra Pradesh. As shown in Figure 2, the Ministry of Health and Family Welfare vaccination data is derived from the daily data published by the Ministry of Health and Family Welfare (MoHFW), Government of India. It contains the cumulative number of vaccinated beneficiaries, including first, second, and total doses. Special note, data became available on February 24.Figure 1
The COVID-19 India dataset read in CSV format.Figure 2
The sample of MoHFW Vaccination data.Population mobility data includes Google mobility and Facebook mobility data. Google community mobility collects trends in population mobility in parks, workplaces, bus stops, retail, entertainment, grocery stores, pharmacies, and residences. Meanwhile, the Facebook Data for Good project quantifies mobility trends and residency values in the area.The Indian census 2011 dataset (Data source website:http://www.census2011.co.in/district.php) contains the related information of India census 2011 which will be used to calculate the immune rate and state-level mobility in 3.2 part.The range of dates is mainly covering from October 1, 2020, to July 15, 2021, and the time period is day. All data are collected from available public sources.The raw data sources are shown in Table1.Table 1
Raw data sources.
Raw data sourcesCOVID-19 IndiaaMoHFW VaccinationbIndian census 2011Google mobility [9]Facebook mobility [10]aData source website: http://www.covid19india.org/. bMinistry of Health and Family Welfare: https://www.mohfw.gov.in/.Please note that the website of MoHFW does not record the historical data. The daily data need to be crawled by the user. The crawled data in this study will also be shared in the GitHub later.The raw dataset description is given in Table2.Table 2
Raw dataset description.
Raw data sourcesCOVID-19 IndiaLevelStateStorage formatJson/csvMoHFW VaccinationLevelStateStorage formatPDFIndian census 2011LevelDistrictStorage formatWebsiteVariableDescriptionDistrictThe name of districtStateThe state which the district belongs toPopulationThe population number of the districtGrowthThe growth of population number since last censusSex rationThe ratio of number of male and femaleLiteracyThe percentage of literacy in the stateGoogle mobilityLevelStateStorage formatCSVVariableDescriptionGrocery and pharmacyMobility trends for places like grocery marketsParksMobility trends for parksTransit stationsMobility trends for public transport hubsRetail and recreationMobility trends for retail and recreationResidentialMobility trends for places of residenceWorkplacesMobility trends for places of workFacebook mobilityLevelDistrictStorage formatCSVVariableDescriptionall_day_bing_tiles_visited_relative_changePositive or negative change in movement relative to baselineall_day_ratio_single_tile_usersPositive proportion of users staying put within a single location


## 3.2. Data Preprocessing

Standardization and merging of datasets is challenging due to the diverse data sources and complex social conditions in India. Finally, the following issues were addressed in the pre-processing process: (i) standardized the storage format as CSV. For the MoHFW Vaccination data, I imported the Tabula package to convert the data from PDF to CSV format. Also, I added a step to verify the correction of converting by checking the equality of the sum of the first dose number and second dose number to the total dose number. (ii) Second is the standardized the state names through different data sources. (iii) Third is the standardized the district names. Special notes that some districts in India do not have a sole office spell. My dataset has standardized the district names by referring to the office Indian directory website (http://www.goidirectory.gov.in/). (iv) Fourth is by adding the new districts created after the 2011 to Indian census 2011 dataset, the population numbers were estimated based on original regions. The whole workflow of preprocessing can refer in Figure 3.Figure 3
Procedure of data preprocessing.In the state-level Facebook mobility, since the target dataset is focused on the state level but Facebook mobility records the data at the district level, we need to aggregate these data for further handling. In this case, the district contributes mobility values based on the ratio of the district’s population to the state’s population. The state population is calculated based on the grouping of districts in the India 2011 Census dataset. This is shown in the following equation:(1)S=∑i=1αiMi,where S represents the State’s mobility and Mi and αi separately represent the ith district’s mobility and ratio population of the state.In handing the missing value, the dataset contains two types of missing values. (1) Part of the features cannot cover the whole-time range which is vaccination data in this case. Considering the limited ratio of beneficiaries vaccinated in the starting. I used 0 to fill these missing values. (2) Some missing values are generated by statistical work and data collection. For the gaps which are small, the data would be filled with the previous time step data to fulfill the missing value. For the gaps which are obvious, the current districts or states’ data will be dropped.


## 3.3. Data Description

The final dataset holds data for each of the 33 states or union territories, covering the dates from October 1, 2020, to June 30, 2021. The four union territories of Andaman and Nicobar Islands, Dardala and Nagar Haveli, and Ladakh and Lakshadweep have huge gaps in data collection and will not be used for model construction. Although Telangana has been separated from Andhra Pradesh, these two states will be recorded together in order to minimize errors in manual division of data.Each state data has 273 rows with 14 columns. The detailed information of features is explained in Table3.Table 3
Feature explained.
VariableDescriptiondateymdThe date of tuple of dataconfirmedThe number of daily confirmedrecoveredThe number of daily recovereddeathsThe number of daily deathsDose1The cumulative ratio of population injected first vaccinationDose2The cumulative ratio of population injected second vaccinationGrocery & pharmacyMobility trends for places like grocery marketsParksMobility trends for parksTransit stationsMobility trends for public transport hubsRetail & recreationMobility trends for retail and recreationResidentialMobility trends for places of residenceWorkplacesMobility trends for places of workvisitPositive or negative change in movement relative to baselinestayingPositive proportion of users staying put within a single location


## 3.4. Shortage of Dataset

Except four union territories data has not been recorded, the population of some districts created after 2011 may also been calculated repeated. These new districts’ population are estimated based on the original region’s population that are statistic in 2011, and these regions may belong to different districts before they are independent. It may lead to double counting in the sum of population. Meanwhile, the Telangana also covers some region past belong to other state but not only Andhra Pradesh. However, the sum of these potentially confounding population is smaller than the three percent of the country population, which can generate limited effect to the model.


## 4. Methodology

The research of [8] showed the feasibility of time-series deep learning models in predicting the Indian epidemic. In this section, I will present different models used to predict the number of confirmed cases and deaths of COVID-19. These models were chosen because they have been shown to be effective in a range of problems in different domains [11–13]. I wanted to validate their performance in the new crown outbreak prediction task.


### 4.1. Logistic Regression

The logistic regression model [14] is popular in relevant studies, as it is capable of capturing the effect of the government’s preventive measures [4] and it is believed that logistics regression follows the trend of Coronavirus outbreak [5].The logistic regression model is formulated as follows:(2)y=11+e−wTx,where y is the prediction number of current state’s confirmed cases, x is the current input, and w is the model parameter.


### 4.2. Multiple Linear Regression

Multiple linear regression [14] is a basic and popular statistic model. It only requires minimum computing resources to construct the model and can be explained by comparing the weights of parameters.The multiple linear regression model can be stated as follows:(3)y=b0+b1x1+b2x2⋯bnxn,where bi is the weight of current input item xi and is estimated by the least squares method.


### 4.3. Long Short Term Memory (LSTM)

Compared with both traditional time-series models and standard recurrent neural networks (RNNs), long short term memory (LSTM) [15] shows a better performance in handling the long-term dependency relationship by using the LSTM cell shown in Figure 4.Figure 4
The structure of a typical LSTM cell.Figure4 shows the structure of a LSTM cell, which would be noted as L in Figure 5. Three red dotted bordered boxes represent three different gates in LSTM, namely, forget gate, input gate, and output gate from left to right. The forget gate controls the keeping or throwing of input information from the cell state as follows:
(4)ft=σWfxt+Ufht−1+bf,where xt denotes the input features and ht denotes the hidden states. W∈Rh×d and U∈Rh×h are weight parameter matrices, and b∈Rh is the basis parameter vector.Figure 5
(LSTM) neural networks;L represents the cell of Figure 4.The input gate decides which values will be updated in the cell states and be denoted as follows:(5)It=σWixt+Uiht−1+bi,C¯t=tanhWCxt+UCht−1+bC,Ct=ft○Ct−1+It○C¯t,where C¯t restores the candidate values which may be added into cell states and Ct represents the internal memory of a LSTM unit.The output gate controls the output of the cell states as follows:(6)Ot=σWoxt+Uoht−1+bo,ht=Ot∗tanhCt.


### 4.4. Transformer

The mission of Transformer [16] is to decide what parts of input should be focused on by introducing the attention mechanism. Another important feature of the Transformer is the encoder-decoder structure. Different from traditional time-series models, which encode the input one-time step at a time, the Transformer encodes all the input simultaneously.The architecture of the Transformer is shown in Figure6. The left part represents the encoder block, and the right part represents the decoder block. After the embedding operation is completed, the inputs are fed to the self-attentive layer. In the self-attentive case, each input has three matrix vectors Q, K, and V, representing query, key, and value, respectively. First, these matrices are used for scaled dot product attention with the following equation:
(7)AttentionQ,K,V=softmaxQKTdkV,where dk denotes the number of dimensions of Q and K.Figure 6
The architecture of Transformer.Meanwhile, multiple scaled dot-product attention will be calculated parallelly in multi-head attention as follows:(8)MultiHeadQ,K,V=Concathead1,head2⋯headhWO,where headi=AttentionQWiQ,KWiK,VWiV, h is the number of parallel scaled dot-product attention, and WO∈Rhdv×dmodel is the parameter matrix.Mask multi-head attention is similar to the multi-head attention but only keeps the current and previous for every input row.The feed forward network is a fully connected neural network for every position with a ReLU layer, and a linear layer and can be denoted as follows:(9)FFNx=max0,xW1+b1W2+b2,The add and norm layer will normalize the result of the last layer’s output and construct a residual block with the last layer.


### 4.5. Temporal Convolutional Network (TCN)

Temporal convolutional network (TCN) [17] implements the convolutional network for time series. TCN has an excellent performance in capturing the long-term dependency relations and local information. It also keeps the advantage of a convolutional network by extracting features with limited parameters. The structure of TCN is shown in Figure 7.Figure 7
The architecture of TCN.The convolution operation in TCN is based on the following formula:(10)Fs=∑i=0k−1fi∙xs−d∗i,where Fs represents the dilated convolution operation F on element s, d is the dilation factor, and k is the filter size.


### 4.6. Deep Autoregressive Recurrent Neural Networks (DeepAR)

DeepAR [18] combines recurrent neural networks and the autoregressive model. Instead of a determined value, it will output a probability distribution of the prediction value. Regrading to the feature of autoregressive regression, DeepAR has a better performance on data with noises.DeepAR can be represented as follows:(11)QΘ=zi,t0:Tzi,1:t0−1,xi,1:T=∏t=t0TQΘzi,tzi,1:t−1,xi,1:T=∏t=t0Tℓzi,tθhi,t,Θ,where xi,t is the current input covariates, zi,t−1 denotes the target value of last time step, 1:t0−1 is the conditional range, and t0:T represents the prediction range. hi,t= hhi,t−1,zi,t−1,xi,t,Θ is the output of the autoregressive recurrent network.The training process and prediction process are separately shown in Figures8 and 9. The difference between the two figures is that the prediction range data is unknown in the prediction. The model cannot receive the real value of the last time step but estimates the Z~i,t−1 from the sample.Figure 8
The training process of DeepAR.L is the cell of LSTM.Figure 9
The prediction process of DeepAR.


## 4.1. Logistic Regression

The logistic regression model [14] is popular in relevant studies, as it is capable of capturing the effect of the government’s preventive measures [4] and it is believed that logistics regression follows the trend of Coronavirus outbreak [5].The logistic regression model is formulated as follows:(2)y=11+e−wTx,where y is the prediction number of current state’s confirmed cases, x is the current input, and w is the model parameter.


## 4.2. Multiple Linear Regression

Multiple linear regression [14] is a basic and popular statistic model. It only requires minimum computing resources to construct the model and can be explained by comparing the weights of parameters.The multiple linear regression model can be stated as follows:(3)y=b0+b1x1+b2x2⋯bnxn,where bi is the weight of current input item xi and is estimated by the least squares method.


## 4.3. Long Short Term Memory (LSTM)

Compared with both traditional time-series models and standard recurrent neural networks (RNNs), long short term memory (LSTM) [15] shows a better performance in handling the long-term dependency relationship by using the LSTM cell shown in Figure 4.Figure 4
The structure of a typical LSTM cell.Figure4 shows the structure of a LSTM cell, which would be noted as L in Figure 5. Three red dotted bordered boxes represent three different gates in LSTM, namely, forget gate, input gate, and output gate from left to right. The forget gate controls the keeping or throwing of input information from the cell state as follows:
(4)ft=σWfxt+Ufht−1+bf,where xt denotes the input features and ht denotes the hidden states. W∈Rh×d and U∈Rh×h are weight parameter matrices, and b∈Rh is the basis parameter vector.Figure 5
(LSTM) neural networks;L represents the cell of Figure 4.The input gate decides which values will be updated in the cell states and be denoted as follows:(5)It=σWixt+Uiht−1+bi,C¯t=tanhWCxt+UCht−1+bC,Ct=ft○Ct−1+It○C¯t,where C¯t restores the candidate values which may be added into cell states and Ct represents the internal memory of a LSTM unit.The output gate controls the output of the cell states as follows:(6)Ot=σWoxt+Uoht−1+bo,ht=Ot∗tanhCt.


## 4.4. Transformer

The mission of Transformer [16] is to decide what parts of input should be focused on by introducing the attention mechanism. Another important feature of the Transformer is the encoder-decoder structure. Different from traditional time-series models, which encode the input one-time step at a time, the Transformer encodes all the input simultaneously.The architecture of the Transformer is shown in Figure6. The left part represents the encoder block, and the right part represents the decoder block. After the embedding operation is completed, the inputs are fed to the self-attentive layer. In the self-attentive case, each input has three matrix vectors Q, K, and V, representing query, key, and value, respectively. First, these matrices are used for scaled dot product attention with the following equation:
(7)AttentionQ,K,V=softmaxQKTdkV,where dk denotes the number of dimensions of Q and K.Figure 6
The architecture of Transformer.Meanwhile, multiple scaled dot-product attention will be calculated parallelly in multi-head attention as follows:(8)MultiHeadQ,K,V=Concathead1,head2⋯headhWO,where headi=AttentionQWiQ,KWiK,VWiV, h is the number of parallel scaled dot-product attention, and WO∈Rhdv×dmodel is the parameter matrix.Mask multi-head attention is similar to the multi-head attention but only keeps the current and previous for every input row.The feed forward network is a fully connected neural network for every position with a ReLU layer, and a linear layer and can be denoted as follows:(9)FFNx=max0,xW1+b1W2+b2,The add and norm layer will normalize the result of the last layer’s output and construct a residual block with the last layer.


## 4.5. Temporal Convolutional Network (TCN)

Temporal convolutional network (TCN) [17] implements the convolutional network for time series. TCN has an excellent performance in capturing the long-term dependency relations and local information. It also keeps the advantage of a convolutional network by extracting features with limited parameters. The structure of TCN is shown in Figure 7.Figure 7
The architecture of TCN.The convolution operation in TCN is based on the following formula:(10)Fs=∑i=0k−1fi∙xs−d∗i,where Fs represents the dilated convolution operation F on element s, d is the dilation factor, and k is the filter size.


## 4.6. Deep Autoregressive Recurrent Neural Networks (DeepAR)

DeepAR [18] combines recurrent neural networks and the autoregressive model. Instead of a determined value, it will output a probability distribution of the prediction value. Regrading to the feature of autoregressive regression, DeepAR has a better performance on data with noises.DeepAR can be represented as follows:(11)QΘ=zi,t0:Tzi,1:t0−1,xi,1:T=∏t=t0TQΘzi,tzi,1:t−1,xi,1:T=∏t=t0Tℓzi,tθhi,t,Θ,where xi,t is the current input covariates, zi,t−1 denotes the target value of last time step, 1:t0−1 is the conditional range, and t0:T represents the prediction range. hi,t= hhi,t−1,zi,t−1,xi,t,Θ is the output of the autoregressive recurrent network.The training process and prediction process are separately shown in Figures8 and 9. The difference between the two figures is that the prediction range data is unknown in the prediction. The model cannot receive the real value of the last time step but estimates the Z~i,t−1 from the sample.Figure 8
The training process of DeepAR.L is the cell of LSTM.Figure 9
The prediction process of DeepAR.


## 5. Results

### 5.1. Experiment

The experiment was based on two research hypotheses: (1) The state-of-art time-series deep learning model will have the better performance on predicting the trend of Indian COVID-19 epidemic, and (2) the vaccination data and population mobility data will be helpful for the accuracy of the model.The dataset was divided into a training dataset, covering from October 1, 2020, to June 30, 2021, and a testing dataset, covering from July 1 to July 15, 2021. As a preprocessing step, the min-max normalization has been implemented in the training process. The models are fit with the training dataset and then evaluated with the testing dataset. For the logistic regression and multiple linear regression, a single model is trained for a single state, with all features as input and the current state’s number of confirmed cases as the label. For other models, all the states share a single and common model.The root mean square error (RMSE) has been used as the evaluation metric, which is calculated as follows:(12)RMSE=1N∑i=1Nyi−y∧i2,where yi and y^i are observed and predicted value and N is the number of data samples in the test set.In this research, all the models will predict 15-days confirmed number for every state, and the average RMSE value is used as the main performance measure:(13)RMSEavg=1S∑i=1SRMSEi,where S in the number of states in the dataset and RMSEi is the current state’s RMSE value.The machine learning model is implemented with the open-source Python library dart. Another open source Python library called hyperopt was used for hyperparameter optimization with a stochastic search strategy. The optimization was performed for 100 turns for each model, and the optimal hyperparameters were selected.


### 5.2. Result Table

Table4 shows the result of the experiment. The training time in hours is also recorded and listed in Table 4.Table 4
Results of different models.
ModelRMSEavgTraining time (hours)LSTM584.742.33Transformer460.0811.1Logistic regression971.890.03Multiple linear regression1885.120.01TCN1605.521.12DeepAR927.794.36We can see that the Transformer, as the state-of-art algorithm, performed the best among six models. However, the cost is that the Transformer also took the most time in training. LSTM is less accurate than the Transformer but costs much less time. The traditional statistic methods are not effective in predicting the trend of COVID-19.


### 5.3. Feature Selection

Recall that three feature groups have been used in this research, which are Dose, Google mobility, and Facebook mobility. Considering the contribution of three feature groups to the prediction result, three Transformer models are trained with two feature groups for predicting the number of confirmed and deaths daily number of COVID-19. More specific explanation is given in Table5.Table 5
The explanation of feature selection models.
ModelDescriptionBaseline (Transformer)The transformer model training with all featuresTransformer_without_doseThe transformer model training without dose feature group, which are Dose1 and Dose2 as shown in Table3Transformer_without_googleThe transformer model training without Google mobility feature group, which are grocery and pharmacy parks, transit stations, retail and recreation, residential, and workplaces as shown in Table3Transformer_without_facebookThe transformer model training without Facebook mobility feature group, which are visit and staying as shown in Table3The results have been shown in Table6 and Table 7.Table 6
Transformer model with feature selection for predicting the number of confirmed cases.
Transformer model with feature selection (confirm)ModelRMSEavgBaseline (transformer)460.08Transformer_without_dose426.47Transformer_without_google519.28Transformer_without_facebook1105.17Table 7
Transformer model with feature selection for predicting the number of deaths.
Transformer_deaths model with feature selectionModelRMSEBaseline (transformer)103.80Transformer_without_dose31.22Transformer_without_google45.09Transformer_without_facebook26.89As shown in Table6, mobility data are helpful in predicting, and Facebook mobility dataset contributes the most to the model. It is unexpected that the vaccination rate did not have a positive effect on the prediction. It may cause by the limited immune rate in India; up to July 15, about 23% of the population has been vaccinated one dose, and only 5.8% of the whole population are fully vaccinated. Another potential reason is that the Indian vaccination does not show a stable effect for the new variant virus.According to Table7, we can find that the dose and mobility features bring limited effect in forecasting the number of daily deaths of COVID-19. Considering the lagging of vaccination effect, the dead may not be vaccinated or fully vaccinated, and the effect may need to be observed in the longer term.


### 5.4. Discussion

According to the experiment, there are two research hypotheses: (1) The Transformer as the state-of-art time-series deep learning model has a significant better performance than other regression and deep learning models and (2) the population mobility data are helpful for the prediction of spread of epidemic. However, the vaccination data did not have positive effect in predicting.For the transmission of novel coronavirus, the effect of vaccination is still under the question. Considering the potential variation of the virus, the government should not overlay rely on the vaccination. Meanwhile, the population mobility is an important factor for controlling the spread of epidemic.


## 5.1. Experiment

The experiment was based on two research hypotheses: (1) The state-of-art time-series deep learning model will have the better performance on predicting the trend of Indian COVID-19 epidemic, and (2) the vaccination data and population mobility data will be helpful for the accuracy of the model.The dataset was divided into a training dataset, covering from October 1, 2020, to June 30, 2021, and a testing dataset, covering from July 1 to July 15, 2021. As a preprocessing step, the min-max normalization has been implemented in the training process. The models are fit with the training dataset and then evaluated with the testing dataset. For the logistic regression and multiple linear regression, a single model is trained for a single state, with all features as input and the current state’s number of confirmed cases as the label. For other models, all the states share a single and common model.The root mean square error (RMSE) has been used as the evaluation metric, which is calculated as follows:(12)RMSE=1N∑i=1Nyi−y∧i2,where yi and y^i are observed and predicted value and N is the number of data samples in the test set.In this research, all the models will predict 15-days confirmed number for every state, and the average RMSE value is used as the main performance measure:(13)RMSEavg=1S∑i=1SRMSEi,where S in the number of states in the dataset and RMSEi is the current state’s RMSE value.The machine learning model is implemented with the open-source Python library dart. Another open source Python library called hyperopt was used for hyperparameter optimization with a stochastic search strategy. The optimization was performed for 100 turns for each model, and the optimal hyperparameters were selected.


## 5.2. Result Table

Table4 shows the result of the experiment. The training time in hours is also recorded and listed in Table 4.Table 4
Results of different models.
ModelRMSEavgTraining time (hours)LSTM584.742.33Transformer460.0811.1Logistic regression971.890.03Multiple linear regression1885.120.01TCN1605.521.12DeepAR927.794.36We can see that the Transformer, as the state-of-art algorithm, performed the best among six models. However, the cost is that the Transformer also took the most time in training. LSTM is less accurate than the Transformer but costs much less time. The traditional statistic methods are not effective in predicting the trend of COVID-19.


## 5.3. Feature Selection

Recall that three feature groups have been used in this research, which are Dose, Google mobility, and Facebook mobility. Considering the contribution of three feature groups to the prediction result, three Transformer models are trained with two feature groups for predicting the number of confirmed and deaths daily number of COVID-19. More specific explanation is given in Table5.Table 5
The explanation of feature selection models.
ModelDescriptionBaseline (Transformer)The transformer model training with all featuresTransformer_without_doseThe transformer model training without dose feature group, which are Dose1 and Dose2 as shown in Table3Transformer_without_googleThe transformer model training without Google mobility feature group, which are grocery and pharmacy parks, transit stations, retail and recreation, residential, and workplaces as shown in Table3Transformer_without_facebookThe transformer model training without Facebook mobility feature group, which are visit and staying as shown in Table3The results have been shown in Table6 and Table 7.Table 6
Transformer model with feature selection for predicting the number of confirmed cases.
Transformer model with feature selection (confirm)ModelRMSEavgBaseline (transformer)460.08Transformer_without_dose426.47Transformer_without_google519.28Transformer_without_facebook1105.17Table 7
Transformer model with feature selection for predicting the number of deaths.
Transformer_deaths model with feature selectionModelRMSEBaseline (transformer)103.80Transformer_without_dose31.22Transformer_without_google45.09Transformer_without_facebook26.89As shown in Table6, mobility data are helpful in predicting, and Facebook mobility dataset contributes the most to the model. It is unexpected that the vaccination rate did not have a positive effect on the prediction. It may cause by the limited immune rate in India; up to July 15, about 23% of the population has been vaccinated one dose, and only 5.8% of the whole population are fully vaccinated. Another potential reason is that the Indian vaccination does not show a stable effect for the new variant virus.According to Table7, we can find that the dose and mobility features bring limited effect in forecasting the number of daily deaths of COVID-19. Considering the lagging of vaccination effect, the dead may not be vaccinated or fully vaccinated, and the effect may need to be observed in the longer term.


## 5.4. Discussion

According to the experiment, there are two research hypotheses: (1) The Transformer as the state-of-art time-series deep learning model has a significant better performance than other regression and deep learning models and (2) the population mobility data are helpful for the prediction of spread of epidemic. However, the vaccination data did not have positive effect in predicting.For the transmission of novel coronavirus, the effect of vaccination is still under the question. Considering the potential variation of the virus, the government should not overlay rely on the vaccination. Meanwhile, the population mobility is an important factor for controlling the spread of epidemic.


## 6. Conclusion

In this study, the COVID-19 epidemic in India was analyzed using datasets collected from different sources. Among the various machine learning models for predicting COVID-19 transmission, the Transformer proved to have the best performance. The Transformer model may be a new baseline for future researchers. The Facebook mobile dataset was found to be most useful along with other datasets in predicting the number of confirmed cases, but not as useful in predicting the number of deaths.Although the focus area of our study is India, our analysis process can be extended to other countries and regions as long as the original dataset can be collected and used. Another research direction is to find out about COVID-19 between different countries, which may interact with each other.



---

*Source: 2601149-2022-04-25.xml*