1 Introduction

Heart disease (HD) has been an emerging problem of human beings, and it has been considered as the major disease globally, and the census shows that many people die annually due to this disease. Consequently, an effective diagnosis model is necessary for the patients who are suffering with heart disease, and much attention is required to provide basic care [1]. Many research works have been carried out so far to find the risk factors that lead to heart disease. Providing a promising solution for identifying the heart risk factors is still a research challenge. The main risk factors identified in developing heart diseases are high blood cholesterol with hypertension and diabetes. Other risk factors related to heart disease are life style factors such as eating, drinking alcohol, smoking, obesity, etc.[1]. The disease prediction techniques are commonly used to find the relationship among various features related to the disease and the hidden information inherent in data [2].

Various machine learning and deep learning algorithms are carried out to achieve significant performance in the prediction of heart disease. ML is a method in which large data are divided into subset data, and subsequently, the patterns in the data are discovered as well as used for decision making [3]. The state of the art ML methodologies have been utilized to determine and measure the severity of heart failure and to predict the adverse events that are performed for the detection of heart failure [4,5,6,7]. The existing classifiers of regression tree (RT), SVM, Logistic Regression (Logistic), KNN, Gated Recurrent Unit (GRU), CNN, Ensemble (EL), DBN and DNN are used to predict the heart disease.

Convolutional neural networks (CNN) classification schemes have gained its popularity, due to its power to discover mid and high level image representations [8]. Convolution Neural Network receives 91 feature maps and 2 convolution training levels, and each level consists of 4 fully connected levels as well as each level comprises 1024 hidden units. The performance of the systems is evaluated with different numbers of convolutional layers. Then, the same numbers of map features are used to increase the build level from 2 to 5 in order to observe the effect of the build level. The level of fully connected does not change. The model has evaluated the Cleveland dataset [9, 10]. The model has 13 clinical features derived from the established UCI data as input. The proposed model is trained using an enhanced back propagation algorithm. The best performance of the three convolutional layers is 95% in terms of accuracy.

Deep learning is used to solve complex problems in the real world. Deep neural network classification algorithm has been utilized to determine the exact heart disease of patients. In this article, a framework with a systematic approach for the prediction of heart disease using deep neural networks (DNNs) has been proposed [11]. A layered method with many hidden convolutional layers as well a database method that uses a large amount of data in a deep neural network (DNN) has been utilized. Multiple hidden convolutional layers are also used to simplify the learning process. Then, this model is used to predict the heart disease. Empirical results show that the suggested DNN has achieved 91.246% accuracy, and it is better than the traditional NN model and group model.

Deep belief network (DBN) is one of the proficient classification algorithms, and it utilizes deep learning approach. The deep belief network is a graphical model that learns how to obtain detailed hierarchical representations of training data and to generate hidden variables on multiple levels. In the graphic model, there are connections between levels, rather than connections between units in each level [12]. The proposed architecture has two levels of structures and three levels of complete connectivity. The proposed architecture can avoid overfitting. The last three layers are fully connected, and the properties obtained after the convolutional layer are classified. The proposed study uses 16 medical characteristics that are important for predicting heart disease. As a result, by using DBN Sorter, the heart disease prediction rate achieved is 90% [13]. Prediction accuracy is an important issues in conventional algorithms. To overcome this issue, the proposed heart disease prediction system model introduces in-depth analyses methods in the data mining process to predict the heart disease incidence by using enhanced cluster-based BiLSTM classification algorithm.

1.1 Author contribution

  • A cluster based on neural network models has been introduced for classifying different types of heart diseases. The main objective of this research is to enhance the accuracy prediction of an unbalanced heart disease dataset.

  • Furthermore, in recent years, many studies have restricted the use of feature selection methods for the model. Therefore, the proposed cluster-based model that works on the mechanism of parallel computation allows using all the features without any restriction of feature selection method.

  • This model has been used to realize automatic recognition and for the extraction of entities in unstructured medical texts, a model by combining cluster and Bi-directional, has been proposed.

  • The advantage of BiLSTM method is that it analyzes the data bi-directionally and also analyzes the linear relationship between the characteristics. These processes help to increase the prognostic performance of heart disease.

  • BiLSTM classifier is applied to estimate the performance of the system. When the classification results are compared with theexisting results. The better improvement is shown. Our experimental outcomes by using a real-time data set exhibit an improved diagnosis prediction performance strategy.

