Journal of Intelligent Systems and Internet of Things

Internet of Medical Things Powered by Machine Learning for Real-Time Diabetes Prediction

Qusay Saihood, Inas H Kareem, Omar Ayad Ismael, Saad I. Mohammed, Ahmed NO Algburi
Volume 17, Issue 1, pp. 106-117 (2025)
DOI: https://doi.org/10.54216/JISIoT.170108
Online: https://www.americaspg.com/journal/18/article/3786

Abstract

Diabetes is a common chronic illness that requires ongoing patient monitoring to diagnose the condition in a timely manner. With the significant advancements of the Internet of Medical Things (IoMT) sector in recent years, it is feasible now to monitor the patient's information continuously. There are many studies that used IoMT and machine learning (ML) techniques to diagnose diabetes but so far, the accuracy of the performance is still below the required level. Therefore, this study proposes a common framework for IoMT, cloud, and ML techniques to diagnose diabetes in real-time. IoMT devices continuously collect vital information of diabetic patients such as glucose and insulin levels. Then, this data is transmitted using various communication technologies to be stored in the cloud for diagnosis. Finally, to improve diagnostic accuracy, voting ensemble strategy-based method has been proposed that combines predictions from three base ML techniques (Support Vector Machine (SVM), Decision Tree (DT), and Random Forest (RF)). The proposed voting model achieved promising results in diagnosing diabetes with an accurate rate of up to 98.0%, outperforming the base classifiers in this and previous studies.

Keywords: Internet of Medical Things; Cloud; Machine Learning; Voting Ensemble Method; Diabetes; Diagnosis

1. Introduction

Diabetes is one of the most common chronic illnesses that develops when the pancreas is unable to produce enough insulin that is called type 1 diabetes (T1D). Alternatively, when the body's insulin is ineffectively used that is called type 2 diabetes (T2D) [1]. Insulin is a hormone that helps to keep blood sugar levels under control. Uncontrolled diabetes causes hyperglycemia, which damages many of the body systems, particularly the nerves and blood vessels over time [2]. According to reports published by the World Health Organization (WHO), diabetes is among the top ten causes of death worldwide. Studying indicates that there are about (422 million) people with diabetes in the world. Diabetes also causes an increase in mortality, causing (1.5 million) deaths annually. There has been a noticeable increase in the number of diabetics in recent years. Both the number of cases and the prevalence of diabetes have steadily increased over the past few decades [3]. Diabetes can lead to serious complications such as heart disease, high blood pressure, and stroke [4]. Regular glucose monitoring, on the other hand, is critical for reducing and avoiding diabetes complications [5]. The great development in IoT technologies provides essential solutions in monitoring patient health and diagnosing chronic diseases [6]. IoT is a network environment in which each connected node can communicate with other nodes to transmit critical data for important data to make precise and real-time decisions [7]. These characteristics enable IoT to provide effective solutions in critical scenarios such as medical applications. Therefore, using IoMT technology, diabetes disease can be monitored, and the medical parameters of the patient transmitted to health care centers or doctors in realtime [8].

IoMT consists of many types of sensors and medical devices connected to a healthcare provider's computer system over the Internet. Remote patient monitoring devices, wearables, sensors, and health trackers are examples of IoMT products [9]. These devices monitor the patient's health and continuously collect vital information such as glucose level, Insulin level, heart rate, pulse, blood pressure, body temperature, etc. [10]. IoMT generates a massive amount of data that can be carried from one end to another by using wireless communication technologies such as (ZigBee, WI-Fi, Bluetooth, NFC, RFID (Radio Frequency Identification), 4G, 5G, etc.) [11]. through these technologies, the data generated by IoMT is continuously carried to storage in the cloud. Cloud servers are gaining popularity as a means of storing and processing enormous amounts of data and giving access to real-time data from a distance. That is allowing healthcare monitors to monitor patient health directly and continuously [12]. Analyzing such huge and continuous data is a big challenge, as it is difficult for a person to monitor and analyze such a huge amount of data. Artificial intelligence (AI) techniques, especially ML techniques, provide the best solutions for analyzing this data to diagnose and identify diseases in real-time [2].

