1 Introduction

Monkeypox is a virus [1, 2] that belongs to the Poxviridae family under the genus orthopox virus, which originated in the Democratic Republic of the Congo, Africa, in the 1970s and has been endemic there in African countries. But its worldwide outbreak has resulted in over 50,000 cases, as of 27th September, 2022, across 50+ countries since May 2022 [1, 3]. It is the second largest outbreak of this century followed by COVID-19 [4]. A study [5] has reported that the withdrawal of smallpox vaccine in the late 1980s could be a reason for this outbreak which is efficient in preventing the monkeypox spread as well. This poses a serious threat as a large number of people could be susceptible to the disease. Moreover, several studies indicated that the efficacy of the smallpox vaccine has been waning posing an increasing probability for the disease to spread. Though monkeypox is severe but not fatal in adults and cures on its own, it is severe among children and young adults who have poor health conditions and malnutrition.

Due to the widespread of COVID-19 around the globe [4], we have seen the possibility for the virus to mutate into more virulent ones and can cause damage to people from personal level to societal scale. So proper prediction of the outbreak needs to be done which might help to monitor the disease spread and to implement appropriate control measures by the health care system in bringing the disease spread under control. A well-augmented prediction of the disease spreading is deemed to be necessary for the benefit of the policymakers and the health care systems to strategize to limit the disease spread. A broad spectrum of model-based techniques such as parameterized compartmental SIR models [6, 7], time-series modeling [8], probabilistic master equation-based models [9], iterative maps, fractal-based models [10, 11] and logistic equation [12] are available to predict the disease spread. These methods can be useful only if we have proper information about the epidemiological parameters. The less amount of data and the lack of information on epidemiological parameters would pose serious limitations on the above methods for their prediction. Fortunately, on the other hand, we have model-free data-driven methods such as statistical modeling [13,14,15] and the machine learning model [16], which were helpful in prediction.

For our current investigation, we consider the realtime cumulative monkeypox infection per day data from its initial spread to its spread on 27th September 2022 and use the power law [15] to estimate the scaling exponent of the disease spread in nine most infected countries. We find that the USA stands first in the list of nine countries with highest scaling exponent elucidating the degree of the spread of the monkeypox infection. In contrast, small values of the scaling exponent for the countries like Brazil and Peru are observed. Being a virus from the orthopox family, we have also calculated the scaling exponent for the smallpox outbreak in Tokyo, Japan, during 1907–1908 and found a high degree of scaling exponent quite close to that of the scaling exponent for the monkeypox spread in the USA providing a vital clue about the current spread of the monkeypox virus. Further, we have also analyzed the number of infections using the scale-free echo state network (ESN), which is actually a system of modified recurrent neural networks (RNN) [16, 17]. We have predicted the cumulative monkeypox infection, which agrees fairly well with the realtime cumulative spread for the last ten days from 18th September 2022 to 27th September 2022 and forecasted the cumulative infection for the next ten days from 28th September 2022, which is then used to estimate the scaling exponent. The results from the scaling exponents and those from the machine learning technique are found to be in excellent agreement with each other. Usually, the predictions from the machine learning approach are more accurate in prediction than any other models, but the downside of it is that the results cannot be quantified which severely affects the interpretability of the prediction. In this paper, we combine the results from the power law method along with the machine learning approach and bring out the two important features of prediction, namely accuracy and its interpretability. When it comes to forecasting in realtime systems, our study puts together the better predictability of machine learning and quantitative results from power law approach provide interpretability to the results that help health care system in making more tangible predictions.

The plan of the paper is as follows: In Sect. 2, we provide the description of the power law approach and the scaling exponent of monkeypox outbreak for the USA, Spain, Brazil, France, Canada, Peru, Netherlands, UK and Germany were calculated and reported. We also compare the smallpox outbreak of 1907 in Japan [18] with the current monkeypox outbreak. We present the description of ESN network that we used for prediction and forecasted the results along with its interpretation through the power law fit in Sect. 3. Finally, we provide a conclusion in Sect. 4.

2 Power law approach