In heart diseases prediction, the proposed cluster-based BiLSTM renders more accuracy to detect heart disease. The rest of the paper has been organized as follows: Literature survey is presented in Sect. 2, and the proposed method is explained in Sect. 3. The results are discussed in Sect. 4, and the conclusion is provided in Sect. 5.

1.2 Literature survey

Krishnan et al. [14] proposed a new hybrid deep learning model for heart disease prediction using recurrent neural networks (RNNs) in combination with a multiple gated recurrent units (GRU), long short-term memory (LSTM) and Adam Optimizer. The proposed model showed excellent accuracy of 98.6876%, which is the highest among the conventional RNN models.

Nguyen et al. [15] proposed high-performance architecture for optimizing decision making. Since reliability and stability are paramount factors in medical support systems, improving predictive performance and maintaining model stability are always top priorities. Experimental results show that the proposed approach achieves more powerful and reliable performance than existing ML and DL techniques in statistical, image based and sequential benchmark datasets.

Baccouche et al. [16] proposed an ensemble learning frameworks for various neural network models and how to aggregate random undersampling. Perform a data preprocessing step by characteristic selection to improve the performance of the classification algorithm. Experiments with unidirectional and bi-directional neural network models show that ensemble classifiers using BiGRU models using CNN models have the highest accuracy and F1 score of 91–96% for different types of hearts.

Shorewala et al. [17] proposed the prediction of coronary heart disease (CHD) using a risk factor approach. Predictive techniques such as K-nearest neighbors, Binary Logistic classification and Naive Bayes are evaluated on the basis of metrics such as accuracy, recall and ROC curves. These base classifiers are compared against ensemble modeling techniques such as bagging, boosting, and stacking.

Zhang et al. [18] proposed a heart disease prediction algorithm that is combining Embedded feature selection with deep neural networks. This built-in feature selection algorithm is based on the linear SVC algorithm and uses the L1 norm as a penalty item to select a subset of features that are highly relevant to heart disease. Network weights are initialized with the He initializer to prevent gradient varnishing and explosions, allowing predictors to get better performance.

Krishnan et al. [19] proposed a model aims to run a deep learning advanced recurrent neural network (RNN) model to improve the accuracy of existing predictive models that must be 98.23% or higher. In this paper, we discussed the deep learning method, derive a performance comparison between existing systems, and proposed an improved RNN model for better provision in terms of accuracy and feasibility. The presence of a multi-gated recurrent unit has improvised the performance of RNN models with an accuracy of 98.4%.

Javid et al. [20] used the UCI heart disease dataset tests ML techniques with traditional methods (random forests, support vector machines, K-nearest neighbors, etc.) and deep learning models (long-term, short-term memory, gate repeat unit neural networks, etc.). Combine multiple classifiers to explore voting-based models to improve the accuracy of weak algorithms. Interim persuasive approaches are being used to coordinate the way that ensemble techniques are implemented to improve the accuracy of heart disease prediction.

Zhou et al. [21] have suggested a technique to develop neural systems and genetic algorithms in order to maximize the weights as well as to improve ANN runtime performance. Distinguished crucial hazard factors are applied by the system for the forecasting of heart illnesses, and it is not expensive in clinical analyses. The system has been designed with genetic algorithm optimization, and it is applied to neural network which works better compared to back propagation.

Luo et al. [22] have analyzed a heart disease prediction system which has applied deep neural network algorithm to determine the likely options of heart associated diseases. Deep belief network, which is one of the proficient classification algorithms, utilizes deep learning approach in DNN, and this method renders more accuracy compared to CNN algorithm.

For faster training speed, a full sequence has been prepared by Zhou et al. [23] for various DNN structures for better execution performance, and it also conceives a fractional parallel execution of sequence for applying numerous Graphical Processing Units (GPUs). It is demonstrated that series training could be effortlessly covered with various DNNs by somewhat aligning fault signals in the output layer.

