1. Introduction
The global revolution brought about by the reign of the digital age has touched all walks of human life and ushered in expeditious changes that are reshaping economies and societies and opening up immense possibilities while transforming lives. Given this, the centralized cloud computing model offers ubiquitous access to resources required for processing, analytics, and storage in a conducive manner [
1,
2]. The internet of-things (IoT), which seamlessly connects objects and people, has triggered a data upsurge due to the rapidly expanding number of connected devices. The data thus acquired warrants analysis, identifying patterns and trends to infer insights for efficient decision-making. However, IoT devices possess minimal computational and storage potential. These limitations are overcome by integrating cloud computing with IoT, termed the Cloud-of-Things [
3]. In that context, the cloud has become the key enabler of IoT, offering services across healthcare, education, and industry domains while overcoming significant IoT restraints.
The World Health Organization (WHO) states that cardiovascular diseases claim 17.9 million lives globally annually [
4]. Healthcare applications deploy artificial intelligence, specifically machine learning techniques, to elicit intelligent insights [
5] from the exponentially increasing medical data. These clinical prediction models aid in diagnosing heart disease and prognosis by accurately predicting future medical events, thereby improving individuals’ health [
6]. The proliferating number of healthcare internet-of-things devices, such as smart wearable ones, generates massive amounts of data, transmitted to the cloud for computation. The cloud possesses the improved processing power these machine learning models warrant [
7]. The data transfer between these healthcare IoT devices and the cloud servers requires considerable bandwidth. Furthermore, it increases latency, which is inept for real-time healthcare applications that are, by and large, latency-sensitive [
8]. The fog computing paradigm, put forth by Cisco, positions the fog layer closer to the IoT layer, where data is produced, and conveniently extends the cloud services to the edge [
9]. The inclusion of an additional layer with computational capability amid the cloud layer and the IoT layer considerably minimizes the response time, making inpatient care and remote monitoring possible. With healthcare applications warranting swift reaction times, fog computing is a viable alternative to managing the complexity of vast medical data, eventually enhancing reliability [
10]. Thus, this assures that the cloud is reserved for large-scale, complex analytics tasks. The potential to triage data while eliciting vital decisions within the device’s environment, as in fog, will help extract critical insights from the vast volume of data [
11].
1.1. Motivation
The cloud servers traditionally manage the pre-processing, analysis, and storage of the enormous IoT data generated at varying velocities from sizable IoTs. These are eventually sent to the cloud datacenters, and the computation result is returned to the IoT devices, leading to transmission and processing errors alongside needless delays [
12]. The high latency in handling real-time medical data may render it inadequate, meaningless, and unreliable. With expanding data sizes, delays due to round-trip time may increase from milliseconds to minutes, adversely impacting the quality of service (QoS) of healthcare IoTs’ real-time operations. The crucial necessities of healthcare IoTs include reducing latency and conserving network bandwidth. IoT devices are linked to the cloud by several routers and gateways, causing data to travel a long distance and consume high bandwidth, causing needless delays [
13]. An intensive care unit (ICU) patient or a home-bound cardiac patient under monitoring warrants swift actions as soon as a drop in vital signs is detected, and caretakers are to be promptly notified to avoid it becoming disastrous and fatal [
14]. The physiological state of patients varies with time, and remote patient monitoring insists on rapid responses and agile decisions. Thus, most healthcare IoT applications require processing close to IoT devices and hardly need cloud-scale storage and processing.
The huge amount of data amassed by healthcare IoT devices makes it challenging to infer intuitive and streamlined decisions from the electronic clinical records to enhance clinical care’s reliability. With devices becoming tinier and data becoming more sizeable, finding meaningful methods to acquire, analyse, interpret, and use data that can substantially impact patient care is becoming a hassle. With the cloud unable to meet healthcare IoT demands due to its inherent limitations, the fog computing (FC) concept has garnered attention lately. It eases the burden of the centralized cloud by extending its features to the network edge, which can be a router, gateway, or any device mediating the cloud and IoT. With proximity to IoT end devices, FC’s key intent is to mitigate the high latency between the cloud and IoT devices. The healthcare application entails a smart infrastructure that acquires the massive IoT data in real time, performs preliminary computation tasks while reducing network latency and transmission issues, and sends the processing results to the cloud and IoT end nodes. The primary motivation of this research is to enhance decision-making accuracy when handling vast amounts of data, which deep learning models are competent at handling. The research endeavour also emphasizes the minimum latency requisite for time-critical healthcare applications using fog computing technology for enhanced quality of service.
1.2. Contributions of This Work
The key outcomes of the research primarily oriented toward diagnosing heart disease risk severity are as follows:
The smart and efficient heart disease diagnostic system encompasses the IoT–fog–cloud technologies;
The healthcare IoT data acquired is pre-processed by a filtering technique and fuzzy inference system and subjected to predictive analytics at the fog layer using deep learning’s recurrent neural network model of the gated recurrent unit (GRU);
The proposed fuzzy inference system with improved GRU accurately predicts heart attack risk from IoT patient data and electronic health records (EHR) when compared to the results of the generic GRU model;
The suggested model is evaluated using metrics that test the deep learning model’s predictive adeptness and performance, with a comparison of cloud and fog.
The rest of the article is organized into sections on related work, background, proposed methodology, experimental setup, performance evaluation, results and discussion, and conclusions.
2. Literature Review
Smart healthcare systems are becoming prevalent and have been revolutionised by merging cloud computing and IoT-based sensor technology. Minor errors in heart disease diagnosis may prove fatal to patients; therefore, ML techniques have been deployed to predict various cardiovascular diseases effectively, thereby minimizing the death ratio [
15]. The University of California, Irvine (UCI) Machine Learning Repository’s Heart Disease dataset has been harnessed by many researchers to examine their heart disease classification model’s efficiency, which is discussed as follows [
4,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29]. A study conducted by Singh and Kumar to analyse the effectiveness in detecting heart diseases among the machine learning algorithms of support vector machine, decision tree, k-nearest neighbour, and linear regression concluded that the k-nearest neighbour is the preferred model, with an accuracy of 87% [
16]. A similar study by Rajdhan et al., with the same dataset involving a decision tree, naive Bayes, logistic regression, and random forest algorithms, indicates that the best accuracy, of 90.16%, was shown by the random forest algorithm [
17]. An Android application based on the cloud was proposed to predict heart disease with algorithms such as naive Bayes, simple logistic regression, random forest, support vector machine, and artificial neural networks, among which support vector machine exhibited the highest accuracy at 97.53% [
18]. A heart disease diagnosis system involving two subsystems of relief and rough set feature selection and an ensemble classifier model has shown 92.59% accuracy when evaluated [
19]. Classifying heart diseases from electrocardiogram (ECG) signals by using classification and pre-processed methods displays an accuracy of 98.4% when symbolic aggregate approximation for pre-processing and long short-term memory (LSTM) for classification are used [
20]. A smart system to ascertain key biomedical markers named BioLearner is proposed for predicting heart disease utilizing machine learning algorithms such as a k-nearest neighbour, neural networks, and support vector machine displays an accuracy of 95% [
21]. Predicting heart disease by an ensemble deep dynamic algorithm using linear regression and a deep Boltzmann machine displays an accuracy of 98.12% [
22].
In recent times, IoT–fog–cloud-based models for predictive analytics have become prominent owing to the benefits they offer. Fog computing is equipped to proficiently address computational tasks involving healthcare data originating from diverse IoT devices, such as wearable sensors, and prior electronic clinical data stored in the cloud [
23]. In particular, fog computing’s operational capability minimizes response time, latency, and delay, which is adept for heart disease patients’ healthcare monitoring. An IoT–fog computing integrated healthcare system called HealthFog has been proposed for heart disease diagnosis [
24], which employs ensemble deep learning models of bagging and boosting. Furthermore, it harnesses the FogBus framework [
25], which enables IoT–fog–cloud integration and has shown improved accuracy, latency, network bandwidth, jitter, execution time, and power consumption. It is customizable for different operation modes, offering the best prediction accuracy and quality of service. A novel hybrid IoT–fog assisted healthcare model [
26] for handling heart disease data based on fuzzy reinforcement learning and neural network evolution strategies at fog nodes has been proffered. It indicates optimal performance results regarding latency, RAM consumption, and network usage under simulation compared to existing techniques.
HealthCloud, a cloud-based monitoring system to identify heart disease risk involving a support vector machine, logistic regression, gradient boosting trees, k-nearest neighbour, and neural networks, unveiled logistic regression as being 85.96% more accurate and responsive [
27]. Here, performance was evaluated using the metrics of accuracy, recall, specificity, latency, execution time, and memory usage. An IoT–fog–cloud-based heart disease diagnostic model deploying machine learning algorithms has been put forth, which shows an accuracy of 97.32%, precision of 97.16%, recall of 97.58%, specificity of 96.87%, and F1-measure of 97.37% [
28]. A modified deep convolutional neural network model involving smart healthcare monitoring to predict heart disease in the IoT–cloud framework while harnessing the UCI dataset shows an accuracy of 93.3% [
29]. An IoT smart system for predicting heart disease with kernel discriminant analysis and a modified self-adaptive Bayesian algorithm displays an accuracy of 90% [
30]. An IoT-cloud-based smart heart disease prediction system was suggested to acquire healthcare data from the IoT and utilize a fuzzy inference system for data pre-processing and bidirectional long short-term memory for classification, and showed 98.86% accuracy [
4].
Machine learning is deployed not only for heart disease prediction systems but also for other healthcare diagnostic applications. A system is presented to identify the hypertensive stage, wherein IoT sensors acquire the user’s health parameters in real time at the fog layer [
31]. An alert is generated once hypertension is identified, and the artificial neural network predicts a hypertension attack risk state in users at remote sites. The results are stored in the cloud, while the temporal information produced at the fog layer can be used to enforce preventive measures for patients’ wellness. This model displays high prediction accuracy, low response time, and bandwidth efficiency. For monitoring, prevention, and control of encephalitis [
32], a fog-assisted healthcare model deploying a fuzzy C-Means classifier and a temporal recurrent neural network has shown improved classification and prediction accuracy while minimizing latency and response time. In the research work for a fog-based diabetes patient support system [
33], the J48Graft decision tree has been deployed. A fog-based latency-aware framework to monitor and detect dengue viruses involving cloud computing and IoT has been shown to classify users by symptoms with improved execution and response time [
34].
4. Results and Discussion
The comparison of the generic GRU model; fuzzy inference system (FIS) combined with GRU, indicated by FGRU; and the proposed GRU model was performed, and results in terms of accuracy, precision, recall, specificity, and F1-score were analysed. The three deep models of concern were evaluated by increasing the records from 10% to 100%. The results of a comparative analysis vividly proved that the proposed smart heart attack risk prediction system involving a fuzzy inference system for preliminary analysis and a modified gated recurrent unit for predictive analytics performed better.
Figure 4a–e depicts the accuracy, precision, recall, specificity, and F1-score analysis of the models GRU, FGRU, and the proposed system. The overall performance measures of the GRU, FGRU, and proposed model are hereby compared in
Table 4.
The results of accuracy, precision, recall, specificity, and F1-score analysis indicate that the propounded model outperforms the other models of GRU and FGRU.
Figure 5 portrays the proposed model’s comprehensive performance.
The proffered model has outdone the other models with an accuracy of 99.13%, a precision of 99.13%, a sensitivity of 99.12%, a specificity of 99.13%, and an F1-score of 99.13%. From the accuracy of 99.13%, we infer the misclassification or error rate (e) using the following formula,
gives the misclassified rate of disease prediction, which is equivalent to
Thus, the error rate of the proposed healthcare system for disease prediction is 0.0087.
Moreover, the model was evaluated for its efficiency using the confusion matrix depicted in
Figure 6.
The receiver operating characteristics (ROC) curve is a classification model’s key performance indicator that is plotted using the true positive rate (TPR) and false positive rate (FPR) at different classification thresholds. For binary classification problems with an unbalanced dataset, the area under the ROC curve (AUC) score is preferred to the accuracy measure.
Figure 7 portrays the ROC curve for the proposed approach.
The AUC score of the model was found to be 81.35%. However, the UCI heart disease dataset harnessed to evaluate the propounded model is reasonably balanced, so the accuracy score supersedes the AUC score.
Mean average precision (mAP) is another common metric used to ascertain a classification model’s performance. It is computed based on the average precision value derived from precision and recall. The mAP of the model was found to be 98.43%.
4.1. Comparison with State-of-the-Art Systems
The classification accuracy of the state-of-the-art models harnessing the UCI heart disease dataset was compared with the proposed work. The comparative analysis with the existing literature is characterized by increasing order of accuracy in
Table 5.
4.2. Comparative Analysis—Fog vs. Cloud
The deep learning model proposed in this work was ascertained by increasing the dataset from 10% to 100% in both cloud- and fog-based computing. The model’s performance in terms of latency rate, jitter, average response time, and memory utilization was evaluated in cloud and fog.
Figure 8 depicts the evaluated network latency results. It indicates that classifying the patient’s risk for heart disease by the proposed gated recurrent model involving the fog layer showed less latency relative to that of cloud-based computing. The transmission delay effectuated due to network congestion was referred to as jitter and was examined in cloud and fog, and the results in terms of time are indicated in
Figure 9. The network jitter in the fog was comparatively lower than that in the cloud. The average response time in fog and cloud was also evaluated, and the results in fog showed a lower response time in the fog than in the cloud, which is depicted in
Figure 10. Moreover, the memory utilization of the proposed classification model was ascertained, with fog showing better results due to offloading to nearer fog nodes than the faraway cloud, and the results are portrayed in
Figure 11. With fog computing offering processing as well as communication resources in proximity to the end users, it considerably minimizes data transmission traffic and leads to low latency. In contrast, the centralized cloud computing model transmits enormous data to the cloud server for computation, thus increasing traffic congestion and latency rate.
4.3. Limitations and Future Directions
The system proposed in this work deploys a fuzzy inference system for pre-processing combined with a modified GRU for heart attack risk prediction that outdoes other models, with remarkable outcomes evident from the performance results. The research initiative of performing health analytics at the fog layer has shown substantial results in reducing latency. However, the model harnesses the UCI heart disease dataset, and in order to ascertain the efficacy of the model, it needs to be deployed in a medical setting. Despite having significant upsides to the traditional cloud-only model, the fog model encounters several downsides that must be remedied. Fog computing encompasses a diverse set of end devices ranging among sensors, mobile phones, and internet-of-things gadgets, among others. The billions of geographically dispersed fog devices raise maintainability issues and increase operational expenses. In addition, it encounters the strenuous task of linking heterogeneous devices with different configurations that operate with multiple protocols and are furnished by multiple vendors. The seamless integration of such diverse devices and systems raises compatibility and interoperability issues. Hence, rigorous research efforts are needed to overcome these challenges.
Furthermore, because data is processed and stored on multiple edge devices, there is an increased risk of data breaches and unauthorized access with fog computing. This can be overcome by configuring the fog nodes to be impervious to physical harm and site-based attacks, with strict access control policies and tamper-proof hardware. Authentication and trust methods developed before the advent of heterogeneous IoT nodes and fog nodes are becoming obsolete. Hence, a novel user, service, node authentication, and trust framework must be designed. Offloading work to fog nodes could compromise personal data, so a foolproof method of offloading tasks while ensuring their correctness and integrity is needed. The user has access to multiple potentially sensitive fog nodes. Protecting the confidentiality of private information with appropriate privacy-preserving mechanisms is crucial.
5. Conclusions
The healthcare industry has primarily benefited from digitizing hospital records, enabling clinicians to leverage powerful predictive algorithms to facilitate clinical decision-making. It enables the prevention and cure of health issues by alerting clinicians, as well as caregivers, ahead of time on the possibility of medical events. In this research endeavour, a smart system for the prediction of heart attack risk based on an IoT–fog–cloud model is propounded, which deploys the fuzzy inference system (FIS) and a modified gated recurrent unit (GRU) to handle the predictive task. This suggested system outperforms other cutting-edge heart disease prediction models. The time-sensitive analytical tasks effectuated at the fog layer effectively tackle the IoT data upsurge, as they prevail over the cloud’s inherent shortcoming of higher latency caused by increased response time. The proffered model can be extended to facilitate personalized diet and exercise recommendations to patients on the clinician’s advice. Healthcare analytics expedites the early identification of illnesses, agile clinical decision-making, and timely intervention, enabling more accurate, swifter, and safer patient care. It further enhances the quality of service by involving medical data analytics at the fog layer. This is just a small fraction of the immense potential that deep learning models possess, which has yet to be explored in healthcare. The future of healthcare is anticipated to forge ahead with unfolding technology trends. Moreover, the complex challenges of device heterogeneity and geographically wide distribution, interoperability, maintainability, increased operational expenditure, and security and privacy concerns in the fog-based healthcare environment are to be resolved with further study.