v4: add README.md
Browse files
README.md
CHANGED
|
@@ -8,96 +8,75 @@ tags:
|
|
| 8 |
- cell-type-classification
|
| 9 |
- cellpose
|
| 10 |
- dinov2
|
|
|
|
| 11 |
library_name: rootscope
|
| 12 |
pipeline_tag: image-classification
|
| 13 |
---
|
| 14 |
|
| 15 |
# RootScope: Cross-species Root Cell-Type Classification from Confocal Microscopy Images
|
| 16 |
|
| 17 |
-
Trained
|
|
|
|
|
|
|
| 18 |
|
| 19 |
-
|
| 20 |
-
with Cellpose-SAM, describes each cell with 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 |
-
## Models
|
| 25 |
-
|
| 26 |
-
| | features | backbone |
|
| 27 |
|---|---|---|
|
| 28 |
-
| **
|
| 29 |
-
|
|
| 30 |
-
|
| 31 |
-
v2 is at the root of this repo; v1 is in the `v1/` folder.
|
| 32 |
-
|
| 33 |
-
## Install
|
| 34 |
-
|
| 35 |
-
```bash
|
| 36 |
-
git clone https://github.com/ct-tranchau/Rootscope.git
|
| 37 |
-
cd Rootscope
|
| 38 |
-
conda env create -f environment.yml
|
| 39 |
-
conda activate rootscope
|
| 40 |
-
pip install .
|
| 41 |
-
```
|
| 42 |
-
|
| 43 |
-
## Run
|
| 44 |
-
|
| 45 |
-
```bash
|
| 46 |
-
rootscope --tif my_image.tif --out results/
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
`results/` gets a per-cell CSV and a labeled overlay PNG, per model plus the
|
| 50 |
-
ensemble.
|
| 51 |
-
|
| 52 |
-
To use the earlier model instead:
|
| 53 |
|
| 54 |
-
|
| 55 |
-
rootscope --tif my_image.tif --out results/ --model-version v1
|
| 56 |
-
```
|
| 57 |
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
```
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
```
|
| 64 |
-
|
| 65 |
-
## Cell types
|
| 66 |
-
|
| 67 |
-
root_cap · epidermis · exodermis · cortex · endodermis · pericycle · stele ·
|
| 68 |
-
xylem · phloem
|
| 69 |
-
|
| 70 |
-
## Files
|
| 71 |
-
|
| 72 |
-
| File | v2 | v1 |
|
| 73 |
-
|------|----|----|
|
| 74 |
-
| `backbone.pt` (fine-tuned DINOv2) | 330 MB | 84 MB |
|
| 75 |
-
| `model_RandomForest.joblib` | 100 MB | 333 MB |
|
| 76 |
-
| `model_LightGBM.joblib` | 13 MB | 28 MB |
|
| 77 |
-
| `model_XGBoost.joblib` | 7 MB | 13 MB |
|
| 78 |
-
| scalers, feature columns, label encoder | small | small |
|
| 79 |
-
| `meta.json` | small | — |
|
| 80 |
-
|
| 81 |
-
## Performance
|
| 82 |
|
| 83 |
-
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
| XGBoost | **0.861** | 0.828 – 0.895 |
|
| 88 |
-
| LightGBM | 0.858 | 0.823 – 0.895 |
|
| 89 |
-
| RandomForest | 0.832 | 0.798 – 0.869 |
|
| 90 |
|
| 91 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 92 |
|
| 93 |
## Notes
|
| 94 |
|
| 95 |
-
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
-
|
| 99 |
-
-
|
| 100 |
-
|
|
|
|
| 101 |
|
| 102 |
## Contact
|
| 103 |
|
|
|
|
| 8 |
- cell-type-classification
|
| 9 |
- cellpose
|
| 10 |
- dinov2
|
| 11 |
+
- lightgbm
|
| 12 |
library_name: rootscope
|
| 13 |
pipeline_tag: image-classification
|
| 14 |
---
|
| 15 |
|
| 16 |
# RootScope: Cross-species Root Cell-Type Classification from Confocal Microscopy Images
|
| 17 |
|
| 18 |
+
Trained weights for **[RootScope](https://github.com/ct-tranchau/Rootscope)**.
|
| 19 |
+
This repo holds every published version; the package picks one with
|
| 20 |
+
`--model-version` (default **v4**).
|
| 21 |
|
| 22 |
+
| version | folder | what it is |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|---|---|---|
|
| 24 |
+
| **v4** | `v4/` | the manuscript model. 915 features, LightGBM per refinement round, 3 seeds, radial-order prior |
|
| 25 |
+
| v2 | repo root | 864 features, RandomForest + XGBoost + LightGBM ensemble, 10 rounds |
|
| 26 |
+
| v1 | `v1/` | 480 features, DINOv2 ViT-S/14 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
## v4 files
|
|
|
|
|
|
|
| 29 |
|
| 30 |
+
| File | Size | Role |
|
| 31 |
+
|---|---|---|
|
| 32 |
+
| `v4/backbone.pt` | 346 MB | DINOv2 ViT-B/14, all 12 blocks fine-tuned on cell crops (`meta.json` beside it records the architecture; keep them together) |
|
| 33 |
+
| `v4/lgbm_s42.joblib` | ~170 MB | LightGBM bundle, seed 42: six per-round models, scaler, 915 feature names, class order |
|
| 34 |
+
| `v4/lgbm_s1.joblib`, `v4/lgbm_s7.joblib` | ~170 MB each | the other two seeds. Optional: seed 42 alone predicts; all three reproduce the 3-seed average in the manuscript |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
+
## v4 performance
|
| 37 |
|
| 38 |
+
Clean held-out split: 26 sections, 11,043 labelled cells, 17 species (all
|
| 39 |
+
present in training), pooled over 3 seeds, 6 refinement rounds.
|
|
|
|
|
|
|
|
|
|
| 40 |
|
| 41 |
+
| | accuracy | macro-F1 |
|
| 42 |
+
|---|---|---|
|
| 43 |
+
| round 1 (no neighbor context yet) | 0.845 | — |
|
| 44 |
+
| final (after refinement + prior) | **0.881** (95% CI 0.858–0.905) | **0.852** |
|
| 45 |
+
|
| 46 |
+
Per class, final model — precision / F1: root cap 96.0 / 97.7 · epidermis
|
| 47 |
+
85.8 / 89.8 · exodermis 83.5 / 85.6 · cortex 97.2 / 93.4 · endodermis
|
| 48 |
+
91.0 / 88.8 · pericycle 91.4 / 86.5 · stele 78.3 / 84.0 · xylem 81.6 / 71.4 ·
|
| 49 |
+
phloem 69.9 / 69.5. Stele, xylem and phloem remain the hard classes; most of
|
| 50 |
+
their confusion is among themselves.
|
| 51 |
+
|
| 52 |
+
On species absent from training, expect roughly 0.70.
|
| 53 |
+
|
| 54 |
+
## How v4 predicts
|
| 55 |
+
|
| 56 |
+
1. Cellpose-SAM segments the TIFF (zero-shot, unchanged from v1/v2).
|
| 57 |
+
2. 96 morpho-topological features per cell + 768-d embedding from the
|
| 58 |
+
fine-tuned backbone.
|
| 59 |
+
3. Round 1: classify with the neighbor / layer context set to "unknown".
|
| 60 |
+
4. Rounds 2–6: from the previous round's predictions, rebuild 51 context
|
| 61 |
+
columns — each neighbor direction's class probabilities (36) and agreement
|
| 62 |
+
flags (6), and the cell's distance to each cell-type layer the model has
|
| 63 |
+
predicted (9) — and classify again with that round's own model.
|
| 64 |
+
5. Average the three seeds' probabilities, apply the radial-order prior, take
|
| 65 |
+
the argmax.
|
| 66 |
+
|
| 67 |
+
The loop is capped at 6 rounds and does not converge (about 1% of labels are
|
| 68 |
+
still changing at the cap); extending it to 10 rounds moves accuracy by less
|
| 69 |
+
than 0.1 pp.
|
| 70 |
|
| 71 |
## Notes
|
| 72 |
|
| 73 |
+
- Pixel size is read from the TIFF's OME metadata. A wrong scale distorts
|
| 74 |
+
every size feature; the package refuses to default to 1.0.
|
| 75 |
+
- Input must be a raw confocal image, not a mask.
|
| 76 |
+
- `scikit-learn` is pinned to 1.7.2, the version the bundles were saved with.
|
| 77 |
+
- All evaluation numbers are on cells whose annotator confidence was ≥ 0.6
|
| 78 |
+
(4.1% of labelled test cells were excluded by this filter, concentrated in
|
| 79 |
+
cortex, stele and pericycle).
|
| 80 |
|
| 81 |
## Contact
|
| 82 |
|