In deep learning, an approach has been reported by Gonging Wang et al. [18] to segment right ventricular (RV) endocardium and epicardium. This method possesses two tasks like limiting the Region of Interest (ROI), the area comprises significant features, and also, it will mitigate RV segmentation.

The two tasks are coordinated into a training system, and each task is resolved via two multilayer convolutional neural systems. A full automatic prediction heart disease has been discovered by Ali et al. [24] in 3-dimensional echocardio graphy (3DE). For efficient volume estimation, left ventricular volume evaluation is performed by applying regression and random forests. A Left Ventricular (LV) volume prediction method without segmentation has been structured by deep learning technology using large scale cardiac magnetic resonance imaging (CMRI) datasets.

Yogita Solanki et al. [25] have evaluated a system in which blood alcohol content (BAC) detection has been carried out using pixel wise patch-based steps. To evaluate the system performance, ground truth samples are used, and they are compared with 840 mammograms from 210 cases. The deep learning approach has a huge impact on human experts, and the models can be used in similar fields to detect BAC on mammograms to differentiate cardiovascular risks.

Nandhini et al. [26] have proposed automatic diagnostic system which is used with χ2 statistical models to refine the characteristics and to classify heart disease. The proposed model has been assessed using six different assessment indicators including accuracy, sensitivity, specificity, MCC, AUC and ROC graphs. This work has predicted the heart disease in real time, and it can be used for coronary artery disease. Unlike many other systems, it is ready for monitoring and forecasting. The system's diagnostic system is ready to use ML algorithms to predict disease center and then, the prediction results are supported by the disease center data set. The experiment has been excluded from the control study, and hence, the accuracy of the proposed system with the random forest classifier has reached 89%.

Ramprakash et al. [27] have demonstrated various issues associated with healthcare and different machine learning algorithms. The target of this research is to form a model for heart condition detection, and it deals with nonlinear features, an enormous amount of knowledge and supplying more accurate results than the existing researches. This deep learning with keras package has increased the speed of prediction. This model performs better than the prevailing approaches with 85.72% precision, 88.24% recall, 12.1% loss and 89.15% accuracy.

Sumit et al. [28] have organized a logical order which generally follows the methodological section. Compared to the alternative algorithms and developments, this approach tests the results of intelligent forecasts. Talos development lies in DNN's new development technique. Talos offers higher accuracy of (90.76%) for alternative optimizations.

Repaka et al. [29] have focused on the definition of SHDP (Smart cardiovascular disease prediction), which takes into account the NB classification approach as well as the advanced encryption standard algorithm to solve the prediction problem. It is found that the dominant technique outperforms Naive Bayes in relevance accuracy, as it provides 89.77% accuracy despite the decrease in attributes. Mohan et al. [30] have implicated hybrid random forest linear model, to increase the accuracy of heart disease prediction. Many disease characteristics have been used in standard classifiers for live prediction performance.

1.2.1 Dataset features information

The UCI Cleveland repository [31] with cardiac data set has been used in the experiment. Based on the extensive experimentation, 14 out of the 76 most effective properties have been found. The Cleveland dataset consists of 14 most dominant attributes and 303 samples with 8 absolute functions and 6 numeric functions. Table 1 shows the description of the data set.

Table 1 Dataset description

Patients selected from this data set are between 29 and 77-years-old. A value of 0 is used to represent a female patient, and a value of 1 is used to represent a male patient. There are three types of chest pains that can indicate heart disease. Typical angina type 1 is due to blockage of the heart arteries caused by decreased blood flow to the heart muscle. The main cause of type 1 angina is mental or emotional stress. The second type occurs for a number of reasons, but sometimes, it can be an angina rather than the actual cause of heart disease called chest pain. The next resource is trestbps, which represent dormant blood pressure readings. Cholesterol levels are expressed in Chol. Fasting blood sugar levels are expressed in Fbs. If Fbs is greater than 120 mg/dL, a value of 0 is assigned, and a value of 1 indicates whether Fbs is less than 120 mg/dL. The results of the dormant electrocardiogram are expressed as Restecg.

