  Diabetes Mellitus, one of the leading causes of death worldwide, has no cure
to date and can lead to severe health complications, such as retinopathy, limb
amputation, cardiovascular diseases, and neuronal disease, if left untreated.
Consequently, it becomes crucial to take precautionary measures to
avoid/predict the occurrence of diabetes. Machine learning approaches have been
proposed and evaluated in the literature for diabetes prediction. This paper
proposes an IoT-edge-Artificial Intelligence (AI)-blockchain system for
diabetes prediction based on risk factors. The proposed system is underpinned
by the blockchain to obtain a cohesive view of the risk factors data from
patients across different hospitals and to ensure security and privacy of the
user's data. Furthermore, we provide a comparative analysis of different
medical sensors, devices, and methods to measure and collect the risk factors
values in the system. Numerical experiments and comparative analysis were
carried out between our proposed system, using the most accurate random forest
(RF) model, and the two most used state-of-the-art machine learning approaches,
Logistic Regression (LR) and Support Vector Machine (SVM), using three
real-life diabetes datasets. The results show that the proposed system using RF
predicts diabetes with 4.57% more accuracy on average compared to LR and SVM,
with 2.87 times more execution time. Data balancing without feature selection
does not show significant improvement. The performance is improved by 1.14% and
0.02% after feature selection for PIMA Indian and Sylhet datasets respectively,
while it reduces by 0.89% for MIMIC III.
