Blood Cancer Resnet18
Fine-tuned ResNet18 for classifying blood cell images into 4 classes.
Model source
- Kind
- Other
- File size
- 42.6–42.7 MB
- Version
- vRevision 4bf6639
- Updated
- Oct 24, 2026
- Downloads
- 4
- Source
- Hugging Face
Source description
Blood Cell Cancer Classifier (ResNet18)
Fine-tuned ResNet18 for classifying blood cell images into 4 classes.
Classes
- Benign
- Malignant Pre-B
- Malignant Pro-B
- Malignant early Pre-B
Performance
- Validation Accuracy: 99.38%
Usage
from huggingface_hub import PyTorchModelHubMixin
import torch.nn as nn
from torchvision import models
class BloodCancerResNet18(nn.Module, PyTorchModelHubMixin):
def __init__(self, num_classes=4):
super().__init__()
base = models.resnet18(weights=None)
base.fc = nn.Linear(base.fc.in_features, num_classes)
self.model = base
def forward(self, x):
return self.model(x)
model = BloodCancerResNet18.from_pretrained("your-username/blood-cancer-resnet18")
model.eval()
Training Data
Trained on the Blood Cell Cancer ALL-4class dataset.
Sources
1 source
Sources
1 sourceVerified Aug 19
Model artifacts
2 artifacts
Model artifacts
2 artifactsSource excerpts
2 excerpts
Source excerpts
2 excerpts--- license: mit tags: - image-classification - pytorch - medical-imaging - resnet18 --- # Blood Cell Cancer Classifier (ResNet18) Fine-tuned ResNet18 for classifying blood cell images into 4 classes. ## Classes 0. Benign 1. Malignant Pre-B 2. Malignant Pro-B 3. Malignant early Pre-B ## Performance - Validation Accuracy: 99.38% ## Usage ```python from huggingface_hub import PyTorchModelHubMixin import torch.nn as nn from torchvision import models class BloodCancerResNet18(nn.Module, PyTorchModelHubMixin): def __init__(self, num_classes=4): super().__init__() base = models.resnet18(weights=None) base.fc = nn.Linear(base.fc.in_features, num_classes) self.model = base def forward(self, x): return self.model(x) model = BloodCancerResNet18.from_pretrained("your-username/blood-cancer-resnet18") model.eval() ``` ## Training Data Trained on the [Blood Cell Cancer ALL-4class dataset](https://www.kaggle.com/datasets/mohammadamireshraghi/blood-cell-cancer-all-4class).
Source context: 4 downloads · 0 likes · Pipeline image-classification · Repo NaumanHa/blood-cancer-resnet18