The maximum heart rate is represented by dropout, the preferred exercise for angina pectoris 0 is no pain, 1 is represented by exang, and ST depression stimulated by exercise is indicated by oldpeak, maximum exercise slope. The ST segment is plotted as a slope, and the number of main vessels colored by fluoroscopy is plotted as an approximation. The stress test period is displayed like this, and the final goal is class properties. The value of the class attribute is used to differentiate between patients with heart disease and patients without heart disease. A value of 1 indicates patients with heart disease, and a value of 0 indicates normal.

1.3 Proposed cluster-based BilLSTM

Although many machine learning methods have been used to predict heart disease, these existing methods are still ineffective. The aim of the present study is to improve the effectiveness of heart disease prognosis with the help of the proposed BiLSTM. The BiLSTM method analyzes data in two directions, and it generally improves predictive performance. These techniques are used to ensure a linear distribution of the starting structure, allowing LSTM to improve accuracy. LSTM is a deeplearning method that effectively analyzes data and discovers key features required for prediction.

The architecture of the BiLSTM model is shown in Fig. 1. The model uses BIO labeling scheme (Begin, Inside and Outside). The \(Q=\left({q}_{1}, {q}_{2},\dots .{q}_{k}\right)\) represents the context information carried out by the character embedding trained by Skip-Gram. HyC manifests as hypertension, and its temporal properties are continuous. Meanwhile, HyD manifests itself as hypertension and its temporal properties of data. First, the sentences appear as a series of vectors through the key layer \(X = \left( {x_{1} , x_{2} , \ldots x_{t} , \ldots x_{n} } \right)\) where n is the length of the sentence.

Fig. 1
figure 1

The proposed cluster-based BiLSTM block diagram of heart disease prediction

A tanh layer on the top of BiLSTM is then used to predict the reliability score of the character for which all the possible tags are listed as network exit scores.

$${e}_{t}=\mathrm{tanh}({W}_{e}{h}_{t})$$

where We = weight matrix of training model.

The BiLSTM learning model performs data partitioning by applying k-means clustering algorithm and trains each of the partitioned data. In a highly parallel manner, the advantage of suggested BiLSTM is that its training process hassmaller model size and LSTM is discovered from less training data. The C-BiLSTM model for heart disease prediction is shown in Fig. 2.

Fig. 2
figure 2

C-BiLSTM heart disease prediction framework

1.4 K-means clustering for data partitioning

A clustering algorithm is applied to cluster the objects which are more similar (in some sense or another) to each other than to those in other groups (clusters). There are broad ranges of clustering algorithms available, and they can be separated into three main groups: partitioning, hierarchical and density-based algorithms. In this work, a partitioning-based algorithm is applied, and it is often applied for partitioning large datasets into groups of similar data. Selection of number of clusters at the beginning is a major disadvantage of this algorithm, however; the manual selection of the number of clusters doesn’t affect the performance of partitioning datasets.

1.4.1 Cluster centroid steps

