1 Introduction

The worldwide spread of novel coronavirus disease (COVID-19) has shattered the World and severely affected human life. In December 2019, in Wuhan city, capital of Hubei Province, China, many people had suffered from severe respiratory illness. Towards the end of December 2019, China had informed the World Health Organization (WHO) about the number of patients with symptoms of respiratory disease of unknown cause [1], and later the disease has been renamed as COVID-19 which is occurring due to a virus of novel corona group known as SARS-CoV-2. India is a densely populated country with a population of more than 1.3 billion people spread across the diverse state having wide economic and social disparities, health inequalities, and distinct cultures that possess significant challenges in the period of the COVID-19 pandemic. The first case of COVID-19 in India was reported on 30th January 2020 and up to 24th, March 2020 around 571 confirmed COVID-19 cases had been reported [2]. On 25th March 2020, India faced a countrywide lockdown for 21 days. Reconsidering the situation, the Government of India had extended the lockdown till 31st May 2020, hence India was under complete lockdown for 67 days during the first wave of COVID-19. A study conducted by Kumar and Dwivedi [1] showed the impact of lockdown on individuals’ daily habits such as sleep/getting up, social media use, working from home, and more. Another study (see Wang et al. [3]) shows the severe effect of lockdown on the mental health of humans. On the other hand, during the lockdown period, many daily workers have lost their earnings due to closing the respective workstations. Thus, except for families of monthly salary-based employees of governmental or established non-governmental organizations, all other families have been affected significantly during the lockdown period. From the aspects of severity and expansion, the pandemic holds an exceptional situation that the World had not seen in a century. But, due to climate change, globalization, encroachment on wildlife habitats, the world population may face such a pandemic in the future [4, 5]. Hence, an investigation is required to study the effect of lockdown on the commoner’s lifestyle and health status. Till now many experimental, as well as theoretical research papers on COVID-19 have already been published (see, for example, Acuna-Zegarraetal et al. [6], Mandal et al. [7,8,9], Gowrisankar et al. [10], Easwaramoorthy et al. [11], Das et al. [12], Adam et al. [13], Zandvoort et al. [14], Sornette et al. [15], Lalmuanawma et al. [16], Zhao et al. [17], Adak et al. [18, 19] etc.). A study on mental health due to the lockdown has been done by Hirematha et al. [20]. Analysis of lockdown perception in the United States during the COVID-19 pandemic has also been done by Surano et al. [21]. But, to date, there are not so many significant works that have analyzed the effect of lockdown on public health.

In our present study, we want to create a model and examine it to visualize how the lockdown has affected the health condition of common people. To do so, we intend to use some soft computing-based tools. At present, soft computing-based tools have been used effectively to study the behavior of a disease (Yang et al. [22], Adak and Jana [23, 24], etc). To study the impact of lockdown on public health, we have collected six different parameters (namely systolic pressure (SP), diastolic pressure (DP), respiratory distress (RD), fasting blood sugar (FBS), cholesterol (Chl) and insomnia (INS)) related to health conditions of 200 people before and after lockdown from Birnagar municipality region of Nadia District of West Bengal, India, and applied adaptive neuro-fuzzy inference system (ANFIS) to find a fuzzy mathematical model. The adaptive neuro-fuzzy inference system (ANFIS) is a combination of neural network and fuzzy logic. It has the learning capability to approximate non-linear functions more precisely. ANFIS is an artificial neural network based on the Takagi–Sugeno fuzzy inference system. ANFIS-based predicting models resemble human brain functioning, which helps to predict diseases [25]. There are several works in which ANFIS is used in disease prediction [26,27,28]. ANFIS has been used to investigate the effect of working conditions on occupational injury using data of professional accidents assembled by ship repair yards [29]. Adaptive neuro-fuzzy inference system (ANFIS) technique has been used to model and forecast Nigeria’s industrial electricity consumption [30]. Ekici et al. predicted the building energy needs in the early design stage using ANFIS [31]. Wei et al. used ANFIS in predicting injection profiles [32].

The rest of the paper is organized in the following way. In Sect. 2, we have discussed the materials and methods of the work. In Sect. 3, we have obtained the result and discussed it thoroughly. Next, in Sect. 4, we describe the error measures during our computation. Finally, the last section is dedicated to a precise conclusion of the whole work.

