Update README.md
Browse files
README.md
CHANGED
|
@@ -1,14 +1,16 @@
|
|
| 1 |
# ModelAuditor Pre-trained Models
|
| 2 |
|
| 3 |
-
Pre-trained
|
| 4 |
|
| 5 |
## Models
|
| 6 |
|
| 7 |
-
| Model | Domain | Task | Input Size |
|
| 8 |
-
|-------|--------|------|------------|
|
| 9 |
-
| `camelyon17_resnet50_1_224.pt` | Pathology | Tumor detection in lymph node sections | 224x224 |
|
| 10 |
-
| `chexpert_resnet50_1_224.pt` | Radiology | Chest X-ray classification | 224x224 |
|
| 11 |
-
| `ham10000_resnet50_1_224.pt` | Dermatology | Skin lesion classification (melanoma vs. benign keratosis) | 224x224 |
|
|
|
|
|
|
|
| 12 |
|
| 13 |
## Usage
|
| 14 |
|
|
@@ -23,9 +25,10 @@ huggingface-cli download lukaskuhndkfz/ModelAuditor --local-dir models
|
|
| 23 |
# Or download individually
|
| 24 |
huggingface-cli download lukaskuhndkfz/ModelAuditor ham10000_resnet50_1_224.pt --local-dir models
|
| 25 |
```
|
| 26 |
-
Use with ModelAuditor
|
| 27 |
|
| 28 |
-
|
|
|
|
|
|
|
| 29 |
git clone https://github.com/lukaskuhndkfz/ModelAuditor
|
| 30 |
cd ModelAuditor
|
| 31 |
pip install -e ".[medical]"
|
|
@@ -34,8 +37,9 @@ pip install -e ".[medical]"
|
|
| 34 |
python main.py --model resnet50 --dataset ham10000 --weights models/ham10000_resnet50_1_224.pt
|
| 35 |
```
|
| 36 |
|
| 37 |
-
Load in PyTorch
|
| 38 |
-
|
|
|
|
| 39 |
import torch
|
| 40 |
from torchvision.models import resnet50
|
| 41 |
|
|
@@ -44,8 +48,25 @@ model.load_state_dict(torch.load("ham10000_resnet50_1_224.pt", map_location="cpu
|
|
| 44 |
model.eval()
|
| 45 |
```
|
| 46 |
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
|
| 49 |
- Camelyon17: https://wilds.stanford.edu/datasets/#camelyon17
|
| 50 |
- CheXpert: https://stanfordmlgroup.github.io/competitions/chexpert/
|
| 51 |
-
- HAM10000: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/DBW86T
|
|
|
|
|
|
|
|
|
| 1 |
# ModelAuditor Pre-trained Models
|
| 2 |
|
| 3 |
+
Pre-trained models for medical image classification, used with the [ModelAuditor](https://github.com/lukaskuhndkfz/ModelAuditor) framework for AI-powered model auditing and robustness evaluation.
|
| 4 |
|
| 5 |
## Models
|
| 6 |
|
| 7 |
+
| Model | Architecture | Domain | Task | Input Size |
|
| 8 |
+
|-------|-------------|--------|------|------------|
|
| 9 |
+
| `camelyon17_resnet50_1_224.pt` | ResNet50 | Pathology | Tumor detection in lymph node sections | 224x224 |
|
| 10 |
+
| `chexpert_resnet50_1_224.pt` | ResNet50 | Radiology | Chest X-ray classification | 224x224 |
|
| 11 |
+
| `ham10000_resnet50_1_224.pt` | ResNet50 | Dermatology | Skin lesion classification (melanoma vs. benign keratosis) | 224x224 |
|
| 12 |
+
| `cifar10.pth` | ResNet50 | General | CIFAR-10 image classification | 32x32 |
|
| 13 |
+
| `DermaMNIST_resnet18.pth` | ResNet18 | Dermatology | Skin lesion classification (7 classes) | 28x28 |
|
| 14 |
|
| 15 |
## Usage
|
| 16 |
|
|
|
|
| 25 |
# Or download individually
|
| 26 |
huggingface-cli download lukaskuhndkfz/ModelAuditor ham10000_resnet50_1_224.pt --local-dir models
|
| 27 |
```
|
|
|
|
| 28 |
|
| 29 |
+
### Use with ModelAuditor
|
| 30 |
+
|
| 31 |
+
```bash
|
| 32 |
git clone https://github.com/lukaskuhndkfz/ModelAuditor
|
| 33 |
cd ModelAuditor
|
| 34 |
pip install -e ".[medical]"
|
|
|
|
| 37 |
python main.py --model resnet50 --dataset ham10000 --weights models/ham10000_resnet50_1_224.pt
|
| 38 |
```
|
| 39 |
|
| 40 |
+
### Load in PyTorch
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
import torch
|
| 44 |
from torchvision.models import resnet50
|
| 45 |
|
|
|
|
| 48 |
model.eval()
|
| 49 |
```
|
| 50 |
|
| 51 |
+
For DermaMNIST (ResNet18):
|
| 52 |
+
|
| 53 |
+
```python
|
| 54 |
+
import torch
|
| 55 |
+
from torchvision.models import resnet18
|
| 56 |
+
|
| 57 |
+
model = resnet18(num_classes=7)
|
| 58 |
+
model.load_state_dict(torch.load("DermaMNIST_resnet18.pth", map_location="cpu"))
|
| 59 |
+
model.eval()
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Training
|
| 63 |
+
|
| 64 |
+
Training scripts for all ResNet50 models are available in the [ModelAuditor repository](https://github.com/lukaskuhndkfz/ModelAuditor) under `training/`.
|
| 65 |
+
|
| 66 |
+
## Datasets
|
| 67 |
|
| 68 |
- Camelyon17: https://wilds.stanford.edu/datasets/#camelyon17
|
| 69 |
- CheXpert: https://stanfordmlgroup.github.io/competitions/chexpert/
|
| 70 |
+
- HAM10000: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/DBW86T
|
| 71 |
+
- CIFAR-10: https://www.cs.toronto.edu/~kriz/cifar.html
|
| 72 |
+
- DermaMNIST: https://medmnist.com/
|