1 Introduction

Healthcare systems are widely used worldwide to predict disease [1]. People all over the world are suffering from various types of deadly diseases [2]. Heart disease, is considered the major serious disease with the greatest death rate throughout the world [3]. Data-driven prediction methods play an important role in the healthcare domain which utilizes them to detect heart diseases in their early stage. [4]. According to data provided by the World Health Organization (WHO) nearly 31% of global deaths of populations are caused by heart-related diseases. Therefore, the prognosis of heart disease is very important in the field of medicine [5]. Furthermore, it is estimated that heart disease-related deaths will rise to 22 million by 2030 if crucial actions aren't taken. People at risk of cardiovascular disease can raise blood pressure, glucose and cholesterol levels, and depression. These parameters are easily sustained at home by primary health facilities [6].

The major contest is to predict the diseases in a time with high accuracy so that the mortality rate can be reduced through effective drugs and other countermeasures. Patients with heart disease usually exhibit different symptoms such as dyspnea, body weakness, and painful swelling of the legs. Early perception is complex but can notably enhance the patient's survival rates [7]. In recent years, some openly attainable heart disease datasets and various predictive models were developed [8, 9]. Several existing methods became developed but those techniques were impossible to accurately predict heart disease [10]. Using heart disease datasets comparative results were carried out to prove the proposed method’s detection performances. The proposed method performs an accurate detection of heart disease by extracting the image features after the pre-processing stage. The aim of the paper is explained as follows.

  • A novel Chaos Game Optimization based Recurrent Neural Network (CGO-RNN) is proposed to perform early diagnosis of heart disease.

  • The KPCA is a non-parametric approach that is employed for dimensionality reduction for extracting the significant features. Also, it diminished the computational load.

  • The CGO algorithm automatically obtains the optimal hyperparameters of the RNN model to enhance the accuracy.

  • For evaluating performance of CGO-based RNN the heart disease prediction and Cleveland Heart Disease Dataset (CHDD) dataset is determined.

The remaining section of the paper is described below. The literary works of various authors are determined in Sect. 2. Section 3 explained the proposed methodology. Section 4 discussed the results of the proposed method and Sect. 5 concludes the article.

2 Related works

Casaña-Eslava et al. [11] concentrate on the function that exists on expanding a recent algorithm for cluster assignment through autonomous hyper-parameter selection. To identify clusters based on density, the Schrödinger equation is adopted to manipulate the focal length parameters that are manipulated in the S-adapted Schrodinger equation. Singh and Bose [12] introduced Fast-Forward Quantum Optimization Algorithm (FFQOA) to process the CT scan taken from COVID-19 patients. The algorithm accomplishes values up from 0.90 to 0.91. Adiabatic quantum computers exist as a hopeful platform for resolving optimization problems. So, Arthur and Date [13] exhibited a quadratic unconstrained binary optimization (QUBO) approach to decode the balanced KMC training. As the quantum handles huge datasets at a high pace, the selected dataset is not computationally intensive.

Khan and Algarni [14] investigated heart disease prediction using Modified Slap Swarm Optimization (MSSO). The Internet of Medical Things (IoMT) Framework is also used for the diagnosis of heart disease which is used by MSSO.

Nagarajan and Thirunavukarasu [15] Suggest a framework of neuro-fuzzy-based healthcare, which includes records and a diagnosis of diseases. An accuracy value of 87.7% is achieved using the Neuro-fuzzy based techniques. To strengthen the decision-making process a fuzzy rule base is designed effectively. Muthu et al. [16] introduce a neuro fuzzy-based algorithm for predicting colorectal diseases in a patient. Technical problems, poor data attributes, and low design of the system are the difficulties.

Thus, Harimoorthy and Thangavelu [17] presented an Improved SVM-Radial based kernel method to identify the huge amount of data to identify the severity level. A vast volume of patient data must be evaluated and processed in the healthcare industry. Big data is primarily used for diagnostic purposes. Singh et al. [18] investigate a Beetle Swarm Optimization (BSO) based ANFIS (BSO-ANFIS) model for cardiovascular disease diagnostics. The accuracy was determined to be 96.08%. However, the processing time to anticipate the condition is lengthy.

Kavitha and Kaulgud [19] utilized the application of quantum paradigms to improve unsupervised machine learning algorithms, specifically the KMC technique. The quantum noise and quiet synchronization times are the issues that need to be addressed in this work. Enireddy et al. [20] Predicted human diseases using optimized clustering techniques. Heart, Liver, and Appendicitis datasets are utilized in this model. F1-Score, accuracy, homogeneity score, and execution time are the evaluation measures used in this model. K-Means Clustering (KMC) has revealed enhanced results compared with the other algorithms. But, the time it takes is very high for the prediction process.

