1 Introduction

Our hearts pump oxygen-rich blood throughout our bodies via a network of arteries and veins, making them the most important organs in our bodies. Our hearts can be affected by a variety of conditions like heart disease [1]. Heart illness is considered a dangerous condition since we frequently hear that the majority of people die as a result of heart disease and other types of heart-related ailments [2, 3]. Most medical researchers have noted that, on many occasions, the majority of heart patients do not survive their heart attacks and die as a result of them [4]. The rising incidence of cardiovascular disorders, which are associated with a high death rate, is posing a substantial concern and placing a significant strain on healthcare systems across the world. Although males are more likely than females to suffer from cardiovascular disorders, particularly in middle or old age, youngsters can also suffer from comparable health problems [5,6,7]. Heart illnesses are classified into several categories, including coronary artery disease, congenital heart disease, arrhythmia, and others. Heart disease manifests itself in a variety of ways, with symptoms such as chest discomfort, dizziness, and excessive perspiration being among them. The most common causes of heart disease are smoking, high blood pressure, diabetes, obesity, and other factors [8]. Recent advancements in the field of health decision-making have resulted in the development of machine learning systems for health-related applications [9]. They are intended to increase the accuracy of cardiac diagnosis choices through the use of computer-aided design technologies. Furthermore, these instruments place their faith in optimization [10], clustering, and ML computation models [11] [9, 12]. Because of the development of machine learning and artificial intelligence, researchers may now construct the best prediction model possible based on the huge amount of data that is already accessible. Recent research that has focused on heart-related concerns in both adults and children has stressed the need to lower the mortality rate associated with cardiac and cardiovascular diseases (CVDs) [7]. When machine learning algorithms are trained on appropriate datasets, they perform at their peak [13, 14]. There are a lot of ways to prepare data for algorithms that use consistency to make predictions. Data mining, relief selection, or the LASSO method can be used to make sure that the data is ready to make a more accurate prediction. Once the right features have been chosen, classifiers and hybrid models can be used to predict how likely it is that a disease will happen. Researchers have used different methods to make classifiers and hybrid models [15, 16]. Heart disease can be unpredictable because there aren’t enough medical datasets, a lot of different types of ML algorithms to choose from, and not enough detailed analysis [7, 17]. Classification software relies heavily on the process of feature selection. Because characteristics taken from the object are the primary source of categorization. Classification results can be improved by utilizing the finest characteristics [18]. It is critical to choose the relevant characteristics that may be employed as risk factors in forecasting models. To construct successful prediction models, it is important to pick the optimal combination of features and machine learning algorithms. Risk factors that fit the three criteria of high prevalence, considerable influence on heart disease independently, and controllability or treatability should be assessed for their impact in order to lower the risks [7, 18]. It is critical to choose the relevant characteristics that may be employed as risk factors in forecasting models. To construct successful prediction models, it is important to pick the optimal combination of features and machine learning algorithms. Risk factors that fit the three criteria of high prevalence, considerable influence on heart disease independently, and controllability or treatability should be assessed for their impact in order to lower the risks [18].

The following are the most significant contributions made by this paper:

  • This paper discusses the application of RNN-LSTM in the implementation of collaborative classification approaches for detection and classification.

  • In order to carry out this research, a fictional Cleveland heart disease dataset.

Furthermore, the following sections of this document are examined, as Sect. 2 offers a motivation with literature study of several currently available approaches. The methods of research methodology and dataset selection investigation are described in Sect. 3, and the algorithm result and discussion specification for the suggested implementation is shown in Sect. 4. The concluding Sect. 5 provides the results of the suggested approach as well as a comparison with other state-of-the-art procedures. Section 6 examines the work completed to date as well as its future potential, followed by a conclusion.

2 Motivation

Here, the need for a new algorithm to predict heart disease and the pros and cons of existing research are looked at as well. The challenges and the literature review are thought to be below (Table 1).

Table 1 Literature review analysis