One of the practical applications of ML in healthcare is the prediction and diagnosis of diseases. Therefore, ML techniques provide the most appropriate solution to deal with the huge data generated by IoMT devices [13]. In recent years, there are many studies addressing the diagnosis of diabetes using IoMT-ML but so far, the accuracy of the performance is still under the required level [1, 13]. To build a remote monitoring system for diagnosing diabetes, some challenges exist. One of the most important of these challenges is choosing an appropriate communication technology for real-time data transmission [14]. In addition, gathering and storing data from IoMT devices is a big challenge [13]. While the biggest challenge is to use an effective ML technique that can deal well with this continuous and large data to diagnose diabetes in real-time and with providing high classification accuracy [12].

Therefore, this study proposes a common framework for the IoMT, cloud, and ML techniques for real-time diabetes diagnosis. IoMT devices collect vital information from the patient and transmit this data using communication technologies to the cloud, where this data is stored in the cloud and analyzed using ML techniques. To diagnose diabetes with high accuracy and efficiency, data preprocessing was effectively implemented by filling in missing values, dealing with outliers, and balancing data classes. In addition, a voting strategy was proposed to build an ensemble model using three base techniques (DT, RF, and SVM). The proposed model in this study was trained and tested using a Pima Indians Diabetes Database [15], and performance was evaluated using a set of performance measures such as (Accuracy, Precision, Sensitivity, and F1-score). In addition, the performance of the proposed voting model was compared with five base ML techniques (SVM, DT, RF, K-Nearest Neighbors (KNN), and Logistic Regression (LR)) used in this study. The main contributions of this study are:

 Simulating a complete framework based on the IoMT, cloud, and ML techniques to diagnose diabetes in realtime.  Performing efficient data preprocessing to prepare the data well.  Exploring the performance of five base ML classifiers for diabetes diagnosis.  Fine-tuning the hyperparameters of base classifiers using Random Search (RS) method.  A voting strategy was proposed to build an ensemble model using three base ML techniques (SVM, DT, and RF).

After the introduction, related works are discussed in Section 2 especially works dealing with IoMT-ML for predicting diabetes. Section 3 explains the stages of the proposed framework (IoMT devices, communication techniques, cloud, and ML). Section 4 combines and shows the results. Section 5 contains the conclusion and future work.

Diabetes disease is among the most common diseases in the world and leads to serious complications that affect human life if it is not diagnosed early. There is a lot of literature that uses ML techniques to diagnose diabetes, but there are still limited studies that combine the advantages of the IoMT and ML to diagnose diabetes in real-time.

In [16], Chatrati, Saiteja Prasad, et al., introduced a system that works on monitoring both the patient's glucose level and blood pressure level at home and alerts the health care provider if an abnormality is detected. This system receives both input glucose and blood pressure readings and uses ML techniques for early diagnosis for each diabetes and blood pressure. This system was trained and tested on Pima Indians Diabetes Database where the SVM technique has achieved the highest accuracy with 75%.

In [17] Alfian, Ganjar, et al., suggested diabetes monitoring system monitor patient health using a Bluetooth Low Energy (BLE)-based sensor, real-time data processing, and ML techniques to help diabetics better manage their chronic condition. This system uses sensors to collect vital sign data from users, which is then transmitted via BLE for storage. MongoDB was used to store patients’ data and Apache Kafka was used as a streaming platform. Finally, the Multilayer perceptron technique (MLP) is used to predict the presence or likelihood of developing diabetes in the future, whereas long short-term memory (LSTM) is used to predict future blood sugar levels.

In [18] Rghioui, Amine, et al., suggested the use of 5G in diabetes monitoring systems. A set of sensors and wearable devices, a smartphone application, and a server with a database make up the system architecture. The proposed system is prepared to gather data on diabetes patients' blood glucose levels, physical activity, and temperature using a combination of wearable devices and sensors. Wi-Fi is used to connect various sensors to the smartphone, where data is transmitted from the smartphone via a 5G connection to a database. Next, ML techniques are used to predict diabetes. Among the several ML techniques used in this study, the Sequential Minimal Optimization (SMO) technique gave a higher classification accuracy than the other techniques used.

In [19], Parampreet, et al., suggested using a framework based on the use of IoT devices, Cloud, and ML techniques for predicting diabetes. Smart wearables devices continuously monitor and collect blood glucose data that is transmitted to store in the cloud where the ensemble model is used to diagnose diabetes. When the model was tested on “Pima Indians Diabetes,” the ensemble model combining both DT technique and neural network technique got the best accuracy of 94.5%.