2 Materials and methods

2.1 Brief introduction to ANFIS model

Fuzzy inference systems (FIS) are among the most famous applications of fuzzy logic, and fuzzy set theory [33]. ANFIS is capable of learning and generalizing from the training data [34]. The strength of FIS is the ability to handle linguistic concepts and perform non-linear mappings between inputs and outputs [35]. There are two types of fuzzy inference systems (1) Mamdani type and (2) Sugeno type. The Takagi–Sugeno fuzzy inference system was developed in 1985 [36]. This method is similar to the Mamdani method in many ways. The Takagi–Sugeno system is mainly used in a model with one output, suitable for modeling non-linear systems by interpolating between multiple linear models. Like the Mamdani in the Takagi–Sugeno method, the initial step is to fuzzify the inputs and apply the fuzzy rules. The output membership functions are either linear or constant. An adaptive network is a network that consists of nodes and links that connect the nodes. Some of the nodes are adaptive (square nodes), and some remain fixed (circular nodes), and the learning rules specify how these parameters need to be changed to minimize the error. Adaptive neuro-fuzzy inference system (ANFIS) is derived by embedding a fuzzy inference system into the framework of an adaptive neural network. The basic idea behind ANFIS is that it creates a fuzzy inference system and tries to improve the membership function of the input variables by learning from the provided data. ANFIS is based on Takagi–Sugeno fuzzy inference system. The application of an adaptive neural-fuzzy inference system (ANFIS) was first introduced by Jang [37]. To explain the ANFIS, let us consider an example of a Takagi–Sugeno fuzzy model with the following two rules:

$$\begin{aligned} {\mathrm{{If}}}~ x_{1}~{ \mathrm{{is}}}~ a_{11}~ {\mathrm{{and}}}~ x_{2}~ {\mathrm{{is}}}~ a_{21}~ {\mathrm{{then}}}~ y=b_{1} \\ {\mathrm{{If}}} ~x_{1} ~{\mathrm{{is}}} ~a_{12} ~{\mathrm{{and}}} ~x_{2}~ {\mathrm{{is}}} ~a_{22} ~{\mathrm{{then}}} ~y=b_{2}. \end{aligned}$$

The pictorial representation of ANFIS model is shown in Fig. 1. The inputs of the first layer are the provided data, say \(x_{1}~\text {and}~x_{2}\) and the output is the degree of membership of the input values corresponding to their membership functions. One can choose the membership functions in several ways. In this work, we have taken the membership function of the inputs as a Gaussian fuzzy number. The functional form of Gaussian fuzzy number with mean \(c_{ij}\) and standard deviation \(\sigma _{ij}\) is

$$\begin{aligned} \mu _{a_{ij}}(x_{ij};c_{ij},\sigma _{ij})= \exp \bigg (\frac{-(x_{j}-c_{ij})^{2}}{2\sigma _{ij}^{2}}\bigg ) \end{aligned}$$
(1)

Here, \(a_{11},~a_{12},~a_{21}~\text {and}~a_{22}\) are linguistic variables. The output of the 1st layer are \(o_{ij}\) for \(i,~j=1,~2\) where \(o_{ij}= \mu _{a_{ij}}(x_{ij};c_{ij},\sigma _{ij})= \exp \bigg (\frac{-(x_{j}-c_{ij})^{2}}{2\sigma _{ij}^{2}}\bigg )\). The output of first layer is the input of 2nd layer. The output of 2nd layer are \(w_{1}\) and \(w_{2}\) where

\(w_{1}=o_{11}*o_{21}=\mu _{a_{11}}(x_{1})*\mu _{a_{21}}(x_{2})\) and

\(w_{2}=o_{12}*o_{22}=\mu _{a_{12}}(x_{1})*\mu _{a_{22}}(x_{2})\).

The output of the 3rd layer are normalized output which are obtained by computing \(w_{1}^{'}=\frac{w_{1}}{w_{1}+w_{2}}\) and \(w_{2}^{'}=\frac{w_{2}}{w_{1}+w_{2}}\). These are the inputs of the 4th layer. The output of layer 4 is multiplication with \(b_{i}'s~\text {for}~i=1,~2\). The final output is obtained at Layer 5 by summing the outputs of the previous nodes, i.e., \(y= \sum _{i=1}^{2}b_{i}w_{i}^{'}\).

