1 Introduction of the feasibility of controlling and spreading Prediction of COVID-19

Modeling and simulation are significant decision-making methods that can control human and animal diseases (Alrasheed et al. 2020). However, since any disorder has its biological characteristics, the models have to be adapted to each scenario, such that specific cases can be addressed (Rekha Hanumanthu 2020). The new pathogen responsible for COVID-19 disease is a Severe Acute Respiratory Syndrome Coronavirus-2 (SARS-CoV-2) (Agbehadji et al. 2020). The COVID-19 is spread from person to person by close contact with contaminated surfaces and respiratory droplets inhaled by contaminated persons (Hao et al. 2020). For successful reduction of COVID-19 distribution, governments have introduced various controls such as strict, obligatory lockdown, and promising (and in certain instances police regulation) other steps such as people preserving a minimum distance from one another (social distance) (Mardani et al. 2020).Contact tracing of confirmed contaminated cases has been paced up in many countries to help minimize COVID-19 spread and reported cases (asymptomatic and symptomatic) are rapidly identified for prompt treatment (Popkin et al. 2020). The likelihood of an epidemic control is one-dimensional since the model does not enforce limits on the number of cases and connections traced and separated (Poletto et al. 2020). In turn, it would be possible to track contact and isolate both the possibility of control and the tools required to find and isolate cases that have been infected (Alsofyani et al. 2020). New instances demand that the connections be tracked, and they will, in effect, overwhelm the contact-tracing scheme if the numbers are large and have a subsequent impact on the quality of the contact-tracing undertaking (Allam et al. 2020). There is probably a gap between country to country in the upper limit for tracking contacts (Alshamrani et al. 2020). The advantages of contact tracking depend primarily on quarantine and isolation between individuals traced to this process, which can be strengthened by policy actions like out-of-home accommodation, income substitution, and social support (Kumaravel et al. 2020). To guarantee that contacts can be traced and quarantined early enough to avoid transmission, prompt testing, diagnosis, and warning are expected of individuals with infection (Ovsyannikova et al. 2020). Testing contacts without symptoms can expand the program's aids by tracing new cases and refining the quarantine's possible observance (Willis et al. 2020).The unprecedented circumstances that the tourism sector and travel currently face due to the COVID-19 pandemic indicate evolutionary sense (Liu et al. 2020).It is flawless that in the era of ubiquitous connectedness,air travel, super mobility carries pathogens promptly across the world (Elavarasan et al. 2020). Pathogens and vectors can be transported quickly with travel and transport goods. By tracking immigrant stock data and travel data volume based on human mobility corridors, countries could have been better prepared to handle the spread of COVID-19.

Large data on the increasing network of infected people, patient information, population trends, and integration into health experiments, medicines, genomic, and public health data are required for innovative resolutions to manage, develop, and analyze. Multiple data points, including text messaging, email messages, social media, and web articles, may help determine community-based infection growth (Habes et al. 2020). With this information's aid, researchers will anticipate where the infection is supposed to travel and report the disease to the ML and Artificial Intelligence (AI) area to meet the arrangements required. The history of travel of infected individuals can be automatically tracked to examine the epidemiological correlation with disease dissemination. Due to the obvious difficulty and large size of the problem in designing epidemiological models, the development of outbreak predictive models is recently tackled by machine learning. ML methods aim to develop models with increased potential for generalization and higher reliability for long lead times. Variables used in developing the machine learning model include information that patients may easily provide without laboratory or radiographic evaluation (Gwenzi 2020). The factors included age, sex, smoking history, body temperature, underlying comorbidities, day-to-day life behavior, and patient symptoms. Bioactivity data sets from numerous high-performance screen providing valuable means for classifiers for machine learning as they provide both binary (active/inactive) and numerical information to identify various compounds being considered (Zeouk et al. 2020).Today, IoT devices play an important role in the effective analysis of cases COVID-19. The study includes wearable devices, human interpretation and web servers, statistic analysis, data management and therapeutic therapy for IoT influences. Research begins with wearable sensor data collection, cloud server data recovery, preparation and classification based on gender and age information. IoT systems help to track and control patients for the necessary prerequisites.The suspected cases are tested based on symptom factors, including temperature, oxygen level (SPO2), the difference in the respiratory rate and continuous investigation. These demographic factors are evaluated using gender and age factors from the gathered information using IoT factors, hence providing a cutting-edge design in clinical trials.

