File size: 13,819 Bytes
16faf97 2a2b7e2 16faf97 2a2b7e2 9ff479f 2a2b7e2 2aad8d0 2a2b7e2 2aad8d0 9ed18b4 2aad8d0 a616eb1 2a2b7e2 2aad8d0 2a2b7e2 2aad8d0 2a2b7e2 2aad8d0 2a2b7e2 9ff479f b2aa174 9ff479f 2a2b7e2 2aad8d0 2a2b7e2 030451f 2aad8d0 9ed18b4 2aad8d0 92e2227 2aad8d0 2a2b7e2 a616eb1 2a2b7e2 9ff479f b2aa174 9ff479f b2aa174 9ff479f b2aa174 2a2b7e2 2aad8d0 2a2b7e2 a616eb1 9ff479f b2aa174 9ff479f a616eb1 9ff479f a616eb1 030451f a616eb1 9ff479f b2aa174 9ff479f 2a2b7e2 9ff479f 2a2b7e2 9ff479f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 | ---
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 on [MIMIC-CXR-JPG v2.0.0](https://physionet.org/content/mimic-cxr-jpg/2.0.0/) with seed=123. MedGemma experiments use the MedGemma-refined subset (`mimic-cxr-gemma`), containing only normal CXRs filtered by MedGemma.
## Models
| Model | Architecture | Params | File size |
|-------|-------------|--------|-----------|
| MedMamba | VSSM_DoubleLinear / VSSM_Double_addDemothen2 | ~29M | ~115 MB |
| DenseNet121 | DenseNetWithDoubleLinear / _addDemothen2 | ~8M | ~59 MB |
| Swin Transformer V2 | SwinTDoubleLinear / _addDemothen2 | ~50M | ~218 MB |
## Repository Structure
```
insurance_paper_weights/
βββ exp0/ # Baselines (CheXpert / MIMIC)
β βββ CheXpert/
β β βββ densenet.pt, mamba.pt, swinTF.pt
β βββ MIMIC/
β βββ densenet.pt, mamba.pt, swinTF.pt
β
βββ exp0-2/ # Random Initialization
β βββ swinTF_random.pt
β
βββ exp1/ # Patch keep/remove β DenseNet
β βββ densenet_keep/
β β βββ patch1.pt ... patch9.pt
β βββ densenet_remove/
β βββ patch1.pt ... patch9.pt
β
βββ exp1-1/ # Patch keep/remove β MedMamba
β βββ mamba_keep/
β β βββ patch1.pt ... patch9.pt
β βββ mamba_remove/
β βββ patch1.pt ... patch9.pt
β
βββ exp1-2/ # Patch keep/remove β DenseNet + Swin Transformer
β βββ densenet_keep/
β β βββ patch1.pt ... patch9.pt
β βββ densenet_remove/
β β βββ patch1.pt ... patch9.pt
β βββ swinTF_keep/
β β βββ patch1.pt ... patch9.pt
β βββ swinTF_remove/
β βββ patch1.pt ... patch9.pt
β
βββ exp2/ # Resolution β MedMamba
β βββ mamba_2.pt ... mamba_224.pt (8 files)
β
βββ exp2-1/ # Resolution β DenseNet
β βββ densenet_2.pt ... densenet_224.pt (8 files)
β
βββ exp2-2/ # Resolution β Swin Transformer
β βββ swinTF_4.pt ... swinTF_224.pt (7 files)
β
βββ exp3/ # Demographics β MedMamba
β βββ sex.pt, age.pt, race.pt
β βββ sexage.pt, sexrace.pt, agerace.pt
β βββ sexagerace.pt
β
βββ exp3-1/ # Demographics β DenseNet
β βββ (same 7 files)
β
βββ exp3-2/ # Demographics β Swin Transformer
β βββ (same 7 files)
β
βββ exp4/ # Frequency filtering β MedMamba
β βββ highpass/
β β βββ 1Hz.pt, 5Hz.pt, ... 400Hz.pt
β βββ lowpass/
β βββ 1Hz.pt, 5Hz.pt, ... 400Hz.pt
β
βββ exp4-1/ # Frequency filtering β Swin Transformer
β βββ highpass/ βββ lowpass/
β
βββ exp4-2/ # Frequency filtering β DenseNet
β βββ highpass/ βββ lowpass/
β
βββ exp2_medgemma/ # MedGemma Resolution β MedMamba
β βββ mamba_2.pt ... mamba_224.pt (8 files)
β
βββ exp2-1_medgemma/ # MedGemma Resolution β DenseNet
β βββ densenet_2.pt ... densenet_224.pt (8 files)
β
βββ exp2-2_medgemma/ # MedGemma Resolution β Swin Transformer
β βββ swinTF_4.pt ... swinTF_224.pt (7 files)
β
βββ exp3_medgemma/ # MedGemma Demographics β MedMamba
β βββ sex.pt, age.pt, race.pt
β βββ sexage.pt, sexrace.pt, agerace.pt
β βββ sexagerace.pt
β
βββ exp3-1_medgemma/ # MedGemma Demographics β DenseNet
β βββ (same 7 files)
β
βββ exp3-2_medgemma/ # MedGemma Demographics β Swin Transformer
β βββ (same 7 files)
β
βββ exp4_medgemma/ # MedGemma Frequency filtering β MedMamba
β βββ highpass/
β β βββ 1Hz.pt, 5Hz.pt, ... 400Hz.pt
β βββ lowpass/
β βββ 1Hz.pt, 5Hz.pt, ... 400Hz.pt
β
βββ exp4-1_medgemma/ # MedGemma Frequency filtering β Swin Transformer
β βββ highpass/ βββ lowpass/
β
βββ exp4-2_medgemma/ # MedGemma Frequency filtering β DenseNet
βββ highpass/ βββ lowpass/
```
## Checkpoint Table
> **Note:** All experiments are trained and available.
| Experiment | Description | Model | Config | # Checkpoints | HF path | Available? |
|------------|-------------|-------|--------|---------------|---------|------------|
| **exp0** | Baselines (CheXpert/MIMIC) | All 3 | β | 6 | `exp0/{dataset}/{model}.pt` | Yes |
| **exp0-2** | Random Initialisation | SwinT | β | 1 | `exp0-2/swinTF_random.pt` | Yes |
| **exp1** | Patch keep/remove | DenseNet | 9 patches x 2 | 18 | `exp1/densenet_{keep/remove}/patch{N}.pt` | Yes |
| **exp1-1** | Patch keep/remove | MedMamba | 9 patches x 2 | 18 | `exp1-1/mamba_{keep/remove}/patch{N}.pt` | Yes |
| **exp1-2** | Patch keep/remove | SwinT | 9 patches x 2 | 18 | `exp1-2/swinTF_{keep/remove}/patch{N}.pt` | Yes |
| **exp2** | Resolution | MedMamba | 8 resolutions | 8 | `exp2/mamba_{N}.pt` | Yes |
| **exp2-1** | Resolution | DenseNet | 8 resolutions | 8 | `exp2-1/densenet_{N}.pt` | Yes |
| **exp2-2** | Resolution | SwinT | 7 resolutions | 7 | `exp2-2/swinTF_{N}.pt` | Yes |
| **exp3** | Demographics (addDemo) | MedMamba | 7 demo combos | 7 | `exp3/{combo}.pt` | Yes |
| **exp3-1** | Demographics (addDemo) | DenseNet | 7 demo combos | 7 | `exp3-1/{combo}.pt` | Yes |
| **exp3-2** | Demographics (addDemo) | SwinT | 7 demo combos | 7 | `exp3-2/{combo}.pt` | Yes |
| **exp4** | Freq filtering (HP+LP) | MedMamba | 8 freq x 2 | 16 | `exp4/{highpass,lowpass}/{F}Hz.pt` | Yes |
| **exp4-1** | Freq filtering (HP+LP) | SwinT | 8 freq x 2 | 16 | `exp4-1/{highpass,lowpass}/{F}Hz.pt` | Yes |
| **exp4-2** | Freq filtering (HP+LP) | DenseNet | 8 freq x 2 | 16 | `exp4-2/{highpass,lowpass}/{F}Hz.pt` | Yes |
**Original: 153 checkpoints**
### MedGemma Experiments (mimic-cxr-gemma dataset)
| Experiment | Description | Model | Config | # Checkpoints | HF path | Available? |
|------------|-------------|-------|--------|---------------|---------|------------|
| **exp2** | Resolution | MedMamba | 8 resolutions | 8 | `exp2_medgemma/mamba_{N}.pt` | Yes |
| **exp2-1** | Resolution | DenseNet | 8 resolutions | 8 | `exp2-1_medgemma/densenet_{N}.pt` | Yes |
| **exp2-2** | Resolution | SwinT | 7 resolutions | 7 | `exp2-2_medgemma/swinTF_{N}.pt` | Yes |
| **exp3** | Demographics (addDemo) | MedMamba | 7 demo combos | 7 | `exp3_medgemma/{combo}.pt` | Yes |
| **exp3-1** | Demographics (addDemo) | DenseNet | 7 demo combos | 7 | `exp3-1_medgemma/{combo}.pt` | Yes |
| **exp3-2** | Demographics (addDemo) | SwinT | 7 demo combos | 7 | `exp3-2_medgemma/{combo}.pt` | Yes |
| **exp4** | Freq filtering (HP+LP) | MedMamba | 8 freq x 2 | 16 | `exp4_medgemma/{highpass,lowpass}/{F}Hz.pt` | Yes |
| **exp4-1** | Freq filtering (HP+LP) | SwinT | 8 freq x 2 | 16 | `exp4-1_medgemma/{highpass,lowpass}/{F}Hz.pt` | Yes |
| **exp4-2** | Freq filtering (HP+LP) | DenseNet | 8 freq x 2 | 16 | `exp4-2_medgemma/{highpass,lowpass}/{F}Hz.pt` | Yes |
**MedGemma: 92 checkpoints**
**Total: 153 original + 92 MedGemma = 245 unique checkpoints**
- **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)
## Usage
### Download all weights
```bash
git lfs install
git clone https://huggingface.co/InsurancePrediction/insurance_paper_weights
```
### Download a single experiment
```bash
# Using huggingface_hub
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="InsurancePrediction/insurance_paper_weights",
allow_patterns="exp3-1/*",
local_dir="./weights"
)
```
### Load a checkpoint
```python
import torch
# Base model (exp1, exp4)
from model import DenseNetWithDoubleLinear
model = DenseNetWithDoubleLinear(num_classes=2, dropout_prob=0)
ckpt = torch.load("exp1-2/densenet_keep/patch1.pt", map_location="cpu")
model.load_state_dict(ckpt["model_state_dict"])
# Demographics model (exp3)
from MedMamba.MedMamba import VSSM_Double_addDemothen2
model = VSSM_Double_addDemothen2(num_classes=2, demo_size=5) # e.g. sexage -> 2+3=5
ckpt = torch.load("exp3/sexage.pt", map_location="cpu")
model.load_state_dict(ckpt["model_state_dict"])
```
### Mapping from HF paths to original training paths
Weights in JAMA_codes were trained on ORCD. Weights marked with (*) were trained by Chi-Yu and uploaded directly β no JAMA_codes equivalent.
| HF path | Original training path |
|---------|----------------------|
| `exp0/{dataset}/{model}.pt` | Trained by Chi-Yu |
| `exp0-2/swinTF_random.pt` | Trained by Chi-Yu |
| `exp1-1/mamba_keep/patch{N}.pt` | Trained by Chi-Yu |
| `exp1-1/mamba_remove/patch{N}.pt` | `JAMA_codes/exp1-1/Rand123/Rand123_patchidx{N}_exp1-1_model_aucbest.pt` |
| `exp1-2/densenet_keep/patch{N}.pt` | `JAMA_codes/densenet_keep/Rand123/Rand123_patchidx{N}_densenet_keep_model_aucbest.pt` |
| `exp1-2/densenet_remove/patch{N}.pt` | Trained by Chi-Yu |
| `exp1-2/swinTF_keep/patch{N}.pt` | `JAMA_codes/swinTF_keep/Rand123/Rand123_patchidx{N}_swinTF_keep_model_aucbest.pt` |
| `exp1-2/swinTF_remove/patch{N}.pt` | `JAMA_codes/swinTF_remove/Rand123/Rand123_patchidx{N}_swinTF_remove_model_aucbest.pt` |
| `exp2/mamba_{N}.pt` | Trained by Chi-Yu |
| `exp2-1/densenet_{N}.pt` | Trained by Chi-Yu |
| `exp2-2/swinTF_{N}.pt` | Trained by Chi-Yu |
| `exp3/{combo}.pt` | `JAMA_codes/{combo}_weights/mamba/sunday/Rand123/Rand123_{combo}_mamba_sunday_model_aucbest.pt` |
| `exp3-1/{combo}.pt` | `JAMA_codes/{combo}_weights/densenet/sunday/Rand123/Rand123_{combo}_densenet_sunday_model_aucbest.pt` |
| `exp3-2/{combo}.pt` | `JAMA_codes/{combo}_weights/swin/sunday/Rand123/Rand123_{combo}_swin_sunday_model_aucbest.pt` |
| `exp4/{highpass,lowpass}/{F}Hz.pt` | `JAMA_codes/{F}{HighPass,LowPass}_weights/mamba/{direction}/Rand123/...` |
| `exp4-1/{highpass,lowpass}/{F}Hz.pt` | `JAMA_codes/{F}{HighPass,LowPass}_swin_freq/Rand123/...` |
| `exp4-2/{highpass,lowpass}/{F}Hz.pt` | `JAMA_codes/{F}{HighPass,LowPass}_densenet_freq/Rand123/...` |
| `exp2_medgemma/mamba_{N}.pt` | `JAMA_codes_medgemma/{N}_mg_exp2/mamba/Rand123/...` |
| `exp2-1_medgemma/densenet_{N}.pt` | `JAMA_codes_medgemma/{N}_mg_exp2/densenet/Rand123/...` |
| `exp2-2_medgemma/swinTF_{N}.pt` | `JAMA_codes_medgemma/{N}_mg_exp2/swinTF/Rand123/...` |
| `exp3_medgemma/{combo}.pt` | `JAMA_codes_medgemma/{combo}_mg_exp3/mamba/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_medgemma/{highpass,lowpass}/{F}Hz.pt` | `JAMA_codes_medgemma/{F}{HighPass,LowPass}_mg_exp4/mamba/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 Status
All 153 original bootstrap evaluations complete (n_bootstrap=20, sample_size=1000, seed=42).
| Experiment | Evaluations | Status |
|-----------|-------------|--------|
| **exp0** | 6 (3 models x 2 datasets) | Done |
| **exp0-2** | 1 | Done |
| **exp1-1** | 18 (mamba keep + remove x 9 patches) | Done |
| **exp1-2** | 36 (densenet keep/remove + swinTF keep/remove x 9 patches) | Done |
| **exp2/2-1/2-2** | 23 (8+8+7 resolutions) | Done |
| **exp3/3-1/3-2** | 21 (3 models x 7 combos) | Done |
| **exp4/4-1/4-2** | 48 (3 models x 2 directions x 8 freqs) | Done |
### MedGemma Bootstrap Status
| Experiment | Evaluations | Status |
|-----------|-------------|--------|
| **MedGemma exp2/2-1/2-2** | 23 (8+8+7 resolutions) | Done |
| **MedGemma exp3/3-1/3-2** | 21 (3 models x 7 combos) | Done |
| **MedGemma exp4/4-1/4-2** | 48 (3 models x 2 directions x 8 freqs) | Done |
Results: `bootstrap_results/` in the [code repository](https://github.com/altis5526/Insurance-Project-Journal-version-).
## Training Details
- **Dataset (original)**: MIMIC-CXR-JPG v2.0.0 (normal frontal chest X-rays)
- **Dataset (MedGemma)**: mimic-cxr-gemma (MedGemma-refined, normal CXRs only)
- **Task**: Binary classification β Private vs. Public/Government insurance
- **Image size**: 448 x 448
- **Seed**: 123
- **Selection**: Best validation AUC checkpoint
## Citation
```bibtex
@inproceedings{chen2025unawareness,
title={The Unawareness of AI Looking for Health Insurance Type from Normal Chest X-ray Images},
author={Chen, Chi-Yu and others},
year={2025}
}
```
## Code
[Code Repository](https://github.com/altis5526/Insurance-Project-Journal-version-) <!-- Update with actual repo URL -->
|