Fig. 1
figure 1

Pictorial representation of ANFIS model

Two learning methods are generally used to identify the relationship between input and output in ANFIS, which determines the optimized distribution of membership functions. These learning methods are back-propagation and hybrid. The hybrid system is a combination of the back-propagation and the least-squares method [38]. In this backward pass, the premise parameters are updated by the gradient descent algorithm [39]. The parameters associated with the membership functions change through the learning process. A gradient vector measures how well the fuzzy inference system is modeling the input–output data for a given set of parameters. Once the gradient vector is obtained, an optimization procedure can be applied to adjust the parameters to reduce the error [40].

To create FIS using ANFIS, we applied fuzzy logic toolbox of MATLAB (R2013a) which enables creation and editing of FIS, manually or automatically driven by the data. Model performance is examined using root mean square error (RMSE).

2.2 Data preparation

2.2.1 Choosing input and output variables

This study includes the health condition before and after lockdown of 200 persons from Birnagar municipality of Nadia district of West Bengal chosen at random. We collect the data of blood pressure (BP both SP and DP), respiratory distress (RD), fasting blood sugar (FBS), cholesterol (CHL) and insomnia (INS) of 200 persons before and after lockdown from Birnagar municipality area.

2.2.2 Systolic pressure (SP) and diastolic pressure (DP)

Normal blood pressure is a measure of good health. Measuring systolic pressure (SP) and diastolic pressure (DP) gives blood pressure measurement. If SP is higher than the standard measurement, then it is called hypertension, and if the measure of DP is lower than normal, it is called hypotension. Hypertension increases the chance of heart diseases, heart attack, stroke. On the other hand, hypotension causes hazards, especially for the elderly. According to [41], the distribution of blood pressure is given in Table 1.

Table 1 The chart of weights for SP and DP

2.2.3 Respiratory distress (RD)

Respiratory distress occurs when fluid builds up in the tiny, elastic air sacs in one’s lungs. The fluid keeps one’s lungs from filling with air, due to which enough oxygen does not reach the organs. This leads to breathing problems. Respiratory distress occurs mostly in the elderly. The distribution of respiratory distress is given in Table 2.

Table 2 The chart of weights for RD

2.2.4 Fasting blood sugar (FBS)

Fasting blood sugar (FBS) measures the level of blood sugar after overnight fasting. A fasting blood sugar level of 99 mg/dL or lower is considered as normal, 100-125 mg/dL indicates prediabetes. Change in blood sugar can cause low vision, headaches, fatigue, frequent urination, etc. The distribution is given in Table 3.

Table 3 The chart of weights for FBS

2.2.5 Cholesterol (CHL)

Cholesterol is fat that moves throughout the human body on its own. It does not dissolve into blood. There are two types of cholesterol (i) high-density lipoprotein (HDL)  (ii) low-density lipoprotein (LDL). If the blood contains too much of LDL, then one is said to be diagnosed with high cholesterol. High cholesterol leads to many health hazards like stroke, heart attack. On the other hand, low cholesterol indicates cancer, depression, hemorrhagic stroke, etc. The distribution is given in Table 4.

Table 4 The chart of weights for CHL

2.2.6 Insomnia (INS)

According to [41], insomnia is a sleeping disorder in which one has trouble sleeping. They may have a problem in falling asleep or staying asleep. Insomnia can be acute or chronic. Stress, anxiety, and depression may lead to insomnia. One may also face insomnia due to a change of habits, new shifts at work, genes (Table 5).

Table 5 The chart of weights for INS

2.2.7 Normalized health condition (NHC)