The main contribution of the paper is.

  • Designing the SEIRUD model and MLA for controlling &spreading Prediction of COVID-19 in Saudi Arabia.

  • Evaluating the nonlinear mathematical model for prediction, isolation, and contact tracing.

  • The experimental results have been executed based on prediction, accuracy, and time.

The remainder of the article is organized as follows: Sect. 1 and Sect. 2 discussed the feasibility of controlling and spreading the Prediction of COVID-19 and existing methods. In Sect. 3, the SEIRUD-MLA model has been suggested. In Sect. 4, the simulation findings have been executed. Finally, Sect. 5 concludes the research article.

2 Literature works

Yang et al. (2020) suggested the Susceptible-Exposed-Infectious-Mild-Critical-death-recovered model (SEMCR) for mitigating and controlling COVID-19 outbreaks. The model was fitted and tested in January 2020 and March 2020 with a public data set that included the regular number of reported active events, including Wuhan and London. The findings showed:1) Immediate suppression in Wuhan significantly decreased the overall population exposed and contaminated and needs to be sustained for at least 90 days regularly (by the middle of April 2020). We expect that the number of infections by the middle of April 2020 will have gone 73 times higher without this action. Its effectiveness calls for successful government policies and effective collaborative leadership to mobilize corporate resources to provide critical products.

Wang et al. (2020) proposed the long short-term memory (LSTM) for time series prediction for the epidemic trends of COVID-19. Firstly, as typical epidemic models use accumulated confirmed training events, it can only forecast an escalated epidemic pattern and can't predict when the epidemic deteriorates or stops; an updated model is created based on the long short-term memory (LSTM). Second, given the current LSTM-based forecasted model, the disease trend can only be projected reliably over the next 30 days. For long-term forecasts, the LSTM-based rolling update mechanism is implemented. Third, the effectiveness of prevention interventions such as social exclusion and COVID-19 lockdown is evaluated by introducing the Diffusion Index (DI).

Kavadi et al. 2020 introduced the partial derivative regression and nonlinear machine learning (PDR-NML) method to predict COVID-19. They utilized a progressive partial linear derivative regression model to look for the dataset's right constraints effectively. Next, the standard features have been used to make reliable forecasts in a nonlinear global pandemic machine learning model. The findings reveal that the ML approach proposed outperformed state-of-the-art approaches in the population and can be an easy instrument for predicting other countries. The PDR-NML has been used to normalize the features needed for timely prediction and the PDR-NML to ensure robust and accurate predictions.

Abdelhafid Zeroual et al. (Zeroual et al. 2020) discussed the deep learning methods (DLM) to forecast COVID-19 time series data.Financially Support and decision-makers with sufficient details about the anticipated condition and steps they need to impose by estimating the number of cases reported or retrieved. Furthermore, details from forecasts can help the general population consider the steps implemented to slow this virus's spread. In this research, NN-based models, including LSTM, RNN, GRU, BiLSTM, and VAE, were used to help the regular confirmations and recoveries in six different countries in real-time COVID-19 predictions. This choice is informed by the profound learning model's widespread capability to capture nonlinearity in processes and their versatility to model time-based data.

Dias et al. 2020 initialized Deep learning and learning management systems (DeepLMS) to predict COVID-19 and support online learning. Here they illustrate, for the first time, that Deep learning techniques can be used to deal with the interaction of LMS users and form a new paradigm for predicting interaction efficiency (QoI) with LMS, DeepLMS. DeepLMS is used to measure root mean square error (RMSE) in average with the use of Long Short-Term Memory (LSTM) networks, with the mean coefficient similarity of ground truth to expected QoI values r > 0.97(p < 0.05) when evaluated on QoI from one database and two data during COVID-19. In addition to contents assessment, DeepLMS customized QoI prediction scapegoats the individual's interest in online learning and offered educators an appraisal direction that improves the overall perspective on students' commitment and their involvement in the learning process.

Based on the survey, there are some challenges in the accurate prediction of COVID-19, and to overcome those issues, the SEIRUD-MLA model has been suggested in this paper. The following section discusses the proposed model briefly. The proposed system would employ an Internet of Things (IoT) platform for the collection of user data on symptoms in real-time, for early detection of potential coronaviruses, to track the treatment response of those who have recently healed from the virus and to gather and examine the existence of the virus.The Internet of Things (IoT) incorporates networking systems as well as sensing technologies and all-inclusive information technology to upgrade physical objects into smart things.

3 SEIRUD and machine learning algorithm (MLA)

