MSc: Heterogeneous Graph Neural Network for credit scoring of the unbanked in Cameroon using mobile-money transaction graphs
# Heterogeneous Graph Neural Networks for Credit Scoring of the Unbanked in Cameroon
A **Heterogeneous Graph Neural Network (HGNN)** that scores the creditworthiness of financially
underserved ("unbanked") users in Cameroon by learning from the *network structure* of their
mobile-money activity (MTN Mobile Money / Orange Money) rather than from a traditional credit history.
The core idea: a person's trustworthiness is reflected in **who and what they transact with**.
By linking transactions through shared National Identity (CNI) super-nodes and behavioural buckets
(utilities, merchants, gambling, capital flight, etc.), the model captures *homophilic* signals of
stability and *heterophilic* signals of risk that a flat, tabular model cannot see.
## Highlights
- **Graph construction** from raw mobile-money-style transactions, with CNI linkage to collapse
multiple accounts into a single real-world identity.
- **Heterogeneous GNN** (message passing over multiple node/edge types) implemented in
PyTorch Geometric.
- Discussion of the **accuracy paradox** on imbalanced fraud/credit data, with AUC-ROC and
confusion-matrix evaluation instead of raw accuracy.
- A **Streamlit inference dashboard** (`app.py`) that runs a live "credit evaluation" for a selected
borrower and recommends a starting micro-loan limit.
## Repository contents
### Notebooks (the pipeline, in logical order)
| Notebook | Purpose |
|----------|---------|
| `01_data_pipeline.ipynb` | Stages 1 to 3: data loading, context injection (network split), cleaning, and CNI super-node linkage |
| `02_hgnn_model_training.ipynb` | Main model: PyTorch Geometric setup, chunked graph building, and HGNN training |
| `03_results_and_figures.ipynb` | Results and figures: cleaned dataframe, NetworkX transaction graph, confusion matrix |
| `diagram_message_passing_graph.ipynb` | Diagram: the computational / message-passing graph |
| `diagram_data_flow_architecture.ipynb` | Diagram: data-flow architecture of the base model …