The Takagi–Sugeno fuzzy inference system can have only one output. To fix the output, we have multiplied the provided data of the six parameters after lockdown with its corresponding weight and added it. For example, if the SP, DP, RD, FBS, CHL and INS of a person after lockdown be 112, 80, 1, 108, 114, and 1 then according to the defined weights which are given in Table 6, the output is computed as \(112\times 0.1 + 80 \times 0.1 + 1 \times 0.15 + 108 \times 0.2 + 114 \times 0.2+ 1 \times 0.15\), i.e., 63.9. After computing this value for each of the 200 persons, the output range becomes [37.86–80.89]. To have a clear picture of the variable NHC, we have computed the value of NHC when the inputs, namely SP, DP, RD, FBS, and CHL, are in different ranges (see Tables 1, 2, 3, 4, 5). For example,

  1. (i)

    when all the input variables are in low range, SP \(=\) 90, DP \(=\) 60, RD \(=\) 0, FBS \(=\) 70, CHL \(=\) 120, and INS \(=\) 0, then NHC\(=90\times 0.07+60\times 0.08+0\times 0.2 + 70\times 0.15+120\times 0.15+0\times 0.2=39.6.\)

  2. (ii)

    when all the input variables are in normal range, SP \(=\) 120, DP \(=\) 80, RD \(=\) 0, FBS \(=\) 126, CHL \(=\) 200, and INS \(=\) 0, then NHC\(=120\times 0.09+80\times 0.075+0\times 0.2 + 126\times 0.15+200\times 0.12+0\times 0.2=63.7.\)

  3. (iii)

    when SP, DP are in range of pre-hypertension, RD and INS are low, FBS is in prediabetic range, CHL is in borderline, SP \(=\) 130, DP \(=\) 85, RD \(=\) 1, FBS \(=\) 130, CHL \(=\) 220, and INS \(=\) 1, then NHC\(=130\times 0.09+85\times 0.075+1\times 0.15 + 130\times 0.12+220\times 0.12+1\times 0.15=60.375\).

  4. (iv)

    when SP, DP are in the range of stage-1 hypertension, RD, INS are medium, FBS is in the range of diabetic, CHL is in high range, for example if SP \(=\) 150, DP \(=\) 95, RD \(=\) 2, FBS \(=\) 205, CHL \(=\) 245, and INS \(=\) 2, then NHC\(=150\times 0.07+95\times 0.05+2\times 0.1 + 205\times 0.05+245\times 0.04+2\times 0.1=35.7\).

  5. (v)

    In a similar manner, SP \(=\) 170, DP \(=\) 100, RD \(=\) 3, FBS \(=\) 300, CHL \(=\) 260, and INS \(=\) 3, then NHC\(=170\times 0.03+100\times 0.025+3\times 0.05 + 300\times 0.03+260\times 0.025+3\times 0.05=23.4\). Thus, we can say that high value of NHC indicates good health. When the value of NHC decreases, the normal health of a person deteriorates.

Table 6 The chart of weights

2.2.8 Normalization

We can see that the features taken as inputs in this system are of different types and lie within various ranges. To enhance the system’s performance, we convert the raw data into normalized data. Due to normalization, the data set will have a uniform range [0, 1]. There exist several normalization methods such as min–max, Z score, and simple feature scaling. In this work, we have used the min–max scaling technique, which is given as

$$\begin{aligned} x_{\mathrm{{norm}}}=\frac{x-x_{\min }}{x_{\max }-x_{\min }} \end{aligned}$$
(2)

where \(x_{\min }\) and \(x_{\max }\) represents, respectively, the minimum and maximum values among the set of data x.

2.3 Cross-validation

Model validation is a process that confirms if the goal of the model is achieved. There are many processes to validate a model, such as (i) train/test split, (ii) k-fold cross-validation, (iii) time-series cross-validation, (iv) nested cross-validation, and many more. Among all these processes, k-cross-validation is one of the most common validation techniques. In k-cross-validation technique, we are validating the model k times. Therefore, this method is more effective than the other validation methods. Hence, in this paper, we have used the k-fold validation process. In this process, we divide the total data into k classes. Each of them is called fold. That is why the process is called k-fold validation. Among the k folds, we choose arbitrarily onefold and use it as testing data, and the remaining \((k-1)\) folds as training data. We compute the testing error at this stage. We repeat the process by choosing one fold from the remaining \((k-1)\), which we had used for training in the previous step for testing, and the remaining \((k-1)\) fold for training. We continue this process till all the folds are used for training and testing (Table 7). The error of the application is the average error after each iteration.

Table 7 k-cross validation