Coronavirus 19 (COVID-19) is extremely transmittable and pathogenic virus contamination that has arisen and spread worldwide owing to acute respiratory syndrome coronavirus 2 (SARS-CoV-2). The use of sensor equipment has significantly increased and IoT implementations have taken advantage of different advances in solving the COVID-19 crisis. The technological innovation uses IoT inputs and symptom functions to predict wearable sensors for COVID-19. The working framework incorporates wearable sensors, quality control, case checking, suspect, and IoT elements. The Iot devices like smart watches are used to collect the physiological parameters for individuals. The data collected from IoT devices are stored in the database and these data from devices can be viewed by the healthcare specialist. The IoT variables and the role of symptom detection using wearable sensors to forecast cases of COVID-19 is illustrated in Fig. 1.

Fig. 1
figure 1

IoT variables and the roles of symptom detection using wearable sensors to forecast cases of COVID-19

The data obtained from IoT devices are analyzed by Genetic code that shows the phylogenetic link among SARS-CoV-2 and severe bat-like (SARS-like) respiratory syndrome, so bats may be a potential key reservoir. However, humans' rapid transmission to humans is widely confirmed; the intermediate cause is understood by the use of IoT sensors. The virus is classified as a novel coronavirus by the series-based study of patient isolates. In addition, the detection of virus infection is made using the genetic sequence. However, more study has found that some people constricted the infections without a record visiting the market of seafood. These interpretations found that this virus would spread to humans in more than 100 countries across the world. The virus's human transmission occurs because of near contact with an infectious person exposed to cough, sneezing, air aerosols,or droplets. The IoT sensors collect all physiological changes occurred in human and the breathing difficulties are identified. These inhalers can breach the body of the human body (lungs). This paper uses a mathematical model using SEIRUD and Machine learning Algorithm (SEIRUD-MLA) to evaluate the viability of contact tracing and isolation cases to control an outbreak of COVID-19. This paper utilized disease transmission physiognomies detailed to the pathogen and gave better accessible evidence of IoT sensors if isolation and contact tracing can control an outbreak in Saudi Arabia. Different machine learning algorithms have been suggested to be trained to predict and classify viral genomes at various taxonomy levels in IoT platform. The control problem contains determining the optimal control design and dynamic systems. This paper views the transmission of COVID-19 dynamics as a Markov Decision Process (MDP) or dynamic model. A common dynamic system is typically established by nonlinear state-space calculations to be converted into RNN. The recurrent neural network is a supreme tool to learn a partially perceived MDP. After the MDP or dynamic system is learned from past information, this paper uses reinforcement learning or optimal control theory to suppose control actions or signals collected from IoT sensors, transforming the system into the anticipated state.Reinforcement learning delivers information wealth about the results of action or data about effect and cause of data obtained from IoT devices. The data obtained from the human host and the primary host is collected by the IoT sensor. The transmission and contact between these two host is collected via the IoT sensor, and the patient details regarding the disease is stored in the database as shown in Fig. 2.

Fig. 2
figure 2

Rate of contact and transmission of disease

The potential of IoT technologies to combat the pandemic COVID-19.Any remote health management solution built on IoT will help streamline systems and discourage patients from accessing healthcare prematurely. In COVID-19 detection centers, "medical robots" are used to test patients' temperatures, provide medications in isolation and even clean rooms. IoT-based screening devices can also identify potentially infectious people so that workers can return to workplaces and reopen public spaces, buildings, stores, and other facilities securely.

Figure 3 shows the COVID-19 Origin, Transmission, Biological Evolution, and Treatment. The novel coronavirus's impact and biological growth, symptoms, transmission process, and possible actions and suppression options are expressed in Fig. 1. Moreover, the economic, environmental, social, and psychological influences collected from IoT devices of the people's life are discussed. The human respiratory zone is the impending route for entry of SARS-CoV-2 into the humanoid host, and the intestinal tract is one of the possible causes of the infection as the COVID-19 symptoms. The quick and accurate prediction of COVID-19 is essential for us to control this pandemic. The scientist predicted that the virus source is palm civets and raccoon dogs. This virus's transmission path from human to human is via near contact leading to contact with the tears of eyes, mouth's slimy layer saliva, or respiratory dewdrops of running nose.

Fig. 3
figure 3

COVID-19 origin, transmission, biological evolution, and treatment

Figure 4 shows the transmission pattern of COVID-19. This paper established a branching progression model in which the number of possible secondary cases generated by every human is strained from an adverse binomial distribution with an average equivalent to the imitation number and heterogeneity in the number of new infections generated by every individual. The diseases transmitted by the contact between host must be obtained from IoT devices. Every probable new infection is allocated a period of infection strained from the sequential interval distribution. Subordinate cases have only been created if the person with the infection had not been isolated by the infection period. A person infected with the virus can create three secondary infections. Two transmissions potency happens before the case is isolated. Therefore, in the model, a condensed delay from onset to isolation could decrease the mean number of secondary cases.

