| license: apache-2.0 | |
| tags: | |
| - image-classification | |
| - medical-imaging | |
| - cervical-cancer | |
| - pap-smear | |
| - pytorch | |
| # AlexNet Fine-Tuned on HERLEV Dataset | |
| This repository provides a fine-tuned AlexNet model trained on the HERLEV cervical cytology dataset for multi-class cervical cell classification. | |
| ## Model Details | |
| - Architecture: AlexNet | |
| - Framework: PyTorch | |
| - Input size: 224x224 RGB | |
| - Classes: 5 | |
| ## Classes | |
| 0: Superficial–Intermediate | |
| 1: Parabasal | |
| 2: Koilocytotic | |
| 3: Dyskeratotic | |
| 4: Metaplastic | |
| ## How to Use | |
| ```python | |
| import torch | |
| from PIL import Image | |
| from torchvision import transforms | |
| from model import load_model | |
| device = "cuda" if torch.cuda.is_available() else "cpu" | |
| model = load_model("best_alexnet.pth", device=device) | |
| 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] | |
| ) | |
| ]) | |
| img = Image.open("cell_image.jpg").convert("RGB") | |
| img = transform(img).unsqueeze(0).to(device) | |
| with torch.no_grad(): | |
| pred = model(img).argmax(1) | |
| print("Prediction:", pred.item()) | |
| Intended Use | |
| Research and educational purposes only. | |