Document v1 and v2; replace the pre-leak-fix accuracy table with verified v2 numbers
Browse files
README.md
CHANGED
|
@@ -14,12 +14,22 @@ pipeline_tag: image-classification
|
|
| 14 |
|
| 15 |
# RootScope: Cross-species Root Cell-Type Classification from Confocal Microscopy Images
|
| 16 |
|
| 17 |
-
Trained model weights for
|
| 18 |
|
| 19 |
RootScope takes a raw confocal root-tip cross-section TIFF, segments every cell
|
| 20 |
-
with
|
| 21 |
-
features plus fine-tuned
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
## Install
|
| 25 |
|
|
@@ -40,6 +50,12 @@ rootscope --tif my_image.tif --out results/
|
|
| 40 |
`results/` gets a per-cell CSV and a labeled overlay PNG, per model plus the
|
| 41 |
ensemble.
|
| 42 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
Or from Python:
|
| 44 |
|
| 45 |
```python
|
|
@@ -49,35 +65,55 @@ df = predict_tif("my_image.tif", out_dir="results/")
|
|
| 49 |
|
| 50 |
## Cell types
|
| 51 |
|
| 52 |
-
|
| 53 |
-
|
| 54 |
|
| 55 |
## Files
|
| 56 |
|
| 57 |
-
| File |
|
| 58 |
-
|------|------|
|
| 59 |
-
| `
|
| 60 |
-
| `
|
| 61 |
-
| `model_LightGBM.joblib` |
|
| 62 |
-
| `model_XGBoost.joblib` |
|
| 63 |
-
| scalers, feature columns, label encoder | small |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
|
| 65 |
## Performance
|
| 66 |
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
| RandomForest | 0.937 |
|
| 74 |
|
| 75 |
-
Inference: ~1.5–3 min per image on a single GPU.
|
|
|
|
|
|
|
| 76 |
|
| 77 |
## Notes
|
| 78 |
|
| 79 |
- Set `--um-per-px` to your image's real scale — it is not auto-detected, and
|
| 80 |
-
the default of 1.0 distorts every size feature
|
|
|
|
| 81 |
- Input must be a raw image, not a segmentation mask.
|
| 82 |
- CPU works but is far slower (~15–30 min per image).
|
| 83 |
- `scikit-learn` is pinned to 1.7.2, the version these models were saved with.
|
|
|
|
| 14 |
|
| 15 |
# RootScope: Cross-species Root Cell-Type Classification from Confocal Microscopy Images
|
| 16 |
|
| 17 |
+
Trained model weights for RootScope.
|
| 18 |
|
| 19 |
RootScope takes a raw confocal root-tip cross-section TIFF, segments every cell
|
| 20 |
+
with Cellpose-SAM, describes each cell with hand-crafted morpho-topological
|
| 21 |
+
features plus fine-tuned DINOv2 embeddings, and classifies it into one of nine
|
| 22 |
+
anatomical cell types using an iterative tree-based ensemble.
|
| 23 |
+
|
| 24 |
+
## Two model versions
|
| 25 |
+
|
| 26 |
+
| | features | backbone | use |
|
| 27 |
+
|---|---|---|---|
|
| 28 |
+
| **v2** (default) | 864 = 96 morphometric + 768 embeddings | fine-tuned DINOv2 **ViT-B/14** | the model evaluated in the manuscript, and the one the hosted demo runs |
|
| 29 |
+
| v1 | 480 = 96 morphometric + 384 embeddings | fine-tuned DINOv2 **ViT-S/14** | the earlier release, kept for reproducing previous results |
|
| 30 |
+
|
| 31 |
+
v2 lives in the `v2/` folder of this repo; v1 is at the root. RootScope
|
| 32 |
+
downloads whichever you select and caches it.
|
| 33 |
|
| 34 |
## Install
|
| 35 |
|
|
|
|
| 50 |
`results/` gets a per-cell CSV and a labeled overlay PNG, per model plus the
|
| 51 |
ensemble.
|
| 52 |
|
| 53 |
+
To use the earlier model instead:
|
| 54 |
+
|
| 55 |
+
```bash
|
| 56 |
+
rootscope --tif my_image.tif --out results/ --model-version v1
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
Or from Python:
|
| 60 |
|
| 61 |
```python
|
|
|
|
| 65 |
|
| 66 |
## Cell types
|
| 67 |
|
| 68 |
+
root_cap · epidermis · exodermis · cortex · endodermis · pericycle · stele ·
|
| 69 |
+
xylem · phloem
|
| 70 |
|
| 71 |
## Files
|
| 72 |
|
| 73 |
+
| File | v2 | v1 |
|
| 74 |
+
|------|----|----|
|
| 75 |
+
| `backbone.pt` (fine-tuned DINOv2) | 330 MB | 84 MB |
|
| 76 |
+
| `model_RandomForest.joblib` | 100 MB | 333 MB |
|
| 77 |
+
| `model_LightGBM.joblib` | 13 MB | 28 MB |
|
| 78 |
+
| `model_XGBoost.joblib` | 7 MB | 13 MB |
|
| 79 |
+
| scalers, feature columns, label encoder | small | small |
|
| 80 |
+
| `meta.json` | small | — |
|
| 81 |
+
|
| 82 |
+
`meta.json` records the backbone architecture. It must travel with
|
| 83 |
+
`backbone.pt`: without it the loader builds ViT-S/14 and silently discards
|
| 84 |
+
mismatched ViT-B weights, leaving the classifiers a 384-wide feature block where
|
| 85 |
+
they expect 768.
|
| 86 |
|
| 87 |
## Performance
|
| 88 |
|
| 89 |
+
**v2**, held-out test split, 11,070 cells across 26 sections, 9 classes,
|
| 90 |
+
864 features. Accuracy after the iterative neighbour labels converge, with 95%
|
| 91 |
+
bootstrap confidence intervals over sections:
|
| 92 |
+
|
| 93 |
+
| Model | Test | 95% CI |
|
| 94 |
+
|-------|------|--------|
|
| 95 |
+
| XGBoost | **0.861** | 0.828 – 0.895 |
|
| 96 |
+
| LightGBM | 0.858 | 0.823 – 0.895 |
|
| 97 |
+
| RandomForest | 0.832 | 0.798 – 0.869 |
|
| 98 |
+
|
| 99 |
+
The three-model ensemble scores 0.860, statistically indistinguishable from
|
| 100 |
+
XGBoost alone; the differences among all of these sit inside the confidence
|
| 101 |
+
intervals.
|
| 102 |
|
| 103 |
+
**v1** has not been re-evaluated since the neighbour-label leak was corrected.
|
| 104 |
+
The figure of 0.965 published here previously was measured with ground-truth
|
| 105 |
+
neighbour labels in place, which inflates the result by roughly 3 points, and it
|
| 106 |
+
is not comparable to the v2 figures above. Use v2 for any quantitative claim.
|
|
|
|
| 107 |
|
| 108 |
+
Inference: ~1.5–3 min per image on a single GPU. v1 and v2 measured within 2% of
|
| 109 |
+
each other end to end — the heavier v2 backbone costs a few seconds, while
|
| 110 |
+
Cellpose segmentation dominates and is identical for both.
|
| 111 |
|
| 112 |
## Notes
|
| 113 |
|
| 114 |
- Set `--um-per-px` to your image's real scale — it is not auto-detected, and
|
| 115 |
+
the default of 1.0 distorts every size feature (`area_um2`, `perimeter_um`,
|
| 116 |
+
`dist_from_centroid_um`).
|
| 117 |
- Input must be a raw image, not a segmentation mask.
|
| 118 |
- CPU works but is far slower (~15–30 min per image).
|
| 119 |
- `scikit-learn` is pinned to 1.7.2, the version these models were saved with.
|