vkatg's picture
Update README.md
d205e64 verified
|
Raw
History Blame
8.99 kB
---
pretty_name: Streaming PHI Deidentification Benchmark
license: mit
language:
- en
tags:
- pii
- phi
- de-identification
- deidentification
- healthcare
- healthcare-nlp
- clinical-text
- medical-nlp
- privacy
- hipaa
- reinforcement-learning
- streaming
- multimodal
- audit-log
- synthetic
- benchmark
- evaluation
- synthetic-data
size_categories:
- 1K<n<10K
configs:
- config_name: default
data_files:
- split: train
path: audit_log.jsonl
- config_name: signed
data_files:
- split: train
path: audit_log_signed_adaptive.jsonl
- config_name: crossmodal
data_files:
- split: train
path: data/crossmodal_train.jsonl
---
# Streaming PHI De-Identification Benchmark
A benchmark dataset for evaluating adaptive de-identification policies on multimodal streaming healthcare data. Every record is fully synthetic. No real patient data, protected health information, or identifiable individuals are present anywhere in this dataset.
This dataset is different from existing PHI benchmarks. Most evaluate masking quality on static, single-modality documents. This dataset captures how re-identification risk accumulates across modalities and time, the same subject appearing across clinical notes, ASR transcripts, imaging proxies, waveform data, and audio metadata over a longitudinal stream.
It supports:
- Benchmarking adaptive vs static de-identification policies
- Studying cross-modal PHI linkage behavior
- Evaluating privacy-utility tradeoffs in streaming systems
- Reproducing results from the associated research implementation
## Quick Start
```python
# Install dependencies
# pip install phi-exposure-guard datasets pandas
import pandas as pd
import json
# Load policy benchmark results
df = pd.read_csv("policy_metrics.csv")
print(df)
# Load full audit log
with open("audit_log.jsonl") as f:
events = [json.loads(line) for line in f]
# Filter adaptive policy events
adaptive = [e for e in events if e["policy_run"] == "adaptive"]
# Filter by modality
text_events = [e for e in events if e["modality"] == "text"]
```
Or load via the Hugging Face datasets library:
```python
from datasets import load_dataset
# Base audit log (default config)
ds = load_dataset("vkatg/streaming-phi-deidentification-benchmark")
# Signed adaptive audit trail (includes _signature, _record_hash, _chain_ts)
ds_signed = load_dataset("vkatg/streaming-phi-deidentification-benchmark", "signed")
```
## Motivation
Automatic de-identification of healthcare data is critical for safe secondary use in AI research and clinical analytics. Existing PHI datasets have significant limitations for streaming and multimodal evaluation:
- They evaluate each document in isolation with no memory of prior events
- They are restricted to single modalities, usually clinical text only
- Most require data use agreements and are not openly available
- None model cumulative re-identification risk across events and modalities
This dataset was created to fill that gap — providing a reproducible, open benchmark for evaluating exposure-aware and adaptive de-identification strategies in realistic streaming pipelines.
## Privacy-Utility Tradeoff
![Privacy-Utility Tradeoff](privacy_utility_curve.png)
The adaptive policy achieves full utility while keeping leakage close to the redact floor. It only escalates masking strength when cumulative exposure actually justifies it, not on every record by default.
## Policy Benchmark Results
| Policy | Leak Total | Utility Proxy | Mean Latency (ms) | P90 Latency (ms) |
| --- | --- | --- | --- | --- |
| raw | 3.03 | 1.0 | 0.123 | 0.154 |
| weak | 2.0 | 0.51 | 0.141 | 0.18 |
| pseudo | 0.51 | 1.0 | 0.159 | 0.188 |
| redact | 0.51 | 0.51 | 0.157 | 0.192 |
| adaptive | 0.56 | 1.0 | 1.16 | 1.237 |
## Comparison with Existing PHI Datasets
| Dataset | Modality | Access | Real Data | Streaming | Size |
| --- | --- | --- | --- | --- | --- |
| i2b2 2014 | Text only | DUA required | Yes | No | 1,304 records |
| PhysioNet deid | Text only | DUA required | Yes | No | 2,434 notes |
| This dataset | Text, ASR, Image, Waveform, Audio | Open | No (synthetic) | Yes | 1K-10K events |
The key distinction is multimodal streaming evaluation. Existing datasets evaluate masking quality on static text records in isolation. This dataset captures how re-identification risk accumulates across modalities and time steps.
## Dataset Structure
The primary file is `audit_log.jsonl`. Each line is one masking decision for one event.
### Key Fields
| Field | Description |
| --- | --- |
| `event_id` | Event identifier within the stream |
| `patient_key` | Synthetic subject identifier |
| `modality` | Data modality: `text`, `asr`, `image_proxy`, `waveform`, `audio` |
| `policy_run` | Which policy was evaluated: `raw`, `weak`, `pseudo`, `redact`, `adaptive` |
| `chosen_policy` | The policy actually applied |
| `reason` | Why that policy was selected |
| `risk` | Cumulative re-identification risk score at decision time |
| `localized_remask_trigger` | Whether cross-modal synergy triggered pseudonym versioning |
| `latency_ms` | Decision latency in milliseconds |
| `leaks_after` | Residual PHI leakage after masking |
| `policy_version` | Policy version token |
| `decision_blob` | Full structured decision record including risk components, DCPG graph state, CMO execution log, and cross-modal matches |
### Sample Record
```json
{
"event_id": "evt_0",
"patient_key": "patient_1",
"modality": "text",
"policy_run": "adaptive",
"chosen_policy": "pseudo",
"reason": "risk_threshold_exceeded",
"risk": 0.43,
"localized_remask_trigger": false,
"latency_ms": 1.12,
"leaks_after": 0.0,
"policy_version": "v1"
}
```
### Modalities
Each event is evaluated across five modalities representing a realistic multimodal healthcare stream:
- `text` — clinical note proxy
- `asr` — speech recognition transcript proxy
- `image_proxy` — imaging metadata proxy
- `waveform` — physiological monitoring proxy
- `audio` — audio metadata proxy
### Policies
- `raw` — no masking applied
- `weak` — minimal token suppression
- `pseudo` — pseudonymization
- `redact` — full redaction
- `adaptive` — risk-governed dynamic policy selection
## System Architecture
The dataset was generated by a modular pipeline with the following components:
| Module | Description |
| --- | --- |
| `context_state.py` | Per-subject exposure state, persisted via SQLite |
| `controller.py` | Risk scoring and adaptive policy selection |
| `dcpg.py` | Dynamic Context Persistence Graph — tracks cross-modal identity linkage |
| `dcpg_crdt.py` | CRDT-based federated graph merging for distributed deployments |
| `cmo_registry.py` | Composable Masking Operator registry and DAG execution |
| `flow_controller.py` | DAG-based policy flow controller with audit provenance |
| `rl_agent.py` | PPO reinforcement learning agent for adaptive policy control |
| `audit_signing.py` | Cryptographic signing and FHIR export of audit records |
| `phi_detector.py` | PHI detection and leakage measurement |
| `masking_ops.py` | Token-level masking operations per policy |
## Additional Files
| File | Description |
| --- | --- |
| `policy_metrics.csv` | Aggregated per-policy evaluation metrics |
| `latency_summary.csv` | Latency distribution per policy |
| `audit_log_signed_adaptive.jsonl` | Cryptographically signed adaptive policy audit trail |
| `EXPERIMENT_REPORT.md` | Full experiment report with leakage breakdown by modality |
## Limitations
This dataset is fully synthetic and designed to model structural properties of longitudinal healthcare streams. It does not contain real clinical language, real diagnoses, or real patient records. Models trained or evaluated on this dataset should be validated on real clinical data before deployment. The dataset covers English language proxies only.
## Source Code and Reproduction
All data in this dataset was generated by the open-source research implementation:
GitHub: [azithteja91/phi-exposure-guard](https://github.com/azithteja91/phi-exposure-guard)
Hugging Face Space: [vkatg/amphi-rl-dpgraph](https://huggingface.co/spaces/vkatg/amphi-rl-dpgraph)
Colab demo: [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/azithteja91/phi-exposure-guard/blob/main/notebooks/demo_colab.ipynb)
To regenerate locally:
```bash
git clone https://github.com/azithteja91/phi-exposure-guard.git
cd phi-exposure-guard
pip install -e .
python -m amphi_rl_dpgraph.run_demo
```
## Citation
If you use this dataset in academic or technical work, please cite via the `CITATION.cff` file in the GitHub repository.
## License
MIT
## Note on Intended Use
This dataset is intended for privacy research, streaming system design, and reproducible evaluation of de-identification strategies. It is not derived from real clinical data and should not be used as a substitute for validated compliance infrastructure.