Fig. 4
figure 4

Transmission pattern of COVID-19

The overall human population at period \(t\), represented by \({N}_{g}(t)\), is divided into mutually limited subpopulations of exposed humans \(E(t)\), susceptible humans \(S(t)\), infectious humans \(I(t)\), predicted infectious humans through testing and recovered humans \(R(t)\), and \(U\left(t\right)\) denotes the number of recovered people satisfying untraceable criteria at period \(t\), and disease detected humans \(D(t)\). Therefore, \(N_{g} \left( t \right) = S\left( t \right) + E\left( t \right) + I\left( t \right) + U\left( t \right) + R\left( t \right) + D\left( t \right)\). The model for COVID-19 spread dynamics in a population is specified by the deterministic nonlinear differential expression (1),

$$\frac{dS}{dt}=-\frac{{\alpha }_{c}\left(\beta A+I\right)}{{N}_{g}-{I}_{D}}S$$
$$\frac{dE}{dt}=\frac{{\alpha }_{c}\left(\beta A+I\right)}{{N}_{g}-{I}_{D}}S-\sigma E$$
$$\frac{dI}{dt}=\left(1-v\right)\sigma E-\left(\varphi +{\delta }_{o}+{d}_{o}\right)I$$
$$\frac{dR}{dt}=\sigma I-\left(\rho +\mu +\omega \right)R$$
$$\frac{dD}{dt}=\beta I\left(t\right)$$
$$ \frac{{dU}}{{dt}} = \sigma R - \left( {\mu + \varepsilon } \right)U $$
(1)

As shown in Eq. (1) where \({\alpha }_{c}\) indicates the effective transmission rate, \(\sigma \) denotes the evolution rate from uncovered state to infectious state, \(v\) signifies the fraction of new infectious person,\(\beta \) denotes the modification constraint that interpretations for the decreased infectious of persons in the \(A\) class when equated to persons in the \(I\) class,\(\varphi \) denotes the prediction rate (via testing and contact tracing) for the \(I\) class, \(\mu \) indicates the natural mortality rate of the population, \(\omega \) represents the disease-induced mortality rate of infected receiving quarantined, \(\rho \) indicates the rate of recovery,\(\varepsilon \) denotes the proportion of the detached population still being perceived and being relocated to susceptible classes.

Figure 5 shows the schematic diagram of the model.The flow of individuals through these compartments is modeled utilizing differential equations. During spreading COVID-19 in Saudi Arabia, the population could be separated into six dynamic subpopulations. Susceptible humans are derived by deducting persons confirmed to be virus carriers by testing hospitals from the overall population. Ordinary differential equation is utilized for the simulation to calculate the parameters after a short time. The ordinary differential equation demonstrates the change rate for each variable. The number of infected human reductions with recoveries and deaths. Recovered individuals can no longer change to the susceptible condition.\(S\left(t\right)\) denotes the susceptible population who are healthy and can contract the disease, \(E(t)\) indicates the exposed population who infected and not yet infectious, \(I\left(t\right)\) denotes people who confirmed infected and under treatment, \(R\left(t\right)\) indicated the individuals who have recovered and cannot contract the COVID-19 again. \(D(t)\) represents the number of fatalities, \(U\left(t\right)\) denotes the number of recovered adults satisfying undetectable.

Fig. 5
figure 5

Schematic diagram of the model

4 Preposition 1: Markov decision process

Solution 1:Markov Decision Process (MDP) is a theoretical progression for reinforcement learning (RL), and it has three elements: action,reward, and the state contains optimal control of the design and system identification. Reinforcement learning can be observed as a dynamic, open system with respective reward functions. The dynamic model can be a continuous-time or discrete-time dynamic model.

Let’s consider \(g_{t} \in O^{n}\) be a hidden state, \(x_{t}\) indicates the perceived parameter (the number of new cases), \(B_{t}\) denotes an action parameter or intervention parameter and \(y_{t}\) be vectors of covariate at period \(t\). Considering the subsequent dynamic model essential the spread dynamic of COVID-19:

$$ g_{{t + 1}} = f\left( {g_{t} ,B_{t} ,y_{t} ,x_{t} } \right) $$
(2)
$$ \hat{x}_{{t + 1}} = h\left( {g_{{t + 1}} } \right) $$
(3)