In this work, among 200 collected data, we have taken 20 data for validation. We divide the remaining 180 data into fivefold, i.e., here \(k=5\). Then, each fold contains 36 data. We have made five iterations, as shown in Table 7. Choosing the number of epochs is a critical task in the training process. Epochs represent the number of complete pass-through training data set. We must select a necessary number of epochs as a high number of epochs may cause over-fitting of the data. In our present work, we have taken epoch number as 10. Figure 2 represents the change of RMSE value of training with respect to the number of epochs. We can observe from Fig. 2 that the ultimate error is achieved at epoch 2, and the error does not change after that. Choosing the epochs, we compute the RMSE values of training and testing at each iteration and observe at which iteration both the errors are comparatively low. In addition, we have to keep in mind that the difference between training and testing errors must be low. Otherwise, there will be a chance of over-fitting or under-fitting the data. The training and testing error of each iteration for this model is shown in Table 8. From Table 8 we see, in the 1st iteration, the training error is minimum; the difference between testing and training error is lowest. Hence, we choose the ratio of iteration 1 to train and test the model. Further, to check the performance of the model, we have tried to fit the model with data of 20 persons which are distinct from the 180 data that we have already used.

Table 8 Cross-validation for this model

3 Results and discussion

From the above section, we have derived the best possible model using ANFIS. We can see from Fig. 2 that the RMSE value of training finally takes the value of 0.05513. Figure 3 illustrates the graphical representation of FIS-predicted output and the given test data. The red color represents FIS-generated output, and the blue represents the output used while testing. Here, we can see the plot of 40 testing data points and FIS-derived output. In this case, the RMSE value of testing is 0.134, which is computed using the formula (2).

Ultimately, we have derived a Sugeno-type fuzzy inference system (Fig. 4). The inputs are taken as Gaussian fuzzy numbers in the model and output as constant. Each of the inputs has three membership functions. The fuzzy inference system is generated by the grid partitioning method. In the grid partitioning method, the input and output space are divided as per the linguistic variables into equal partitions; each partition is called ‘grid’. The system starts with zero output; it gradually learns the rules in the training process and changes the output values accordingly. 729 ‘if-then’ rules have been created in the system. Product is done in ‘and’ method, and probabilistic or method is done in ‘or method’. Hybrid learning is selected as learning algorithm. Defuzzification is done using weighted average method. Figure 5 represents the ‘if-then’ rules of the fuzzy inference system.

Fig. 2
figure 2

Graph of training error with the change of epochs

Fig. 3
figure 3

Graphical representation of FIS-predicted output and the given test data; \(*\) represents the FIS-generated output, . represents the given testing data

Fig. 4
figure 4

ANFIS model structure

Fig. 5
figure 5

‘if-then’ rules of the fuzzy inference system

Figure 6 represents the surfaces generated by the model, which represents how NHC changes with respect to any two inputs keeping other inputs fixed. Figure 6a represents the change in NHC with respect to SP and DP when RD\(= 0.5\), FBS \(=0.6\), CHL \(= 0.001\) and INS \(=0.1\). Figure 6b represents its projection. Figure 6c represents the change in NHC with respect to SP and DP when RD \(= 0.1\), FBS \(=0.2\), CHL \(= 0.001\) and INS \(=0.1\). Figure 6d represents its projection. Figure 6e represents the change in NHC with respect to RD and INS when SP \(= 0.3\), DP \(=0.0005\), FBS \(= 0.1\) and CHL \(=0.001\). Figure 6f represents its projection. Figure 6g represents the change in NHC with respect to RD and INS when SP\(= 0.7\), DP \(=0.001\), FBS \(= 0.6\), CHL \(= 0.001\). Figure 6h represents its projection. Figure 6i represents the change in NHC with respect to FBS and CHL when SP \(= 0.3\), DP \(=0.0005\), RD \(= 0.1\) and INS \(=0.2\). Figure 6j represents its projection. It is seen from the figures that the output takes negative values and positive values. Further, it takes values beyond [0,1] because the output variable starts with zero. Gradually, it learns via the hybrid algorithm, leading to a change of the output variable. Therefore, the output value does not remain within [0, 1] interval. In a real-life situation, it is observed that the output attains the negative values when the inputs are taken relatively odd in contrast with any real-life scenario. For example, in Fig. 6a, RD and FBS are medium, whereas CHL and INS are low. For a person with respiratory distress, high blood sugar, low SP, and high DP is not possible. The system has taken negative outputs while generating the model in such cases. Due to the same reason mentioned above, we can see the output has taken values greater than 1. Therefore, here we will explain the cases when the output range is [0, 1]. When the value of NHC decreases, it implies poor health, whereas the high value of NHC implies good health. From the figures, we observe that the health status of a person who had low or high blood pressure before lockdown does not change much (Fig. 6a, c). But, it is interesting to note that the output range in Fig. 6c is greater than Fig. 6a. This may happen due to the low value of the other inputs, namely RD, FBS, CHL, and INS. People with normal blood pressure, normal blood sugar, and cholesterol have faced respiratory distress and insomnia due to lockdown. A similar scenario has occurred for a person with cholesterol and blood sugar. Increasing blood sugar level shows low NHC. Figure 6i and j represents that situation.

