Skip to main content
Journal of Public Health Research logoLink to Journal of Public Health Research
. 2025 Sep 15;14(3):22799036251373012. doi: 10.1177/22799036251373012

Application of machine learning for early detection of chronic diseases in Africa

Samson Otieno Ooko 1,2,, Ruth Oginga 2
PMCID: PMC12437260  PMID: 40964424

Abstract

Background:

Chronic diseases such as diabetes, hypertension, and cardiovascular conditions continue to burden African public health systems, especially due to late diagnosis. This study explores the application of Machine Learning (ML) for the early detection of diabetes using a localized dataset of 768 electronic health records from a clinic in Africa.

Design and methods:

A Design Science Research methodology was used to evaluate and compare different ML algorithms which includedDecision Trees, Support Vector Machines, Naïve Bayes, and a Neural Network (NN). preprocessing and hyperparameter tuning was applied to optimized the model perfomance. The models were tested for feasibility in edge-based deployment scenarios which are ideal for implimentation in the African setting.

Results:

The optimized NN model achieved the highest accuracy (89%), minimal latency (1 ms), and low memory usage (1 kB RAM), making it suitable for deployment in resource-constrained environments. While the dataset is limited in scope, it sets a foundation for future cross-regional studies.

Conclusion:

This study demonstrates the potential of edge-deployable ML models in supporting early chronic disease detection in Africa and recommends future work in regulatory alignment, ethical safeguards, and multi-site validations.

Keywords: machine learning, chronic diseases in Africa, disease prediction, diabetes, edge-based ML

Significance to public health

The authors believe the use of machine learning is an initial step in solving the public health burden of chronic diseases in Africa. The high accuracy and reliability of the optimized NN model indicate its potential for practical application in healthcare settings in Africa. This model, with its efficient resource usage and robust performance, aligns with the literature’s emphasis on the importance of context-specific models and the integration of local data to improve predictive accuracy of diseases. However, the study also acknowledges limitations in data representativeness and emphasizes the need for broader regional testing to ensure equitable applicability across Africa’s varied healthcare landscapes.

Introduction

According to recent statistics from the World Health Organization (WHO), there has been a rise in Chronic diseases, also referred to as Non-Communicable Diseases (NCDs) including kidney diseases, diabetes, hypertension, and cardiovascular diseases, among others. 1 Diabetes has been reported as a major challenge for people around the world, affecting not only individuals but also families and entire communities. According to the International Diabetes Federation (IDF), about 10.5% of adults aged 20–79 are living with diabetes, with more than half of them not even realizing it. 2 Projections from the IDF further suggest that this number will grow exponentially by 2045. It’s estimated that one in eight adults, which amounts to approximately 783 million people, will be affected by diabetes representing an increase of 46%. 2 The trend is worse in African countries and has led to significant public health challenges 3 with NCDs disproportionately affecting people in low- and middle-income countries, where nearly three-quarters of global NCD deaths (32 million) occur. 1 Diabetes and other NCD diseases have contributed to high morbidity and mortality rates that have led to strains in economies and health care systems specifically. Some of the factors that have been attributed to the increase in chronic diseases include urbanization, lifestyle changes, and an aging population. 4

Early detection of chronic diseases is needed to ensure effective management and improved health outcomes. When chronic diseases are diagnosed on time, it may lead to enhanced management and reduced related complications, thereby lowering the related health costs. 5 In the African setting, there are inadequate early detection mechanisms, even though there are increasing cases of the diseases. Moreover, healthcare facilities in Africa have inadequate resources and the infrastructure needed to promote screening programs that can help in early disease detection. 6 The limited availability of trained healthcare professionals and the high costs of acquisition and maintenance of diagnostic tools further enhance this gap in Africa. 7 This has resulted in late diagnosis of chronic diseases when the treatment and management options are limited and are less effective. 8

Emerging technologies such as Artificial Intelligence and, specifically, Machine Learning (ML) are increasingly being applied in different sectors, including in the healthcare sector to enable new capabilities in the early detection and diagnosis of chronic diseases. 9 By analyzing large datasets it is possible for ML algorithms to be used to identify patterns and predict diseases with a high accuracy depending on the data and model used. 10 Diverse data sources including data from Internet of Things (IoT) devices, social media, and electronic health records among others can be used to train ML models to provide early disease warnings and support clinical decision-making by healthcare providers. 11 Recent studies that applied ML in the prediction of NCDs include a study in which different ML techniques for predicting NCDs are outlined 12 and another that presented Machine Learning Models for the prediction of NCDs. 13 Other studies that focused on the application of ML in predicting diabetes have also been presented.14,15 However, most existing models have been developed and tested in developed economies and may not be directly applicable in the African context that is characterized by differences in the health care infrastructure, prevalence of diseases, and also socio-economic factors. 16 Furthermore, existing models are often cloud-based, making it a challenge to implement in Africa, where connectivity is a problem in many areas. 17 In addition, the need for connectivity also increases the cost of implementation and energy requirements. Therefore, there is a need to train and evaluate machine learning models from localized data and that can be implemented at the edge as a step to overcoming the challenges in the African context. Given the genetic, socio-economic, and healthcare infrastructure diversity across African regions, ML models trained on single-site datasets may not generalize well. This study represents a first step toward localized model development and acknowledges the importance of future multi-regional datasets for broader applicability.

