|
Download README.md from InsurancePrediction/insurance_public_weights: direct link, hf CLI and curl.
- Browser
- Download file 10.1 kB
-
https://huggingface.co/InsurancePrediction/insurance_public_weights/resolve/main/README.md
- Command line
-
hf download hf://InsurancePrediction/insurance_public_weights/README.md
-
curl -L -o README.md https://huggingface.co/InsurancePrediction/insurance_public_weights/resolve/main/README.md
10.1 kB
| license: mit | |
| tags: | |
| - medical-imaging | |
| - chest-x-ray | |
| - insurance-prediction | |
| - fairness | |
| - bias-detection | |
| - mimic-cxr | |
| datasets: | |
| - mimic-cxr | |
| # Insurance Paper β Pretrained Weights | |
| Pretrained checkpoints for **"The Unawareness of AI Looking for Health Insurance Type from Normal Chest X-ray Images"**. | |
| All models were trained with seed=123 on the MedGemma-refined subset of [MIMIC-CXR-JPG v2.0.0](https://physionet.org/content/mimic-cxr-jpg/2.0.0/) (`mimic-cxr-gemma`), which contains only normal CXRs filtered by MedGemma. Some baseline and subgroup experiments also include CheXpert checkpoints. | |
| ## Models | |
| | Model | Tag in file/folder names | Architecture | File size | | |
| |-------|--------------------------|--------------|-----------| | |
| | DenseNet121 | `densenet` | DenseNetWithDoubleLinear / _addDemothen2 | ~59 MB | | |
| | MedMamba | `mamba` | VSSM_DoubleLinear / VSSM_Double_addDemothen2 | ~115 MB | | |
| | MedMamba-S (pretrained) | `mamba_pretrained`, `*_s_fix` folders | VSSM (small), initialised from `MedMamba_pretrained_weight/MedMamba_S_PneumoniaMNIST.pth` | ~146 MB | | |
| | Swin Transformer V2 | `swinTF` | SwinTDoubleLinear / _addDemothen2 | ~218 MB | | |
| | Swin Transformer (pretrained, Base) | `swinTFB`, `PretrainedB`, `pretrainedB` | SwinTDoubleLinear / _addDemothen2 | ~690 MB | | |
| ## Repository Structure | |
| ``` | |
| insurance_paper_weights/ | |
| βββ MedMamba_pretrained_weight/ # MedMamba initialisation weights | |
| β βββ MedMamba_PneumoniaMNIST.pth, MedMamba_S_PneumoniaMNIST.pth | |
| β | |
| βββ exp0_medgemma/ # Baselines (CheXpert / MIMIC) | |
| β βββ MedGemma_CheXpert_{densenet,mamba,mamba_pretrained,swinTF,swinTF_pretrainedB}.pt | |
| β βββ MedGemma_MIMIC_{densenet_0228,mamba_0228,mamba_pretrained,swinTF_0228,swinTF_pretrainedB}.pt | |
| β | |
| βββ exp0-2_medgemma/ # Random init / perturbed labels | |
| β βββ {densenet,mamba,mamba_pretrained,swinTF,swinTF_pretrained}_random.pt | |
| β βββ {densenet,mamba_pretrained,swinTF_pretrained}_perturbed[_chexpert].pt | |
| β βββ {densenet,mamba_pretrained,swinTF_pretrained}_patientlevelperturbed[_chexpert].pt | |
| β | |
| βββ exp1_medgemma/ # Patch keep/remove β DenseNet | |
| β βββ densenet_keep/ βββ patch1.pt ... patch9.pt | |
| β βββ densenet_remove/ βββ patch1.pt ... patch9.pt | |
| β | |
| βββ exp1-1_medgemma_s_fix/ # Patch keep/remove β MedMamba-S (pretrained) | |
| β βββ mamba_keep/ βββ patch1.pt ... patch9.pt | |
| β βββ mamba_remove/ βββ patch1.pt ... patch9.pt | |
| β | |
| βββ exp1-2_medgemma/ # Patch keep/remove β Swin Transformer | |
| β βββ swinTF_keep/ βββ patch1.pt ... patch9.pt | |
| β βββ swinTF_remove/ βββ patch1.pt ... patch9.pt | |
| β βββ swinTFB_keep/ βββ SwinTFB_patch1.pt ... SwinTFB_patch9.pt | |
| β βββ swinTFB_remove/ βββ SwinTFB_patch1.pt ... SwinTFB_patch9.pt | |
| β | |
| βββ exp2_medgemma_s_fix/ # Resolution β MedMamba-S (pretrained) | |
| β βββ mamba_2.pt ... mamba_224.pt (8 files) | |
| β | |
| βββ exp2-1_medgemma/ # Resolution β DenseNet | |
| β βββ densenet_2.pt ... densenet_224.pt (8 files) | |
| β | |
| βββ exp2-2_medgemma/ # Resolution β Swin Transformer (pretrained Base) | |
| β βββ PretrainedSwinTFB_2.pt ... PretrainedSwinTFB_224.pt (8 files) | |
| β | |
| βββ exp3_medgemma_s_fix/ # Demographics β MedMamba-S (pretrained) | |
| β βββ sex.pt, age.pt, race.pt, sexage.pt, sexrace.pt, agerace.pt, sexagerace.pt | |
| β | |
| βββ exp3-1_medgemma/ # Demographics β DenseNet | |
| β βββ (same 7 files) | |
| β | |
| βββ exp3-2_medgemma/ # Demographics β Swin Transformer | |
| β βββ {combo}.pt (7 files) | |
| β βββ {combo}_PretrainedB_swinTF.pt (7 files) | |
| β | |
| βββ exp4_medgemma_s_fix/ # Frequency filtering β MedMamba-S (pretrained) | |
| β βββ highpass/ βββ 1Hz.pt ... 400Hz.pt | |
| β βββ lowpass/ βββ 1Hz.pt ... 400Hz.pt | |
| β | |
| βββ exp4-1_medgemma/ # Frequency filtering β Swin Transformer | |
| β βββ highpass/ βββ {F}Hz.pt, {F}HighPass_PretrainedB_swinTF.pt | |
| β βββ lowpass/ βββ {F}Hz.pt, {F}LowPass_PretrainedB_swinTF.pt | |
| β | |
| βββ exp4-2_medgemma/ # Frequency filtering β DenseNet | |
| β βββ highpass/ βββ 1Hz.pt ... 400Hz.pt | |
| β βββ lowpass/ βββ 1Hz.pt ... 400Hz.pt | |
| β | |
| βββ exp5_medgemma/ # Single-subgroup training | |
| βββ Only{Female,Male,Old,White}_{model}[_CheXpert]/Only{...}_{model}[_CheXpert].pt | |
| ``` | |
| ## Checkpoint Table | |
| | Experiment | Description | Model(s) | Config | # Checkpoints | Path | | |
| |------------|-------------|----------|--------|---------------|------| | |
| | **exp0** | Baselines | DenseNet, MedMamba, MedMamba-S, SwinT, SwinT-B | 5 models x 2 datasets | 10 | `exp0_medgemma/MedGemma_{CheXpert,MIMIC}_{model}.pt` | | |
| | **exp0-2** | Random init / perturbed labels | DenseNet, MedMamba, MedMamba-S, SwinT, SwinT-B | random, perturbed, patient-level perturbed (MIMIC + CheXpert) | 17 | `exp0-2_medgemma/{model}_{setting}.pt` | | |
| | **exp1** | Patch keep/remove | DenseNet | 9 patches x 2 | 18 | `exp1_medgemma/densenet_{keep,remove}/patch{N}.pt` | | |
| | **exp1-1** | Patch keep/remove | MedMamba-S | 9 patches x 2 | 18 | `exp1-1_medgemma_s_fix/mamba_{keep,remove}/patch{N}.pt` | | |
| | **exp1-2** | Patch keep/remove | SwinT, SwinT-B | 9 patches x 2 x 2 models | 36 | `exp1-2_medgemma/{swinTF,swinTFB}_{keep,remove}/...` | | |
| | **exp2** | Resolution | MedMamba-S | 8 resolutions | 8 | `exp2_medgemma_s_fix/mamba_{N}.pt` | | |
| | **exp2-1** | Resolution | DenseNet | 8 resolutions | 8 | `exp2-1_medgemma/densenet_{N}.pt` | | |
| | **exp2-2** | Resolution | SwinT-B | 8 resolutions | 8 | `exp2-2_medgemma/PretrainedSwinTFB_{N}.pt` | | |
| | **exp3** | Demographics (addDemo) | MedMamba-S | 7 demo combos | 7 | `exp3_medgemma_s_fix/{combo}.pt` | | |
| | **exp3-1** | Demographics (addDemo) | DenseNet | 7 demo combos | 7 | `exp3-1_medgemma/{combo}.pt` | | |
| | **exp3-2** | Demographics (addDemo) | SwinT, SwinT-B | 7 demo combos x 2 | 14 | `exp3-2_medgemma/{combo}[_PretrainedB_swinTF].pt` | | |
| | **exp4** | Freq filtering (HP+LP) | MedMamba-S | 8 freq x 2 | 16 | `exp4_medgemma_s_fix/{highpass,lowpass}/{F}Hz.pt` | | |
| | **exp4-1** | Freq filtering (HP+LP) | SwinT, SwinT-B | 8 freq x 2 x 2 | 32 | `exp4-1_medgemma/{highpass,lowpass}/...` | | |
| | **exp4-2** | Freq filtering (HP+LP) | DenseNet | 8 freq x 2 | 16 | `exp4-2_medgemma/{highpass,lowpass}/{F}Hz.pt` | | |
| | **exp5** | Single-subgroup training | DenseNet, MedMamba, MedMamba-S, SwinT, SwinT-B | 4 subgroups x 5 models x 2 datasets | 40 | `exp5_medgemma/Only{Group}_{model}[_CheXpert]/...` | | |
| **Total: 255 checkpoints** (+ 2 MedMamba initialisation weights in `MedMamba_pretrained_weight/`) | |
| - **Demo combos** (exp3): `sex`, `age`, `race`, `sexage`, `sexrace`, `agerace`, `sexagerace` | |
| - **Frequencies** (exp4): 1, 5, 10, 25, 50, 100, 200, 400 Hz | |
| - **Resolutions** (exp2): 2, 4, 7, 14, 28, 56, 112, 224 | |
| - **Patches** (exp1): 1-9, corresponding to a 3x3 grid on 448x448 images (left-to-right, top-to-bottom) | |
| - **Subgroups** (exp5): `OnlyFemale`, `OnlyMale`, `OnlyOld`, `OnlyWhite` | |
| ## Usage | |
| ### Download all weights | |
| ```bash | |
| git lfs install | |
| git clone https://huggingface.co/InsurancePrediction/insurance_paper_weights | |
| ``` | |
| ### Download a single experiment | |
| ```python | |
| from huggingface_hub import snapshot_download | |
| snapshot_download( | |
| repo_id="InsurancePrediction/insurance_paper_weights", | |
| allow_patterns="exp3-1_medgemma/*", | |
| local_dir="./weights" | |
| ) | |
| ``` | |
| ### Load a checkpoint | |
| ```python | |
| import torch | |
| # Base model (exp1, exp2, exp4) | |
| from model import DenseNetWithDoubleLinear | |
| model = DenseNetWithDoubleLinear(num_classes=2, dropout_prob=0) | |
| ckpt = torch.load("exp1_medgemma/densenet_keep/patch1.pt", map_location="cpu") | |
| model.load_state_dict(ckpt["model_state_dict"]) | |
| # Demographics model (exp3) | |
| from model import DenseNetWithDoubleLinear_addDemothen2 | |
| model = DenseNetWithDoubleLinear_addDemothen2(num_classes=2, demo_size=5) # e.g. sexage -> 2+3=5 | |
| ckpt = torch.load("exp3-1_medgemma/sexage.pt", map_location="cpu") | |
| model.load_state_dict(ckpt["model_state_dict"]) | |
| ``` | |
| ### Mapping from HF paths to original training paths | |
| | HF path | Original training path | | |
| |---------|----------------------| | |
| | `exp2-1_medgemma/densenet_{N}.pt` | `JAMA_codes_medgemma/{N}_mg_exp2/densenet/Rand123/...` | | |
| | `exp3-1_medgemma/{combo}.pt` | `JAMA_codes_medgemma/{combo}_mg_exp3-1/densenet/Rand123/...` | | |
| | `exp3-2_medgemma/{combo}.pt` | `JAMA_codes_medgemma/{combo}_mg_exp3-2/swinTF/Rand123/...` | | |
| | `exp4-1_medgemma/{highpass,lowpass}/{F}Hz.pt` | `JAMA_codes_medgemma/{F}{HighPass,LowPass}_mg_exp4-1/swinTF/Rand123/...` | | |
| | `exp4-2_medgemma/{highpass,lowpass}/{F}Hz.pt` | `JAMA_codes_medgemma/{F}{HighPass,LowPass}_mg_exp4-2/densenet/Rand123/...` | | |
| Bootstrap evaluation results: `bootstrap_results/` in the [code repository](https://github.com/altis5526/Insurance-Prediction-from-Normal-CXRs-Public-Version). | |
| ## Training Details | |
| - **Dataset**: mimic-cxr-gemma (MedGemma-refined normal frontal CXRs from MIMIC-CXR-JPG v2.0.0); CheXpert for `*_CheXpert` / `*_chexpert` checkpoints | |
| - **Task**: Binary classification β Private vs. Public/Government insurance | |
| - **Image size**: 448 x 448 | |
| - **Seed**: 123 | |
| - **Selection**: Best validation AUC checkpoint | |
| ## Citation | |
| ```bibtex | |
| @article{chen2025algorithms, | |
| title={Algorithms Trained on Normal Chest X-rays Can Predict Health Insurance Types}, | |
| author={Chen, Chi-Yu and Abulibdeh, Rawan and Asgari, Arash and Ord{\'o}{\~n}ez, Sebasti{\'a}n Andr{\'e}s Cajas and Celi, Leo Anthony and Goode, Deirdre and Hamidi, Hassan and Seyyed-Kalantari, Laleh and McCague, Ned and Sounack, Thomas and others}, | |
| journal={arXiv preprint arXiv:2511.11030}, | |
| year={2025} | |
| } | |
| ``` | |
| ## Code | |
| [Code Repository](https://github.com/altis5526/Insurance-Prediction-from-Normal-CXRs-Public-Version) | |