colonycount v0.1 weights
Bacterial colony detectors for colonycount, an open-source colony counter for agar plates. The package is pre-release (v0.1, not yet on PyPI); these files are the weights it downloads on first use.
| name (file) | architecture | params | default threshold |
|---|---|---|---|
rfdetr-nano (rfdetr-nano.onnx), the default |
RF-DETR nano | 27.2 M | 0.40 |
yolox-tiny (yolox-tiny.onnx), fastest |
YOLOX-Tiny | 5.0 M | 0.50 |
yolox-m (yolox-m.onnx) |
YOLOX-M | 25.3 M | 0.35 |
SHA-256:
42e7602cbcbb4b18d1851464b660a42d744d0b86edf11c02eb62046141081586 rfdetr-nano.onnx
cbc98f010e242726c781b0a4c6d6ea5a6d6c2b81ed7f28b2b30603ccacf8900e yolox-tiny.onnx
392a148324c462b36777d353ded9be3db17a67f9adbecab376099183ff4500f6 yolox-m.onnx
Base code and starting weights
- rfdetr-nano: RF-DETR by Roboflow (
rfdetr==1.12.1, Apache-2.0), fine-tuned from the COCO-pretrained RF-DETR nano weights. - yolox-tiny, yolox-m: YOLOX by Megvii (Apache-2.0), vendored at commit
6ddff4824372906469a7fae2dc3206c7aa4bbaee, fine-tuned from the COCO-pretrainedyolox_tiny.pth/yolox_m.pth(YOLOX 0.1.1rc0 release).
Training data and attribution
All three models were trained on the union of the two datasets below (train split of each; 70/15/15 train/val/test split by species or isolate with a fixed seed).
Smartphone set. Solymosi, N. & Nagy, S. A. (2023). Annotated dataset for deep-learning-based bacterial colony detection. figshare. Dataset. https://doi.org/10.6084/m9.figshare.22022540.v3. Licensed under CC BY 4.0.
Paper: Makrai, L., Fodroczy, B., Nagy, S. A., Czeiszing, P., Csabai, I., Szita, G. & Solymosi, N. (2023). Annotated dataset for deep-learning-based bacterial colony detection. Scientific Data 10, 497. https://doi.org/10.1038/s41597-023-02404-8
Changes made: the shipped COCO annotations (annot_COCO.json) are used; images are split 70/15/15 into train/val/test by species with a fixed seed.
Clinical set. Du, J. (2026). Clinical Dataset of 19 Bacterial Colony Images. Zenodo. https://doi.org/10.5281/zenodo.18256864. Licensed under CC BY 4.0.
Paper: Du, J., Yang, C., Sun, M., Sun, Q., Wang, M., Ji, X., Wang, K. & Xu, J. (2026). High-Resolution Colony Images of Clinically Isolated Bacteria for Automated Detection and Deep Learning. Scientific Data 13, 757. https://doi.org/10.1038/s41597-026-07095-5
Changes made: labels converted to COCO format; images split 70/15/15 into train/val/test by isolate with a fixed seed; the augmented (flipped) images_agu.zip and label_agu.zip files are not used.
License
The weights are released under CC BY 4.0; give credit to colonycount and to the two datasets above. The colonycount code is Apache-2.0.
ONNX contract
- Input
images: float32[1, 3, T, T], RGB, values 0..1. The tile sizeTis read from the model. - Outputs:
boxes[N, 4]float32, xyxy in tile pixels;scores[N]. The package tiles the plate, merges tiles with NMS and applies the threshold. - Default score threshold per model: see the table above (chosen on the validation split, frozen 2026-11-15).
How to use
colonycount is pre-release; install it from source until it is on PyPI.
pip install colonycount
colonycount --model rfdetr-nano plate.jpg
Weights are downloaded once, checked against the pinned SHA-256 and cached. --model yolox-tiny and --model yolox-m select the other two.
Results
Plate counts against the human count, plate-crop mode (the default), with the threshold fixed on val. MdAPE is the median absolute percentage error on plates with 30-300 true colonies; MAE is colonies per plate; bias is predicted minus true.
Test split (192 plates: 142 clinical, 50 smartphone; never used for training or any choice; run once):
| model | MdAPE (30-300) | MAE | precision | recall |
|---|---|---|---|---|
| rfdetr-nano | 1.06% | 1.06 | 98.3% | 98.2% |
| yolox-tiny | 1.45% | 1.84 | 98.5% | 97.1% |
| yolox-m | 0.92% | 1.04 | 98.1% | 98.1% |
Validation split (198 plates: 142 clinical, 56 smartphone; the thresholds were chosen here, so these are optimistic):
| model | MdAPE (30-300) | MAE | precision | recall | CPU s/plate |
|---|---|---|---|---|---|
| rfdetr-nano | 0.75% | 3.52 | 97.4% | 97.2% | 8.7 |
| yolox-tiny | 0.96% | 4.31 | 97.5% | 96.0% | 1.3 |
| yolox-m | 1.05% | 4.45 | 97.1% | 96.6% | 4.5 |
Notes:
rfdetr-nanois the default model; it was chosen on val before the test run.yolox-mis slightly ahead on test (0.92% vs 1.06%), within the noise of 114 in-range plates.yolox-tinyis weak on smartphone photos: MdAPE 4.42% on test, undercounting by 4.5 colonies per plate (clinical plates: 0.46%).- The test split has no plate above 300 colonies (val: 12) and more near-empty plates, so test MAE is lower than val MAE; compare MdAPE instead.
- CPU times are quoted from the val run, where all methods ran back to back under the same conditions (per plate, one at a time). Times on test were 20-40% higher.
- Full report and per-source tables: https://github.com/rafaliazz/colonycount/blob/main/results/README.md
Limitations and intended use
A research and laboratory counting aid, not a diagnostic device and not for clinical decisions. Plates with more than 300 colonies (TNTC) are undercounted (val: bias about -8 colonies on those plates for rfdetr-nano) and none were in the test split. Accuracy was measured on the two datasets above only (smartphone photos and high-resolution clinical plates); other media, lighting, or imaging setups may behave differently. Check the counts, in particular on dense, merged or unusual plates.