Johnyquest7 commited on
Commit
3fe7874
·
verified ·
1 Parent(s): 9c0b700

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +14 -63
  2. best_model.pth +2 -2
  3. pytorch_model.bin +2 -2
  4. results.json +26 -28
README.md CHANGED
@@ -1,73 +1,24 @@
1
  ---
2
  license: cc-by-4.0
3
  tags:
4
- - medical-imaging
5
- - ultrasound
6
- - thyroid
7
- - classification
8
- - efficientnet
9
- - ml-intern
10
  datasets:
11
- - Johnyquest7/TN5000-thyroid-nodule-classification
12
  ---
13
-
14
- # Thyroid Nodule Classification EfficientNetV2-S (AUC-Optimized v2)
15
-
16
- This model was trained on the TN5000 thyroid ultrasound dataset for binary classification of thyroid nodules (Benign vs Malignant), **optimized for AUC-ROC**.
17
-
18
- ## Key Training Decisions
19
-
20
- - **No class weighting in BCE loss**: AUC is a ranking metric; class weighting distorts probability calibration and hurts discriminative power.
21
- - **WeightedRandomSampler**: Used to ensure balanced batches during training.
22
- - **EMA decay 0.999**: For stable validation/test predictions.
23
-
24
- ## Training Configuration
25
-
26
- | Parameter | Value |
27
- |-----------|-------|
28
- | Backbone | tf_efficientnetv2_s.in1k (timm, ImageNet pretrained) |
29
- | Input size | 384×384 |
30
- | Batch size | 64 |
31
- | Epochs | 11 (early stopped) |
32
- | LR head | 0.0001 |
33
- | LR backbone | 1e-05 |
34
- | Weight decay | 0.0001 |
35
- | Warmup | 3 epochs |
36
- | Scheduler | Cosine annealing |
37
- | EMA decay | 0.999 |
38
- | Loss | BCE (no pos_weight) |
39
- | Optimization metric | AUC-ROC |
40
 
41
  ## Test Set Performance
42
-
43
  | Metric | Value | 95% CI |
44
  |--------|-------|--------|
45
- | Sensitivity | 0.9111 | [0.8881, 0.9307] |
46
- | Specificity | 0.1115 | [0.0765, 0.1554] |
47
- | PPV | 0.7359 | [0.7059, 0.7644] |
48
- | NPV | 0.3158 | [0.2242, 0.4192] |
49
- | AUC-ROC | 0.5195 | [0.4772, 0.5549] |
50
-
51
  ## Citation