[20] Pavleen Kaur, et al., proposed a framework that allows remote E-Health monitoring based on IoT equipment and cloud computing assistance while embedding ML features in the cloud. Several ML techniques, namely Linear-SVM, KNN, DT, MLP, and RF were applied on datasets of various diseases inclusive (Diabetes, Breast Cancer, Heart Disease, surgery data, thyroid, dermatology, and liver disorder). The suggested RF technique has achieved promising results in the prediction of various diseases.

In [21] Khanam, Jobeda Jamal, and Simon Y. Foo., applied 7 ML techniques to diagnose diabetes by using the Pima Indian Diabetes dataset. NN, with two hidden layers, achieved the highest accuracy of 88.6%. Also, in [22] Sisodia, Deepti, and Dilip Singh Sisodia used three different techniques (SVM, NB, and DT) for early diagnosis of diabetes where the NB technique achieved the highest result with an accuracy of 76.30%. While in [23] ANN technique provided the best accuracy of 75.7% superior to both RF and K-mean techniques. In [24] Tigga, Neha Prerna, and Shruti Garg used the LR algorithm to improve diabetes prediction as the system achieved good accuracy results.

In [25] Larabi-Marie-Sainte, Souad, et al., experimented with the use of new and rare methods of ML techniques to predict diabetes. However, with the lack of sufficient knowledge of the disease and deep interpretation of the data, these techniques did not achieve better results than previous studies.

In [26] Ashiquzzaman, Akm, et al., presented a system for predicting diabetes using the dropout method to reduce the problem of overfitting that most ML techniques suffer from it. The proposed deep neural network achieved superior performance with an accuracy of 88.41%. Table 1 shows a complete summary of studies related to this study.

In [27] Saihood, Qusay, and Emrullah Sonuç proposed a comprehensive framework to improve the accuracy of diabetes diagnosis based on three stages: In the first stage, missing values were filled, data was normalized, outliers were handled, and important features were selected. In the second stage, the hyperparameters of individual models used were tuned. In the last stage, these individual classifiers were combined using the ensemble method.

Table 1. Summary of studies mentioned in related works.
Table 1. Summary of studies mentioned in related works.
Figure

3. Proposed Methodology

Early prediction and diagnosis of diabetes is especially important to avoid serious complications that threaten the patient's life. Diabetes can be diagnosed by monitoring some vital information of a person such as (blood glucose level, insulin level, and blood pressure level etc.). Therefore, this study proposes a combined framework IoMT devices, Cloud, and ML for real-time diabetes diagnosis. IoMT devices consist of a group of sensors and wearable devices that collect vital information about diabetic patients. The data generated by the IoMT devices is carried to storage in the cloud using communication technologies. Then, diabetes is diagnosed using the voting ensemble method. The proposed system architecture framework consists of two stages; the first stage collects data from the patient, and the second stage diagnoses diabetes. Figure 1 shows the proposed framework for this study.

Figure 1. Proposed framework for diabetes diagnosis.
Figure 1. Proposed framework for diabetes diagnosis.

The following steps explain the workflow of the proposed framework:

3.1. Data Gathering

The proposed model framework for data acquisition from diabetic patients consists of three layers (perception layer, communication layer, and storage layer).

3.3.1. Perception layer

This layer is the closest to the patient and consists of IoMT technologies that include both sensors and wearable devices. This layer is responsible for collecting vital information from diabetic patients. The sensors and wearable devices collect health parameters of diabetic patients such as glucose level, insulin level, blood pressure level, body temperature, etc. [16, 18].

3.1.2. Communication Layer

Vital information collected from different IoMT devices is transmitted to the cloud through various communication technologies. The choice of the type of communication technologies depends on the type of sensor, which includes ZigBee, WI-Fi, Bluetooth, NFC, RFID, 4G, 5G, etc. [11].

3.1.3. Storage Layer

The data generated by the IoMT is stored in the cloud for further analysis. Cloud storage provides a convenient solution to accommodate this huge amount of data generated continuously. The cloud environment also provides a secure environment for remote data storage and access, which provides the opportunity to effectively monitor the vital information of diabetic patients [19].