As shown in Eqs. (2) and (3), where\(f\), \(h\) are two nonlinear functions. System expression (2) defines that the subsequent hidden states \(g_{{t + 1}}\) is transformed from the present hidden states \(g_{t}\) and impacted by the present intervention oractions \(B_{t}\).

The respective reward functions are stated as \(O:B \to O\), which is a present action function. The reward at period \(t\) is stated as \(O_{t} = O\left( {B_{t} } \right)\). As the present reward may create a minor involvement to the overall reward, in the extended term, and added reward over the period with a probable discount element \(\delta \in \left[ {1,0} \right]\) is stated as

$$ O = \mathop \sum \limits_{{t = 1}}^{T} \delta ^{{t - 1}} O_{t} $$
(4)

The Markov Decision Process and learner produce a sequence: \(g_{0} ,B_{0} ,O_{1} ,g_{1} ,B_{1} ,O_{2}\). The reinforcement contains two-step learning: (1) optimal intervention policy learning and (2) system identification. The reward functions in two-step learning are diverse.

Figure 6 shows the Markov decision process. This paper proposes a discrete-time Markov chain system analogous to a financial forecasting model that straightly integrates stochastic behavior and for which constraint estimation is upfront from available data obtained from IoT platform. A Markov chain is a stochastic model that defines probable events in which every event's likelihood is contingent only on the state achieved in the prior events. The patient treatment progression is modeled as a captivating Markov chain with the succeeding discrete states: discharged, infected severe, under medical observation,infected non-severe, critical, cured, and deceased.

Fig. 6
figure 6

Markov decision process

5 Preposition 2:system identification

Solution 2: System identification applies two resolutions. Firstly, since the COVID-19 dynamics are partially perceived, the hidden states must be assessed from the past information. Secondly, to learn the optimal control strategy, it needs to determine the system inherent in the COVID-19 dynamics. It aids as a source for the subsequent stage, optimal strategy learning. For the suitability of consultation, expression (3) is altered to

$$ \hat{x}_{t} = h\left( {x_{{t - 1}} , \ldots ,x_{{t - k}} ,g_{t} ,B_{{t - 1}} ,y_{{t - 1}} } \right) $$
(5)

This paper objective is to reduce the reward function:

$$ \mathop {\min }\limits_{{f,h,B}} O\left( {f,h,B} \right) = \mathop \sum \limits_{{t = 1}}^{T} \left\|x_{t} - \hat{x}_{t}\right\|^{2} + \mathop \sum \limits_{{t = 1}}^{T} \left\|B_{t} - \hat{B}_{t}\right\|^{2} $$
(6)

As inferred from Eq. (6), where \(B = \left[ {B_{0} ,B_{1} ,B_{2} , \ldots B_{{T - 1}} } \right]^{T}\) are calculated from the data, \(f,h\) functions are employed by Recurrent Neural Network. Based on the mathematical expression, precision or specificity and recall or sensitivity rate has been improved.

6 Preposition 3: Optimal intervention policy learning

Solution 3:Supposing the optimal intervention strategy based on the system determined in the prior phase. This study searches for an optimal intervention policy that reduces cumulative cases or deaths in the subsequent stage. Thus, the reward functions at time \(t\) are stated as

$$ O\left( {B_{t} } \right) = \left\| {\overset{\lower0.5em\hbox{$\smash{\scriptscriptstyle\frown}$}}{x} _{t} } \right\|^{2} $$
(7)

In other verses, this paper needs to create new cases at periodt as minor as probable. Let’s consider \(\pi\) denotes the action assortment strategy that regulates the model’s following actions \(B_{t}\). The action assortment strategy \(\pi\) which based on the hidden states perceived information and covariate is assumed as

$$ B_{t} = \pi \left( {x_{{t - 1}} ,..,x_{{t - k}} ,g_{t} ,B_{{t - 1}} ,y_{t} } \right) $$
(8)

This paper attempts to reduce the reward function.

$$ \mathop {\min }\limits_{\pi } O = \mathop \sum \limits_{{t = 1}}^{T} \delta ^{{t - 1}} O\left( {B_{t} } \right) $$
(9)

7 Preposition 4: Recurrent neural network

Solution 4: System identification is to acquire a typical fundamental to the COVID-19 dynamic from past obtainable information. The past data comprise the infectious cases (cumulative or new) \(x_{t}\), the covariate \(y_{t}\) like sex, race, age, and the intervention or action \(B_{t}\). The model captures the basic system's major progress and elucidates the system evolution beyond the perceived data zone. RNN is an influential apparatus for system identification. The recurrent neural networks can acquire the compound dynamic in the input period sequence's temporal organization and usage interior memory to recall.