For our analysis, throughout this paper, we took the data from the website (https://ourworldindata.org/monkeypox) accessed on 27th September 2022. Epidemiological models make the assumption that the number of person n(t) infected by a sick person will grow exponentially over time ‘t’ as

$$\begin{aligned} n(t)=Bt^{\gamma }, \end{aligned}$$
(1)

where B is a proportionality constant and \(\gamma \) is the scaling exponent which reveals the growth pattern of the disease in the chosen demography or a particular nation. We determine the range of power law behavior by plotting the cumulative infection per day data corresponding to different countries in a log-log plot. The scaling exponent for each country was then calculated. To illustrate this method, we took the cumulative infection data for the United States of America (USA) as an example. The cumulative cases of the monkeypox outbreak in the USA are plotted in Fig. 1. The two vertical lines (see Fig. 1b) indicate the range used to extract the scaling exponent. The data points are overlaid with the best fit as determined by linear regression.

Fig. 1
figure 1

a Total number of monkeypox infections in the USA was plotted as a function of time from 3rd June, 2022 to 27th September 2022. b Log–Log plot of number of infections of the USA as a function of time, the two vertical lines indicate the spectrum of scale-free behavior. The data points are overlaid with a linear regression’s best fit

We have also carried out the aforementioned analysis for the nine most infected countries by the monkeypox, listed in the first column of Table 1. We found the scaling exponent during the initial power law growth for all the nine countries and tabulated the results in the second column of Table 1 against the respective countries. We have calculated the scaling exponent for all the other eight countries for the window (days) where there exists a power law growth similar to that calculated for the USA as in Fig. 1. From the table, one can say that the USA tops the tabulated list of countries with the highest scaling exponent of 4.421, whereas in countries like Brazil and Peru still a significant amount of growth of the disease is yet to occur, which can be inferred from rather smaller values of their scaling exponents. Further, we have also calculated the scaling exponent for the last ten days (from 27th Sep. 2022) from which one can infer whether the disease spread is either in the growth state or slowing down phase or saturated. The scaling exponent calculated for the last ten days was given in the third column of Table 1. It is evident from the table that in all the nine countries the disease spread was significantly dropped with Germany having the lowest scaling exponent \( \gamma = 0.219\) elucidating that the disease spread is in the state of getting saturated in Germany. Countries like Germany, the UK, the USA and Spain with significantly low values of the scaling exponent unveil the reduced rate of the spread of the disease, whereas in Brazil scaling exponent only dropped a little revealing that there lies an imminent power law growth. The results from these scaling exponents were also helpful in validating the corresponding results predicted from the machine learning approach.

There were studies that showed the withdrawal of the smallpox vaccination in the late 1980s could be the reason for the outbreak of monkeypox as the efficacy of the smallpox vaccine is found to be around 80 percent against the monkeypox virus also. As it has been withdrawn, the waning of immunity due to the vaccine could be a reason for the emergence of the orthopox virus. We have considered the daily disease spread data of smallpox outbreak in Tokyo, Japan, in 1907–1908 (see Fig. 2a) and investigated the similarities among the disease spreading rate of the current monkeypox outbreak with that of smallpox. From the daily infection data, we have calculated the cumulative cases and estimated the power law fit for the time window (days) represented by two vertical dotted lines depicted in Fig. 2b. The scaling exponent for the smallpox outbreak is found to be 4.983 which is quite close to that of the scaling exponent for the monkeypox spread in the USA. This is an important and interesting result, and is also an alarming one as the recent monkeypox spread is similar to the spread of the smallpox virus in Japan in 1907–1908, which accounts for one of the long spanning epidemics causing a significant amount of loss at both individual and societal levels in the human history.

Fig. 2
figure 2

a Total number of infections for the smallpox outbreak of Tokyo, Japan, in 1907 was plotted as a function of time from 18th December 1907 to 25th July 1908. b Log–Log plot of number of infections as a function of time, the two vertical lines indicate the spectrum of scale-free behavior. The data points are overlaid with a linear regression best fit

Table 1 Country-wise scaling exponent (\(\gamma \)) for initial power law growth

3 Machine learning approach

3.1 Architecture of echo state network (ESN)

In this section, we use a machine learning technique known as reservoir computing, a class of recurrent neural networks called echo state network for prediction [16, 17]. The primary reason for the choice of the ESN over the other schemes is that the echo state network has all the advantages of the recurrent neural network (RNN). Note that ESN also avoids the training issues such as vanishing and exploding gradient problems that are inherent to the traditional RNNs. Furthermore, the training process in ESN is also relatively straightforward since most of the weights are chosen randomly and only once. Only the output weights need to be trained in the ESN, which is not the case in the traditional RNNs. Nevertheless, ESN can imbibe the characteristics of the dynamical systems and capture complicated dynamics throughout time. ESN showed encouraging results of handling multiple different inputs of temporal data in a wide spectrum of works [19, 20]. Its ability to trace the correlation between the sequential data, inspired us to use the power of the ESN to create a method for forecasting the spread of monkeypox outbreak. In this model, for a given input vector there is a reservoir that drives the model to train the weights of the output layer accordingly so as to learn the specific temporal pattern of the input data points. The schematic representation of this ESN model is given in Fig. 3. An ordinary leaky tanh governs the dynamics of the nodes of the ESN, which is represented by the following recursive relation

$$\begin{aligned} x(t+1)=( 1- \alpha ) x(t) + \alpha . \tanh (W_{\textrm{res}}x(t) + W_{\textrm{in}}u(t)). \end{aligned}$$
(2)
Fig. 3
figure 3

Schematic depiction of architecture of Echo state model

Here, u(t) is a M-dimensional input vector and x(t) is a \(N_{\textrm{res}}\)-dimensional vector corresponding to the state of the reservoir nodes at the time instant t. The weights of the internal connections between reservoir nodes are embedded in the matrix \(W_{\textrm{res}}\) (dimension: \(N_{\textrm{res}}*N_{\textrm{res}}\)) and the matrix \(W_{\textrm{in}}\) (dimension: \(N_{\textrm{res}}*M\)) represents the input weight matrix. The leakage constant, denoted by the parameter \( \alpha \), can indeed vary in the range of zero to unity. It is important to remember that the \(\tanh \) function is the activation function for each node constituting the reservoir. The initial reservoir weight matrix \(W_{\textrm{res}}\) is created by uniformly distributed random values in the range (\(-1, 1\)).

Now, we consider the time-series data consisting of N data points corresponding to the cumulative infection per day for N days. This includes the cumulative infection per day for M days that is to be fed as the input to the reservoir for training and the remaining \((N - M)\) days of the cumulative infection data points are used as a benchmark to test the predicted cumulative infection per day by the model. The initial goal is to determine appropriate input weights of the input layer and connection weights of the reservoir to mimic the specific data pattern embedded in the first M (when \(t = 0, 1,\ldots , t_r\)) data points of the input corresponding to the cumulative infection per day during the training phase. At each time step, t, the evolution of the input connection weight matrix of the reservoir nodes can be given as

$$\begin{aligned} \begin{pmatrix} W_{\textrm{in}}(1,1) &{}\quad \cdots &{} \quad W_{\textrm{in}}(1,M)\\ W_{\textrm{in}}(2,1) &{}\quad \cdots &{}\quad W_{\textrm{in}}(2,M)\\ \vdots &{} \quad \vdots &{} \quad \vdots \\ W_{\textrm{in}}(N_{\textrm{res}},1) &{} \quad \cdots &{} \quad W_{\textrm{in}}(N_{\textrm{res}},M)\\ \end{pmatrix} \times \begin{pmatrix} I_{1}(t)\\ I_{2}(t)\\ \vdots \\ I_{M}(t)\\ \end{pmatrix}, \end{aligned}$$

where I(t) is the input data corresponding to the realtime cumulative infection per day for M days. In the training phase, at each instant t, the reservoir state x(t) and input u(t) are accumulated in \(V(t)=[1;u(t);x(t)]\). The output vector Y(t) can be written in the form as

$$\begin{aligned} Y(t)=W_{\textrm{out}}V(t), \end{aligned}$$
(3)

where Y(t) is a column vector of length \((1+M + N_{\textrm{res}})\) and V(t) is the column vector of length of \((1+ M+N_{\textrm{res}})\), which is represented as

$$\begin{aligned} V(t)= \begin{pmatrix} {\begin{array}{cccc} 1 \\ I_{1}(t) \\ I_{2}(t) \\ \vdots \\ I_{M}(t)\\ x(1,t) \\ x(2,t) \\ \vdots \\ x(N_{\textrm{res}},t) \\ \end{array} } \end{pmatrix}. \end{aligned}$$
(4)

Here t is the time duration that runs from \(0, 1,\ldots , t_r\). Ridge regression method is used to determine the output weight matrix \(W_{\textrm{out}}\), represented as

$$\begin{aligned} W_{\textrm{out}} = YV^{T}(VV^{T} + \lambda I)^{-1}, \end{aligned}$$
(5)

where \( \lambda \) is the regularization factor used to match the forecasted data to the test data. I is the identity matrix of dimension same as \(VV^T\). Using the output weight matrix \(W_{\textrm{out}}\), the output data corresponding to the prediction of cumulative infection per day made by the model is given by the vector Y(t) expressed as [16],

$$\begin{aligned} Y(t)= \begin{pmatrix} I_{M+1}(t_{r+1})\\ I_{M+2}(t_{r+2})\\ \vdots \\ I_{N}(t_{\textrm{final}}) \end{pmatrix}. \end{aligned}$$
(6)

3.2 Analysis of realtime cumulative infection

To perform the prediction of realtime cumulative infection per day, we divide the real-world infection data to the proportion of 9:1, in which 9/10th of the data has been given as input to the system and let the machine evolve the input weight and the connection weight to mimic the input data pattern and the rest 1/10th of the data has been used as a metric to validate the system prediction. The data was pre-processed, that is smoothed using Savitzky-Golay filter [21], before being fed into the reservoir. For this prediction, the system has to be fed with proper hyper-parameters based on the nature of the data to be trained. For this optimization process, the hyperopt package [22] in python has been used, which will provide the best parameters that can be used for the prediction. Note that in all our simulations, we use the hyper-parameter \(\rho \) to be negative because of non-chaotic nature of the infection data and the magnitude of the spectral radius is scaled to be less than unity. The value of \(N_{\textrm{res}}\) is taken to be 5000.

Fig. 4
figure 4

Prediction of monkeypox cumulative infection per day for nine most infected countries listed in the Table 1. Red solid line indicates the realtime cumulative infection data, and open blue circles represent the prediction of the test set by the ESN model and forecasting done by the ESN model is represented by green triangles extended from the predicted set

Both the predicted and forecasted data for the nine most infected countries listed in Table 1 are shown in Fig. 4. The predicted data represented by blue open circles is depicted in Fig. 4 and is superimposed along with the realtime cumulative infections (red solid line). It is evident that the ESN model has predicted the realtime cumulative infections fairly well. For this, we took the cumulative infection data from initial infection up to 27th September 2022. The last ten data point from the initial infection data is used as the test set, which is used for the validation of the model. We have forecasted the evolution for the next ten days. From the predicted data, represented by green triangles, it is evident that countries like France, Brazil, Peru and the USA show still a growth pattern despite that the growth pattern is slowed down.

Table 2 Country-wise ReMSE values for different \(N_{\textrm{res}}\)

Moreover, one can infer that for countries like Germany, the Netherlands and the UK the infection spread curve looks like a logistic one which shows that in those countries the disease spread is reduced as the value of cumulative cases reaches a constant. It is to be noted that these results were in good agreement with the results obtained from the power law method given in Table 4, where the above-said countries like Germany, Netherlands and the UK have the scaling exponent being dropped below one. This shows that the ESN model is well suited for forecasting the spread for a week or two from the current state. But the drawback of the ESN model is that it might not be suited for long-term prediction because, during the initial spread, the curve looks like an exponential one, so the model might misinterpret the growth as an exponential one forever, which might not a meaningful result. To overcome this limitation, we need to update the data in realtime and then the prediction needs to be done.

Now, we validate the predictions of our model with the realtime data using the normalized root mean square value error defined by

$$\begin{aligned} R e M S E=\sqrt{\frac{{\frac{1}{T} \int _{0}^{T} (I_{a}(t)-I_{m}(t))^{2} \hbox {d}t}}{{\max (I_{a})}}}, \end{aligned}$$
(7)

where \(I_{a}\) is the realtime data of the total number of infected individuals, and \(I_{m}\) is the number of infected individuals predicted by the proposed model. The ReMSE values of all the nine most infected countries for the various output weights are calculated and tabulated in Table 2. It is evident from the table that increasing \(N_{\textrm{res}}\), correspondingly increase in the output weights \(W_{\textrm{out}}\), results in better accuracy of the predictions made by the model. Further, the ReMSE values of the nine most infected countries for various data proportions are estimated and tabulated along with their standard deviation in Table  3, which elucidates that the prediction error will be minimized only when a large data set is used for the training. Note that we have used a proportion of 9:1 of the input data for training and testing because of the availability of relatively less realtime data. The model can be provided with a reasonably large data for training than that for the testing process by using this proportion.

Table 3 Country-wise ReMSE values with various training and testing time split ratio

3.3 Power law fit for the forecasted data

Using the machine learning technique, we forecasted the disease spread for ten days from the data available (as of 27th September 2022). We have also performed the power law fit for the forecasted cumulative infections, which will provide a quantitative measure for the disease spreading. The calculated scaling exponent corresponding to the forecasted data is tabulated in Table 4. Using the power law fit for the forecasted cumulative infection, indicated by green triangles in Fig. 4, by the ESN, one can infer whether the disease attained the endemic state or not. From that, one can get quantitative information about the infection rate and its trend. These results elucidate that in all nine countries the power law growth has ended and a saturation stage has been attained. For the countries like Netherlands, Spain and UK, the regime of power law has completely ended as the number of new infections is dropped near to zero. Moreover, our results elucidate that even the countries which still show the power law growth in last ten days like the USA, Brazil and Peru have the trend of moving toward saturation stage over time. Using this method has an advantage over usual machine learning method because whenever health care systems make decisions it has been backed up by a quantitative measure of scaling exponent which reveals to us the disease spread rate rather than the results from traditional machine learning methods.

Table 4 Country-wise scaling exponent for forecasted data

4 Conclusion

In this paper, we have adopted a machine learning-based technique coupled with a power law-based approach for accurate yet quantitatively interpretable prediction of the monkeypox infection. We have accomplished this by choosing the realtime data corresponding to the cumulative infection per day for the nine most infected countries listed in Table 1 and performing a power law fit to the infection data of all these countries. The scaling exponents deduced from the power law fit elucidate the trend of the infection rate. For instance, the initial scaling exponent for the USA is found to be around \(\gamma =4.424\), which reveals the exponential growth of the infection rate.

The scaling exponent for all nine countries is tabulated in the second column of Table 1, which illustrates us the nature of the infection trend in the respective countries. For instance, the infection rate for Brazil and Peru is found to be the least, but above unity, revealing that there lies a possibility of imminent exponential growth of the infection rate in those countries. In order to understand the complete trend of the outbreak, we have performed the power law fit for the last ten days (from 18th September 2022 to 27th September 2022) and tabulated the corresponding scaling exponents in the third column of Table 1. The decimal values of the scaling exponent of the infection rate in several countries for the last ten days elucidate that the infection rate in those countries is in the saturation state, whereas the scaling exponents for Brazil, Peru and USA are still greater than unity revealing the exponential growth pattern of the infection rate is still intact. Further, the scaling exponent for the smallpox outbreak in Japan in 1907–1908 is found to be \(\gamma =4.983\), which is in the order of the initial monkeypox spread in the USA depicting the similarity in the infection pattern of these two viruses signaling that monkeypox could also be potential threat as an epidemic.

We have also used a modified neural network (ESN) to predict and forecast the infection growth pattern. The predicted data is found to match well with the realtime infection data. We have validated the predictions of our model with the realtime data using the normalized root mean square value error and the results are tabulated in Tables 2 and  3. The ReMSE values in these tables elucidates that the accuracy of predictions will be increased for a large output weights and a large input data for the training phase. We have also estimated the scaling exponents for all nine countries from the forecasted data, listed in Table 4, which largely agrees with the scaling exponents for the last ten days tabulated in the third column of Table 1. These observations elucidate that the trend in most countries, other than Brazil, Peru and USA, is almost in saturation phase. It is to be noted that now, at the time of finalizing the manuscript, we have the realtime data until 3rd November 22 as depicted in Fig. 5. It is evident that our results are in excellent agreement with the trend observed in Fig. 5 for the forecasted period.

Fig. 5
figure 5

Total number of monkeypox infections in all the countries that were taken for analysis is plotted as a function of time from initial infection to 4th November 2022

It is also to be noted that though the power law model is simple to interpret, it cannot take into account the pharmaceutical protocols like quarantine, lockdown, etc. Nevertheless, as of now, there were no such things followed by the infected countries and hence our model provides a valid and interpretable analysis that might help healthcare systems to back their decisions with a quantitative measure. We need to carefully track and control the monkeypox outbreak before it spreads all across the globe because there will be a possibility of this virus getting mutated and intensified. Added to the fact that currently there is no vaccination practice against any of the viruses from the orthopox family, we need more careful analysis of the realtime infection as well as its spread until it becomes completely endemic.