FairHealth: An Open-Source Python Library for Trustworthy Healthcare AI in Low-Resource Settings

arXiv cs.LG Tools

Summary

FairHealth is an open-source Python library designed for trustworthy healthcare AI in low-resource settings, offering modules for fairness auditing, privacy-preserving federated learning, and explainability.

arXiv:2605.08198v1 Announce Type: new Abstract: We present FairHealth, an open-source Python library that provides a unified, modular framework for trustworthy machine learning in healthcare applications, with particular focus on low-resource and low-income country (LMIC) settings such as Bangladesh. FairHealth addresses four critical gaps in existing healthcare AI toolkits: (1) the absence of integrated fairness auditing for biosignals and clinical tabular data; (2) the lack of privacy-preserving federated learning tools compatible with standard ML workflows; (3) missing explainability tools tailored for low-bandwidth clinical decision support; and (4) no existing toolkit covering Global South healthcare datasets. Built from five peer-reviewed research contributions, FairHealth provides six modules covering federated learning with homomorphic encryption (fairhealth.federated), intersectional fairness metrics (fairhealth.fairness), hybrid fuzzy-SHAP explainability (fairhealth.explain), multilingual dengue triage (fairhealth.lowresource), equitable disaster aid allocation (fairhealth.equity), and public dataset loaders (fairhealth.datasets). All datasets used are publicly available without institutional data use agreements. FairHealth is installable via pip install fairhealth(PyPI: pypi.org/project/fairhealth/) and available at https://github.com/Farjana-Yesmin/fairhealth.
Original Article
View Cached Full Text

Cached at: 05/12/26, 07:03 AM