The recurrent neural networks contain two sorts of outputs and inputs: (1) internal output and input (2) external output and input. The inner output of recurrent neural networks can be observed as a ‘system state,’\(g_{t}\), which is accepted to the subsequent period stage. A recurrent neural networks cell obtains a previous internal state \(g_{{t - 1}}\) and present external input: the number of case \(x_{t} , \ldots x_{{t - k + 1}}\), action \(g_{t}\) and covariate \(y_{t}\) and produces a present internal state \(g_{t}\) and a present external output \(\hat{x}_{{t + 1}}\) at the time (t + 1). The recurrent neural networks models input the time sequence (past number of COVID-19 cases over the period) and forecast the upcoming response period sequence (number of COVID-19 cases in the prospect with a deliberate series of intervention).

Defining the input vector \(U_{t}\) as

$$ U_{t} = \left[ {\begin{array}{*{20}c} {x_{t} } \\ \vdots \\ {x_{{t - k + 1}} } \\ \end{array} } \right] $$
(10)

The recurrent neural networks model for an output calculation of the dynamic model and state transition underlying COVID-19,

$$ {\text{State}}\;{\text{transition}}\;g_{t} = f_{g} \left( {S_{{gg}} g_{{t - 1}} + S_{{ug}} U_{t} + S_{{bg}} B_{t}^{l} + S_{{yg}} y_{t} + a_{g} } \right) $$
(11)
$$ {\text{Output}}\;{\text{equation}}\;\hat{X}_{{t + 1}} = f_{x} \left( {S_{{gx}} g_{t} + a_{x} } \right) $$
(12)

As derived in Eq. (11) and (12), where \(S_{{gg}}\) is a \(n~ \times ~n\) dimension weight matrices that associate the prior state to the present state,\(S_{{bg}}\) is a n dimension vector,\(S_{{ug}}\) is a \(n~ \times k\) dimensional matrices, \(B_{t}^{l}\) is the \(lth\) intervention iteration extent at period \(t\). \(S_{{yg}}\) is a \(n \times l\) dimensional matrices, \(y_{t}\) is a \(l\) dimensional vectors of the covariate, and \(a_{g} = \left[ {a_{g}^{1} , \ldots ,a_{g}^{n} } \right]^{T}\) is a \(n\) dimension bias vectors that correct the bias and \(S_{{gx}}\) is a \(n\) dimensional weight vector, \(f_{g}\) is an element-wise nonlinear activation functions, \(a_{x}\) is the output of neuron bias vectors and \(f_{g}\) is an activation function.

Utilizing recurrent neural networks to determine the system basis of the COVID-19 dynamics can be expressed as the subsequent optimization issue,

$$ \mathop {\min }\limits_{{\theta ,B}} O\left( {h,g,B} \right) = \mathop \sum \limits_{{t = 1}}^{T} \left\|x_{t} - \hat{x}_{t} \right\|^{2} + \mathop \sum \limits_{{t = 1}}^{T} \left\|B_{t} - \hat{B}_{t}\right\| ^{2} $$
(13)

s.t

$$ g_{t} = f_{g} \left( {S_{{gg}} g_{{t - 1}} + S_{{ug}} U_{t} + S_{{bg}} B_{t}^{l} + S_{{yg}} y_{t} + a_{g} } \right) $$
(14)
$$ \hat{x}_{{t + 1}} = f_{x} \left( {S_{{gx}} g_{t} + a_{x} } \right) $$
(15)
$$ \hat{B}_{t} ^{{l + 1}} = \pi \left( {S_{{bg}} g_{t} + a_{b} } \right) $$
(16)

As discussed in Eq. (13), (14), (15), and (16), where \(\hat{B}_{t} ^{{l + 1}}\) is the \(\left( {l~ + ~1} \right)th\) intervention measure iteration at period \(t\), \(\pi\) is a nonlinear activation function, \(S_{{bg}}\) is a \(1~ \times ~n\) dimension matrices, and the variable \(\theta\) is the bias vector and weight matrix. The over head reduction issue would be resolved by a back-propagation approach and a forward dynamic program model.

