Brain Tumor Classification with ResNet
Model Description
Bu model, beyin MRI görüntülerinden tümör sınıflandırması yapmak için eğitilmiş bir ResNet modelidir.
Dataset
Model, Brain Tumor Classification MRI veri seti üzerinde eğitilmiştir.
Veri seti 4 sınıf içermektedir:
- Glioma
- Meningioma
- No Tumor
- Pituitary
Training Details
En İyi Model Konfigürasyonu:
- Model: resnet101
- Test Accuracy: 79.95%
- Validation Accuracy: 97.56%
Denenen Konfigürasyonlar ve Sonuçları
| Model | Augmentation | Optimizer | Test Acc |
|---|---|---|---|
| resnet50 | heavy | - | 76.65% |
| resnet101 | best | - | 79.95% |
Kullanım
import torch
from torchvision import transforms, models
from PIL import Image
# Model yükleme
model = models.resnet101(pretrained=False)
num_features = model.fc.in_features
model.fc = torch.nn.Linear(num_features, 4)
checkpoint = torch.hub.load_state_dict_from_url(
'https://huggingface.co/Yasette/brain-tumor-resnet-classifier/resolve/main/pytorch_model.pth',
map_location='cpu'
)
model.load_state_dict(checkpoint['model_state_dict'])
model.eval()
# Görüntü işleme
transform = transforms.Compose([
transforms.Resize((224, 224)),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225])
])
# Tahmin
image = Image.open('brain_mri.jpg').convert('RGB')
input_tensor = transform(image).unsqueeze(0)
with torch.no_grad():
output = model(input_tensor)
_, predicted = torch.max(output, 1)
classes = ['glioma', 'meningioma', 'notumor', 'pituitary']
print(f"Tahmin: {classes[predicted.item()]}")
Ekip Üyeleri
- [İsim 1]
- [İsim 2]
- [İsim 3]
Lisans
Apache 2.0
Evaluation results
- accuracy on Brain Tumor Classification MRIself-reported79.950