File size: 2,323 Bytes
b93e032 e51e477 b93e032 70918ae 4ff2812 b93e032 d1e74e3 b93e032 70918ae b93e032 d1e74e3 b93e032 70918ae b93e032 d1e74e3 b93e032 70918ae c47eafc 70918ae b93e032 70918ae | 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 | # 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/ |