DoB24 commited on
Commit
02ba7e0
·
verified ·
1 Parent(s): 0ce5343

Remove stale kfold/gradcam sections pending v2 regeneration

Browse files
Files changed (1) hide show
  1. README.md +0 -108
README.md CHANGED
@@ -167,103 +167,6 @@ fine-tuning for 15 epochs at backbone-LR 1e-5 / head-LR 1e-4.
167
  | 9 | `retfound` | **83.88** | [82.64, 85.10] | 87.68 | 0.810 | 0.238 | 0.9838 |
168
  | — | **9-Model Ensemble** | **89.68** | [88.65, 90.74] | **92.25** | 0.878 | 0.144 | **0.9941** |
169
 
170
- ### v1 5-Fold Cross-Validation (Original Dataset, 30 epochs/fold, no augmentation)
171
-
172
- These are baseline numbers from an earlier sanity run on the **unaugmented**
173
- Original Dataset (5,335 images), reported here for completeness. The headline
174
- v2 numbers above use the augmented dataset with pHash-grouped 5-fold splits.
175
-
176
- | Model | CV Accuracy (mean ± std) |
177
- |---|---|
178
- | `vgg19` | 79.31 ± 1.89% |
179
- | `resnet101` | 79.27 ± 1.07% |
180
- | `clip_transformer` | 63.92 ± 1.79% |
181
-
182
- Raw per-fold metrics: `kfold/kfold_fold_metrics.csv`, `kfold/kfold_results.json`.
183
-
184
- ### Compute Disclosure
185
-
186
- | Item | Value |
187
- |---|---|
188
- | GPU | NVIDIA Tesla T4, 16 GB |
189
- | Framework | PyTorch 2.11 + CUDA 12.8, AMP fp16 |
190
- | Total wall time | ≈ 40 GPU-hours (9 models, v2 protocol) |
191
- | Inference cost | < 50 ms / image on T4 (single forward pass) |
192
- | Ensemble cost | 9 × single-model inference (no joint forward) |
193
-
194
-
195
- CI columns are non-parametric percentile bootstrap (n = 1 000 resamples)
196
- on the test set.
197
-
198
- ### 5.2 Pairwise statistical significance — McNemar with Bonferroni
199
-
200
- We compare every pair of models on per-sample errors. With 9 models
201
- that is 36 pairs (subset shown below; full table in
202
- `ensemble_report.json` → `mcnemar_bonferroni`):
203
-
204
- Total pairs: 36 | Bonferroni-corrected at α=0.05
205
-
206
- | Model A | Model B | b | c | Raw p | Adj. p (Bonf.) | Sig. |
207
- |---------|---------|---|---|-------|----------------|------|
208
- | `clip_openai` | `densenet121` | 85 | 198 | 1.5e-11 | 5.4e-10 | **\*** |
209
- | `clip_openai` | `dinov2_l` | 106 | 210 | 5.04e-09 | 1.81e-07 | **\*** |
210
- | `clip_openai` | `inception_v3` | 110 | 205 | 9.53e-08 | 3.43e-06 | **\*** |
211
- | `clip_openai` | `resnet101` | 103 | 199 | 3.55e-08 | 1.28e-06 | **\*** |
212
- | `clip_openai` | `resnet50` | 110 | 201 | 2.77e-07 | 9.96e-06 | **\*** |
213
- | `clip_openai` | `retfound` | 183 | 107 | 9.51e-06 | 0.000342 | **\*** |
214
- | `clip_openai` | `swin_b` | 125 | 144 | 0.272 | 1 | |
215
- | `clip_openai` | `vgg19` | 89 | 187 | 3.64e-09 | 1.31e-07 | **\*** |
216
- | `densenet121` | `dinov2_l` | 78 | 69 | 0.51 | 1 | |
217
- | `densenet121` | `inception_v3` | 70 | 52 | 0.123 | 1 | |
218
- | `densenet121` | `resnet101` | 61 | 44 | 0.118 | 1 | |
219
- | `densenet121` | `resnet50` | 64 | 42 | 0.0409 | 1 | |
220
- | `densenet121` | `retfound` | 293 | 104 | 6.23e-22 | 2.24e-20 | **\*** |
221
- | `densenet121` | `swin_b` | 173 | 79 | 3.1e-09 | 1.11e-07 | **\*** |
222
- | `densenet121` | `vgg19` | 82 | 67 | 0.251 | 1 | |
223
- | `dinov2_l` | `inception_v3` | 84 | 75 | 0.526 | 1 | |
224
- | `dinov2_l` | `resnet101` | 82 | 74 | 0.575 | 1 | |
225
- | `dinov2_l` | `resnet50` | 86 | 73 | 0.341 | 1 | |
226
- | `dinov2_l` | `retfound` | 291 | 111 | 1.04e-19 | 3.73e-18 | **\*** |
227
- | `dinov2_l` | `swin_b` | 182 | 97 | 4.05e-07 | 1.46e-05 | **\*** |
228
- | `dinov2_l` | `vgg19` | 100 | 94 | 0.72 | 1 | |
229
- | `inception_v3` | `resnet101` | 70 | 71 | 1 | 1 | |
230
- | `inception_v3` | `resnet50` | 78 | 74 | 0.808 | 1 | |
231
- | `inception_v3` | `retfound` | 290 | 119 | 1.42e-17 | 5.11e-16 | **\*** |
232
- | `inception_v3` | `swin_b` | 179 | 103 | 7.06e-06 | 0.000254 | **\*** |
233
- | `inception_v3` | `vgg19` | 98 | 101 | 0.887 | 1 | |
234
- | `resnet101` | `resnet50` | 61 | 56 | 0.712 | 1 | |
235
- | `resnet101` | `retfound` | 291 | 119 | 9.99e-18 | 3.6e-16 | **\*** |
236
- | `resnet101` | `swin_b` | 173 | 96 | 3.1e-06 | 0.000112 | **\*** |
237
- | `resnet101` | `vgg19` | 85 | 87 | 0.939 | 1 | |
238
- | `resnet50` | `retfound` | 301 | 134 | 7.66e-16 | 2.76e-14 | **\*** |
239
- | `resnet50` | `swin_b` | 173 | 101 | 1.61e-05 | 0.000581 | **\*** |
240
- | `resnet50` | `vgg19` | 92 | 99 | 0.664 | 1 | |
241
- | `retfound` | `swin_b` | 103 | 198 | 4.7e-08 | 1.69e-06 | **\*** |
242
- | `retfound` | `vgg19` | 98 | 272 | 4.73e-20 | 1.7e-18 | **\*** |
243
- | `swin_b` | `vgg19` | 73 | 152 | 1.5e-07 | 5.4e-06 | **\*** |
244
-
245
- A `*` indicates Bonferroni-corrected significance at α=0.05.
246
- The cluster of CNN models (VGG-19, ResNet-50/101, DenseNet-121,
247
- Inception-v3) is **statistically indistinguishable** from each other
248
- and from DINOv2-L; CLIP, Swin-B and RETFound all separate
249
- significantly (worse) from this top cluster.
250
-
251
- ### 5.3 Conformal sets (90% coverage, Mondrian per class)
252
-
253
- Conformal-prediction sets were computed per class on the validation
254
- split and applied to the test split (Mondrian variant; see
255
- `ensemble_report.json` → `conformal`). Average set size for the
256
- ensemble is < 1.5 at α = 0.1 for most classes, indicating well-
257
- calibrated predictive intervals.
258
-
259
- ### 5.4 Take-aways
260
-
261
- 1. **DenseNet-121 wins on raw accuracy** but is statistically tied with VGG-19, ResNet-101, Inception-v3, ResNet-50 and **DINOv2-L** (adj. p ≥ 0.66 on all such pairs).
262
- 2. **DINOv2-L is the best transformer** (89.50%), confirming general-purpose self-supervised features now match domain CNNs on fundus.
263
- 3. **RETFound under-performs** (83.88%) on this benchmark. Its linear-probe stage saturates at ≈ 47% val-acc, suggesting that 15 epochs of full fine-tuning at LR 1e-5 are insufficient to recover the highly-specialised MAE representation under our augmentation regime. A longer FT schedule (e.g. 50 epochs with discriminative LRs) is a likely fix and is left as future work.
264
- 4. **The 9-model ensemble does not dominate** the best individual model on accuracy because the CNN cluster is heavily correlated — but its **ROC-AUC of 0.9941** is the highest of any reported system, useful for thresholded screening deployment.
265
-
266
- ---
267
 