Figure 7 shows the recurrent neural network encoder. The major aim of reinforcement learning is to create a better choice from past data. The additional portion of the distinctive reinforcement learning is to learn an optimum control strategy. Selections of community health intervention are limited by manifold technological, cultural, political, economic factors. Policy optimization is frequently almost impossible. Thus, this paper does not challenge to design of optimal control action. The recurrent neural networks for system identification is termed an encoder, and the recurrent neural networks for action assortment and assessment is known as a decoder. Here, this paper concentrates on the recurrent neural network decoder. Contrasting the normal decoder rebuilds the input period sequence from the hidden representation, the recurrent neural networks decoder utilized the learned feature of the COVID-19 dynamic in the recurrent neural networks encoder and assumed a series of deliberate community health intervention as an input to the recurrent neural networks decoder. The subsequent set of equations can signify the recurrent neural networks decoder:

$$ g_{{t + \tau }} = f_{g} \left( {S_{{gg}} g_{{t + \tau + 1}} + S_{{ug}} U_{{t + \tau }} + S_{{bg}} \hat{B}_{{t + \tau }} + a_{g} } \right) $$
(17)
$$ \hat{x}_{{t + \tau + 1}} = f_{x} \left( {S_{{gx}} g_{{t + \tau }} + a_{x} } \right) $$
(18)
$$ \hat{B}_{{t + \tau + 1}} = f_{b} \left( {S_{{gb}} g_{{t + \tau }} + a_{b} } \right) $$
(19)
Fig. 7
figure 7

Recurrent neural network encoder

Figure 8 shows the recurrent neural network decoder. As shown in Eq. (17), (18), and (19), where \(U_{{t + \tau }}\) is stated as \(\tau \ge 1\). The proposed SEIRUD-MLA model achieves high precision, recall, F1 score, accuracy ratio of predicting and controlling COVID-19 cases in Saudi Arabia.

Fig. 8
figure 8

Recurrent neural network decoder

8 Results and discussion

This paper attempts to develop a system predicting the number of cases affected by COVID-19 in Saudi Arabia, utilizing machine learning approaches. Data from IoT devices can be extensively analyzed for observations and decision-making for COVID-19 transmission and tracking. The real-time data are obtained by wearable sensors in IoT platform. The Machine Learning and Deep Learning (ML/DL) algorithms are currently used to replace more conventional approaches since they can manage big data. The proposed SEIRUD-MLA model's experimental result shave been performed based on the performance metrics such as accuracy, prediction, precision, recall, and F1 score ratio, contact rate.

8.1 Contact rate

The level of contact of the COVID-19 patient is determined as follows from various occasions and the number of contacts received during transmission. The level of contact among human and the primary, secondary host is obtained via IoT sensors. In the area of digital technology, the contact rate is quite significant as it enables the users/ patients to establish whether testing of cases, suspicious and IoT elements works effectively. The contact rate of the COVID-19 crisis is illustrated in Fig. 9

Fig. 9
figure 9

The contact rate of the COVID-19 crisis

8.2 Accuracy ratio

Artificial intelligence solutions help struggle against coronavirus, forecast the size,peak, and duration of the outbreaks, which is requested to have been realized with 89.3% accuracy in real-time tests in different Saudi Arabia regions. This paper incorporates significant parameters like distribution of age, population density, level of healthcare services available in IoT platform individual and community movements, the virus's virulence and strain type, and the prediction accuracy. The RNN network was selected based on fitting performance and prediction accuracy. SEIRUD model, by reflecting the important incubation time during which persons are infected, presented improved model accuracy. It is perceived that the suggested model produces high accuracy for short-term forecast with less error. Accuracy describes how often the model is classifying properly.

$$ {\text{Accuracy}}~\left( \% \right) = \frac{{{\text{TP + TN}}}}{{{\text{TP + FN + FP + TN}}}} \times 100 $$
(20)

As shown in Eq. (20), where \(TN\) denotes the true negative, \(TP\) indicates the true positive, \(FP\) signifies the false positive, \(FN\) represents the false negative. Figure 10 demonstrates that the accuracy ratio analysis using the suggested SEIRUD-MLA model.

Fig. 10
figure 10

Accuracy ratio analysis

8.3 Prediction ratio

Mathematical modeling is often utilized to forecast the outbreak of various diseases in epidemiology. The function and structure of different proteins connected to CoV-2 and their contact with the human host protein and the cellular settings can be predicted with artificial intelligence. This paper develops appropriate algorithms, and it can predict the involvement of different socio-economic constraints to identify the spread,vulnerability, and epidemic progression. This can contribute to an efficient decision on resource allocation in large, medically limited countries. The proposed machine learning method can forecast a person pretentious with COVID-19 and has the likelihood to progress acute respiratory distress syndrome. Figure 11. demonstrates the prediction ratio of the suggested SEIRUD-MLA model.