This study therefore presents the evaluation of different ML models trained with localized datasets that can be used for the prediction of diabetes, one of the leading chronic diseases in Africa, as a proof of concept. The hypothesis is that lighter models can be trained for deployment at the edge while maintaining the model performance. A Design Science Research (DSR) methodology was used in developing the models. By optimizing a Neural Network (NN) model, we demonstrate its feasibility for deployment in resource-constrained environments. Our findings contribute to the growing body of research on AI in healthcare, offering practical recommendations for implementing ML-based disease prediction tools in Africa. In addition, a conceptual model for edge-based disease prediction is given to guide future studies.

The rest of the paper is organized as follows; in the next section the literature review is presented, this is followed by the proposed conceptual framework, the research methodology, the results and discussions, and a conclusion drawn.

Literature review

This section presents a narrative review of literature relating to the study, first chronic diseases in Africa are presented followed by the use of machine learning in health care, the application of ML in diabetes prediction, and the related gaps.

Chronic diseases in Africa

There has been an increase in chronic diseases in Africa with the trend expected to continue in the coming years. Diabetes is one of the chronic diseases that is becoming a major public health concern in the region. 18 Some of the reasons attributed to the growing cases of diabetes are urbanization, changes in lifestyles, and history of the disease in the family. The International Diabetes Federation (2020) reports that the prevalence of diabetes in sub-Saharan Africa is expected to increase by 143% by 2045. Another widespread chronic disease is hypertension with many cases going undiagnosed and untreated resulting in major complications such as stroke, heart failure, and kidney disease. 19 Moreover, According to a World Health Organization in 2021, it was reported that cardiovascular diseases were also becoming common in Africa, including coronary artery diseases and heart failures, driven by risk factors such as high blood pressure, excessive smoking, unhealthy diets, and inadequate physical activity. 20

One way of overcoming the related health problems presented by chronic diseases is to ensure early detection and management. However, the existing detection and management practices for chronic diseases in Africa face several challenges. To begin with, there are limited resources with limited access to the appropriate diagnostic tools and unavailability of trained healthcare professionals. 8 In addition, the screening programs put in place are inadequate which has led to late diagnosis and poor management of the diseases. 4 The problem is worse in rural areas where access to even basic health care services is a challenge with patients having to travel long distances to receive medical attention. The disease management efforts are further complicated by the lack of standardized protocols and guidelines tailored to the African context. There have been attempts to try to overcome the challenges including initiatives such as mobile health programs that enable remote monitoring of patients and health awareness which are still in their initial stages and also have scalability and sustainability challenges. 21 There is, therefore, a need to explore additional solutions to help overcome the highlighted challenges.

Machine learning in chronic disease management

The use of Machine Learning is a possible solution and has shown potential in enhancing healthcare in the early detection and management of chronic diseases. 22 Recent studies highlight the use of ML in predicting chronic diseases such as diabetes, cardiovascular disease, chronic kidney disease, and cancer.23,24 By analyzing clinical and demographic data, ML models achieve high prediction accuracies ranging from 80% to 100% depending on the disease type.25,26 These studies show that ML can present disease risk assessment by identifying critical predictors like age, blood pressure, cholesterol levels, and other clinical markers. For example, diabetes prediction relies on factors such as waist size and sodium intake, while cardiovascular disease prediction considers age and blood pressure. 27 Chronic kidney disease prediction benefits from indicators such as albumin levels and anemia, showing accuracies as high as 100% in some models. 28 Additionally, ML’s integration with electronic health records, web-based tools, and standardized data models suggests promising real-world applications for early diagnosis and prevention. 29 Some studies emphasize the importance of interpretability, ensuring clinicians can understand model predictions.

Some of the ML techniques that have been applied to develop predictive models for chronic diseases include logistic regression, decision trees, support vector machines, and neural networks.20,3032 The models are able to analyze various datasets and detected patterns and correlation that would not be possible to do with the traditional statistical methods. 33 Logistic regression models have the capability of predicting the probability of disease occurrence by analyzing the related risk factors. Decision tree models can be used to identify the main possible predictors of a given disease.3436 Neural networks including deep learning models have the capability of analyzing complex data for example radiographic medical images to detect early signs of various diseases. 37

At the global level, there have been several studies that demonstrate the effectiveness of ML models in the healthcare sector. To begin with, deep learning algorithms have been used to develop models for predicting cardiovascular diseases with high accuracy. 20 Deep learning has also been used to train algorithms on electronic health records to predict diabetes by identifying at-risk patients up to 1 year in advance. 38 In addition, convolutional neural networks have been used for the prediction of diabetes and were able to achieve a performance comparable to that of medical experts. 39 There are additional studies that present the use of ML in the prediction of other chronic diseases, including cancer and asthma.4043 In addition to these, a study 44 applied machine learning to predict the possible risk of cardiovascular diseases using data from wearable devices and smartphones. The models were able to enable timely interventions by providing real-time risk assessments. Routine health check-up data was also used in training a machine learning model for the prediction of hypertension with an accuracy of over 80%. 45 However, most ML applications in healthcare have been developed in high-income countries. 46 Such countries have well-established electronic health record (EHR) systems that provide extensive datasets for training and validation. This raises concerns about the direct applicability of these models in low-resource settings, such as Africa, where data limitations and infrastructure constraints may reduce predictive accuracy. 47

