PyTorch
medical-imaging
ultrasound
thyroid
classification
resnet
ml-intern
Johnyquest7 commited on
Commit
85f3cc5
·
verified ·
1 Parent(s): 5b2e504

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. README.md +18 -32
  2. best_model.pth +1 -1
  3. pytorch_model.bin +1 -1
  4. results.json +17 -16
README.md CHANGED
@@ -1,20 +1,25 @@
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)
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
  ## Training Configuration
19
 
20
  | Parameter | Value |
@@ -29,6 +34,7 @@ This model was trained on the TN5000 thyroid ultrasound dataset for binary class
29
  | Warmup | 3 epochs |
30
  | Scheduler | Cosine annealing |
31
  | EMA decay | 0.999 |
 
32
  | Optimization metric | AUC-ROC |
33
 
34
  ## Test Set Performance
@@ -36,31 +42,11 @@ This model was trained on the TN5000 thyroid ultrasound dataset for binary class
36
  | Metric | Value | 95% CI |
37
  |--------|-------|--------|
38
  | Sensitivity | 0.9111 | [0.8881, 0.9307] |
39
- | Specificity | 0.1078 | [0.0734, 0.1511] |
40
- | PPV | 0.7351 | [0.7051, 0.7636] |
41
- | NPV | 0.3085 | [0.2173, 0.4122] |
42
- | AUC-ROC | 0.5201 | [0.4779, 0.5554] |
43
 
44
  ## Citation
45
 
46
  Yu, Xiaoxian et al. "TN5000: An Ultrasound Image Dataset for Thyroid Nodule Detection and Classification." Scientific Data (Nature), 2025.
47
-
48
- <!-- ml-intern-provenance -->
49
- ## Generated by ML Intern
50
-
51
- 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.
52
-
53
- - Try ML Intern: https://smolagents-ml-intern.hf.space
54
- - Source code: https://github.com/huggingface/ml-intern
55
-
56
- ## Usage
57
-
58
- ```python
59
- from transformers import AutoModelForCausalLM, AutoTokenizer
60
-
61
- model_id = 'Johnyquest7/Thyroid_EfficientNetV2'
62
- tokenizer = AutoTokenizer.from_pretrained(model_id)
63
- model = AutoModelForCausalLM.from_pretrained(model_id)
64
- ```
65
-
66
- 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
 
13
+ # Thyroid Nodule Classification – EfficientNetV2-S (AUC-Optimized v2)
14
 
15
  This model was trained on the TN5000 thyroid ultrasound dataset for binary classification of thyroid nodules (Benign vs Malignant), **optimized for AUC-ROC**.
16
 
17
+ ## Key Training Decisions
18
+
19
+ - **No class weighting in BCE loss**: AUC is a ranking metric; class weighting distorts probability calibration and hurts discriminative power.
20
+ - **WeightedRandomSampler**: Used to ensure balanced batches during training.
21
+ - **EMA decay 0.999**: For stable validation/test predictions.
22
+
23
  ## Training Configuration
24
 
25
  | Parameter | Value |
 
34
  | Warmup | 3 epochs |
35
  | Scheduler | Cosine annealing |
36
  | EMA decay | 0.999 |
37
+ | Loss | BCE (no pos_weight) |
38
  | Optimization metric | AUC-ROC |
39
 
40
  ## Test Set Performance
 
42
  | Metric | Value | 95% CI |
43
  |--------|-------|--------|
44
  | Sensitivity | 0.9111 | [0.8881, 0.9307] |
45
+ | Specificity | 0.1115 | [0.0765, 0.1554] |
46
+ | PPV | 0.7359 | [0.7059, 0.7644] |
47
+ | NPV | 0.3158 | [0.2242, 0.4192] |
48
+ | AUC-ROC | 0.5195 | [0.4772, 0.5549] |
49
 
50
  ## Citation
51
 
52
  Yu, Xiaoxian et al. "TN5000: An Ultrasound Image Dataset for Thyroid Nodule Detection and Classification." Scientific Data (Nature), 2025.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
best_model.pth CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:5002cd1ce3073ba44ca4e841529042b5b3d640038ae079067be36629ca7044c1
3
  size 324288274
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:15482835c21c210cee07fa1abcfa57738e34d45140074311f91b883e55fd7c98
3
  size 324288274
pytorch_model.bin CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:ec00324575fa05cffc06e62b9825294126b56359de21e1737c6f75c4df665713
3
  size 81611074
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:2ff41a1f37ee9f32c2d78c0371fd7cc230ec8187344f4d72c8c7c692d9ce5d65
3
  size 81611074
results.json CHANGED
@@ -1,35 +1,35 @@
1
  {
2
  "best_epoch": 1,
3
- "best_val_auc": 0.482752,
4
  "test_metrics": {
5
  "sensitivity": 0.9110807113543091,
6
  "sensitivity_ci": [
7
  0.8880679545923451,
8
  0.930704677143796
9
  ],
10
- "specificity": 0.10780669144981413,
11
  "specificity_ci": [
12
- 0.0733982286883636,
13
- 0.15114930580486097
14
  ],
15
- "ppv": 0.7350993377483444,
16
  "ppv_ci": [
17
- 0.7050788339309577,
18
- 0.7635823335148073
19
  ],
20
- "npv": 0.30851063829787234,
21
  "npv_ci": [
22
- 0.2172931496088876,
23
- 0.41218276665696707
24
  ],
25
- "auc": 0.5200774007190843,
26
  "auc_ci": [
27
- 0.4778848439216083,
28
- 0.5553833568557005
29
  ],
30
  "tp": 666,
31
- "tn": 29,
32
- "fp": 240,
33
  "fn": 65,
34
  "threshold": 0.5
35
  },
@@ -42,6 +42,7 @@
42
  "lr_backbone": 1e-05,
43
  "weight_decay": 0.0001,
44
  "ema_decay": 0.999,
45
- "optimization_metric": "auc"
 
46
  }
47
  }
 
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
  },
 
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
  }