Update README.md
Browse files
README.md
CHANGED
|
@@ -1,4 +1,128 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
pipeline_tag: image-segmentation
|
| 4 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
pipeline_tag: image-segmentation
|
| 4 |
+
---
|
| 5 |
+
|
| 6 |
+
AdvisorBot
|
| 7 |
+
Acá tenés el README en inglés, con todo lo que hablamos ya resuelto: título v1.0.0, terminología consistente (testículo/seminíferos), fila de clDice quitada, y los marcadores condicionales convertidos en afirmaciones — pero con dos lugares marcados donde TENÉS que verificar contra tu código antes de publicar. No puedo resolver esos dos por vos porque dependen de lo que realmente hace tu código, y son justo los que no se pueden publicar "a ojo".
|
| 8 |
+
|
| 9 |
+
# TubuleSegmentation v1.0.0 — Seminiferous tubule segmentation and morphometry (mouse testis, H&E)
|
| 10 |
+
|
| 11 |
+
Semantic segmentation model for seminiferous tubules in H&E sections of mouse testis
|
| 12 |
+
(*Mus musculus*, CF-1 strain). Segments 3 classes (0 = background, 1 = epithelium,
|
| 13 |
+
2 = lumen) and derives calibrated morphometric metrics. Architecture: EfficientNet-B4
|
| 14 |
+
encoder + UNet with a dual decoder (segmentation + boundary) and SCSE attention.
|
| 15 |
+
Input 512×512, ImageNet normalization, scale 0.32 µm/px.
|
| 16 |
+
|
| 17 |
+
> This release (v1.0.0) is the result of ~23 internal iterations of architecture and
|
| 18 |
+
> training design.
|
| 19 |
+
|
| 20 |
+
---
|
| 21 |
+
|
| 22 |
+
## 1. Segmentation performance (validation, n = 49)
|
| 23 |
+
|
| 24 |
+
| Class | IoU | Dice / F1 |
|
| 25 |
+
|-----------------|-------|-----------|
|
| 26 |
+
| Background (0) | 0.989 | 0.994 † |
|
| 27 |
+
| Epithelium (1) | 0.935 | 0.966 † |
|
| 28 |
+
| Lumen (2) | 0.931 | 0.964 † |
|
| 29 |
+
| **Mean** | **mIoU 0.952** | **Dice 0.975 †** |
|
| 30 |
+
|
| 31 |
+
- Best checkpoint: epoch 47
|
| 32 |
+
|
| 33 |
+
> Metrics reported on the validation set, never on train.
|
| 34 |
+
|
| 35 |
+
---
|
| 36 |
+
|
| 37 |
+
## 2. Agreement with manual measurement (ImageJ, gold standard) — validation, n = 39
|
| 38 |
+
|
| 39 |
+
Method comparison (predicted vs. manual freehand tracing).
|
| 40 |
+
Bias = predicted − manual.
|
| 41 |
+
95% LoA = Bland-Altman limits of agreement.
|
| 42 |
+
|
| 43 |
+
### Tubule
|
| 44 |
+
|
| 45 |
+
| Metric | Pearson r | CCC (Lin) | Bias | Bias % | 95% LoA | MAE |
|
| 46 |
+
|------------------|-----------|-----------|-----------|--------|-------------------|---------|
|
| 47 |
+
| Area (µm²) | 0.996 | 0.78 | +4043.8 | +11.9% | [2379.6, 5708.0] | 4043.8 |
|
| 48 |
+
| Major axis (µm) | 0.996 | 0.83 | +14.29 | +6.2% | [8.71, 19.86] | 14.29 |
|
| 49 |
+
| Minor axis (µm) | 0.995 | 0.80 | +11.71 | +6.2% | [8.03, 15.38] | 11.71 |
|
| 50 |
+
| Max Feret (µm) | 0.997 | 0.85 | +13.50 | +5.8% | [8.15, 18.85] | 13.50 |
|
| 51 |
+
| Min Feret (µm) | 0.995 | 0.82 | +11.05 | +5.9% | [7.22, 14.89] | 11.05 |
|
| 52 |
+
| Perimeter (µm) | 0.996 | 0.79 | +37.73 | +5.7% | [25.38, 50.07] | 37.73 |
|
| 53 |
+
| Aspect ratio | 0.999 | 1.00 | −0.0001 | +0.4% | [−0.013, 0.013] | 0.005 |
|
| 54 |
+
| Roundness | 0.997 | 0.99 | −0.007 | +0.9% | [−0.020, 0.007] | 0.007 |
|
| 55 |
+
|
| 56 |
+
### Lumen
|
| 57 |
+
|
| 58 |
+
| Metric | Pearson r | CCC (Lin) | Bias | Bias % | 95% LoA | MAE |
|
| 59 |
+
|------------------|-----------|-----------|-----------|--------|-------------------|---------|
|
| 60 |
+
| Area (µm²) | 0.993 | 0.95 | +1080.3 | +8.1% | [8.5, 2152.2] | 1080.3 |
|
| 61 |
+
| Major axis (µm) | 0.970 | 0.83 | +12.19 | +8.3% | [1.43, 22.96] | 12.19 |
|
| 62 |
+
| Minor axis (µm) | 0.988 | 0.88 | +9.86 | +8.7% | [3.59, 16.14] | 9.86 |
|
| 63 |
+
| Max Feret (µm) | 0.974 | 0.96 | +4.51 | +3.7% | [−6.51, 15.54] | 6.36 |
|
| 64 |
+
| Min Feret (µm) | 0.984 | 0.98 | +2.70 | +3.1% | [−4.88, 10.28] | 4.02 |
|
| 65 |
+
| Perimeter (µm) | 0.926 | 0.93 | −4.06 | +6.0% | [−113.88, 105.77] | 41.90 |
|
| 66 |
+
| Aspect ratio | 0.972 | 0.97 | −0.009 | +3.0% | [−0.118, 0.101] | 0.040 |
|
| 67 |
+
| Roundness | 0.931 | 0.80 | −0.061 | +8.0% | [−0.147, 0.024] | 0.062 |
|
| 68 |
+
|
| 69 |
+
> **Shape vs. size**: dimensionless shape descriptors (aspect ratio, roundness) reach
|
| 70 |
+
> CCC ≈ 0.99 in tubule and 0.97 in lumen. The model captures *morphology* almost perfectly;
|
| 71 |
+
> the ~8–12% area bias is an approximately uniform overestimation that preserves shape rather
|
| 72 |
+
> than distorting it. Per-metric Bland-Altman plots in `imagej_validation/`.
|
| 73 |
+
|
| 74 |
+
---
|
| 75 |
+
|
| 76 |
+
## 3. Data and training
|
| 77 |
+
|
| 78 |
+
| Item | Value |
|
| 79 |
+
|-----------------------|-------------------------------------------------------------------|
|
| 80 |
+
| Tissue / species | Mouse testis (*Mus musculus*), CF-1 strain; seminiferous tubules, H&E |
|
| 81 |
+
| Dataset | `LuGot16/tubules` (HuggingFace) |
|
| 82 |
+
| Train | 273 images — 11 animals, 2 slides per animal |
|
| 83 |
+
| Train / Validation | 273 / 49 images, random 85/15 split (seed 42) |
|
| 84 |
+
| Split level | Image-level random split (not grouped by animal) |
|
| 85 |
+
| Scale | 0.32 µm/px |
|
| 86 |
+
| Input | 512×512, ImageNet normalization |
|
| 87 |
+
| Classes | 0 = background, 1 = epithelium, 2 = lumen |
|
| 88 |
+
| Augmentation | Macenko (stain normalization) + geometric |
|
| 89 |
+
| Post-processing | largest connected component → morphological closing → hole filling → lumen cleanup |
|
| 90 |
+
| Inference | 8× TTA (4 rotations × 2 flips) |
|
| 91 |
+
|
| 92 |
+
---
|
| 93 |
+
|
| 94 |
+
## 4. Robustness, known biases, and scope
|
| 95 |
+
|
| 96 |
+
**Generalization (animals / stain intensities / fixative):**
|
| 97 |
+
- **Note on validation:** the train/validation split is random at the image level, not
|
| 98 |
+
grouped by animal — so images from the same animal may appear in both sets. The validation
|
| 99 |
+
metrics in Sections 1–2 may therefore be optimistic with respect to generalization to fully
|
| 100 |
+
unseen animals. The strongest evidence for cross-animal generalization is the
|
| 101 |
+
external test below (129 images from other animals and experiments, with different stains
|
| 102 |
+
and fixatives).
|
| 103 |
+
- **External test**: 129 images from **other animals and different experiments** (the training
|
| 104 |
+
set comprises 11 animals across 3 experiments; the external images come from outside that set),
|
| 105 |
+
with widely varying stain intensities and different fixatives. Satisfactory segmentation on
|
| 106 |
+
**128/129**; the single failure was a patch of extremely thin epithelium left unsegmented in
|
| 107 |
+
one image. Macenko stain normalization during training contributes to this tolerance to stain
|
| 108 |
+
and fixation variation.
|
| 109 |
+
|
| 110 |
+
**Known biases:**
|
| 111 |
+
- Systematic **area** overestimation: ~+12% (tubule) and ~+8% (lumen) vs. manual tracing.
|
| 112 |
+
It is systematic (r ≈ 0.99), attributable to the boundary convention (the model mask is
|
| 113 |
+
slightly more generous than the manual freehand trace), not noise. It **preserves shape**
|
| 114 |
+
(AR/roundness CCC ≈ 0.99). Do not correct with a factor derived from the validation set itself.
|
| 115 |
+
- **Lumen perimeter**: good mean agreement (CCC 0.93, bias ≈ 0) but wide LoA (±110 µm):
|
| 116 |
+
varies case by case due to tracing convention.
|
| 117 |
+
|
| 118 |
+
**Validated scope:** single-tubule crops at 0.32 µm/px, H&E staining. **Not validated** on
|
| 119 |
+
multi-tubule fields or other magnifications.
|
| 120 |
+
|
| 121 |
+
---
|
| 122 |
+
|
| 123 |
+
## Attribution
|
| 124 |
+
|
| 125 |
+
Dataset curated by Lucila Gotfryd (image acquisition, annotation, design of the segmentation
|
| 126 |
+
and morphometry approach, including the anatomically-motivated containment constraint and the
|
| 127 |
+
choice to enforce tubular connectivity). Model implementation carried out with AI coding
|
| 128 |
+
assistance under the author's direction.
|