Regional application of ML in predicting NCDs

Recent studies show the need for context-specific ML models that are adapted to regional healthcare needs. In India for example, localized ML models have improved diabetes detection rates by 30% compared to generic global models. 48 In a similar study done in China, it was found that ML models integrating wearable device data significantly enhanced cardiovascular risk prediction. 49 However, the African continent lags in ML-driven healthcare applications. Studies indicate that most predictive models rely on externally trained datasets, which fail to capture the genetic, environmental, and socio-economic variations unique to African populations. 50 This gap show the need for regionally trained ML models that incorporate localized data and healthcare system constraints. Furthermore, the cloud-based implementation of the ML algorithms does not apply to most African regions with connectivity and energy limitations. In contrast, ML was applied to Indian health survey data for diabetes classification, with the study highlighting how regional adaptation improves accuracy—emphasizing the need for similar Africa-specific ML models. 48 The challenges that limit the adoption of the solutions in Africa can be summarized as follows;

  • a) Reliable healthcare datasets are scarce, making it difficult to train and validate robust ML models

  • b) Cloud-based ML models require high-speed internet and reliable computational power, both of which are lacking in many African regions

  • c) Many ML models are computationally intensive, making them impractical for low-resource settings. This highlights the need for lightweight, edge-based ML models that function effectively in environments with minimal infrastructure

  • d) Data privacy laws and a lack of standardized AI regulations create hurdles for ML adoption in healthcare

Given the challenges discussed, there is an urgent need for Africa-specific ML models that integrate regional data, infrastructure realities, and healthcare constraints. Unlike existing global models, locally trained ML systems can enhance predictive accuracy and improve early disease detection. This study contributes to addressing this gap by:

  • a) Developing an optimized NN model trained on localized African datasets.

  • b) Minimizing computational demands to ensure feasibility for edge-based deployment.

  • c) Evaluating multiple ML algorithms to determine the best-performing model for chronic disease prediction in Africa.

By implementing context-aware AI solutions, this research aims to bridge the gap between ML advancements and practical healthcare applications in Africa, paving the way for improved early detection and management of chronic diseases.

Conceptual model for study

Based on the reviewed literature a conceptual framework for the application of Machine Learning for Early Detection of Chronic Diseases in Africa was developed as presented in Figure 1. The independent variables that also form input to the ML models are medical attributes, personal attributes, and lifestyle. The dependent variable and the main output of the model is the diagnosis of a chronic disease. The mediating variables that explain the relationship between the independent and dependent variables in the study are the machine learning algorithms used and edge-capable tinyML algorithms that give the ability to run the models in low-resource environments. The moderating variables in the study are the conditions that affect the model performance which include the location of the source of the datasets, Size and type of data, and connectivity. An external validation component is essential to evaluate how the model performs across varying regional, epidemiological, and infrastructural conditions.

Figure 1.

Figure 1.

Conceptual model for prediction of chronic diseases.

Design and methods

A proof of concept was done for the early prediction of diabetes. The development and evaluation of the ML model were done following the Design Science Research (DSR) methodology. This methodology was selected given its iterative approach to problem identification, solution design, implementation, and evaluation. This methodology helped ensure that the proposed model is practically applicable in a real-world environment. The following steps as shown in Figure 2 and as outlined in the DSR were undertaken in developing the model for the early prediction of diabetes.

Figure 2.

Figure 2.

DSR steps.

Dataset

The dataset used in this study was based on electronic health records of 768 patients with different attributes relevant to diabetes prediction. The sample size of 768 patient records was determined based on the availability of data from the clinic over a 3-month period. While not a probabilistic sample, this dataset provides a representative distribution of diabetes cases within the study setting. The dataset primarily comprises patients from an urban clinic, and may therefore underrepresent rural populations, who face different risk profiles and healthcare access barriers. The socioeconomic diversity within the dataset is also limited. These limitations suggest caution in generalizing findings across all African populations. To enhance reproducibility, a synthetic sample mirroring the data distribution is being prepared and will be made available through a GitHub repository. However, the use of data from a single clinic introduces limitations in generalizability. Future studies will prioritize multi-site and stratified sampling strategies to improve population diversity. The current dataset may be biased toward urban demographics or a specific socio-economic group. The key attributes include the number of pregnancies, glucose levels, blood pressure, skin thickness, insulin levels, Body Mass Index (BMI), and diabetes pedigree function based on family history and age.

The diagnosis of diabetes in this study was based on standard medical guidelines that utilize glycated hemoglobin (HbA1c) levels and fasting blood sugar (FBS) levels as key diagnostic markers. The following thresholds were applied:

  • a) HbA1c ≥ 6.5%—A measure of average blood sugar levels over the past 2–3 months, where values at or above this threshold indicate diabetes.

  • b) Fasting Blood Sugar (FBS) ≥ 126 mg/dL—Blood glucose levels measured after at least 8 h of fasting. A reading of 126 mg/dL or higher is classified as diabetes.

To ensure the relevance and reliability of the dataset, the study included patients who met the following criteria:

  • a) Diagnosed with Type 2 Diabetes—Patients confirmed to have Type 2 diabetes based on clinical assessment and laboratory results.

  • b) Age 18 years and above—Given that Type 2 diabetes is more common in adults, only individuals 18 years or older were included in the study.