Fig. 11
figure 11

Prediction ratio evaluation

8.4 Precision ratio

The efficacy of isolation of cases and contacts to control an outbreak of COVID-19 is based on the precise transmission features, which remain unclear. The infectious disease model aims to understand the mechanisms that impact diseases' spread and predict disease transmission under epidemiology.By perfectly monitoring the respiratory rate, the irregularity can be determined in an earlier phase without any deterioration indication. This aids in classifying the abnormalities because of COVID-19 for the alleged cases. This paper mapped all cases with the precise time of symptom onset.

$$ {\text{Precision}} = \frac{{{\text{TP}}}}{{{\text{TP + FP}}}} $$
(21)

Precision is utilized to stretch the association between the true-positive predicted values and false-positive predicted values. Figure 12. illustrates the precision ratio using the suggested model.

Fig. 12
figure 12

Precision ratio

8.5 Recall ratio

Pathological tests are executed based on the machine learning method. A quick and precise diagnosis is essential for the current fight against COVID-19. Our model relied on recurrent neural networks (RNNs) to determine structural abnormalities and disease categorization that were solutions to discover hidden patterns. Our study analyzes an approach to enhance accuracy in COVID-19 prediction based on machine learning. The recall is stated as the overall number of properly categorized positive patients to the overall positive patient population. It must be as high as probable. Our findings demonstrate a high value of the recall rate of the COVID-19 sorting.

$$ {\text{Recall}} = \frac{{{\text{TP}}}}{{{\text{TP + FN}}}} $$
(22)

Figure 13 demonstrates the Recall ratio using the suggested SEIRUD-MLA model.

Fig. 13
figure 13

Recall ratio

8.6 F1-score ratio

The main symptoms of suspected diseases include illness, fever, and contaminants. In more aggressive infections, the virus can cause pneumonia. Besides pneumonia, a serious acute breathing syndrome, septic shock, multi-organ failure, and death can occur in the infection.F1-score can be described as the harmonic mean of recall and Precision. It is complex to associate two models with high recall and low precision, and vice versa. Therefore, to render them equivalent, this paper uses F1score. It permits the extent of the Precision and Recall values in a similar period. It utilizes the harmonic mean on behalf of the arithmetic average by imprisoning the great values more.

$$F1\;{\text{Score}} = 2 \times \frac{{{\text{Recall}} \times {\text{Precision}}}}{{{\text{Recall}} + {\text{Precision}}}}$$
(23)

Figure 14 shows the F1-score ratio using the suggested SEIRUD-MLA model.

Fig. 14
figure 14

F1 score ratio

The proposed SEIRUD-MLA method for controlling and spreading Prediction of COVID-19 in Saudi Arabia and experimental results have been performed based on accuracy, prediction, precision, recall, F1 score ratio compared to other existing different Susceptible-Exposed-Infectious-Mild-Critical-death-recovered model (SEMCR), long short-term memory (LSTM), partial derivative regression and nonlinear machine learning (PDR-NML), deep learning methods (DLM), Deep learning and learning management systems (DeepLMS) methods.

9 Conclusion

This paper proposes the SEIRUD-MLA model for forecasting the COVID-19 positive cases in Saudi Arabia. The number of cases and daily growth is characterized into moderate, mild, and severe regions for realistic lockdown actions compared to locking down the entire nation, impacting socio-economic problems. As the world struggles with the COVID-19 pandemic, many inventions have been developed to tackle the epidemic. The Internet of Things (IoT), a technology widely used in the healthcare industry.Wearable devices are becoming increasingly prevalent and are expected to impact potential health and lifestyle uses, particularly when combined with IoT systems. Although Bluetooth technology wearable devices can have certain shortcomings, some structural benefits outstripped. Long data obtained through the use of wearable devices provide the ability to build smart IoT solutions through decision support mechanisms based on AI. Recurrent neural networks (RNN) and Markov decision processes are utilized as prediction models. The results of two machine learning models (MDP and RNN) described a high generalization capability for a long-term forecast. Concerning the outcomes informed in this study and because of the highly dynamic nature of the COVID-19 outbreaks and variances from nation-to-nation, this paper proposes machine learning as an efficient tool to model the outbreaks. The experimental findings have been executed, and the suggested model improves the accuracy ratio of 89.3%, prediction ratio of 88.7%, the precision ratio of 87.7%, recall ratio of 86.4%, and F1 score of 90.9% compared to other existing methods.