Upload folder using huggingface_hub
Browse files- README.md +14 -63
- best_model.pth +2 -2
- pytorch_model.bin +2 -2
- 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 |
-
|
| 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.
|
| 46 |
-
| Specificity | 0.
|
| 47 |
-
| PPV | 0.
|
| 48 |
-
| NPV | 0.
|
| 49 |
-
| AUC-ROC | 0.
|
| 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:
|
| 3 |
-
size
|
|
|
|
| 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:
|
| 3 |
-
size
|
|
|
|
| 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":
|
| 3 |
-
"best_val_auc": 0.
|
| 4 |
"test_metrics": {
|
| 5 |
-
"sensitivity": 0.
|
| 6 |
"sensitivity_ci": [
|
| 7 |
-
0.
|
| 8 |
-
0.
|
| 9 |
],
|
| 10 |
-
"specificity": 0.
|
| 11 |
"specificity_ci": [
|
| 12 |
-
0.
|
| 13 |
-
0.
|
| 14 |
],
|
| 15 |
-
"ppv": 0.
|
| 16 |
"ppv_ci": [
|
| 17 |
-
0.
|
| 18 |
-
0.
|
| 19 |
],
|
| 20 |
-
"npv": 0.
|
| 21 |
"npv_ci": [
|
| 22 |
-
0.
|
| 23 |
-
0.
|
| 24 |
],
|
| 25 |
-
"auc": 0.
|
| 26 |
"auc_ci": [
|
| 27 |
-
0.
|
| 28 |
-
0.
|
| 29 |
],
|
| 30 |
-
"tp":
|
| 31 |
-
"tn":
|
| 32 |
-
"fp":
|
| 33 |
-
"fn":
|
| 34 |
"threshold": 0.5
|
| 35 |
},
|
| 36 |
"config": {
|
| 37 |
"backbone": "tf_efficientnetv2_s.in1k",
|
|
|
|
| 38 |
"img_size": 384,
|
| 39 |
"batch_size": 64,
|
| 40 |
-
"epochs_trained":
|
| 41 |
-
"lr_head": 0.
|
| 42 |
-
"
|
| 43 |
-
"
|
| 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 |
}
|