ModelAuditor / README.md
lukaskuhndkfz's picture
Update README.md
c47eafc verified
# ModelAuditor Pre-trained Models
Pre-trained models for medical image classification, used with the [ModelAuditor](https://github.com/MLO-lab/ModelAuditor) framework for AI-powered model auditing and robustness evaluation.
## Models
| Model | Architecture | Domain | Task | Input Size |
|-------|-------------|--------|------|------------|
| `camelyon17_resnet50_1_224.pt` | ResNet50 | Pathology | Tumor detection in lymph node sections | 224x224 |
| `chexpert_resnet50_1_224.pt` | ResNet50 | Radiology | Chest X-ray classification | 224x224 |
| `ham10000_resnet50_1_224.pt` | ResNet50 | Dermatology | Skin lesion classification (melanoma vs. benign keratosis) | 224x224 |
| `cifar10.pth` | ResNet50 | General | CIFAR-10 image classification | 224x224 |
| `DermaMNIST_resnet18.pth` | ResNet18 | Dermatology | Skin lesion classification (7 classes) | 224x224 |
## Usage
### Download Models
```bash
pip install huggingface_hub
# Download all models
huggingface-cli download lukaskuhndkfz/ModelAuditor --local-dir models
# Or download individually
huggingface-cli download lukaskuhndkfz/ModelAuditor ham10000_resnet50_1_224.pt --local-dir models
```
### Use with ModelAuditor
```bash
git clone https://github.com/lukaskuhndkfz/ModelAuditor
cd ModelAuditor
pip install -e ".[medical]"
# Run auditing
python main.py --model resnet50 --dataset ham10000 --weights models/ham10000_resnet50_1_224.pt
```
### Load in PyTorch
```python
import torch
from torchvision.models import resnet50
model = resnet50(num_classes=2)
model.load_state_dict(torch.load("ham10000_resnet50_1_224.pt", map_location="cpu"))
model.eval()
```
For DermaMNIST (ResNet18):
```python
import torch
from torchvision.models import resnet18
model = resnet18(num_classes=7)
model.load_state_dict(torch.load("DermaMNIST_resnet18.pth", map_location="cpu"))
model.eval()
```
## Training
Training scripts for all ResNet50 models are available in this repository as well (click on Files and Versions in the menu above).
## Datasets
- Camelyon17: https://wilds.stanford.edu/datasets/#camelyon17
- CheXpert: https://stanfordmlgroup.github.io/competitions/chexpert/
- HAM10000: https://dataverse.harvard.edu/dataset.xhtml?persistentId=doi:10.7910/DVN/DBW86T
- CIFAR-10: https://www.cs.toronto.edu/~kriz/cifar.html
- DermaMNIST: https://medmnist.com/