Bhavekar and Goswami [21] illustrated the prediction of heart disease by classifying the images using Recurrent Neural Network and Long Short Term Memory (RNN-LSTM) approach. The developed method was used to perform the classification process and the outcome of the result enhanced the performance. But the prediction was not accurate due to multiple images. Mishra and Mohapatra [22] discussed the validation of heart disorders by Random Forest (RF), Support Vector Machine (SVM), and Logistic Regression (LR). The established methods were determined to perform training and testing classification. The result revealed that the developed method improved the classification accuracy by 96%. However, It could not.

Mohapatra et al. [23] introduced Naïve Bayes Classifier (NB-C) for validating records of heart patients to classify the diseased and normal cases. The distribution-preserving train-test splitting outperformed the developed method. But instruments were cost-effective. Sharwardy et al. [24] presented the frequent validation of heart disease for children by the Markov model. The established method was used to predict the disorder at an early stage that restricts the severity level. The results enhanced the performance but did not validate the accurate diseased case due to limited space. Sahu et al. [25] elaborated heart disorder detection by Machine Learning (ML) algorithm. Various train-test folds were determined for validating the prediction performance and improved the effectiveness. On the other hand, the decision-making process was not effective.

3 Chaos game optimization based region-convolutional neural network (CGO-based RNN) architecture

We proposed CGO-based RNN architecture to enhance the prognosis precision of heart diseases in the healthcare environment. Here, the classification process is done by the RNN with the CGO algorithm to increase the accuracy of the prognosis of cardiovascular disease in the healthcare environment. The CGO algorithm optimizes the RNN network structure by tuning its hyperparameters. Finally, using the dataset the output is classified into heart disease or normal.

3.1 Data preprocessing

Generally, preprocessing adapts the raw data which may improve the processing’s classification capability [26]. The real-world data cannot apply to the diagnosing task directly due to it being inconsistent, incomplete, and noisy. Hence, to represent the heart disease diagnosis data, the preprocessing step is used. Data preprocessing also performs normalization, missing-data filtering, aggregation, and integration. Moreover, the data preprocessing approaches are used to enhance the data quality. [27].

Data cleaning

This is also called the data cleansing approach which is used to remove the anomalies that affect the image. This enhanced the quality of data. It is determined to remove the unwanted noise or data obtained in the image while performing pre-processing.

Data transformation

The data is transformed into a valuable format that is analyzed for making decisions and enhancing the prediction process. It is widely used when any data needs to be converted for attaining the destination. It is easy to perform by both humans as well as computers. The formatting of the data is performed accurately and enhanced the quality of the image which restricts the penetration of incorrect index and incompatible format of the image.

3.2 Dimensionality reduction

The Principal Component Analysis (PCA) is used to predict heart disease but a huge number of features are present that reduced the predicting efficiency. Also, the dimension of the images is maximized that diminished the performance and failed to perform accurate classification and prediction of heart disease. But KPCA reduced the computational load dimensionality as well as multiple features are extracted that predict the heart disorder accurately and at an early stage. The KPCA is used in this paper for feature extraction which results in a completely new feature space obtained via functional mapping, The dimensional reduction process retains the maximum information possible by transforming the high-dimensional features in a low-dimensional space. This step improves the computational cost along with the accuracy of the analysis. The data distributions can be both high-dimensional and sparse or low-dimensional and dense at different subareas [28]. Examine the set of data called \(Y \in S^{m \times e}\) that has \(e\) variables and \(m\) observations and \(Y = [y_{1}^{T} ,.........,y_{m}^{T} ]\) with \(Y_{j} \in {\rm K}^{e}\). The covariance matrix is constructed by the below equation once the data are translated to linear feature space \(G^{e}\).

$$ \sum^{G} = \frac{1}{m}\sum\limits_{i = 1}^{m} {\Delta (Y_{i} } )\Delta (Y_{j} )^{T} $$
(1)

The mapping function is represented by \(\Delta ( \cdot )\). The kernel PCs (KPCs) is evaluated for solving the issues of eigen value.

$$ \alpha u = \left( {\frac{1}{m}\sum\limits_{i = 1}^{m} {\Delta (Y_{i} } )\Delta (Y_{j} )^{T} } \right)u = \frac{1}{m}\left\langle {\Delta (Y_{i} ),u} \right\rangle \Delta (Y_{j} ) $$
(2)

