Downloads · 30 days
0
Svetozar1993/LocalMedScan-malaria-mobilenetv2
LocalMedScan-malaria-mobilenetv2 is a image classification model from Svetozar1993. Use it when you need a label for an image. It is set up for pytorch. The card lists the license as mit.
Recommended production model. Fine-tuned MobileNetV2 for malaria parasite detection from thin blood smear microscopy images. Achieves 97.97% test accuracy — the highest in our model family. Part of LocalMedScan.
Downloads · 30 days
0
Access
Public
Updated Feb 18, 2026
Repo size
9.1 MB
Likes
0
Public
Click a slice to open those files.
.pth9.1 MB · 100%
From the Hugging Face model README
Recommended production model. Fine-tuned MobileNetV2 for malaria parasite detection from thin blood smear microscopy images. Achieves 97.97% test accuracy — the highest in our model family. Part of LocalMedScan.
| Property | Value |
|---|---|
| Architecture | MobileNetV2 (ImageNet pretrained, fine-tuned) |
| Parameters | ~3.4M |
| Model Size | 14 MB |
| Input | RGB 224x224 blood smear cell images |
| Output | Binary classification: Parasitized vs Uninfected |
| Training | 3-phase progressive unfreezing from ImageNet weights |
| Framework | PyTorch |
| License | MIT |
| Metric | Without TTA | With 5-View TTA |
|---|---|---|
| Accuracy | 97.68% | 97.97% |
| Sensitivity | 97.12% | 97.41% |
| Specificity | 98.22% | 98.51% |
| Precision | 98.19% | 98.49% |
| F1 Score | 97.65% | 97.95% |
| Model | Params | Size | Accuracy (TTA) | F1 | Training |
|---|---|---|---|---|---|
| MobileNetV2 (this model) | 3.4M | 14 MB | 97.97% | 97.95% | Fine-tuned from ImageNet |
| PlasmoSENet | 10.6M | 41 MB | 96.55% | 96.47% | Trained from scratch |
MobileNetV2 outperforms PlasmoSENet by 1.42 percentage points while being 3x smaller and 3x faster. Transfer learning from ImageNet provides a decisive advantage on this dataset size (27K images).
Use MobileNetV2 for deployment. Use PlasmoSENet for research into domain-specific architectures or when ImageNet-free training is required.
random_split bug where train/val/test subsets inadvertently share transforms, causing training to run without augmentationStrong augmentation pipeline with RandomResizedCrop, RandomRotation(90), ColorJitter, GaussianBlur, and RandomErasing. The TransformSubset wrapper ensures training and validation use independent transforms.
NIH Malaria Cell Images Dataset (Rajaraman et al., 2018)
import torch
import torchvision.models as models
# Load model
model = models.mobilenet_v2(weights=None)
model.classifier[1] = torch.nn.Linear(model.last_channel, 2)
state_dict = torch.load("model.pth", map_location="cpu", weights_only=True)
model.load_state_dict(state_dict)
model.eval()
# Inference
from torchvision import transforms
from PIL import Image
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("blood_smear_cell.png").convert("RGB")
tensor = transform(img).unsqueeze(0)
with torch.inference_mode():
probs = torch.softmax(model(tensor), dim=1)
# probs[0][0] = Parasitized, probs[0][1] = Uninfected