Fig. 6
figure 6

a Representation of the change in NHC with respect to SP and DP when RD\(= 0.5\), FBS \(=0.6\), CHL \(= 0.001\) and INS \(=0.1\). b Its projection. c Representation of the change in NHC with respect to SP and DP when RD\(= 0.1\), FBS \(=0.2\), CHL \(= 0.001\) and INS \(=0.1\). d Its projection. e Representation of the change in NHC with respect to RD and INS when SP\(= 0.3\), DP \(=0.0005\), FBS \(= 0.1\) and CHL \(=0.001\). f Its projection. g Representation of the change in NHC with respect to RD and INS when SP\(= 0.7\), DP \(=0.001\), FBS \(= 0.6\), CHL \(= 0.001\). h Its projection. i Representation the change in NHC with respect to FBS and CHL when SP\(= 0.3\), DP \(=0.0005\), RD \(= 0.1\) and INS\(=0.2\). j Its projection

4 Error analysis for measuring NHC

Table 9 Table of data

In this section, we intend to compute the error to validate the model. With the help of root mean square error (RMSE), we can find the error of a proposed model, and with the R-squared value, we can see how well the model predicts. The expected values and model-derived values of the output variable are given in Table 9. The inputs used to determine the model-derived outputs are distinct from the training data and testing datasets. Using formula (2), the RMSE of the proposed model has been computed. We see that the computed RMSE is 0.197, an accepted value of the error. The \(R^2\) value is computed using (4).

$$\begin{aligned} R^{2}= 1-\frac{{\mathrm{RSS}}}{{\mathrm{TSS}}}, \end{aligned}$$

where  RSS \(=\text {residual sum of squares}=\sum _{i=1}^{n}(y(i)-f(x(i)))^{2},\)

TSS \(=\text {total sum of squares}=\sum _{i=1}^{n}(y(i)-{\bar{y}})^{2},~~~~(4)\)

where y(i) are the actual values, \(f(x(i))'s\) are the predicted values where \(i=1,2, \ldots ,n\), and n is the sample number.

In addition, the value of the coefficient of determination, i.e., \(R^{2}\) is 0.97. Hence, we conclude that the proposed model is a good fit.

5 Conclusion

In this paper, an artificial intelligent-based system has been proposed and analyzed to investigate the impact of lockdown on human health. Here, we have successfully created a model that can determine the effect of lockdown on public health. We have determined the model based on six basic parameters: systolic pressure, diastolic pressure, respiratory distress, fasting blood sugar, cholesterol, and insomnia. We have developed a fuzzy inference system with the help of an adaptive neuro-fuzzy inference system (ANFIS). Further, we have discussed some surfaces generated by the fuzzy inference system. Using the above fuzzy inference system, we can say that the six parameters, SP, DP, RD, FBS, CHL, and INS, do not affect a person’s health independently. All the inputs have a significant amount of contribution to a person’s well-being. The health of persons with normal blood pressure average cholesterol levels do not change much due to lockdown. But, for a person with relatively poor health conditions, NHC has decreased significantly. In addition, it is observed that due to lockdown, some healthy individuals have also faced respiratory distress and even insomnia. Further, it can be concluded that in the future, lockdown can be implemented to contain the disease in desperate times like this. But, the Government officials’ decision-makers must keep in mind that all the measures taken by the government officials must be on par with the practical situation of the majority of the population. To extend this work, we will consider other inputs like lifestyle, economic background while formulating a model in the future. This work can also be expanded by collecting more data by surveying more individuals in different regions.