Commit ·
be43047
0
Parent(s):
upload
Browse files- .gitattributes +35 -0
- README.md +84 -0
- ckpt_best.pt +3 -0
- config.snapshot.yaml +48 -0
- metrics.json +0 -0
- per_sample.csv +0 -0
.gitattributes
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tar filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: cc-by-nc-nd-4.0
|
| 3 |
+
library_name: pytorch
|
| 4 |
+
tags:
|
| 5 |
+
- medical-imaging
|
| 6 |
+
- 3d-cnn
|
| 7 |
+
- ultrasound
|
| 8 |
+
- focused-ultrasound
|
| 9 |
+
- transcranial-ultrasound
|
| 10 |
+
- reproduction
|
| 11 |
+
- fine-tuned
|
| 12 |
+
datasets:
|
| 13 |
+
- vinkle-srivastav/TFUScapes
|
| 14 |
+
base_model: masonwang025/deeptfus-base
|
| 15 |
+
language:
|
| 16 |
+
- en
|
| 17 |
+
---
|
| 18 |
+
|
| 19 |
+
# DeepTFUS: variant C (soft-argmax cranked + anchor restored)
|
| 20 |
+
|
| 21 |
+
*A reproduction attempt of DeepTFUS, proposed by [Srivastav et al. (arXiv:2505.12998)](https://arxiv.org/abs/2505.12998).*
|
| 22 |
+
|
| 23 |
+
Fine-tune of [`masonwang025/deeptfus-base`](https://huggingface.co/masonwang025/deeptfus-base)
|
| 24 |
+
that's a single-knob counterfactual to variant B: same aggressive
|
| 25 |
+
soft-argmax recipe, but with the paper's `gradient_L1=0.1` anchor
|
| 26 |
+
restored. Tests whether the anchor matters at this aggression level.
|
| 27 |
+
|
| 28 |
+
⭐ Statistically tied with B on the three paper headline metrics; the
|
| 29 |
+
anchor exists to suppress secondary hot-spots (median secondary-lobe
|
| 30 |
+
volume drops 99% vs B), not to move `focal_mm`.
|
| 31 |
+
|
| 32 |
+
## Modification (vs base)
|
| 33 |
+
|
| 34 |
+
```
|
| 35 |
+
loss.focal_weight 0 to 5e-5 (+soft-argmax term)
|
| 36 |
+
loss.focal_temperature : to 0.03 (sharper than A's 0.05)
|
| 37 |
+
loss.grad_weight 0.1 to 0.1 (anchor KEPT, single knob diff vs B)
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
3-epoch warmup ramp on `focal_weight`. Fine-tune ran 10 epochs from base
|
| 41 |
+
ckpt at `lr=3e-5`; shipped ckpt is `ckpt_epoch_008.pt` (best
|
| 42 |
+
val_focal_mm in plateau).
|
| 43 |
+
|
| 44 |
+
## Test results (n = 597)
|
| 45 |
+
|
| 46 |
+
| metric | paper | base | C (this model) | Δ vs base | Δ vs B |
|
| 47 |
+
|---|---:|---:|---:|---:|---:|
|
| 48 |
+
| `relative_l2` mean ± std | 0.414 ± 0.086 | 0.384 ± 0.078 | **0.388 ± 0.077** | +0.005 (in budget) | 0.000 (tied) |
|
| 49 |
+
| `relative_l2` median | 0.394 | 0.369 | 0.372 | +0.003 | 0.000 |
|
| 50 |
+
| `focal_position_error_mm` mean ± std | 2.89 ± 2.14 | 6.49 ± 4.58 | 5.11 ± 3.76 | −1.38 mm | +0.05 (≈ tied) |
|
| 51 |
+
| `focal_position_error_mm` median | 2.45 | 5.15 | **4.15** | **−1.00 mm (−19%)** | −0.03 (≈ tied) |
|
| 52 |
+
| `max_pressure_error` mean ± std | 0.199 ± 0.158 | 0.225 ± 0.116 | 0.239 ± 0.106 | +0.014 | 0.000 |
|
| 53 |
+
| `max_pressure_error` median | 0.166 | 0.217 | 0.239 | +0.022 | 0.000 |
|
| 54 |
+
| `focal_pressure_error` median | : | 0.528 | 0.496 | −0.032 | −0.006 |
|
| 55 |
+
| `focal_iou_fwhm` median | : | 0.143 | 0.136 | −0.007 | 0.000 |
|
| 56 |
+
| `inference_latency_s` median | : | 0.233 | 0.232 | unchanged | unchanged |
|
| 57 |
+
|
| 58 |
+
## Other variants and discussion
|
| 59 |
+
|
| 60 |
+
See the [Collection](https://huggingface.co/collections/masonwang025/deeptfus-reproduction-6a03e39286a09470b960511f)
|
| 61 |
+
for the other 5 variants, and the [project page](https://masonjwang.com/projects/reproducing-deeptfus)
|
| 62 |
+
for the full reproduction story, interactive viewer, and discussion of
|
| 63 |
+
trade-offs.
|
| 64 |
+
|
| 65 |
+
## Usage
|
| 66 |
+
|
| 67 |
+
```python
|
| 68 |
+
from huggingface_hub import hf_hub_download
|
| 69 |
+
import torch
|
| 70 |
+
|
| 71 |
+
ckpt = torch.load(
|
| 72 |
+
hf_hub_download("masonwang025/deeptfus-ft-c-softargmax-anchored", "ckpt_best.pt"),
|
| 73 |
+
map_location="cpu", weights_only=False,
|
| 74 |
+
)
|
| 75 |
+
```
|
| 76 |
+
|
| 77 |
+
Model code: [github.com/masonwang025/deeptfus](https://github.com/masonwang025/deeptfus).
|
| 78 |
+
|
| 79 |
+
## Citation & License
|
| 80 |
+
|
| 81 |
+
Paper: Srivastav et al., [arXiv:2505.12998](https://arxiv.org/abs/2505.12998), 2025.
|
| 82 |
+
|
| 83 |
+
License: [CC-BY-NC-ND-4.0](https://creativecommons.org/licenses/by-nc-nd/4.0/),
|
| 84 |
+
matching the TFUScapes dataset.
|
ckpt_best.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:93d1f20501207d9755e78c5f6fdca661625e61ad5e8633cf3fb54ebd2f68c795
|
| 3 |
+
size 20747205
|
config.snapshot.yaml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
data:
|
| 2 |
+
resolution: 256
|
| 3 |
+
n_transducer_points: 512
|
| 4 |
+
model:
|
| 5 |
+
base_width: 16
|
| 6 |
+
cond_dim: 128
|
| 7 |
+
n_transducer_freqs: 8
|
| 8 |
+
dynamic_conv_kernel: 3
|
| 9 |
+
cross_attention_heads: 4
|
| 10 |
+
cross_attention_levels:
|
| 11 |
+
- level1
|
| 12 |
+
- level2
|
| 13 |
+
- level3
|
| 14 |
+
- bottleneck
|
| 15 |
+
cross_attention_bidirectional: false
|
| 16 |
+
use_film_decoder: false
|
| 17 |
+
loss:
|
| 18 |
+
alpha: 5.0
|
| 19 |
+
grad_weight: 0.1
|
| 20 |
+
focal_weight: 5.0e-05
|
| 21 |
+
focal_temperature: 0.03
|
| 22 |
+
focal_warmup_off: 0
|
| 23 |
+
focal_warmup_epochs: 3
|
| 24 |
+
box_weight: 0.0
|
| 25 |
+
train:
|
| 26 |
+
seed: 0
|
| 27 |
+
epochs: 15
|
| 28 |
+
batch_size: 4
|
| 29 |
+
lr: 3.0e-05
|
| 30 |
+
weight_decay: 0.0001
|
| 31 |
+
grad_clip: 1.0
|
| 32 |
+
num_workers: 4
|
| 33 |
+
val_every: 1
|
| 34 |
+
precision: pure-bf16
|
| 35 |
+
grad_checkpoint_encoder: false
|
| 36 |
+
channels_last: false
|
| 37 |
+
compile: false
|
| 38 |
+
save_every_epochs: 1
|
| 39 |
+
wandb_project: deeptfus-reproduction
|
| 40 |
+
wandb_entity: mason-wang
|
| 41 |
+
eval:
|
| 42 |
+
voxel_size_mm: 0.5
|
| 43 |
+
focal_threshold_db: -6.0
|
| 44 |
+
off_target_min_dist_mm: 10.0
|
| 45 |
+
n_warmup_inferences: 3
|
| 46 |
+
save_predictions: false
|
| 47 |
+
output:
|
| 48 |
+
run_dir: runs/deeptfus_ft_E_anchored_aggressive
|
metrics.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
per_sample.csv
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|