Upload HF_README.md
Browse files- HF_README.md +76 -0
HF_README.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- object-detection
|
| 5 |
+
- yolo
|
| 6 |
+
- biology
|
| 7 |
+
- computer-vision
|
| 8 |
+
- c-elegans
|
| 9 |
+
- worm-counting
|
| 10 |
+
base_model: ultralytics/assets
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
# WormML — YOLOv11 Worm Counting Weights
|
| 14 |
+
|
| 15 |
+
Pretrained YOLOv11-Large checkpoints for counting *C. elegans* worms across four imaging systems. Each model was trained on images from a specific camera and should be used with its matching preprocessing pipeline.
|
| 16 |
+
|
| 17 |
+
## Models
|
| 18 |
+
|
| 19 |
+
| File | Camera | Preprocessing |
|
| 20 |
+
|------|--------|---------------|
|
| 21 |
+
| `og_best.pt` | OG (original lab microscope) | Hough circle crop → resize 1344×1344 |
|
| 22 |
+
| `tau_best.pt` | Tau imaging system | Histogram equalisation + circle crop |
|
| 23 |
+
| `lb_best.pt` | LoopBio automated platform | Circle crop + colour inversion + augmentation |
|
| 24 |
+
| `uva_best.pt` | UVA external dataset | No preprocessing |
|
| 25 |
+
|
| 26 |
+
## Usage
|
| 27 |
+
|
| 28 |
+
Download all weights with one command using the [WormML repository](https://github.com/tommyli88/wormml):
|
| 29 |
+
|
| 30 |
+
```bash
|
| 31 |
+
git clone https://github.com/tommyli88/wormml.git
|
| 32 |
+
cd wormml
|
| 33 |
+
pip install -r requirements.txt
|
| 34 |
+
python scripts/download_weights.py
|
| 35 |
+
```
|
| 36 |
+
|
| 37 |
+
Or download a single camera:
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
python scripts/download_weights.py --camera og
|
| 41 |
+
```
|
| 42 |
+
|
| 43 |
+
Run inference on a preprocessed image:
|
| 44 |
+
|
| 45 |
+
```python
|
| 46 |
+
from ultralytics import YOLO
|
| 47 |
+
|
| 48 |
+
model = YOLO("weights/og_best.pt")
|
| 49 |
+
results = model("plate_image.jpg", conf=0.35, iou=0.30)
|
| 50 |
+
print(f"Worm count: {len(results[0].boxes)}")
|
| 51 |
+
```
|
| 52 |
+
|
| 53 |
+
## Recommended Thresholds
|
| 54 |
+
|
| 55 |
+
These confidence and IoU thresholds were tuned on each camera's validation set to minimise mean absolute error:
|
| 56 |
+
|
| 57 |
+
| Camera | Confidence | IoU |
|
| 58 |
+
|--------|-----------|------|
|
| 59 |
+
| OG | 0.35 | 0.30 |
|
| 60 |
+
| Tau | 0.36 | 0.25 |
|
| 61 |
+
| LB | 0.265 | 0.30 |
|
| 62 |
+
| UVA | 0.32 | 0.30 |
|
| 63 |
+
|
| 64 |
+
## Training
|
| 65 |
+
|
| 66 |
+
All models use YOLOv11-Large (`yolo11l.pt`) trained for 100 epochs. Camera-specific hyperparameters (warmup epochs, box loss weight, learning rate, augmentation) are documented in the [configs](https://github.com/tommyli88/wormml/tree/main/configs) folder of the main repository.
|
| 67 |
+
|
| 68 |
+
## Citation
|
| 69 |
+
|
| 70 |
+
```bibtex
|
| 71 |
+
@misc{wormml2024,
|
| 72 |
+
title = {WormML: A Cross-Camera Pipeline for C. elegans Worm Counting},
|
| 73 |
+
year = {2024},
|
| 74 |
+
note = {\url{https://github.com/tommyli88/wormml}}
|
| 75 |
+
}
|
| 76 |
+
```
|