52
-
53
- Yu, Xiaoxian et al. "TN5000: An Ultrasound Image Dataset for Thyroid Nodule Detection and Classification." Scientific Data (Nature), 2025.
54
-
55
- <!-- ml-intern-provenance -->
56
- ## Generated by ML Intern
57
-
58
- This model repository was generated by [ML Intern](https://github.com/huggingface/ml-intern), an agent for machine learning research and development on the Hugging Face Hub.
59
-
60
- - Try ML Intern: https://smolagents-ml-intern.hf.space
61
- - Source code: https://github.com/huggingface/ml-intern
62
-
63
- ## Usage
64
-
65
- ```python
66
- from transformers import AutoModelForCausalLM, AutoTokenizer
67
-
68
- model_id = 'Johnyquest7/Thyroid_EfficientNetV2'
69
- tokenizer = AutoTokenizer.from_pretrained(model_id)
70
- model = AutoModelForCausalLM.from_pretrained(model_id)
71
- ```
72
-
73
- For non-causal architectures, replace `AutoModelForCausalLM` with the appropriate `AutoModel` class.
 
1
  ---
2
  license: cc-by-4.0
3
  tags:
4
+ - medical-imaging
5
+ - ultrasound
6
+ - thyroid
7
+ - classification
8
+ - efficientnet
 
9
  datasets:
10
+ - Johnyquest7/TN5000-thyroid-nodule-classification
11
  ---
12
+ # Thyroid Nodule Classification - EfficientNetV2-S (AUC-Optimized v4)
13
+ Frozen backbone, deeper head with Dropout 0.5. Optimized for AUC-ROC.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
  ## Test Set Performance
 
16
  | Metric | Value | 95% CI |
17
  |--------|-------|--------|
18
+ | Sensitivity | 0.1751 | [0.1482, 0.2046] |
19
+ | Specificity | 0.9294 | [0.8919, 0.9569] |
20
+ | PPV | 0.8707 | [0.8055, 0.9204] |
21
+ | NPV | 0.2931 | [0.2627, 0.3249] |
22
+ | AUC-ROC | 0.6835 | [0.6467, 0.7199] |
 
23
  ## Citation
24
+ Yu, Xiaoxian et al. "TN5000..." Scientific Data (Nature), 2025.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
best_model.pth CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:15482835c21c210cee07fa1abcfa57738e34d45140074311f91b883e55fd7c98
3
- size 324288274
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:1475972504c0a9df090290d68e2fea6ee1d719a1de25e0e2055ae0683d3fbf58
3
+ size 82917646
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:2ff41a1f37ee9f32c2d78c0371fd7cc230ec8187344f4d72c8c7c692d9ce5d65
3
- size 81611074
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:50344f12c08700a55344eb5c64cd45994bf32e878b45715ada7f0c4711344d95
3
+ size 82919434
results.json CHANGED
@@ -1,48 +1,46 @@
1
  {
2
- "best_epoch": 1,
3
- "best_val_auc": 0.4818346666666667,
4
  "test_metrics": {
5
- "sensitivity": 0.9110807113543091,
6
  "sensitivity_ci": [
7
- 0.8880679545923451,
8
- 0.930704677143796
9
  ],
10
- "specificity": 0.11152416356877323,
11
  "specificity_ci": [
12
- 0.07652180042423258,
13
- 0.155368432564055
14
  ],
15
- "ppv": 0.7359116022099448,
16
  "ppv_ci": [
17
- 0.7058993124376329,
18
- 0.7643793122110114
19
  ],
20
- "npv": 0.3157894736842105,
21
  "npv_ci": [
22
- 0.22421979057887004,
23
- 0.41920736370136785
24
  ],
25
- "auc": 0.5194773163004287,
26
  "auc_ci": [
27
- 0.4771984664530449,
28
- 0.5548698473128044
29
  ],
30
- "tp": 666,
31
- "tn": 30,
32
- "fp": 239,
33
- "fn": 65,
34
  "threshold": 0.5
35
  },
36
  "config": {
37
  "backbone": "tf_efficientnetv2_s.in1k",
 
38
  "img_size": 384,
39
  "batch_size": 64,
40
- "epochs_trained": 11,
41
- "lr_head": 0.0001,
42
- "lr_backbone": 1e-05,
43
- "weight_decay": 0.0001,
44
- "ema_decay": 0.999,
45
- "optimization_metric": "auc",
46
- "pos_weight": 1.0
47
  }
48
  }
 
1
  {
2
+ "best_epoch": 24,
3
+ "best_val_auc": 0.6955626666666666,
4
  "test_metrics": {
5
+ "sensitivity": 0.17510259917920656,
6
  "sensitivity_ci": [
7
+ 0.14822370178949582,
8
+ 0.2046325480923097
9
  ],
10
+ "specificity": 0.929368029739777,
11
  "specificity_ci": [
12
+ 0.8918951222927511,
13
+ 0.9569420548075194
14
  ],
15
+ "ppv": 0.8707482993197279,
16
  "ppv_ci": [
17
+ 0.8055358886428969,
18
+ 0.9203548937021385
19
  ],
20
+ "npv": 0.29308323563892147,
21
  "npv_ci": [
22
+ 0.26271020298013675,
23
+ 0.3248933746402657
24
  ],
25
+ "auc": 0.6834783537345084,
26
  "auc_ci": [
27
+ 0.6466884099392298,
28
+ 0.7199268327692855
29
  ],
30
+ "tp": 128,
31
+ "tn": 250,
32
+ "fp": 19,
33
+ "fn": 603,
34
  "threshold": 0.5
35
  },
36
  "config": {
37
  "backbone": "tf_efficientnetv2_s.in1k",
38
+ "frozen": true,
39
  "img_size": 384,
40
  "batch_size": 64,
41
+ "epochs_trained": 39,
42
+ "lr_head": 0.0005,
43
+ "weight_decay": 0.001,
44
+ "optimization_metric": "auc"
 
 
 
45
  }
46
  }