3.2. Diabetes Prediction

After obtaining data of diabetic patients using IoMT devices and storing it in the cloud. The data is analysed using ML techniques for the early diagnosis of diabetes. The voting strategy is used for a more accurate diagnosis process. In addition, the performance of five base ML techniques is individually tested for performance comparison. Before implementing the diabetes diagnosis process, data preprocessing is performed, which consists of filling in missing values, detecting and handling outliers, handling the imbalance issue, and normalizing numerical values.

The process of diagnosing diabetes using ML techniques goes through the following stages:

3.2.1. Data Preprocessing

First, as indicated in Table 2, the dataset utilized in this work is the Pima Indians Diabetes Dataset [15], which includes (768) samples and (9) characteristics.

Table 2. Description of Pima Indians Diabetes Dataset.
Table 2. Description of Pima Indians Diabetes Dataset.

Data preprocessing is a crucial step in ML approaches since raw data frequently contains duplicate, irrelevant, and inconsistent information. The caliber of the data fed into ML techniques determines much of their effectiveness [28]. Thus, proper preprocessing is essential for creating a model with acceptable accuracy and high performance. The following stages provide a summary of the preprocessing of the diabetes data used in this study:

3.2.1.1. Fill In the Missing Value

The diabetes dataset used in this study contains some missing values, which are preferably treated to improve diagnostic accuracy. In this work, the features with missing values were filled by calculating the meaning of the feature column containing the missing value according to the target class it belongs to, as shown in Table 3.

Table 3. Mean Values of Features with Missing Values According to The Target Class.
Table 3. Mean Values of Features with Missing Values According to The Target Class.

3.2.1.2. Handle the Outliers

Outliers have a significant negative impact on the diagnostic process because they differ significantly from the rest of the data. Therefore, detecting and handling outliers is one of the most important steps in data preprocessing that can greatly improve diagnostic accuracy. In this work, the interquartile range (IQR) method was applied to detect and handle the outliers within Pima Indians Diabetes Dataset. It is one of the commonly used statistical methods for detecting outliers within a dataset. IQR used to measure the distance between the first quartile (Q1) and the third quartile (Q3), to identify outliers. It is a good metric of prevalence that is used to determine the range that represents the middle half of the data [27].

Outliers are detected and handled by the IQR method through the following steps:

First, Q1 is determined.

Second, Q3 is determined.

Third, IQR is Calculated by:

𝐼𝑄𝑅= (𝑄3 −𝑄1)                        (1)

Fourth, the lower bounds of the normal data range are determined by:

lower whisker = (Q1 – (1.5 ∗ IQR))                       (2)

Fifth, the upper limits of the normal data range are determined by:

Upper whisker = (Q3 + (1.5 ∗ IQR))                       (3)

Sixth, the values below (lower longitudinal) and above (upper longitudinal) are replaced by the median value.

3.2.1.3. Balance the data classes

The Synthetic Minority Oversampling Technique (SMOTE) was used to balance the classes, where the data consisted of two classes with diabetes, which numbered 500, and those who did not have diabetes numbered 268. Table 4 shows the number of samples for each class after using over-sampling.

Table 4. The number of per class before and after oversampling
Table 4. The number of per class before and after oversampling

3.2.1.4. Data normalization

To normalize the values of numerical column to a uniform scale, the Min-Max normalization method was applied to convert the numerical column values in the Pima Indians Diabetes Dataset to a common scale between 0 and 1 without distorting the value ranges, using the following equation [29]:

𝑌= 𝑋−𝑀𝑖𝑛(𝑋) 𝑀𝑎𝑥(𝑋) −𝑀𝑖𝑛(𝑋)                       (4)

Where Y represents the normalized value, X represents the original value.

3.2.2. Classification Techniques

Brief description of the ML techniques used:

3.2.2.1. Decision Trees (DT) Technique

A non-parametric supervised learning approach is well known for its effectiveness in classification applications. This flexible method can be used for both regression and classification issues. With the highest node acting as the root, the decision tree's topology resembles a hierarchical tree. A feature test is associated with each internal node, branches represent test results, and leaf nodes [30] represent class labels. When diagnosing diabetes, a Classification and Regression Tree (CART) is utilized. To pick features for classification issues, CART generates binary trees and uses the Gini index function.