Certain individuals were excluded to maintain data integrity and ensure consistency in the predictive model:

  • a) Patients with gestational diabetes—This temporary form of diabetes occurs during pregnancy and follows a different physiological pattern than Type 2 diabetes.

  • b) Patients with missing or incomplete medical records—Incomplete data can introduce biases and reduce model accuracy, so records lacking key attributes such as blood glucose levels or demographic information were excluded.

Model development process

The model was developed following the steps outlined in Figure 3.

Figure 3.

Figure 3.

Model development steps.

The dataset was preprocessed before training the models to ensure accuracy and reliability. Missing values, mainly for BMI and glucose levels, were imputed using the median to maintain data consistency. To ensure robustness, we also conducted a sensitivity analysis by comparing model outputs after applying mean imputation and complete case analysis. The performance metrics showed less than 3% variation, justifying the choice of median imputation. Outliers were identified using the Interquartile Range (IQR) method and adjusted at the 1st and 99th percentiles to prevent them from affecting model performance. Feature selection was conducted through correlation analysis, which showed glucose levels, BMI, and age as the strongest predictors of diabetes.

Five machine learning models—Decision Tree (DT), Support Vector Machine (SVM), K-Nearest Neighbor (KNN), Naïve Bayes (NB), and an Optimized Neural Network (NN)—were developed and evaluated to balance model complexity, predictive performance, and interpretability. The Decision Tree and Naïve Bayes classifiers were selected for their high interpretability and transparent decision boundaries, which are essential for clinical decision support and can aid in gaining practitioner trust. SVM and Neural Networks were included to capture complex, non-linear relationships in the data that simpler models may not effectively handle. K-Nearest Neighbor (KNN) was chosen due to its simplicity, effectiveness on smaller datasets, and non-parametric nature, which allows it to adapt to complex decision boundaries without prior assumptions about data distribution. KNN also served as a useful benchmark to compare against more advanced models.

Logistic regression, while a common choice in clinical prediction tasks due to its interpretability, was not included as preliminary data exploration indicated non-linear interactions among key predictors—such as glucose level, BMI, and age—which it may not capture without significant feature engineering or transformation. Logistic regression offers limited optimization flexibility compared to models like decision trees and neural networks, which support techniques such as pruning and quantization for resource-constrained environments.

This diversity of models enabled a comparison of trade-offs between model interpretability and predictive performance. Hyperparameter tuning was conducted to improve accuracy, with the Decision Tree optimized using GridSearchCV and the Neural Network refined through node-level structured pruning and 8-bit quantization. These optimizations significantly reduced model size and memory footprint, making the NN model suitable for edge-based deployment with minimal latency. Robustness and generalizability were ensured using 5-fold cross-validation to mitigate overfitting.

Model evaluation

Statistical analysis was performed using Python and the Scikit-learn library. Descriptive statistics were computed for demographic and clinical variables. The performance of the developed models was evaluated using key metrics applied in ML model evaluation. The metrics include the model accuracy, recall, precision, F1 score, and the ROC-AUC (Receiver Operating Characteristic - Area Under Curve).

Ethical considerations

The study complies with ethical guidelines outlined by the World Medical Association (WMA) Declaration of Helsinki (2013) for research involving human health data. The datasets used in the study ensured the anonymity and confidentiality of patients. Ethical approval was obtained from the University of Rwanda Institutional Review Board, and a waiver of informed consent was granted due to the retrospective and anonymized nature of the data. For future edge deployment, on-device encryption and role-based access controls are being considered to mitigate data privacy risks in low-connectivity environments. Bias and fairness were addressed by mitigating any dataset imbalances. The machine learning model developed is interpretable and can only be used as a support tool for clinicians, not a replacement.

To address equity concerns, it is essential to ensure the model does not present healthcare disparities. Deployment must be accompanied by equitable access initiatives such as training local health workers and adapting tools to low-literacy users. Regular audits should be conducted to detect algorithmic bias, and datasets must be diversified across gender, geography, and socioeconomic status. Moreover, local data governance structures must be involved to ensure compliance with evolving data privacy laws and cultural sensitivities.

Results and analysis

Baseline characteristics

Table 1 presents the baseline table summarizing patient characteristics, including mean, standard deviation, median, and range for key clinical variables. The p-values indicate statistical significance between diabetic and non-diabetic groups. The p-values were obtained using the independent samples t-test for continuous variables to compare the means between diabetic and non-diabetic groups. This test was chosen because it evaluates whether there is a statistically significant difference in the means of two independent groups.

Table 1.

Baseline table.

Variable Mean ± SD Median Range p-Value
Age (years) 33.2 ± 11.8 29.0 21–81 <0.001
BMI (kg/m²) 32.0 ± 7.9 32.0 0.0–67.1 <0.001
Glucose (mg/dL) 120.9 ± 32.0 117.0 0–199 <0.001
Blood pressure (mmHg) 69.1 ± 19.4 72.0 0–122 0.087

Age, BMI, and glucose levels showed statistically significant differences between diabetic and non-diabetic groups (p < 0.001), meaning these factors are likely important predictors of diabetes. Blood pressure, however, did not show a significant difference between groups (p = 0.087).

