Downloads · 30 days
0
Yasette/brain-tumor-resnet-classifier
brain-tumor-resnet-classifier is a image classification model from Yasette. Use it when you need a label for an image. The card lists the license as apache-2.0.
Bu model, beyin MRI görüntülerinden tümör sınıflandırması yapmak için eğitilmiş bir ResNet modelidir.
Downloads · 30 days
0
Access
Public
Updated Nov 23, 2025
Repo size
171 MB
Likes
0
Public
Click a slice to open those files.
.pth171 MB · 100%
From the Hugging Face model README
Bu model, beyin MRI görüntülerinden tümör sınıflandırması yapmak için eğitilmiş bir ResNet modelidir.
Model, Brain Tumor Classification MRI veri seti üzerinde eğitilmiştir.
Veri seti 4 sınıf içermektedir:
En İyi Model Konfigürasyonu:
| Model | Augmentation | Optimizer | Test Acc |
|---|---|---|---|
| resnet50 | heavy | - | 76.65% |
| resnet101 | best | - | 79.95% |
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()]}")
Apache 2.0