here, the eigenvalues, eigenvector, are denoted by \(\alpha ,u\) and the dot product between b and a is represented as \(\left\langle {b,a} \right\rangle\) \(\alpha u = \sum^{G}\) is equivalent to

$$ \left\langle {\Delta (Y_{c} ),u} \right\rangle = \left\langle {\Delta (Y_{c} ),\sum^{G} } \right\rangle ,\,\,\,\,\,\,\,\,\,(c = 1,2,3,4,......m) $$
(3)

Each sample coefficient is \(b_{j} (j = 1,2,3.....m)\) in such a way

$$ u = \sum\limits_{j = 1}^{m} {b_{j} \Delta (Y_{j} )} $$
(4)

By integrating Eqs. 3 and 4, the following Eq. 5 is achieved

$$ \alpha \sum\limits_{j = 1}^{m} {b_{j} \left\langle {\Delta (Y_{c} ),\Delta (Y_{j} )} \right\rangle } = \frac{1}{m}\sum\limits_{j = 1}^{m} {b_{j} \left\langle {\Delta (Y_{c} ),\sum\limits_{j = 1}^{m} {\Delta (Y_{j} )} } \right\rangle } \left\langle {\Delta (Y_{i} ),\Delta (Y_{j} )} \right\rangle $$
(5)

Equation (5) is simplified by including the kernel matrix C for \((c = 1,2,3,4,......m)\).

$$ \alpha \lambda = \frac{1}{m}C\lambda $$
(6)

here, \(\lambda = [b_{1} ,b_{2} ,........b_{e} ]^{T}\). A subsequent equation for the fresh data is used to calculate the Kernel PCs.

$$ t_{c} = \left\langle {u_{c} ,\Delta (Y)} \right\rangle = \sum\limits_{i = 1}^{m} {\lambda_{i}^{c} } \left\langle {\Delta (Y_{i} )\Delta (Y)} \right\rangle $$
(7)

\(T^{2}\) and SPE statistical indicators can be utilized to modify errors in new data once the KPCA model is constructed. The model’s variation is represented in the below equation.

$$ T^{2} = [t_{1} ,t_{2} ,.....,t_{q} ]\Lambda^{ - 1} [t_{1} ,t_{2} ,.....t_{q} ]^{T} $$
(8)