The feature importance analysis presented in Figure 4 was primarily derived from the Decision Tree (DT) model, which provides inherent feature ranking based on information gain. To validate these findings, feature importance was also extracted from the Support Vector Machine (SVM) model using a permutation-based method, and from the Optimized Neural Network (NN). Across all three models, glucose level, BMI, and age consistently emerged as the most influential predictors of diabetes. The Naïve Bayes model, while not inherently producing feature importance scores, also indirectly highlighted similar features through high conditional probability contributions. K-Nearest Neighbor (KNN), being a non-parametric model, does not provide traditional feature importance scores, but a univariate sensitivity analysis confirmed alignment with the top features identified by the other models.

Figure 4.

Figure 4.

Feature importance for the DT model.

In addition, the correlation analysis reveals insights into the relationships between various medical attributes and the presence of diabetes, with glucose levels, BMI, and age showing the highest positive correlations with the output variable. The prioritization of features facilitated efficient feature selection for model development and thus enhanced the predictive accuracy. These findings show the importance of glucose and BMI as critical indicators in diabetes prediction models, which is consistent with established medical knowledge. This provides a foundation for developing targeted early detection systems in African healthcare settings.

Model performance

The results of the K-Nearest Neighbors (KNN) classifier are summarized by the accuracy scores for both the training and testing datasets across different numbers of neighbors as presented in Figure 5. The accuracies were calculated using a range of neighbors from 1 to 34. The training accuracies show a decline from 1.0 when the number of neighbors is 1, indicating overfitting, to 0.7378 as the number of neighbors increases to 34. This pattern suggests that the model complexity decreases with more neighbors. The test accuracies show an initial increase from 0.6688 to 0.7532 indicating that the model’s performance on unseen data improves as it becomes less overfitted and more generalized. This analysis shows the importance of selecting an appropriate number of neighbors in KNN to balance the trade-off between overfitting and generalization to enhance the model performance on unseen data.

Figure 5.

Figure 5.

KNN training and test results.

The Decision Tree model from the initial training has an accuracy of 1.0, which indicates overfitting, with a test accuracy of 0.6948. To improve the model’s performance hyperparameter tuning was conducted using GridSearchCV identifying the best parameters as max_depth = 3, min_samples_leaf = 4, and min_samples_split = 2. With these optimized hyperparameters, the model’s test accuracy improved to 0.7532, and the training accuracy to 0.7769, showing a better balance between fitting the training data and generalizing to unseen data. Figure 6 shows the confusion matrix for the DT model

Figure 6.

Figure 6.

Confusion matrix for the DT model.

The Gaussian Naive Bayes (GNB) classifier achieved a training accuracy of 75.24% and a test accuracy of 75.97%. This indicates that the model generalizes well, performing consistently on both the training and unseen test data. Figure 7 shows the confusion matrix for the GNB model.

Figure 7.

Figure 7.

Confusion matrix for the GNB model.

The SVM model’s performance is evaluated through its accuracy on both training and test datasets, achieving 78.66% on the training data and 77.27% on the test data. This close alignment between training and test accuracies indicates that the model generalizes well to unseen data.

The initial neural network model achieved an accuracy of 66.4% and a loss of 0.77 on the validation set. The model was optimized by pruning and quantization with the best model achieving the highest accuracy at 89%. Further, the model maintained a minimal latency (1 ms out of 100 ms) and was resource-efficient with 1 kB of RAM and 15 kB of ROM requirements. Figure 8 shows the confusion matrix for the model.

Figure 8.

Figure 8.

Confusion matrix for the optimized NN model.

Although the NN model was optimized for low-resource deployment, real-world testing on edge hardware such as Raspberry Pi or smartphones was not yet conducted. Simulations suggest feasibility based on latency and memory usage benchmarks, but future empirical evaluations are necessary.

Comparison of the models

The graph presented in Table 2 compares the performance of different machine learning models used for diabetes prediction based on five metrics: accuracy, precision, recall, F1 score, and ROC-AUC. The SVM model shows strong and balanced performance across all metrics. After hyperparameter tuning, the Decision Tree model achieved balanced metrics, though slightly lower than the SVM. The GNB model displayed consistent performance. The initial neural network had lower performance across all metrics, indicating the need for optimization. The optimized with NN outperformed all other models with the highest accuracy (89%) and better performance across all other metrics, indicating it is the most reliable model for diabetes prediction among those tested.

Table 2.

Model performance comparison.

Model Accuracy (%) Precision Recall F1-Score ROC-AUC
DT 75.3 0.74 0.77 0.75 0.76
SVM 77.2 0.76 0.78 0.77 0.78
NB 75.9 0.75 0.76 0.75 0.76
Optimized NN 89.0 0.87 0.90 0.88 0.91

Discussion and recommendations

The performance of the optimized neural network of 89% in this study is consistent with, and in some cases surpasses, the results reported in similar global studies. An accuracy of 86% using supervised learning models on diabetes datasets from developed regions was achieved in a related study. 51 Similarly, accuracies ranging from 82% to 88% using logistic regression, random forests, and deep learning on Taiwanese health records were reported in another study. 14 In a study conducted in India using regional demographic and health data, achieved a 91% accuracy with an ensemble model, which improved upon generic global models by 30%. 48 These comparisons show that the accuracy of our model is within the expected range of well-performing models while being optimized for edge deployment in low-resource settings, a feature often lacking in studies from high-income countries. Moreover, the model’s success in using localized African data underlines the importance of context-specific ML development, addressing generalizability limitations seen when applying externally trained models to diverse populations.