Let the input data points be \(A_{x} = \{ A_{1} , A_{2} ,..A_{z} )\), where \(A_{x} |{\text{ x}} = (\left\{ {{\text{x}} = 1,2, \ldots {\text{X}}} \right\}\) represents the X number of input data with z -dimensional vectors. The goal of k-means clustering method is to group the input data in to N clusters.

Thus, a subset with cluster centers, \(G\left( {G = G_{1} , G_{2} , \ldots G_{n} } \right)\) is found for the Ax by reducing the objective function, \(F = \mathop \sum \nolimits_{p = 1}^{q} \mathop \sum \nolimits_{{A_{q} \in G_{p} }}^{q} m_{p,q} \left( {A_{q} , G_{p} } \right)\), where Aq represents the data with z-dimensional vector, and mp,q \(\left( {A_{q} , G_{p} } \right)\)depicts the distance among the data Aq and the cluster center Gp.

The distance between the data Aq and the cluster center Gp is calculated in Eq. (1) as,

$$m_{p,q} (A_{q} ,G_{p} ) = \left\| {A_{q} - G_{p} } \right\|^{2}$$
(1)

Thus, the objective function can be written in Eq. (2) as,

$$F = \sum\limits_{p = 1}^{q} {\sum\limits_{{A_{q} \in G_{p} }}^{q} {\left\| {A_{q} - G_{p} } \right\|} }^{2}$$
(2)

The cluster centers can be determined when the values of the objective functions are known. The minimization of the objective function is calculated in Eqs. (3, 4),

$$\frac{\partial F}{{\partial G_{p} }} = \frac{\partial }{{\partial G_{p} }}\left[ {\sum\limits_{q = 1}^{{z_{p} }} {\left( {A_{q} - G_{p} } \right)^{2} } } \right]$$
(3)
$$\frac{\partial F}{{\partial G_{p} }} = - 2\sum\limits_{q = 1}^{{z_{p} }} {\left( {A_{q} - G_{p} } \right)} = 0$$
(4)

Now, the cluster centers can be found in Eq. (5) as,

$$G_{p} = \frac{1}{{{\text{z}}_{{\text{p}}} }}\left( {\sum\limits_{q = 1}^{{z_{p} }} {A_{q} ,p = (1,2,...N)} } \right)$$
(5)

In the above equation, zp represents the number of data points in cluster ‘p’.

Major steps involved in k-means clustering are:

  • Step 1 Determine the number of groups "N", where "N" is the number of partitions to be created for the data set.

  • Step 2 Start with N cluster centroids by randomly separating all objects into N clusters by calculating the distance. This step is used to verify or to confirm that the centroids are different from each other.

  • Step 3 In this stage, calculating the distances of all clusters of centroids is processed and then based on the nearest centroid, each object to the cluster will be processed.

  • Step 4 Calculate the centrifuges of the improved clusters with the new updated cluster center as the average of the creation instances.

  • Step 5 Re-iterate Step 3 until the centroids do not alter any more.

1.5 Cluster-based BiLSTM

A neural network has been designed to be a bilinear LSTM (BiLSTM) with many levels of nodes between the input and the output along with a series of steps to perform the identification and processing of resources. However, the processing time required for BiLSTM training is high, and the cluster-based BiLSTM is used to increase the training speed.

The BiLSTM cluster-based learning model performs data partitioning with a k-means clustering algorithm and trains each partitioned data on multiple BiLSTM simultaneously. In a highly parallel way, the advantage of the suggested cluster-based BiLSTM is that its training process has smaller model dimensions, and each BiLSTM is discovered by less training data. The proposed model for the heart disease prediction method is shown in Fig. 2.

1.6 4 Block diagram

Classification of heart disease is the final section in which type of heart disease cluster-based BiLSTM classifier. One of the advantages of this method is that the learned features from raw training data are demonstrated automatically, and they are quite different from the traditional method as shown Fig. 3.

Fig. 3
figure 3

Proposed Cluster-based BiLSTM

1.7 Cluster-based BiLSTM architecture

Cluster-based BiLSTM has been utilized in the model for predicting heart diseases, and at the same time, the approach aids to reduce the computation cost and time. The BiLSTM principle of operation recognizes the current output and applies it as an input to the next hidden layer. The number of tests available during the training phase is huge, but deep learning techniques are very effective. The proposed cluster-based BiLSTM has been developed and for every group of data, the cluster-based BiLSTM applies multiple BiLSTM structures. C-BiLSTM architecture is depicted in Fig. 4. Five function layers are included: Input layer, embedding layer, BiLSTM layer, attention layer and output layer. In the forward propagation process, the output of each layer is used as the input of the next layer.

Fig. 4
figure 4

Cluster-BiLSTM architecture

To evaluate the error of entire network, the cost function is applied. The minimization criterion of cost function helps in altering proper weights and biases of BiLSTM, during pre-training so as to decrease the error. At each iteration, the cost function is reduced and in which, the weights and biases are found to maximize the network output. Once the network gets trained, the trained BiLSTM can be applied to anticipate the heart diseases. Likewise, multiple BiLSTMs are trained with the cluster groups. At last, the network efficiency is formalized by applying the test data (Fig. 5).

Fig. 5
figure 5

Sixfold cross-validation

The test data are also grouped into number of clusters as adequate to the number of groups in the training data for validation. Each group of test data is aligned to the trained BiLSTM, so that each BiLSTM network is able to predict heart diseases, and finally, the outcomes from each BiLSTM are aggregated.

2 Result and discussion

2.1 Data processing

The proposed algorithm has been modeled in MATLAB platform. Cleveland heart disease data from the california irvine (UCI) data warehouse have been used for analysis. Each segmented data are individually trained using k-means grouping. This dataset individually predicts the results based on the presence or absence of heart disease. Heart disease data collected in real time from Hospital Medica Norte are retrieved, and they contain 300 patient records with various biological indicators including age, sex, systolic and diastolic blood pressure and heart rate. For this test, Python software has been used for simulation with an Intel i3 processor, 4 GB RAM and 1 TB hard drive.

2.2 Training method

All the developed models are trained with datasets generated from 300 patient record registers. That is, the data are divided into training dataset and testing dataset with a ratio of 6:1:1. The performance is reported using the test data for the area under the AUC curve. The Graphical User Interface (GUI) of the proposed approach is presented in Fig. 6. With the test sample provided as in Fig. 3, the model has predicted the correct output as ‘abnormal’.

Fig. 6
figure 6

GUI interface of heart disease prediction

A heat map is also used to clearly analyze the correlation of all the features in Fig. 7.

Fig. 7
figure 7

Correlation-cross values heat map

Regarding the age distribution attribute, Fig. 8 illustrates people with and without heart disease. It can be seen that the ages are in between 40 and 52 years. It can be understood when the age is associated with heart disease, people aged from 50 to 52 and 40 to 41 are primarily consolidated by heart disease. Additionally, histograms are designed to display discrete property data that focus on the distribution of marginal features related to disease and not disease, as shown in Figs. from 9, 10, 11.

Fig. 8
figure 8

Age distribution

Fig. 9
figure 9

Serum cholesterol distribution

Fig. 10
figure 10

Blood pressure distribution

Fig. 11
figure 11

Maximal heart rate acquire

According to the age distribution characteristics, there are usually people with heart diseases and people without heart disease. The patient ages are varied from 40 to 52 years. It is found if the age is associated with disease, people aged from 50 to 52 and 40 to 41 suffer from heart disease and dominant associations. It is also designed to be age-adjacent to reflect the possibility of a highly correlated stopping characteristic (thalach). It is generally observed that people with heart disease have higher heart rates than people without heart disease. In addition, as age increases, the maximum heart rate decreases to a negative value of −0.3 as depicted in Fig. 12.

Fig. 12
figure 12

Age vs. Thalach

2.3 Evaluation metrics

The model has been evaluated with the evaluation metrics namely Accuracy, Prediction Time, Precision, Recall and F-measure.

2.3.1 Precision

Precision is the determination of true positives for the ratio of the sum of true positives to false positives.

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

2.3.2 Recall

Recall is defined as the true positive versus the false negative sum ratio.

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

2.3.3 Accuracy

Precision is calculated using sensitivity and specificity by the following equation,

$${\text{Accuracy}} = \frac{{\text{TP + TN}}}{{\text{TP + TN + FP + FN}}}*100$$
(8)

2.3.4 F-measure

The measure F is an assessment of test precision that is, the weighted harmonic mean of the test precision and recovery.

2.4 Performance analysis

The values obtained for the suggested model are tabulated in Tables 2 and 3

Table 2 Experimental results of the proposed models of UCI data set
Table 3 Experimental results of the proposed models of Real time data set

Table 2 and Fig. 13 depict the comparison of different performance metrics of the proposed (C-BiLSTM) approach and the existing classifiers of Regression Tree (RT), SVM, Logistic Regression(Logistic), KNN, Gated Recurrent Unit(GRU), CNN, Ensemble(EL), DBN and DNN. The proposed method has obtained high classification accuracy of 94.78%, sensitivity of 99.56% and specificity of 94.18% compared to the existing classifiers. The accuracy of the existing classifier is 91.24% for DNN, 90% for DBN, 88.54% for Ensemble, 85% for CNN,81.46% for Gated Recurrent Unit, 82.80% for KNN, 81.38% for Logistic Regression, 78.79% for SVM and 75.40% for Regression Tree. From these analyses, it is evident that the proposed C-BiLSTM approach has greatly improved in the context of all performance metrics compared to other classifiers for the online UCI dataset. The F1-score value of the C-BiLSTM is 92.55% which is the highest value among all other conventional methods.

Fig. 13
figure 13

Comparison of C-BiLSTM with the existing algorithm of UCI Dataset

Table 3 and Fig. 14 illustrate the comparison of different performance metrics of the proposed (C-BiLSTM) approach and the existing classifiers of Regression Tree (RT), SVM, Logistic Regression(Logistic), KNN, Gated Recurrent Unit(GRU), CNN, Ensemble(EL), DBN and DNN. The proposed method has obtained high classification accuracy of 92.84%, sensitivity of 96.20%, specificity of 93.36% compared to the existing classifiers. The accuracy of the existing classifier is 90.90% for DNN, 90.17% for DBN, 90.21% for Ensemble, 85.90% for CNN, 85.34% for Gated Recurrent Unit, 89.23% for KNN, 86.74% for Logistic Regression, 85.17% for SVM and 81.73% for Regression Tree. From these analyses, it can be revealed that the proposed C-BiLSTM approach has greatly improved in terms of all performance metrics compared to other classifiers for the real time dataset. The F1-score value of the C-BiLSTM is 93.41% which is the highest value among all other conventional methods.

Fig. 14
figure 14

Comparison of C-BiLSTM with existing algorithm of real time dataset

3 Discussion

The proposed cluster-based BiLSTM method has analyzed the data in two directional ways and provided the linear relationship between the attributes. Hence, the proposed method has attained higher performance compared to the existing methods. The target of this work is to classify four types of heart diseases. However, each type has very unbalanced distribution due to the large proportion of collected records by indicating that the patients have not been diagnosed with any type of disease. Subsequently, the proposed framework has demonstrated a technique of averaging and random under-balancing of the records, in order to equally generate proportional dataset for building the classification models.

The proposed method has obtained high classification accuracy of 94.78%, sensitivity of 99.56% and specificity of 94.18% compared to the existing classifiers. The accuracy of the existing classifier is 91.24% for DNN, 90% for DBN, 88.54% for Ensemble, 85% for CNN, 81.46% for Gated Recurrent Unit, 82.80% for KNN, 81.38% for Logistic Regression, 78.79% for SVM and 75.40% for Regression Tree. From these analyses, it is realized that the proposed C-BiLSTM approach has greatly improved in view of all performance metrics compared to other classifiers for the online UCI dataset. The proposed method has achieved high classification accuracy of 92.84%, sensitivity of 96.20%, and specificity is 93.36% compared to the existing classifiers. The accuracy of the existing classifier is 90.90% for DNN, 90.17% for DBN, 90.21% for Ensemble, 85.90% for CNN, 85.34% for Gated Recurrent Unit, 89.23% for KNN, 86.74% for Logistic Regression, 85.17% for SVM and 81.73% for Regression Tree. From these analyses, it is proved that the proposed C-BiLSTM approach has greatly improved all performance metrics compared to other classifiers for the Real Time heart disease dataset.

4 Conclusion

In this paper, an effective method of classifying heart disease has been proposed by using cluster-based BiLSTM. The heart disease prediction experiment has been carried out through cluster-based BiLSTM algorithm by using structured data. The proposed algorithm is used to identify the risk of cardiovascular disease and its corresponding risk factors. The dataset has been chosen from online repositories and real time dataset. The techniques of preprocessing applied are filled in missing values and removing correlated columns. Next, the classifier is applied to the preprocessed dataset, and then, BiLSTM is constructed. Finally, the accuracy of the models is calculated, and the analyses are performed based on efficiency calculations. The proposed methods are compared with the conventional classifiers such as Regression tree, SVM, Logistic Regression, KNN, Gated Recurrent Unit, CNN, Ensemble, DBN and DNN. High classification accuracy obtained through the proposed method is 94.78%, sensitivity is 99.56%, and specificity is 94.18% for online UCI dataset whereas the accuracy is 94.78% for real time dataset. In future, a further study will be carried out with other feature selection and optimization techniques to improve the effectiveness of predictive classifiers for the diagnosis of cardiovascular disease.