HMH-1-Cell
Cell classifier and detector
2 min read
A two-stage pipeline based on onnxruntime for microscopic image analysis, combining object detection and classification across 20 categories. The system detects cells using a YOLO11s-seg model and then classifies them into cell lines, blood cells, immune cells, and malaria samples. The solution runs on standard CPU hardware without requiring heavy PyTorch installations. This project will be useful for researchers, bioinformaticians, and developers of cell culture analysis applications.
Key features
- Two-stage architecture: YOLO11s-seg for localization and ResNet18 for precise cell type identification.
- Support for 20 distinct classes, including cell lines, blood elements, and malaria samples.
- Fully autonomous CPU operation powered by the onnxruntime library.
- Open data structure with expansion and customization capabilities via configuration files.
What you can do
- Integrate the pipeline into local scripts for automated microscopic image processing.
- Run a complete processing cycle on full-size images with detection, cropping, and classification.
- Use pre-trained weights and classes to build specialized diagnostic prototypes.
Example
import json, numpy as np, onnxruntime as ort
from PIL import Image
cls = ort.InferenceSession("model.onnx", providers=["CPUExecutionProvider"])
meta = json.load(open("classes.json", encoding="utf-8"))
classes = meta["classes"]
im = Image.open("sample_cell.jpg").convert("RGB").resize((128, 128))
x = np.asarray(im, dtype=np.float32) / 255.0
x = x.transpose(2, 0, 1)[None]
logits = cls.run(None, {cls.get_inputs()[0].name: x})[0][0]
print(classes[int(np.argmax(logits))]["name_cn"])
Read more
Details• Classifier accuracy (top-1): 94.04% on a test set of 29,668 images.
• Detector (LIVECell): recall 0.813, precision 0.781, F1 0.797.
• Trained on LIVECell, BloodMNIST, Deepcell, and NIH Malaria datasets.
• License: CC BY-NC 4.0 (non-commercial use only).
• Limitation: optimized for phase-contrast and brightfield microscopy.










Comments