In order to classify, several researchers use different artificial intelligence techniques such as machine learning [26,27,28,29,30,31] and deep learning [32,33,34] algorithms. In this approach for heart disease prediction, machine learning was employed 60% of the time, whereas deep learning techniques were used 30% of the time. Many machine learning approaches, including Naive Bayes [35, 36], Decision Tree, KNN [37, 38], Support Vector Machine [39, 40], Random Forest [41], Logistic Regression, Optimization technique [42] and others are used to categories the cancer dataset. Deep learning approaches based on the ANN have been used by many researchers. The RNN and CNN deep learning algorithms were used. In the classification of ECG images and other visual data, convolutional neural networks (CNNs) [41,42,43] are often used. A recurrent neural network (RNN), multi-layered feed-forward neural network (MLFFNN) [44] is a kind of artificial neural network [43, 45] that improves on prior networks with fixed-size input and output vectors.

3 Research methodology and dataset selection

The proposed system has divided into two different phases, training and testing. In this research, an effective disease prediction using deep learning techniques is proposed. To achieve decent classification accuracy, the dataset plays an important role in the entire execution process. The data from the first synthesis was gathered (UCI Machine Learning Repository Heart Disease Data Set). The dataset was obtained from the University of California, Irvine Machine Learning Repository. It is made up of 14 columns, one of which is shown below with a brief description of each (Table 2).

Table 2 Dataset information

The above Fig. 1 describes a training and testing phases of synthetic Cleveland data classification. The training module generates Background Knowledge (BK) for all classes, and predict the class label for new input record during module testing. The system also calculates vascular age of Heart (VaH) using below formula,