# An Open-Source Python Library for Trustworthy Healthcare AI in Low-Resource Settings
Source: [https://arxiv.org/html/2605.08198](https://arxiv.org/html/2605.08198)
###### Abstract

We presentFairHealth, an open\-source Python library that provides a unified, modular framework for trustworthy machine learning in healthcare applications, with particular focus on low\-resource and low\-income country \(LMIC\) settings such as Bangladesh\. FairHealth addresses four critical gaps in existing healthcare AI toolkits: \(1\) the absence of integrated fairness auditing for biosignals and clinical tabular data; \(2\) the lack of privacy\-preserving federated learning tools compatible with standard ML workflows; \(3\) missing explainability tools tailored for low\-bandwidth clinical decision support; and \(4\) no existing toolkit covering Global South healthcare datasets\. Built from five peer\-reviewed research contributions, FairHealth provides six modules covering federated learning with homomorphic encryption \(fairhealth\.federated\), intersectional fairness metrics \(fairhealth\.fairness\), hybrid fuzzy\-SHAP explainability \(fairhealth\.explain\), multilingual dengue triage \(fairhealth\.lowresource\), equitable disaster aid allocation \(fairhealth\.equity\), and public dataset loaders \(fairhealth\.datasets\)\. All datasets used are publicly available without institutional data use agreements\. FairHealth is installable viapip install fairhealthand available at[https://github\.com/Farjana\-Yesmin/fairhealth](https://github.com/Farjana-Yesmin/fairhealth)\.

## 1Introduction

Machine learning has demonstrated substantial promise in healthcare applications\[[9](https://arxiv.org/html/2605.08198#bib.bib1)\], yet three structural problems limit its real\-world impact, particularly in low\-resource settings:

Demographic bias\.Models trained on population\-level data frequently underperform for minority demographic groups\. For ECG\-based myocardial infarction detection, uncorrected models achieve a disparate impact ratio of 0\.23 across sex groups — well below the 0\.80 threshold considered equitable in algorithmic fairness literature\[[5](https://arxiv.org/html/2605.08198#bib.bib2)\]\.

Privacy\.Healthcare records are legally protected in most jurisdictions\. Training ML models across hospitals without sharing raw patient data requires federated learning, yet no existing Python library provides federated learning with cryptographic homomorphic encryption \(HE\) in a form accessible to healthcare ML researchers\.

Explainability in low\-resource settings\.Clinical decision support tools deployed in Bangladesh and similar LMIC settings must operate with minimal connectivity, support local languages, and provide explanations clinicians can interpret without ML expertise\. Existing explainability libraries \(SHAP, LIME\) provide no clinical workflow integration\.

Existing healthcare AI toolkits such as PyHealth\[[18](https://arxiv.org/html/2605.08198#bib.bib3)\]provide broad coverage of EHR datasets and clinical tasks but do not address fairness auditing, federated learning, or LMIC\-specific deployment\. FairHealth is designed as a complementary layer: it focuses exclusively on the trustworthiness dimension that PyHealth deliberately leaves open\.

FairHealth makes the following contributions:

1. 1\.A unified, pip\-installable Python library with six modules spanning federated learning, fairness, explainability, low\-resource tools, equity, and datasets\.
2. 2\.The first healthcare AI toolkit built entirely on publicly available datasets, requiring no institutional data use agreements\.
3. 3\.A curated collection of Bangladesh\-specific health datasets \(maternal health, dengue surveillance, flood PDNA\) not available in any existing ML library\.
4. 4\.Open implementations of five peer\-reviewed methods, enabling reproducibility and extension\.

## 2Related Work

Healthcare AI toolkits\.PyHealth\[[18](https://arxiv.org/html/2605.08198#bib.bib3)\]is the most comprehensive open\-source healthcare ML library, covering 20\+ EHR datasets and 33\+ clinical models\. However, it does not include fairness metrics, federated learning, or differential privacy\. FATE\[[12](https://arxiv.org/html/2605.08198#bib.bib4)\]provides federated learning infrastructure but is not healthcare\-specific and requires significant engineering overhead\. IBM AIF360\[[2](https://arxiv.org/html/2605.08198#bib.bib5)\]provides fairness metrics but does not integrate with healthcare\-specific datasets or federated workflows\. FairHealth fills the intersection of these three spaces\.

Trustworthy AI for LMICs\.Healthcare AI research overwhelmingly focuses on datasets from North America and Europe — MIMIC\-III, eICU, UK Biobank — which require institutional data use agreements inaccessible to independent researchers\. FairHealth is the first toolkit to curate and standardize openly accessible health datasets from South Asia, including Bangladesh maternal health records, dengue surveillance data, and official government flood damage assessments\.

## 3Library Design

### 3\.1Architecture

FairHealth follows a modular architecture where each submodule corresponds to a distinct research contribution \(Figure 1\)\. Modules are loosely coupled: a user can import onlyfairhealth\.fairnesswithout installing the federated learning dependencies\.

pipinstallfairhealth

pipinstall"fairhealth\[federated\]"

pipinstall"fairhealth\[explain\]"

pipinstall"fairhealth\[all\]"

### 3\.2Design Principles

Public data only\.Every dataset loader infairhealth\.datasetsdownloads from publicly available sources\. No institutional affiliation or DUA is required\. This is a deliberate design choice enabling reproducibility for independent researchers in any country\.

Paper\-anchored modules\.Each module is anchored to a specific peer\-reviewed publication, with the paper’s key results documented in the module docstring\. This enables users to trace every implementation decision to a citable source\.

Clinical framing\.Fairness metrics, explanations, and triage outputs are framed in clinical language rather than ML jargon, following feedback from the 14\-clinician validation study documented in\[[14](https://arxiv.org/html/2605.08198#bib.bib15)\]\.

## 4Modules

### 4\.1fairhealth\.fairness— Fairness Metrics for Biosignals

Motivation\.ECG\-based disease prediction models in wearable systems exhibit significant demographic bias\. Evaluated on the PTB\-XL dataset\[[11](https://arxiv.org/html/2605.08198#bib.bib6)\]\(4,367 records, 20% subsample\), an uncorrected CNN classifier achieves disparate impact \(DI\) of 0\.23 across sex groups — far below the equitable threshold of 0\.80\. After adversarial debiasing using a gradient reversal layer\[[6](https://arxiv.org/html/2605.08198#bib.bib10)\], DI improves to 0\.71 while AUROC is maintained at 0\.8472\[[16](https://arxiv.org/html/2605.08198#bib.bib14)\]\.

Implementation\.The module provides:

fromfairhealth\.fairness\.metricsimport\(

demographic\_parity\_diff,

equalized\_odds\_diff,

disparate\_impact,

intersectional\_fairness,

fairness\_summary,

\)

dpd=demographic\_parity\_diff\(y\_pred,sensitive=sex\_array\)

All metrics accept numpy arrays and are model\-agnostic\. Theintersectional\_fairnessfunction extends standard parity metrics to multiple simultaneous sensitive attributes \(e\.g\., sex×\\timesage group\), addressing the intersectionality gap identified in\[[16](https://arxiv.org/html/2605.08198#bib.bib14)\]\.

### 4\.2fairhealth\.explain— Hybrid Fuzzy\-XGBoost Explainability

Motivation\.Black\-box models create trust deficits in clinical settings, particularly in resource\-constrained environments where clinicians cannot consult ML specialists\[[10](https://arxiv.org/html/2605.08198#bib.bib9)\]\. A clinician validation study \(N=14 healthcare professionals\) demonstrated that 71\.4% preferred the hybrid Fuzzy\+SHAP explanation over SHAP\-only \(24%\) or score\-only \(5%\) explanations across three clinical cases\[[14](https://arxiv.org/html/2605.08198#bib.bib15)\]\.

Implementation\.The hybrid Fuzzy\-XGBoost model achieves 88\.67% accuracy \(ROC\-AUC=0\.9703\) on the UCI Maternal Health Risk dataset\[[4](https://arxiv.org/html/2605.08198#bib.bib13)\], outperforming the best baseline \(Gradient Boosting: 86\.21%\) by 2\.46 percentage points\. The module provides both ante\-hoc \(fuzzy rules\) and post\-hoc \(SHAP\) explanations:

fromfairhealth\.explain\.fuzzyimportget\_fired\_rules,score\_to\_label

rules=get\_fired\_rules\(age=42,sbp=145,bs=12\.0,hr=88\)

forrinrules:

print\(f"Rule␣\{r\[’id’\]\}:␣\{r\[’condition’\]\}␣\-\>␣\{r\[’outcome’\]\}"\)

Fairness analysis revealed equitable regional performance \(σ\\sigma=0\.0766 across 8 Bangladesh divisions\), with a counter\-intuitive negative correlation \(r=−\-0\.876\) between healthcare access score and model accuracy — suggesting the model performs best precisely where specialist expertise is most scarce\[[14](https://arxiv.org/html/2605.08198#bib.bib15)\]\.

### 4\.3fairhealth\.federated— Privacy\-Preserving Federated Learning

Motivation\.Sharing patient data across hospitals is legally prohibited in most jurisdictions\. Standard federated learning \(FedAvg\[[7](https://arxiv.org/html/2605.08198#bib.bib7)\]\) transmits gradient updates that remain vulnerable to membership inference attacks \(MIA\), with a worst\-case attack success rate of 56\.3% in standard FL\[[17](https://arxiv.org/html/2605.08198#bib.bib16)\]\.

Implementation\.MedHE co\-designs adaptive gradient sparsification with CKKS homomorphic encryption\[[3](https://arxiv.org/html/2605.08198#bib.bib8)\]\. Transmitting only the top 10% of gradient magnitudes packed into CKKS ciphertexts reduces communication from 1,277 MB to 32 MB \(97\.5% reduction\) while maintaining macro\-F1=0\.950±\\pm0\.005, statistically equivalent to standard FedAvg \(p=0\.32\)\. MIA resistance improves to 51\.1% \(near\-random, ideal=50%\)\[[17](https://arxiv.org/html/2605.08198#bib.bib16)\]:

fromfairhealth\.federated\.privacyimport\(

clip\_weights,

add\_gaussian\_noise,

sparsify,

dp\_fedavg\_aggregate,

\)

sparse\_w,rate=sparsify\(weights,sparsity=0\.975\)

noisy\_w=add\_gaussian\_noise\(clipped\_w,epsilon=1\.0\)

### 4\.4fairhealth\.lowresource— Multilingual Dengue Triage

Motivation\.Bangladesh reported 321,179 dengue cases and 1,705 deaths in 2023 — the deadliest outbreak since 2000\[[1](https://arxiv.org/html/2605.08198#bib.bib11)\]\. Healthcare facilities become overwhelmed during outbreaks, creating demand for AI\-powered preliminary triage that operates in low\-bandwidth conditions and supports the Bengali language\.

Implementation\.The module implements a Decision Tree classifier trained on demographic features \(Age, Gender, AreaType, HouseType, District\), achieving Accuracy=0\.79, F1=0\.802, AUC=0\.851 on non\-leaky features\. Age is the dominant predictor \(Gini importance=0\.686\), with District and HouseType as secondary signals confirmed by SHAP analysis\[[15](https://arxiv.org/html/2605.08198#bib.bib17)\]\. The confidence threshold mechanism \(P<<0\.70→\\rightarrowreroute to doctor\) achieved 75% user satisfaction in a pilot study \(n=50\):

fromfairhealth\.lowresource\.triageimportassess\_dengue\_risk

result=assess\_dengue\_risk\(

age=8,gender="male",area\_type="urban",

district="Dhaka",language="bangla"

\)

### 4\.5fairhealth\.equity— Equitable Disaster Aid Allocation

Motivation\.Post\-disaster aid allocation in Bangladesh systematically underserves rural Haor regions despite their higher flood vulnerability\. The 2022 Bangladesh floods affected 7\.2 million people and caused $405\.5M in damages across 11 districts\[[8](https://arxiv.org/html/2605.08198#bib.bib12)\], yet standard AI models trained on historical allocation data perpetuate existing urban biases\.

Implementation\.The adversarial debiasing architecture employs a gradient reversal layer to learn district\-invariant vulnerability representations\. Evaluated on 87 upazilas from the official PDNA dataset, the fair model reduces statistical parity difference by 41\.6% and regional fairness gap by 43\.2%, with only a 2\.7 percentage point R2cost \(0\.784 vs 0\.811 baseline\)\[[13](https://arxiv.org/html/2605.08198#bib.bib18)\]\. Priority rankings shift substantially: 70\.6% of upazilas receive different rankings, with Sunamganj \(42\.7% poverty rate, $159\.6M damage\) moving from rank 14 to rank 6:

fromfairhealth\.equity\.flood\_aidimportgenerate\_priority\_ranking

rankings=generate\_priority\_ranking\(verbose=True\)

### 4\.6fairhealth\.datasets— Public Dataset Loaders

All dataset loaders download data at runtime to a local cache \(~/\.fairhealth/data/\)\. No institutional affiliation, hospital DUA, or special credentials are required for any dataset in Table[1](https://arxiv.org/html/2605.08198#S4.T1)\.

Table 1:Datasets available infairhealth\.datasets

## 5Comparison With Related Libraries

Table[2](https://arxiv.org/html/2605.08198#S5.T2)positions FairHealth relative to existing healthcare AI and fairness toolkits\.

Table 2:Feature comparison with related libraries
## 6Installation and Usage

FairHealth requires Python 3\.9\+ and is tested on Python 3\.9–3\.12\.

pipinstallfairhealth

importfairhealthasfh

importnumpyasnp

fromfairhealth\.fairness\.metricsimportdemographic\_parity\_diff

fromfairhealth\.explain\.fuzzyimportget\_fired\_rules

fromfairhealth\.lowresource\.triageimportassess\_dengue\_risk

fromfairhealth\.equity\.flood\_aidimportgenerate\_priority\_ranking

fromfairhealth\.federated\.privacyimportsparsify

dpd=demographic\_parity\_diff\(y\_pred,sensitive\)

rules=get\_fired\_rules\(age=42,sbp=145,bs=12\.0,hr=88\)

result=assess\_dengue\_risk\(8,"male","urban","Dhaka",

language="bangla"\)

rankings=generate\_priority\_ranking\(verbose=False\)

sparse\_w,rate=sparsify\(weights,sparsity=0\.975\)

## 7Conclusion

FairHealth provides the first unified Python library for trustworthy healthcare AI that simultaneously addresses fairness, privacy, and explainability, with a specific focus on low\-resource and LMIC settings\. Its six modules are each anchored to peer\-reviewed research, ensuring every implementation is traceable, reproducible, and citable\. By relying exclusively on publicly available datasets, FairHealth enables researchers worldwide — including those without institutional hospital access — to conduct rigorous healthcare AI research\.

Future work will expand the federated module to include full TenSEAL\-based CKKS encryption for neural network weight matrices, add the PTB\-XL adversarial debiasing model as a trained artifact, and extend the dengue module with real\-time DGHS dashboard integration\.

## Acknowledgements

The author thanks the 14 healthcare professionals who participated in the clinician validation survey, the Government of Bangladesh for making PDNA and DGHS data publicly available, and the maintainers of the UCI ML Repository, PhysioNet, and Kaggle for hosting open health datasets\.

## References

- \[1\]Y\. Arafet al\.\(2024\)Emerging health implications of climate change: dengue outbreaks in bangladesh\.Cited by:[§4\.4](https://arxiv.org/html/2605.08198#S4.SS4.p1.1)\.
- \[2\]AI fairness 360: an extensible toolkit for detecting, understanding, and mitigating unwanted algorithmic biasExternal Links:[Link](https://arxiv.org/abs/1810.01943)Cited by:[§2](https://arxiv.org/html/2605.08198#S2.p1.1)\.
- \[3\]J\.H\. Cheon, A\. Kim, M\. Kim, and Y\. Song\(2017\)Homomorphic encryption for arithmetic of approximate numbers\.InASIACRYPT,Cited by:[§4\.3](https://arxiv.org/html/2605.08198#S4.SS3.p2.1)\.
- \[4\]D\. Dua and C\. Graff\(2021\)UCI machine learning repository: maternal health risk dataset\.External Links:[Link](https://archive.ics.uci.edu/ml)Cited by:[§4\.2](https://arxiv.org/html/2605.08198#S4.SS2.p2.1)\.
- \[5\]M\. Feldman, S\.A\. Friedler, J\. Moeller, C\. Scheidegger, and S\. Venkatasubramanian\(2015\)Certifying and removing disparate impact\.InProceedings of the 21st ACM SIGKDD,pp\. 259–268\.Cited by:[§1](https://arxiv.org/html/2605.08198#S1.p2.1)\.
- \[6\]Y\. Ganinet al\.\(2016\)Domain\-adversarial training of neural networks\.Vol\.17,pp\. 1–35\.Cited by:[§4\.1](https://arxiv.org/html/2605.08198#S4.SS1.p1.1)\.
- \[7\]B\. McMahan, E\. Moore, D\. Ramage, S\. Hampson, and B\.A\. y Arcas\(2017\)Communication\-efficient learning of deep networks from decentralized data\.Cited by:[§4\.3](https://arxiv.org/html/2605.08198#S4.SS3.p1.1)\.
- \[8\]Ministry of Disaster Management and Relief, Government of Bangladesh\(2023\)Post disaster needs assessment: bangladesh floods 2022\.Technical reportGovernment of Bangladesh\.Cited by:[§4\.5](https://arxiv.org/html/2605.08198#S4.SS5.p1.1)\.
- \[9\]Z\. Obermeyer, B\. Powers, C\. Vogeli, and S\. Mullainathan\(2019\)Dissecting racial bias in an algorithm used to manage the health of populations\.Science366\(6464\),pp\. 447–453\.Cited by:[§1](https://arxiv.org/html/2605.08198#S1.p1.1)\.
- \[10\]C\. Rudin\(2019\)Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead\.Nature Machine Intelligence1,pp\. 206–215\.Cited by:[§4\.2](https://arxiv.org/html/2605.08198#S4.SS2.p1.1)\.
- \[11\]P\. Wagner, N\. Strodthoff, R\.D\. Bousseljot,et al\.\(2020\)PTB\-xl, a large publicly available electrocardiography dataset\.Scientific Data7,pp\. 154\.Cited by:[§4\.1](https://arxiv.org/html/2605.08198#S4.SS1.p1.1)\.
- \[12\]FATE: an industrial grade platform for collaborative learning with data protectionExternal Links:[Link](https://fate.fedai.org/)Cited by:[§2](https://arxiv.org/html/2605.08198#S2.p1.1)\.
- \[13\]F\. Yesmin and R\. Akter\(2026\)Toward equitable recovery: a fairness\-aware ai framework for prioritizing post\-flood aid in bangladesh\.Note:Accepted \(oral\), CCAI 2026 \(IEEE\)\. Preprint: arXiv:2512\.22210Cited by:[§4\.5](https://arxiv.org/html/2605.08198#S4.SS5.p2.1)\.
- \[14\]F\. Yesmin, N\. Shirmin, and S\.S\. Bristy\(2026\)Explainable ai for maternal health risk prediction in bangladesh: a hybrid fuzzy\-xgboost framework with clinician validation\.Note:Accepted, ICAIHE 2026, Waseda University\. Preprint:[https://www\.researchsquare\.com/article/rs\-8584734/v1](https://www.researchsquare.com/article/rs-8584734/v1)Cited by:[§3\.2](https://arxiv.org/html/2605.08198#S3.SS2.p3.1),[§4\.2](https://arxiv.org/html/2605.08198#S4.SS2.p1.1),[§4\.2](https://arxiv.org/html/2605.08198#S4.SS2.p4.2)\.
- \[15\]F\. Yesmin\(2026\)AI chatbots for dengue symptom triage in bangladesh: a decision tree classifier approach\.Note:Accepted, DASGRI 2026, Springer LNNS\. Preprint:[https://www\.researchgate\.net/publication/385935162](https://www.researchgate.net/publication/385935162)Cited by:[§4\.4](https://arxiv.org/html/2605.08198#S4.SS4.p2.2)\.
- \[16\]F\. Yesmin\(2026\)Fairness\-aware representation learning for ecg\-based disease prediction in wearable systems\.Note:Accepted, MobiHealth 2026 \(EAI\)\. Preprint:[https://www\.researchgate\.net/publication/396441645](https://www.researchgate.net/publication/396441645)Cited by:[§4\.1](https://arxiv.org/html/2605.08198#S4.SS1.p1.1),[§4\.1](https://arxiv.org/html/2605.08198#S4.SS1.p4.1)\.
- \[17\]F\. Yesmin\(2026\)MedHE: communication\-efficient privacy\-preserving federated learning for healthcare\.Note:Under review, CIBB 2026\. Preprint: arXiv:2511\.09043Cited by:[§4\.3](https://arxiv.org/html/2605.08198#S4.SS3.p1.1),[§4\.3](https://arxiv.org/html/2605.08198#S4.SS3.p2.1)\.
- \[18\]PyHealth: a python library for health predictive modelsExternal Links:[Link](https://arxiv.org/abs/2101.04209)Cited by:[§1](https://arxiv.org/html/2605.08198#S1.p5.1),[§2](https://arxiv.org/html/2605.08198#S2.p1.1)\.

Similar Articles

Introducing HealthBench

OpenAI Blog

OpenAI introduces HealthBench, a new benchmark for evaluating AI systems in healthcare contexts, created with 262 physicians across 60 countries. The benchmark includes 5,000 realistic health conversations with physician-written rubrics to assess model performance on meaningful, trustworthy, and improvable metrics.

OpenAI for Healthcare

OpenAI Blog

OpenAI launches OpenAI for Healthcare, a suite of enterprise products including ChatGPT for Healthcare and API solutions designed to support HIPAA-compliant AI adoption across healthcare organizations. The offering features healthcare-optimized GPT-5 models, evidence-based retrieval with citations, policy integration, and workflow automation tools already deployed at major institutions like Stanford Medicine and UCSF.

Saving lives with AI health coaching

OpenAI Blog

Healthify, a health and fitness AI platform, partnered with OpenAI to enhance its AI-powered nutritionist Ria and food recognition feature Snap, overcoming limitations in accuracy, scalability, and multilingual support. The collaboration represents a significant upgrade to Healthify's decade-long AI-driven health coaching platform.

How to create “humble” AI

MIT News — Artificial Intelligence

MIT researchers propose a framework for 'humble' AI in healthcare that encourages systems to express uncertainty and act as collaborative co-pilots rather than authoritative oracles.