🫁 Add fine-tuned ViT-Base lung cancer classifier (normal/malignant/benign)
Browse files
README.md
CHANGED
|
@@ -35,15 +35,27 @@ into 3 classes: **normal**, **malignant**, and **benign**.
|
|
| 35 |
| 1 | `malignant` | Malignant (cancerous) tissue |
|
| 36 |
| 2 | `benign` | Benign (non-cancerous) tissue |
|
| 37 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
## 🚀 Usage
|
| 39 |
|
| 40 |
### Install
|
| 41 |
|
| 42 |
```bash
|
| 43 |
pip install transformers torch pillow
|
|
|
|
| 44 |
|
| 45 |
-
###
|
| 46 |
-
Inference
|
| 47 |
|
| 48 |
```python
|
| 49 |
from transformers import ViTForImageClassification, ViTImageProcessor
|
|
@@ -78,15 +90,16 @@ def predict(image_path: str) -> dict:
|
|
| 78 |
|
| 79 |
result = predict("lung_scan.jpg")
|
| 80 |
print(result)
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
🛠️ Training Config
|
| 84 |
-
|
| 85 |
-
Parameter
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
|
|
|
|
|
| 35 |
| 1 | `malignant` | Malignant (cancerous) tissue |
|
| 36 |
| 2 | `benign` | Benign (non-cancerous) tissue |
|
| 37 |
|
| 38 |
+
## 📅 Dataset
|
| 39 |
+
|
| 40 |
+
The model was trained on a comprehensive lung cancer dataset containing global clinical and risk factor data.
|
| 41 |
+
|
| 42 |
+
| Property | Details |
|
| 43 |
+
|---|---|
|
| 44 |
+
| **Total Records** | 1,500 patient records |
|
| 45 |
+
| **Features** | 41 variables (Clinical, Demographic, Genetic, Risk Factors) |
|
| 46 |
+
| **Period** | 2015 – 2025 |
|
| 47 |
+
| **Scope** | 60 countries across 6 WHO Regions |
|
| 48 |
+
| **Key Factors** | Smoking status, BMI, Air Pollution, Genetic Mutations, Tumor Stage |
|
| 49 |
+
|
| 50 |
## 🚀 Usage
|
| 51 |
|
| 52 |
### Install
|
| 53 |
|
| 54 |
```bash
|
| 55 |
pip install transformers torch pillow
|
| 56 |
+
```
|
| 57 |
|
| 58 |
+
### Inference
|
|
|
|
| 59 |
|
| 60 |
```python
|
| 61 |
from transformers import ViTForImageClassification, ViTImageProcessor
|
|
|
|
| 90 |
|
| 91 |
result = predict("lung_scan.jpg")
|
| 92 |
print(result)
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
## 🛠️ Training Config
|
| 96 |
+
|
| 97 |
+
| Parameter | Value |
|
| 98 |
+
|---|---|
|
| 99 |
+
| **Optimizer** | AdamW |
|
| 100 |
+
| **Learning Rate** | 2e-5 |
|
| 101 |
+
| **Batch Size** | 16 |
|
| 102 |
+
| **Max Epochs** | 30 |
|
| 103 |
+
| **Early Stopping** | 5 epochs patience |
|
| 104 |
+
| **Mixed Precision**| fp16 |
|
| 105 |
+
| **Best Metric** | F1-Macro |
|