𝑐 Gini Index = 1 −∫𝑃𝑖2 (5) 𝐽=1

where Pi is the probability that a tuple in dataset belongs to class c.

3.2.2.2. Support Vector Machine (SVM) Technique

It is a powerful supervised Model that may be used for both regression problems; however, it is mostly used for classification tasks. Predicting a hyperplane or linear border that divides two classes in a dataset is the basic goal of support vector machines (SVM) classification. Computing the distances between data points that belong to different classes is a step in the SVM process. These are called support vectors, and they are the locations closest to each class's hyperplane. By choosing the one with the biggest margin between the hyperplane and the support vectors, the SVM algorithm aims to determine the ideal hyperplane [30].

3.2.2.3. Logistic Regression (LR) Technique

A logistic curve is used in LR, a supervised learning classification model, to model data and predict the probability of an event occurring using a statistical framework. Establishing the odds connected to a certain occurrence is a step in the logistic regression method. This function produces an S-shaped curve by projecting discrete values, usually binary outcomes (0/1 or yes/no), based on a particular collection of independent factors [58]. Most notably, LR is a multivariable technique that seeks to determine a functional connection between one or more outcome (dependent) variables and two or more predictor (independent) variables. In the current investigation, Binary LR was utilized to forecast the presence of only two categories of results: "Diabetic" or "Not Diabetic" [24].

3.2.2.4. Random Forest (RF) Technique

It is a supervised ML method that may be used for problems involving regression and classification. Differentiating itself from the traditional single decision tree model, RF builds many decision trees. This is due to its ensemble learning approach. This ensemble method gives the classifier more resilience and effectiveness. RF creates a large number of Classification and Regression Trees (CART), each of which is trained on a randomly selected portion of the original dataset. A majority vote from the group determines the categorization choice once the collective decisions of all the trees in the forest are combined [31].

3.2.2.5. K-Nearest Neighbors (KNN) Technique

It is a simple ML method that may be used for regression and classification. The basic tenet of KNN is that comparable items are equal, which implies that things that are like one other are often closer to each other. KNN determines the distance between each item in the training data and the item under consideration during the classification process. The ideal value for K, which represents the number of elements to be classified as closest neighbors, is then determined. Usually, a range of values for K is investigated to identify the best choice. A majority vote among the nearby data points determines the categorization result. The metric used to measure the spatial separation between two locations is called the Euclidean distance [30, 31].

2 (6) Euclidean distance (I, J) = √(𝑋𝐼1 −𝑋𝐽1)^2 + ⋯+ (𝑋𝐼𝑁−𝑋𝐽𝑁)^2

3.2.3. Random Search (RS) Method

RS is one of the commonly used techniques to automatically tune hyperparameters for ML techniques. Unlike grid search, which tries all possible possibilities for hyperparameters, which is computationally expensive, RS selects hyperparameters randomly. Random search has proven to be more efficient and superior to the Grid search technique due to its ability to explore the hyperparameter space more widely and identify the optimal hyperparameters with less computational cost compared to grid search [32].

3.2.4. Voting Method

Voting is an ensemble method in ML field that is used to improve the performance of individual classifiers by combining the predictions of more than one classifier. The voting method relies on voting to determine the final prediction result, which can be done through voting strategies: majority voting, weighted voting, or soft voting [33]. The weighted voting strategy was used to combine three classifiers (SVM, DT, and RF) to predict whether a patient has diabetes or not.

3.3. Classification Performance

The performance of ML techniques was evaluated using four commonly used performance metrics (accuracy, precision, sensitivity, and F1 score), in addition to calculating the confusion matrix for the final voting ensemble model. The positive samples were those that showed diabetes, and they were represented by the number '1,' whereas the negative samples were those that showed health, and they were represented by the number '0'[27].

 True Positives (TP): Diabetic patients who have already been diagnosed do have diabetes.  True Negatives (TN): Non-diabetic patients who have already been diagnosed do not have diabetes.  False Positives (FP): Non-diabetic patients who have been diagnosed do have diabetes.  False Negatives (FN): Diabetic patients who have been diagnosed do not have diabetes.