The findings of this study show the potential of ML models in addressing the challenge of early chronic disease detection in Africa. The optimized NN model performed better as compared to other models, achieving an accuracy of 89%, which makes it a promising tool for real-world healthcare applications. However, its implementation requires consideration of multiple factors, including data quality, infrastructure, and regulatory support. The study further emphasizes the need for localized data in training ML models for chronic disease prediction. It is also important to validate such models using diverse datasets from both rural and urban regions across the continent. This will ensure the model accounts for differing disease prevalence, healthcare access, and socio-economic conditions.

Given the unique genetic, environmental, and socio-economic variations across different African populations, generic models trained on non-African datasets may not yield optimal results. Therefore, it is important to invest in region-specific data collection initiatives that capture demographic and clinical variations within different communities.

It was also noted that infrastructure constraints, particularly limited connectivity and computational resources, present a challenge for cloud-based ML applications. Our findings emphasize the viability of deploying lightweight, edge-based ML models that require minimal energy and processing power. This approach aligns with the continent’s infrastructural realities and ensures broader accessibility, particularly in remote areas. However, robust validation studies should be conducted to ensure model reliability before large-scale deployment.

While the optimized NN yielded the highest accuracy, its interpretability is limited compared to simpler models like Decision Trees. In clinical contexts, where understanding model rationale is critical, interpretability must be weighed against performance. This trade-off suggests that hybrid approaches or interpretable deep learning techniques could enhance adoption.

In practical terms, this model could be embedded in mobile-based diagnostic tools for use by community health workers. Integration with existing national health systems—for example, linking results to patient health records or alerting clinicians via SMS—could streamline early diagnosis in rural clinics. However, ethical considerations such as patient consent, data security, and the lack of regulatory frameworks for AI in many African countries must be addressed. Collaboration with ministries of health and local ethics boards will be vital to ensure responsible implementation.

Although the optimized model demonstrates computational efficiency, future work must involve deployment on actual devices to measure processing speed, energy consumption, and integration with local health data systems. Future research should also explore the applicability of ML models to other chronic diseases beyond diabetes, expanding the scope of AI-driven interventions in African healthcare systems. Integrating additional data sources, such as wearable devices and electronic health records, may further enhance model accuracy and reliability. By addressing these considerations, ML technologies can serve as a transformative force in Africa’s healthcare landscape, improving early disease detection and ultimately reducing the burden of chronic illnesses.

Conclusion

This study confirms the transformative potential of machine learning in enhancing early detection of chronic diseases in Africa. By optimizing a Neural Network model tailored for resource-constrained environments, we demonstrated that ML can provide accurate and efficient diagnostic support while minimizing computational demands. Our findings highlight the importance of localized datasets, infrastructure-conscious model development, and interdisciplinary collaboration between technology experts and healthcare professionals. While challenges remain, including data accessibility, regulatory considerations, and practitioner training, addressing these issues can pave the way for broader ML adoption in African healthcare systems. As the field of AI-driven healthcare continues to evolve, future research should focus on expanding these models to predict a wider range of diseases, integrating diverse data sources, and refining model interpretability for clinical use. Moreover, future studies will emphasize model testing across geographically and demographically varied datasets, as well as pilot deployments on physical edge devices to confirm performance under real-world constraints. With strategic investments and policy support, ML can play a pivotal role in strengthening healthcare systems, enabling earlier diagnoses, and ultimately improving patient outcomes across the continent.

Footnotes

ORCID iD: Samson Otieno Ooko Inline graphic https://orcid.org/0000-0002-2664-6841

Funding: The authors received no financial support for the research, authorship, and/or publication of this article.

The authors declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Data availability statement: The model and processed data are available on request from the corresponding author. A GitHub repository is being prepared to include code, model configurations, and a synthetic sample of the dataset for reproducibility.

