Downloads · 30 days
4
6% of all-time downloads
hp1318/alexnet-finetuned-herlev
alexnet-finetuned-herlev is a image classification model from hp1318. Use it when you need a label for an image. The card lists the license as apache-2.0.
This repository contains a fine-tuned AlexNet model trained on the HERLEV cervical cytology dataset for multi-class classification of Pap smear images.
Downloads · 30 days
4
6% of all-time downloads
All-time downloads
72
Public
Parameters
57M
456 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors228 MB · 50%
From the Hugging Face model README
This repository contains a fine-tuned AlexNet model trained on the HERLEV cervical cytology dataset for multi-class classification of Pap smear images.
The model was uploaded using the PyTorchModelHubMixin, enabling native Hugging Face loading via from_pretrained.
| Label | Cell Type |
|---|---|
| 0 | Superficial Squamous |
| 1 | Intermediate Squamous |
| 2 | Columnar |
| 3 | Mild Dysplasia |
| 4 | Moderate Dysplasia |
| 5 | Severe Dysplasia |
| 6 | Carcinoma in situ |
pip install torch torchvision huggingface_hub pillow
import torch
from huggingface_hub import PyTorchModelHubMixin
from torchvision import transforms
from PIL import Image
from model import AlexNetHERLEV
model = AlexNetHERLEV.from_pretrained(
"hp1318/alexnet-finetuned-herlev"
)
model.eval()
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]
)
])
image = Image.open("cell_image.jpg").convert("RGB")
image = transform(image).unsqueeze(0)
with torch.no_grad():
outputs = model(image)
prediction = torch.argmax(outputs, dim=1)
print("Predicted class:", prediction.item())
The model outputs logits for all cervical cell classes.
The predicted label corresponds to the class with the highest logit score.
If you use this model in academic work, please cite the corresponding paper or repository.