Accuracy = TP + TN 𝑇𝑃+ 𝑇𝑁+ 𝐹𝑃+ 𝐹𝑁                     (7)
Precision = TP 𝑇𝑃 + 𝐹𝑃                     (8)
Sensitivity = TP 𝑇𝑃 + 𝐹𝑁                     (9)
Specificity = TN 𝑇𝑁 + 𝐹𝑃                     (10)
F1 Score = 2 ∗Precision ∗Sensitivity Precision + Sensitivity                     (11)

4. Results and Discussion

In this study, five base ML techniques and the proposed voting (SVM, DT, and RF) model were trained and tested for diabetes diagnosis. The dataset used in this study was separated into 80% for training and 20 for testing. Accuracy, precision, sensitivity, and F1 score were used as performance measures to evaluate the performance of the used ML models. As shown in Table 5, the voting (SVM, DT, and RF) model achieved the best result with an accuracy of 98.0%, superior to each of the individual classifiers in this study. Among the individual techniques used in this work, the RF technique achieved the highest result with an accuracy of 97.5%. The DT technique also achieved a good result in predicting diabetes with an accuracy of 95.5%, followed by all SVM, KNN and LR with 93.0%, 92.0% and 86.5% accuracy, respectively.

Table 5. Performance evaluation of base ML techniques and a stacking classifier.
Table 5. Performance evaluation of base ML techniques and a stacking classifier.

The proposed voting model, which combines basically three classifiers (DT, RF, And SVM), has achieved promising results during the comparison with the previous studies [16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27], as shown in Table 6.

Table 6. Comparing the performance of the proposed model with previous studies.
Table 6. Comparing the performance of the proposed model with previous studies.

In most cases, the voting model performs better than the base ML classifiers because it combines the predictions of a set of weak classifiers to build a strong classifier and improve performance. In this study, the predictions of the top 3 classifiers (SVM, DT, and RF) out of the five base classifiers (LR, KNN, SVM, DT, and RF) used in this study were combined using a weighted voting strategy.

Figure 2. Confusion matrix of the proposed voting model.
Figure 2. Confusion matrix of the proposed voting model.

The proposed voting model demonstrated exceptional performance in diagnosing all cases, correctly classifying 102 positive cases and 94 negative cases, indicating high classification accuracy. However, the model misclassified only 3 negative cases as positive and 1 positive case as negative, indicating a low error rate as shown in figure 2.

In addition, to achieve an effective diabetes diagnosis, data preprocessing steps must be well implemented, because the performance of the ML technique largely depends on the quality of the data presented. In addition, adjusting the hyperparameters for each base ML technique is important to achieve better performance. Therefore, in this study, after performing data preprocessing and adjusting the hyperparameters of each ML technique, the ML technique made a strong improvement in the prediction outcome, superior to the results of the previous study.

The superiority of the proposed voting model in this study is not limited to the accuracy of performance compared to the ensemble methods mentioned in previous works [19, 27], but it goes beyond that to build a ML model with less computational cost and less complexity. The proposed voting model combines the predictions of three finetuned classifiers with low computational cost, RS method was used to tune the models to restrict the depth of the calculations and reduce computational consumption.

5. Conclusion

This study presented a common framework based on the IoMT, cloud, and ML techniques for effective diabetes diagnosis. IoMT devices monitor diabetes patients and collect vital information continuously. This data is transmitted using various communication technologies to be stored in the cloud. After that, ML techniques are used to diagnose the disease in real-time. For a more accurate diagnosis, a voting ensemble method, which combines three base classifiers (SWM, DT, and RF), is conducted. The proposed voting model achieved promising results with an accuracy of 98.0% for diabetes diagnosis, superior to the base techniques (DT, SVM, LR, RF, and KNN) used in this study as well as the results of previous studies. The proposed system has proven highly efficient in the effective diagnosis of diabetes, which aids physicians in making the right decision. Determining the appropriate ML technique for the diagnostic process is very important for the efficiency of the diagnosis. In addition, preprocessing the data as filling in missing values and dealing with outliers is very important to achieve high diagnostic accuracy. To obtain a more accurate diagnosis in future work, it is recommended to build ensemble models that combine DL techniques. In addition, using the real data generated by IoMT devices will give huge data, which will help in improving the accuracy of the diagnosis.

Funding: “This research received no external funding”

Conflicts of Interest: “The authors declare no conflict of interest.”

References

Figure
Figure
Figure