References

  • 1. WHO. Noncommunicable diseases, https://www.who.int/news-room/fact-sheets/detail/noncommunicable-diseases (2024, accessed 6 March 2025).
  • 2. International Diabetes Federation. Diabetes facts and figures. International Diabetes Federation, https://idf.org/about-diabetes/diabetes-facts-figures/ (2024, accessed 6 March 2025). [Google Scholar]
  • 3. Turki H, Sekkal H, Pouris A, et al. Machine learning for healthcare: a bibliometric study of contributions from Africa. Epub ahead of print 2023. DOI: 10.20944/preprints202302.0010.v2 [DOI] [Google Scholar]
  • 4. Maha CC, Kolawole TO, Abdul S. Harnessing data analytics: a new frontier in predicting and preventing non-communicable diseases in the US and Africa. Comput Sci Res J 2024; 5: 1247–1264. [Google Scholar]
  • 5. Yadav Kasula B. Machine learning applications for early detection and intervention in chronic diseases. Res Gate, 2022. [Google Scholar]
  • 6. Masaba BB, Moturi JK, Taiswa J, et al. Devolution of healthcare system in Kenya: progress and challenges. Public Health 2020; 189: 135–140. [DOI] [PubMed] [Google Scholar]
  • 7. Arefin S. Leveraging AI for Healthcare Advancement in Africa. Acad J Sci Technol 2024; 7: 1–11. [Google Scholar]
  • 8. Waljee AK, Weinheimer-Haus EM, Abubakar A, et al. Artificial intelligence and machine learning for early detection and diagnosis of colorectal cancer in sub-Saharan Africa. Gut 2022; 71: 1259–1265. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 9. Ghaniaviyanto Ramadhan N, Maharani W, Akbar Gozali A. Chronic diseases prediction using machine learning with data preprocessing handling: a critical review. IEEE Access 2024; 12: 80698–80730. [Google Scholar]
  • 10. Mekov E, Miravitlles M, Petkov R. Artificial intelligence and machine learning in respiratory medicine. Expert Rev Respir Med 2020; 14: 559–564. [DOI] [PubMed] [Google Scholar]
  • 11. Choudhury A, Renjilian E, Asan O. Use of machine learning in geriatric clinical care for chronic diseases: a systematic literature review. JAMIA Open 2020; 3: 459–471. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 12. Lavanya JMS, Subbulakshmi P. Machine learning techniques for the prediction of non-communicable diseases. In: 2023 International Conference on Artificial Intelligence and Knowledge Discovery in Concurrent Engineering (ICECONF), Institute of Electrical and Electronics Engineers Inc., 2023. [Google Scholar]
  • 13. Al-Zubayer MA, Alam K, Shanto HH, et al. Machine learning models for prediction of double and triple burdens of non-communicable diseases in Bangladesh. J Biosoc Sci 2024; 56: 426–444. [DOI] [PubMed] [Google Scholar]
  • 14. Chou CY, Hsu DY, Chou CH. Predicting the onset of diabetes with machine learning methods. J Pers Med 2023; 13: 406. DOI: 10.3390/jpm13030406 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 15. Alaa Khaleel F, Al-Bakry AM. Diagnosis of diabetes using machine learning algorithms. Mater Today Proc 2023; 80: 3200–3203. [Google Scholar]
  • 16. Thamara A, Elsersy M, Sherif A, et al. A novel classification of machine learning applications in healthcare. In: 2021 3rd IEEE Middle East and North Africa COMMunications conference, MENACOMM 2021, 2021, pp.80–85. Institute of Electrical and Electronics Engineers Inc. [Google Scholar]
  • 17. Ooko SO, Nsenga J. Tiny machine learning (TinyML) based self diagnostic kit for respiratory diseases. In: ICCA 2023 - 2023 5th International conference on computer and applications, proceedings. Epub ahead of print 2023. DOI: 10.1109/ICCA59364.2023.10401673. [DOI] [Google Scholar]
  • 18. Sisodia D, Sisodia DS. Prediction of diabetes using classification algorithms. In: Procedia computer science. Elsevier B.V, 2018, pp.1578–1585. [Google Scholar]
  • 19. Deepanshu, Singh K, Dhawan S. Diagnosing multiple chronic diseases based on machine learning techniques: review, challenges and futuristic approach. In: 2022 International conference on communication, computing and internet of things, IC3IoT 2022 - Proceedings, 2022. Institute of Electrical and Electronics Engineers Inc. DOI: 10.1109/IC3IOT53935.2022.9767930. [DOI] [Google Scholar]
  • 20. Swathy M, Saruladha K. A comparative study of classification and prediction of cardio-vascular diseases (CVD) using machine learning and deep learning techniques. ICT Express 2022; 8: 109–116. [Google Scholar]
  • 21. Rashid J, Batool S, Kim J, et al. An augmented artificial intelligence approach for chronic diseases prediction. Front Public Health 2022; 10. DOI: 10.3389/fpubh.2022.860396 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 22. Kumar Y, Gupta S, Singla R, et al. A systematic review of artificial intelligence techniques in cancer prediction and diagnosis. Arch Comput Methods Eng 2022; 29: 2043–2070. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 23. Delpino FM, Costa ÂK, Farias SR, et al. Machine learning for predicting chronic diseases: a systematic review. Public Health 2022; 205: 14–25. [DOI] [PubMed] [Google Scholar]
  • 24. Lee C, Jo B, Woo H, et al. Chronic disease prediction using the common data model: development study. JMIR AI 2022; 1: e41030. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 25. Samantaray A, Panda DSK. Predictive models in the chronic disease diagnosis. Int J Sci Res Eng Manag 2024; 08: 1–17. [Google Scholar]
  • 26. Srivastava A, Samanta S, Mishra S, et al. Medi-Assist: a decision tree based chronic diseases detection model. In: 4th International conference on intelligent engineering and management, ICIEM 2023, 2023. Institute of Electrical and Electronics Engineers Inc. DOI: 10.1109/ICIEM59379.2023.10167400. [DOI] [Google Scholar]
  • 27. Dinh A, Miertschin S, Young A, et al. A data-driven approach to predicting diabetes and cardiovascular disease with machine learning. BMC Medical Informatics and Decision Making. Springer 2019; 19: 15. http://creativecommons.org/publicdomain/zero/1.0/. [DOI] [PMC free article] [PubMed]
  • 28. Khalid H, Khan A, Zahid Khan M, et al. Machine learning hybrid model for the prediction of chronic kidney disease. Comput Intell Neurosci 2023; 2023: 9266889. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 29. Ramadhan NG, Adiwijaya Maharani W, et al. Chronic diseases prediction using machine learning with data preprocessing handling: a critical review. IEEE Access 2024; 12: 80698–80730. [Google Scholar]
  • 30. Battineni G, Sagaro GG, Chinatalapudi N, et al. Applications of machine learning predictive models in the chronic disease diagnosis. J Pers Med 2020; 10(2): 21. DOI: 10.3390/jpm10020021 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 31. Wu CT, Li GH, Huang CT, et al. Acute exacerbation of a chronic obstructive pulmonary disease prediction system using wearable device data, machine learning, and deep learning: development and cohort study. JMIR Mhealth Uhealth 2021; 9: e22591. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 32. Husnain A, Khawar Hussain H, Shahroz HM, et al. A precision health initiative for chronic conditions: design and cohort study utilizing wearable technology, machine learning, and deep learning. Int JAdv Eng Tech Innov 2024; 2. [Google Scholar]
  • 33. Alghunaim S, Al-Baity HH. On the scalability of machine-learning algorithms for breast cancer prediction in big data context. IEEE Access 2019; 7: 91535–91546. [Google Scholar]
  • 34. Fatima N, Liu L, Hong S, et al. Prediction of breast cancer, comparative review of machine learning techniques, and their analysis. IEEE Access 2020; 8: 150360–150376. [Google Scholar]
  • 35. Jaiswal V, Negi A, Pal T. A review on current advances in machine learning based diabetes prediction. Prim Care Diabetes 2021; 15: 435–443. [DOI] [PubMed] [Google Scholar]
  • 36. Priya RL, Jinny SV. Elderly healthcare system for chronic ailments using machine learning techniques – a review. Iraqi J Sci 2021; 62: 3138–3151. [Google Scholar]
  • 37. Ge R, Zhang R, Wang P. Prediction of chronic diseases with multi-label neural network. IEEE Access 2020; 8: 138210–138216. [Google Scholar]
  • 38. Muhammad LJ, Algehyne EA, Usman SS. Predictive supervised machine learning models for diabetes mellitus. SN Comput Sci 2020; 1: 240. DOI: 10.1007/s42979-020-00250-8 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 39. Butt UM, Letchmunan S, Ali M, et al. Machine learning based diabetes classification and prediction for healthcare applications. J Healthc Eng 2021; 2021: 9930985. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 40. Feng Y, Wang Y, Zeng C, et al. Artificial intelligence and machine learning in chronic airway diseases: focus on asthma and chronic obstructive pulmonary disease. Int J Med Sci 2021; 18: 2871–2889. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 41. Ullah R, Khan S, Ali H, et al. A comparative study of machine learning classifiers for risk prediction of asthma disease. Photodiagnosis Photodyn Ther 2019; 28: 292–296. [DOI] [PubMed] [Google Scholar]
  • 42. Ferroni P, Zanzotto FM, Riondino S, et al. Breast cancer prognosis using a machine learning approach. Cancers 2019; 11: 328. DOI: 10.3390/cancers11030328 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 43. Singh G. Breast cancer prediction using machine learning. Int J Sci Res Comput Sci Eng Inf Technol 2020; 6: 278–284. [Google Scholar]
  • 44. Mathur P, Srivastava S, Xu X, et al. Artificial intelligence, machine learning, and cardiovascular disease. Clin Med Insights Cardiol 2020; 14: 117954682092740. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 45. Ma X, Wu Y, Zhang L, et al. Comparison and development of machine learning tools for the prediction of chronic obstructive pulmonary disease in the Chinese population. J Transl Med 2020; 18: 146. DOI: 10.1186/s12967-020-02312-0 [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 46. Carrillo-Larco RM, Tudor Car L, Pearson-Stuttard J, et al. Machine learning health-related applications in low-income and middle-income countries: a scoping review protocol. BMJ Open 2020; 10: e035983. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 47. Alami H, Rivard L, Lehoux P, et al. Artificial intelligence in health care: laying the foundation for responsible, sustainable, and inclusive innovation in low- and middle-income countries. Global Health 2020; 16: 52. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 48. Thotad PN, Bharamagoudar GR, Anami BS. Diabetes disease detection and classification on Indian demographic and health survey data using machine learning methods. Diabetes Metab Syndr Clin Res Rev 2023; 17: 102690. [DOI] [PubMed] [Google Scholar]
  • 49. Jiang Z, Van Zoest V, Deng W, et al. Leveraging machine learning for disease diagnoses based on wearable devices: a survey. IEEE Internet Things J 2023; 10: 21959–21981. [Google Scholar]
  • 50. Tshimula JM, Kalengayi M, Makenga D, et al. Artificial intelligence for public health surveillance in Africa: applications and opportunities, http://arxiv.org/abs/2408.02575 (2024, accessed 6 March 2025).
  • 51. Ahmed U, Issa GF, Khan MA, et al. Prediction of diabetes empowered with fused machine learning. IEEE Access 2022; 10: 8529–8538. [Google Scholar]

Articles from Journal of Public Health Research are provided here courtesy of SAGE Publications

RESOURCES