cultureqc-qc-effnetb0-v1
EfficientNet-B0 classifier for brightfield cell-culture QC: distinguishes normal culture from contamination, detachment, and image-quality artifacts. Part of the cultureQC project.
Trained entirely on synthetic data (bacterial sprites composited onto LIVECell images; detachment via mask-erosion + floaters). No real contaminated-culture images were used — no open dataset of these exists. Real-world transfer is unvalidated. See Limitations.
Classes
['normal', 'contamination_suspected', 'detachment', 'image_quality']
Results (synthetic test set)
- Overall accuracy: 0.9801
- Validation macro-F1: 0.9881
Per-severity recall (contamination_suspected) — early is the hard case and the headline number:
| severity | recall | n |
|---|---|---|
| early | 1 | 56 |
| late | 1 | 56 |
| mid | 1 | 56 |
False-positive rate on image_quality (weird-negatives called contamination): 0.0000
Full classification report and confusion matrix in metrics.md / confusion_matrix.png.
Usage
import torch, timm, numpy as np, cv2
from huggingface_hub import hf_hub_download
ckpt_path = hf_hub_download('LongGrainRice/cultureqc-qc-effnetb0-v1', 'best.pt')
ckpt = torch.load(ckpt_path, map_location='cpu')
model = timm.create_model('efficientnet_b0', pretrained=False, num_classes=4)
model.load_state_dict(ckpt['model_state'])
model.eval()
# preprocess: grayscale -> 3ch -> ImageNet normalize -> see config.json
Limitations
- Synthetic contamination/detachment only; no real contaminated-culture validation.
- Trained on LIVECell morphologies at 10x phase contrast; other scopes need re-validation.
- Grad-CAM evidence boxes are heuristic (largest connected component above 0.5), not calibrated.
- Part of a 6-evening portfolio project (cultureQC), not a validated diagnostic tool.