here, \(\Lambda = diag(\alpha_{1} > \alpha_{2} > ......\alpha_{q}\) The SPE statistical index is used to track the KPCA model’s residual subspace, and it is measured as.

$$ SPE = \left\| {\Delta (Y) - \Delta (q(Y))} \right\|^{2} $$
(9)

here, \(qPCs\) in higher dimensional feature space are denoted by \(\Delta (q(Y)\). A flaw is testified when the SPE fault indicators and \(T^{2}\) values are beyond the limit of the threshold.

3.3 Classification for heart disease using RNN with CGO architecture

In this subsection, we proposed the RNN with CGO architecture to accurately predict heart disease using the heart disease prediction dataset. Finally, our proposed RNN with CGO architecture predicts normal or heart disease.

3.3.1 LSTM–RNN

The LSTM–RNN has huge memory space and it generates a better way to provide an efficient output based on disease diagnosis [30].

Let us assume an input sequence S of length N is given to the RNN architecture with C input neurons, B output neurons, and A hidden neurons [29]. The hidden neurons in the forward pass are described as follows:

$$ x_{a}^{n} = \sum\limits_{c = 1}^{C} {w_{ca} s_{c}^{n} + } \sum\limits_{{a^{\prime} = 1}}^{A} {w_{{a^{\prime}a}}^{{}} } y_{{a^{\prime}}}^{n - 1} $$
(10)

where the values of the cth input at time n are indicated as \(s_{c}^{n}\) and the hidden neuron input and activation are represented as \(x_{a}^{n}\) and \(y_{a}^{n}\). The neurons are represented as h. The backward pass is computed as shown below.

$$ \delta_{a}^{c} = \theta^{\prime}\left( {x_{a}^{n} } \right)\left( {\sum\limits_{b = 1}^{B} {\delta_{b}^{n} w_{ab} + \sum\limits_{{a^{\prime} = 1}}^{A} {\delta_{{a^{\prime}}}^{n + 1} w_{{aa^{\prime}}} } } } \right) $$
(11)
$$ \delta_{h}^{n} = \frac{\partial L}{{\partial x_{h}^{n} }} $$
(12)
$$ \frac{\partial L}{{\partial w_{ch} }} = \sum\limits_{n = 1}^{N} {\frac{\partial L}{{\partial x_{h}^{n} }}} \frac{{\partial x_{h}^{n} }}{{\partial w_{ch} }} = \sum\limits_{n = 1}^{N} {\partial_{h}^{n} } y_{c}^{n} $$
(13)

3.3.2 Chaos game optimization

The fundamental principle of the CGO algorithm is based on several chaos theory principles, which put fractal self-similarity issues and the chaos game’s arrangement of fractals in context [31]. In dynamic systems, the theory of chaos focuses on certain characteristics. Also, these characteristics are quite susceptible to their early circumstances. Even though there is an inconsistency in these dynamic systems. There are some fundamental patterns present in chaos theory such as repeating shapes, many subsystems, comparable loops, and fractals, making them self-organizing and self-similar dynamic systems. According to chaos theory, a dynamic system’s dependence on its starting conditions means that even small changes in those settings can have a significant impact on future situations. The chaotic game is a mathematical strategy for obtaining fractions that employ a randomly selected principle point in the form of a random and a key polygon. The basic goal is to connect points in an iterative process to create a pattern with a similar shape at different distances. A Sierpinski triangle built as an easy-to-follow fractal is a simple example of the chaos game’s methodology.

3.3.3 Proposed RNN with CGO

Identifying the optimal hyperparameters in an RNN network is a major challenge faced by the existing techniques. The optimal hyperparameter selection improves the efficiency of the classifier. The RNN parameters selected are the time step (P1), batch size (P2), number of hidden layer neurons (P3), learning rate (P4), and number of iterations (P5). The CGO algorithm is initialized with a random set of hyperparameters in different sizes and they are mainly in the form of an N-dimensional vector of size 5. The proposed RNN with CGO is delineated in Fig. 1.

Fig. 1
figure 1

Proposed RNN with CGO

4 Result and discussion

The simulations are carried out using MATLAB and Java programming languages on a Windows 10 Pro 64-bit Core i5 computer with 12 GB of RAM. CGO-based RNN performance is compared with several existing methods including the FFQOA, SVM-Radial based kernel, MSSO, and BSO-ANFIS methods.

4.1 Heart disease prediction dataset

The dataset is gathered from Kaggle [32]. It is determined with 14 attributes of 303 patient records. The features present in the dataset include age, sex, cp, trestbps, chol, fbs, restecg, thalach, exang, oldpeak, slope, ca, thal, and class. The weighting of each trait and how they connect can be determined by a variety of insights and specifically it detects the disease accurately.

4.1.1 Cleveland heart disease dataset (CHDD)

This dataset is determined from UCI-ML repository. It is employed with 76 attributes but only 14 are considered for predicting the disease with 303 instances. But in the latter, it is determined with 16 attributes with 4238 instances [33]. However, 70–30 training as well as a testing validation scheme is determined to validate the performance.

4.2 Comparative analysis

The Accuracy and precision of the CGO-based RNN are represented in Figs. 2 and 3. For accuracy, the CGO-based RNN method achieves higher performance. Our proposed attains 98.99% of accuracy. Similarly, the precision of the proposed method attains a higher precision value of 98.97%.

Fig. 2
figure 2

Accuracy Analysis

Fig. 3
figure 3

Precision Analysis

The Matthews Correlation Coefficient (MCC) comparison is described in Fig. 4. The comparison result depicted that for both metrics CGO-based RNN method achieves higher performance than the baseline methods. The obtained MCC value of the proposed method is 98.54%.

Fig. 4
figure 4

MCC of the CGO-based RNN

The comparative analysis of different metrics based on the proposed is delineated in Table 1.

Table 1 Comparative analysis

4.3 Statistical analysis

The efficiency is validated using a statistical significance test by comparing it with other techniques. If there is no statistical significance between the proposed and existing techniques, then the null hypothesis (NH) will be satisfied. The null hypothesis is defined as NH = 0. The accuracy is computed for a total of 10 times for each model and the paired t-test is applied to it. Table 2 depicts statistical analysis performance of the proposed method.

Table 2 Evaluation of t-test

5 Conclusion

Healthcare monitoring and prediction systems help to save many lives, especially when patients are treated in far-off places and it is the most popular application. A novel approach of Chaos Game Optimization (CGO) is proposed, which is based on the RNN architecture of heart disease diagnosis. The proposed CGO-based RNN technique outperforms the existing FFQOA, SVM-Radial based kernel, MSSO, and BSO–ANFIS methods. When compared to existing baseline work, the proposed method has a relatively short processing time and a very high classification rate. When compared to existing models, the proposed model delivers more accurate predictions. This method enhanced the performance by classifying multiple heart disease images and the identification of severity level is predicted accurately.