$$\widehat{p}=1-{S}_{0}{\left(t\right)}^{{\mathrm{exp}}(\sum_{i=1}^{p}.{\beta }_{i}{\chi }_{i}-\sum_{i=1}^{n}.{\beta }_{i}{\overline{\chi }}_{i}}$$
(1)

where \({S}_{0}\left(t\right)\) is the baseline survival at follow up time t (where t = 10 years), \({\beta }_{i}\) is the estimated regression coefficient, \({\chi }_{i}\) denoted the log transformed measured value of the ith risk factor, \({\overline{\chi }}_{i}\) is the corresponding mean and \(p\) indicates the number of risk factors.

Fig. 1
figure 1

Proposed system architecture

3.1 Experimental setup

We used a Windows 10 computer with 8 GB of RAM and the Python programming language to conduct our experiment. The datasets listed below are used in the implementation.

3.2 Algorithm

In proposed system we made hybrid deep learning classification algorithm collaboration with RNN and LSTM. The below we demonstrate each phase of system execution with our hybrid algorithm (Tables 3, 4).

Table 3 Execution of training
Table 4 Execution of testing

3.3 Performance metrics

The performance metrics explored to determine the efficacy of the proposed Classification for Heart Disease using hybrid model are enlisted below:

Precision: also known as positive predictively, is the number of relevant positive forecasted samples.

$$Precision\left(P\right)=\frac{TP}{TP+FP}.$$
(7)

Sensitivity: or recall, is another term for this. How many positive samples are correctly expected to be positive?

$$Recall \left(R\right)=\frac{TP}{TP+FN}.$$
(8)

Accuracy: can be defined as it is ration of correct classification to the number of total classification.

$$Accuracy\left(A\right)= \frac{TP+TN}{TP+TN+FP+FN}.$$
(9)

F-Measure: is the harmonic mean of precision and recall, so it is called the F-Measure.

$$F\text{-}Measure\left(F\right)=2\times \frac{Precision \times Recall}{Precision +Recall}.$$
(10)

4 Results and discussions

A thorough experimental study was conducted on the systems that were deployed on the widow’s platform, which was running Python 3.7 and the RESNET100 deep learning framework, and a thorough experimental study was conducted.

4.1 Experiment using RNN-LSTM (sigmoid)

Our goal in this experiment was to demonstrate the classification accuracy of RNN (Sigmoid) using the Cleveland heart disease dataset. The results of similar trials utilizing different cross validation methods are presented in Table 5. This analysis found that 15-fold cross validation has the highest average classification accuracy (95.0%) of the methods tested.

Table 5 Classification accuracy RNN-LSTM

In this case, fivefold cross validation with RNN and sigmoid function achieves 93.6% accuracy (Fig. 2). Figure 3 depicts cross validation of tenfold data, whereas Fig. 4 depicts the same. During module testing, the accuracy of both functions is almost the same.

Fig. 2
figure 2

System validation with various cross validation using RNN-LSTM (sigmoid)

Fig. 3
figure 3

System validation with various cross validation using RNN-LSTM (Tanh)

Fig. 4
figure 4

System validation with various cross validation using RNN-LSTM (ReLU)

4.2 Experiment using recurrent neural network (TanH)

The classification accuracy of RNNs using the Cleveland dataset is shown in Fig. 3, and the results of analogous experiments using the cross validation approach are shown in Table 6. According to our findings, 15-fold cross validation achieves the highest average classification accuracy of 93.55% and 94.90% for RNNs using Tan-h respectively. The variables and functions that were utilized in the suggested detection algorithm are listed below.

Table 6 Classification accuracy RNN-LSTM
$${\varvec{X}}{\varvec{t}}{:}\ Input\ vector\ given\ to\ algorithm$$
$${\varvec{H}}{\varvec{t}}{:}\ hidden\ vector\ given\ to\ algorithm$$
$${\varvec{Y}}{\varvec{t}}{:}\ output\ vector\ given\ to\ algorithm.$$

4.3 Experiment using recurrent neural network (ReLU)

With the use of the Cleveland dataset, we investigate the classification accuracy of ReLU in this experiment. Similar studies have been performed on other cross-validations (Fold5, Fold10, and Fold15), and the results are provided in Table 7 for comparison. Taking into consideration the findings of this study, we can conclude that tenfold cross validation yields the highest classification accuracy for RNN, with a classification accuracy of 95.30% and 97.10% for tenfold cross validation, respectively for RNN.

Table 7 Classification accuracy RNN-LSTM (ReLU)

The Table 7 carried out 5-, 10- and 15-fold cross validation training of RNN (Tan h activation function).

Using a machine learning technique, the suggested deep learning classification algorithm is depicted in the preceding Fig. 4. This graphic illustrates the difference between the results obtained with and without cross-validation. The identification of sickness has been accomplished by the use of a minimum of three concealed layers. Following the results of this experiment, we conclude that RNN with sigmoid gives superior detection accuracy than the other two activation functions used in this study as well as the random forest machine learning method.

4.4 Comparative analysis of system

Another study is looking into the possibilities of illness diagnosis using supervised machine learning classification. The suggested system makes four comparisons between our study and the findings of other systems, all of which are based on comparable and/or many datasets, as defined by our findings (Table 8; Figs. 5, 6).

Table 8 ML classifiers on Cleveland heart disease dataset
Fig. 5
figure 5

ML Classifiers on Cleveland heart disease dataset

Fig. 6
figure 6

DL Classifiers on Cleveland heart disease dataset

The Cleveland heart disease dataset has not yet been subjected to the use of RNN, LSTM, or RNN + LSTM hybrid models. This study’s accuracy is 95.10%, which is higher than the accuracy of previous ML and DL models. Table 9, Fig. 7 depicts the deep learning classification accuracy of a proposed model utilising several current machine learning methods as measured by deep learning. In terms of accuracy, the suggested hybrid models outperform the Support Vector Machine, the Decision Tree, and the KNN algorithms in terms of accuracy. A training set and a test set are used to organize or classify data in the most recent expected sample, which is the most recent expected sample. The input function modules and their associated class labels are the building blocks of the training package. After learning from these two learning sets, an arrangement (classification) model is constructed, which organizes the input courses into labels that match them. Afterwards, the model is tested against a test set that is constructed from the class labels of orthonormal course labels.

Table 9 DL classifiers on Cleveland heart disease dataset

5 Conclusion

To analyses the proposed system, we used a variety of machine learning methods, including a hybrid deep learning algorithm that we developed. In addition, the cooperation of deep learning algorithms and the performance of digital algorithms are calculated in the results section. When the RNN is used to run the system, it causes memory difficulties in the feedback layers to arise. By using LSTM, we can successfully overcome the memory issue and handle vast amounts of data in a timely manner. The hybrid deep learning algorithms achieve an average classification accuracy of around 95.10% on a variety of cross-validation tests. Selection of activation function, epoch size, and choice of the kind of features are all variables that may be changed. The system’s future development will involve the analysis of real-time IoT data in order to perform experiments, which will be part of the system’s future growth.