268
  ## 6. Reproducibility
269
 
@@ -377,17 +280,6 @@ In addition to the headline numbers above, the repo ships:
377
  - **`accuracy_ranking.png`** — horizontal bar chart of test accuracy (best on top)
378
  - **`ece_summary.json`** — ECE values for every model
379
 
380
- ### `gradcam/`
381
- Per-class Grad-CAM saliency maps (one PNG per CNN-class model, 10 classes per figure) for VGG19, ResNet50, ResNet101, DenseNet121, InceptionV3, and CLIP. Generated with `pytorch-grad-cam` against the last convolutional block of each backbone (input-gradient saliency for CLIP).
382
-
383
- ### `kfold/`
384
- 5-fold cross-validation results from the v1 sanity-check run (30 epochs/fold, Original Dataset, no augmentation, no group-aware splitting). Kept as a baseline for comparison with the headline v2 results.
385
-
386
- | Model | CV Acc (mean ± std) |
387
- |---|---|
388
- | VGG19 | 79.31 ± 1.89% |
389
- | ResNet101 | 79.27 ± 1.07% |
390
- | CLIP Transformer | 63.92 ± 1.79% |
391
 
392
 
393
  ## Quick Inference
 
167
  | 9 | `retfound` | **83.88** | [82.64, 85.10] | 87.68 | 0.810 | 0.238 | 0.9838 |
168
  | — | **9-Model Ensemble** | **89.68** | [88.65, 90.74] | **92.25** | 0.878 | 0.144 | **0.9941** |
169
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  ## 6. Reproducibility
172
 
 
280
  - **`accuracy_ranking.png`** — horizontal bar chart of test accuracy (best on top)
281
  - **`ece_summary.json`** — ECE values for every model
282
 
 
 
 
 
 
 
 
 
 
 
 
283
 
284
 
285
  ## Quick Inference