TurkishCodeMan commited on
Commit
7a22ac6
·
verified ·
1 Parent(s): 31c52d1

🫁 Add fine-tuned ViT-Base lung cancer classifier (normal/malignant/benign)

Browse files
Files changed (1) hide show
  1. README.md +27 -14
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
- ### Python Inference
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
- # {'prediction': 'malignant', 'probabilities': {'normal': 0.02, 'malignant': 0.91, 'benign': 0.07}}
82
-
83
- 🛠️ Training Config
84
-
85
- Parameter: Value
86
- Optimizer: AdamW
87
- Learning Rate: 2e-5
88
- Batch Size: 16
89
- Max Epochs: 30
90
- Early Stopping Patience: 5
91
- Mixed Precision: fp16
92
- Best Metric: F1-Macro
 
 
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 |