KS987 commited on
Commit
86ee5c5
·
verified ·
1 Parent(s): 15ad365

Upload README.md

Browse files
Files changed (1) hide show
  1. README.md +123 -0
README.md ADDED
@@ -0,0 +1,123 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - medical-imaging
5
+ - segmentation
6
+ - nnunet
7
+ - computed-tomography
8
+ - cancer
9
+ - cvpr2026
10
+ - flare
11
+ datasets:
12
+ - FLARE-MedFM/FLARE-Task1-Pancancer
13
+ metrics:
14
+ - dice
15
+ - normalized-surface-dice
16
+ pipeline_tag: image-segmentation
17
+ ---
18
+
19
+ # Vanilla nnUNet v2 Baseline — FLARE 2025 Task 1: Pan-Cancer Segmentation
20
+
21
+ Binary lesion segmentation from CT using vanilla nnU-Net v2 (ResEncM). Released as a reference baseline for [FLARE 2025 Task 1](https://www.codabench.org/competitions/7149/) participants.
22
+
23
+ **Code + failure analysis:** [GitHub — Kappapapa123/CVPR2026-PanCancerSeg-baseline](https://github.com/Kappapapa123/CVPR2026-PanCancerSeg-baseline)
24
+
25
+ ---
26
+
27
+ ## Model Details
28
+
29
+ | Parameter | Value |
30
+ |-----------|-------|
31
+ | Framework | nnU-Net v2.6.4 |
32
+ | Architecture | Residual Encoder U-Net Medium (`nnUNetResEncUNetMPlans`) |
33
+ | Configuration | 3d_fullres |
34
+ | Task | Binary segmentation (0=background, 1=tumor) |
35
+ | Epochs | 2000 |
36
+ | Fold | 0 (official competition split via `splits_final.json`) |
37
+ | Trainer class | `nnUNetTrainerWandb2000` |
38
+ | Dataset ID | 101 (`Dataset101_FLAREPanCancer`) |
39
+
40
+ ## Training Data
41
+
42
+ [FLARE-MedFM/FLARE-Task1-Pancancer](https://huggingface.co/datasets/FLARE-MedFM/FLARE-Task1-Pancancer) — 10,762 cases total:
43
+ - **train_label** (~10,000 cases): Partially labeled (primary lesion only per case)
44
+ - **DeepLesion5K-MedSAM2** (~762 cases): Pseudo labels from MedSAM2
45
+
46
+ **Important:** Only the primary lesion is annotated per training case. Metastatic lesions may be present but unlabeled.
47
+
48
+ ## Performance
49
+
50
+ Evaluated on 50 validation-public cases:
51
+
52
+ | Metric | Mean | Median | Std |
53
+ |--------|------|--------|-----|
54
+ | Lesion DSC | 0.3278 | 0.2318 | 0.2883 |
55
+ | Lesion NSD (2 mm) | 0.1797 | 0.1046 | 0.2029 |
56
+
57
+ Scores are lower than expected because training labels are partial but validation GT includes all lesions. See the [failure analysis](https://github.com/Kappapapa123/CVPR2026-PanCancerSeg-baseline#failure-analysis) for details.
58
+
59
+ ## How to Use
60
+
61
+ ```bash
62
+ # 1. Install dependencies
63
+ pip install nnunetv2==2.6.4 huggingface-hub
64
+
65
+ # 2. Clone code repo (needed for the custom trainer)
66
+ git clone https://github.com/Kappapapa123/CVPR2026-PanCancerSeg-baseline.git
67
+
68
+ # 3. Symlink the custom trainer into nnUNet
69
+ VARIANTS_DIR=$(python -c "import nnunetv2; print(nnunetv2.__path__[0])")/training/nnUNetTrainer/variants
70
+ ln -sf $(realpath CVPR2026-PanCancerSeg-baseline/trainers/nnUNetTrainerWandb2000.py) \
71
+ "$VARIANTS_DIR/nnUNetTrainerWandb2000.py"
72
+
73
+ # 4. Download model weights
74
+ huggingface-cli download KS987/CVPR2026-PanCancerSeg-baseline \
75
+ --local-dir ./model --repo-type model
76
+
77
+ # 5. Run inference
78
+ nnUNetv2_predict \
79
+ -i /path/to/input_images \
80
+ -o /path/to/output_predictions \
81
+ -d 101 -c 3d_fullres -f 0 \
82
+ -tr nnUNetTrainerWandb2000 \
83
+ -p nnUNetResEncUNetMPlans \
84
+ -m ./model/nnUNet/Dataset101_FLAREPanCancer \
85
+ --disable_tta
86
+ ```
87
+
88
+ Both `checkpoint_final.pth` and `checkpoint_best.pth` are provided. nnUNet uses `checkpoint_final.pth` by default.
89
+
90
+ > **Note:** Inference resampling requires ~64 GB RAM.
91
+
92
+ ## Limitations
93
+
94
+ - **Partial labels:** Training data only labels the primary lesion per case. The model learns to segment some cancer types better than others.
95
+ - **Undertrained:** Both train and val loss were still decreasing at epoch 2000. `checkpoint_best` and `checkpoint_final` are near-identical.
96
+ - **False positive fragmentation:** The dominant failure mode is scattered false-positive blobs across the volume, inflating predicted volume and shifting the centroid away from the true lesion. See the [failure analysis](https://github.com/Kappapapa123/CVPR2026-PanCancerSeg-baseline#failure-analysis).
97
+
98
+ ## Files in This Repository
99
+
100
+ ```
101
+ nnUNet/
102
+ Dataset101_FLAREPanCancer/
103
+ nnUNetTrainerWandb2000__nnUNetResEncUNetMPlans__3d_fullres/
104
+ fold_0/
105
+ checkpoint_best.pth # Best validation checkpoint
106
+ checkpoint_final.pth # Final epoch (2000) checkpoint
107
+ dataset.json # nnUNet dataset descriptor
108
+ dataset_fingerprint.json # nnUNet dataset fingerprint
109
+ plans.json # nnUNet experiment plans
110
+ ```
111
+
112
+ ## Citation
113
+
114
+ If you use this baseline, please cite:
115
+
116
+ ```bibtex
117
+ @misc{flare2025baseline,
118
+ title={Vanilla nnUNet v2 Baseline for FLARE 2025 Task 1: Pan-Cancer Segmentation},
119
+ author={Suzuki, Keishi},
120
+ year={2026},
121
+ url={https://huggingface.co/KS987/CVPR2026-PanCancerSeg-baseline}
122
+ }
123
+ ```