Metadata-Version: 2.4
Name: fairhealth
Version: 0.1.1
Summary: Trustworthy Healthcare AI: federated learning, fairness auditing, and explainability for clinical settings
Author-email: Farjana Yesmin <farjanayesmin76@gmail.com>
License: MIT License
        
        Copyright (c) 2026 Farjana Yesmin
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Research Paper, https://arxiv.org/abs/2605.08198
Project-URL: Homepage, https://github.com/Farjana-Yesmin/fairhealth
Project-URL: Documentation, https://fairhealth.readthedocs.io
Project-URL: Repository, https://github.com/Farjana-Yesmin/fairhealth
Project-URL: Issues, https://github.com/Farjana-Yesmin/fairhealth/issues
Keywords: healthcare,fairness,federated-learning,explainable-ai,trustworthy-ai,bangladesh,maternal-health,differential-privacy
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Healthcare Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy>=1.24
Requires-Dist: pandas>=2.0
Requires-Dist: scikit-learn>=1.3
Requires-Dist: xgboost>=1.7
Requires-Dist: matplotlib>=3.7
Requires-Dist: scipy>=1.10
Requires-Dist: shap>=0.42
Requires-Dist: scikit-fuzzy>=0.4
Provides-Extra: federated
Requires-Dist: tenseal>=0.3.14; extra == "federated"
Provides-Extra: nlp
Requires-Dist: transformers>=4.35; extra == "nlp"
Requires-Dist: nltk>=3.8; extra == "nlp"
Provides-Extra: dev
Requires-Dist: pytest>=7.4; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Requires-Dist: build>=0.10; extra == "dev"
Dynamic: license-file

# FairHealth

**Trustworthy Healthcare AI — built from peer-reviewed research.**

[![PyPI version](https://badge.fury.io/py/fairhealth.svg)](https://pypi.org/project/fairhealth/)
[![Python 3.9+](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://www.python.org/)
[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)
[![arXiv](https://img.shields.io/badge/arXiv-2605.08198-b31b1b.svg)](https://arxiv.org/abs/2605.08198)

FairHealth is an open-source Python library for building **fair, explainable,
and privacy-preserving** machine learning models for healthcare.

Built by [Farjana Yesmin](https://farjana-yesmin.github.io/) from 5 accepted research papers.

---

## Install

```bash
pip install fairhealth
```

---

## Modules and Results

| Module | What | Paper | Key Result |
|---|---|---|---|
| `fairhealth.fairness` | Demographic parity, equalized odds, disparate impact | MobiHealth 2026 | DI: 0.23 → 0.71 |
| `fairhealth.explain` | SHAP wrappers + Fuzzy-XGBoost hybrid | ICAIHE 2026, Waseda | 88.67% acc, 71.4% clinician preference |
| `fairhealth.federated` | FedAvg + CKKS HE + differential privacy | MedHE, CIBB 2026 | macro-F1=0.950, 97.5% comm reduction |
| `fairhealth.lowresource` | Dengue triage, multilingual, low-bandwidth | DASGRI 2026, Springer | F1=0.802, 75% satisfaction |
| `fairhealth.equity` | Fairness-aware flood aid allocation | CCAI 2026, IEEE | SPD↓41.6%, R²=0.784 |

---

## Quick Example

```python
import fairhealth as fh
import numpy as np

# Fairness audit
from fairhealth.fairness.metrics import demographic_parity_diff
dpd = demographic_parity_diff(
    y_pred    = np.array([1, 0, 1, 0, 1, 0]),
    sensitive = np.array([0, 0, 0, 1, 1, 1])
)
print(f"DPD: {dpd:.4f}")   # → 0.3333

# Dengue triage — English + Bangla
from fairhealth.lowresource.triage import assess_dengue_risk
result = assess_dengue_risk(age=8, gender="male",
                             area_type="urban", district="Dhaka",
                             language="bangla")
print(result["recommendation"])   # বাংলা output

# Flood aid equity
from fairhealth.equity.flood_aid import generate_priority_ranking
rankings = generate_priority_ranking(verbose=False)
print(f"Top priority: {rankings[0]['district']}")  # → Sunamganj

# Federated privacy
from fairhealth.federated.privacy import sparsify
_, rate = sparsify(np.random.randn(1000), sparsity=0.975)
print(f"Communication reduced: {rate:.1%}")  # → 97.5%
```

---

## Research Papers

All papers are accepted. Preprint links below; final proceedings forthcoming.

| Paper | Venue | Preprint | Status |
|---|---|---|---|
| ECG Fairness | MobiHealth 2026 (EAI) | [ResearchGate](https://www.researchgate.net/publication/396441645) | Accepted |
| Maternal Health XAI | ICAIHE 2026, Waseda | [ResearchSquare](https://www.researchsquare.com/article/rs-8584734/v1) | Accepted |
| MedHE Federated | CIBB 2026 | [arXiv:2511.09043](https://arxiv.org/abs/2511.09043) | Under review |
| Dengue Triage | DASGRI 2026, Springer LNNS | [ResearchGate](https://www.researchgate.net/publication/385935162) | Accepted |
| Flood Aid Equity | CCAI 2026 (IEEE), oral | [arXiv:2512.22210](https://arxiv.org/abs/2512.22210) | Accepted |

---

## Datasets (All Public — No Hospital Access Required)

| Dataset | Domain | Source |
|---|---|---|
| PTB-XL (4,367 records) | ECG biosignals | PhysioNet |
| Maternal Health Risk (1,014) | Risk prediction | UCI ML Repository |
| UCI Drug Reviews (215K) | NLP / drug effectiveness | UCI ML Repository |
| Bangladesh Dengue (4,700) | Symptom triage | Kaggle + DGHS |
| Bangladesh PDNA 2022 (87 upazilas) | Flood equity | Government open data |

---

## Cite

```bibtex
@article{yesmin2026fairhealth,
  author  = {Yesmin, Farjana},
  title   = {FairHealth: An Open-Source Python Library for
             Trustworthy Healthcare AI in Low-Resource Settings},
  journal = {arXiv preprint arXiv:2605.08198},
  year    = {2026},
  url     = {https://arxiv.org/abs/2605.08198}
}

@software{fairhealth2026,
  author = {Yesmin, Farjana},
  title  = {FairHealth: Trustworthy Healthcare AI},
  year   = {2026},
  url    = {https://github.com/Farjana-Yesmin/fairhealth}
}
```

**Author:** Farjana Yesmin · [farjana-yesmin.github.io](https://farjana-yesmin.github.io/) · MIT License
