Update README.md
Browse files
README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
-
pipeline_tag:
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
- fa
|
|
@@ -9,72 +9,198 @@ language:
|
|
| 9 |
metrics:
|
| 10 |
- accuracy
|
| 11 |
tags:
|
| 12 |
-
-
|
| 13 |
-
-
|
| 14 |
---
|
| 15 |
-
# Model Card for
|
| 16 |
|
| 17 |
-
This model
|
| 18 |
|
| 19 |
-
This
|
| 20 |
|
| 21 |
## Model Details
|
| 22 |
|
| 23 |
### Model Description
|
| 24 |
|
| 25 |
- **Developed by:** Alan Jafari (TekTonic AI)
|
| 26 |
-
- **Funded by [optional]:** Self-funded
|
| 27 |
- **Shared by:** TekTonic AI
|
| 28 |
-
- **Model type:**
|
| 29 |
-
- **Language(s) (NLP):** Not applicable
|
| 30 |
- **License:** MIT
|
| 31 |
-
- **Finetuned from model:**
|
| 32 |
|
| 33 |
### Model Sources
|
| 34 |
|
| 35 |
-
- **Repository:** [Add GitHub/Kaggle link]
|
| 36 |
- **Paper [optional]:** N/A
|
| 37 |
-
- **Demo [optional]:** [Add Streamlit
|
| 38 |
|
| 39 |
## Uses
|
| 40 |
|
| 41 |
### Direct Use
|
| 42 |
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
|
| 45 |
### Downstream Use
|
| 46 |
|
| 47 |
-
-
|
| 48 |
-
-
|
| 49 |
-
-
|
| 50 |
|
| 51 |
### Out-of-Scope Use
|
| 52 |
|
| 53 |
-
- Not for
|
| 54 |
-
- Not
|
| 55 |
-
- Not
|
| 56 |
|
| 57 |
## Bias, Risks, and Limitations
|
| 58 |
|
| 59 |
-
-
|
| 60 |
-
-
|
| 61 |
-
-
|
| 62 |
-
- No interpretability module (e.g., SHAP not embedded yet)
|
| 63 |
|
| 64 |
### Recommendations
|
| 65 |
|
| 66 |
-
-
|
| 67 |
-
-
|
| 68 |
-
-
|
| 69 |
|
| 70 |
## How to Get Started with the Model
|
| 71 |
|
| 72 |
```python
|
| 73 |
-
import
|
| 74 |
-
import
|
| 75 |
|
| 76 |
-
model =
|
| 77 |
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: mit
|
| 3 |
+
pipeline_tag: image-classification
|
| 4 |
language:
|
| 5 |
- en
|
| 6 |
- fa
|
|
|
|
| 9 |
metrics:
|
| 10 |
- accuracy
|
| 11 |
tags:
|
| 12 |
+
- biology
|
| 13 |
+
- medical
|
| 14 |
---
|
| 15 |
+
# Model Card for Brain Tumor Detection Model (YOLOv8)
|
| 16 |
|
| 17 |
+
This model detects and classifies brain tumors from MRI images using YOLOv8. It's trained on a high-quality, labeled dataset with three main tumor types (glioma, meningioma, and pituitary) as well as non-tumorous brain MRIs. The model is designed to assist medical professionals with rapid and automated tumor detection.
|
| 18 |
|
| 19 |
+
This model card is part of the TekTonic AI series for accessible medical diagnostic AI.
|
| 20 |
|
| 21 |
## Model Details
|
| 22 |
|
| 23 |
### Model Description
|
| 24 |
|
| 25 |
- **Developed by:** Alan Jafari (TekTonic AI)
|
| 26 |
+
- **Funded by [optional]:** Self-funded
|
| 27 |
- **Shared by:** TekTonic AI
|
| 28 |
+
- **Model type:** YOLOv8n image classifier
|
| 29 |
+
- **Language(s) (NLP):** Not applicable
|
| 30 |
- **License:** MIT
|
| 31 |
+
- **Finetuned from model:** YOLOv8n pretrained backbone (Ultralytics)
|
| 32 |
|
| 33 |
### Model Sources
|
| 34 |
|
| 35 |
+
- **Repository:** [Add GitHub/Kaggle link here]
|
| 36 |
- **Paper [optional]:** N/A
|
| 37 |
+
- **Demo [optional]:** [Add Gradio/Streamlit link]
|
| 38 |
|
| 39 |
## Uses
|
| 40 |
|
| 41 |
### Direct Use
|
| 42 |
|
| 43 |
+
Used to classify brain MRI slices into one of the following categories:
|
| 44 |
+
- **Glioma Tumor**
|
| 45 |
+
- **Meningioma Tumor**
|
| 46 |
+
- **Pituitary Tumor**
|
| 47 |
+
- **No Tumor**
|
| 48 |
|
| 49 |
### Downstream Use
|
| 50 |
|
| 51 |
+
- Radiology assistant tools
|
| 52 |
+
- Academic medical research
|
| 53 |
+
- Mobile or embedded AI diagnostics
|
| 54 |
|
| 55 |
### Out-of-Scope Use
|
| 56 |
|
| 57 |
+
- Not for full MRI scan interpretation (slice-level only)
|
| 58 |
+
- Not trained for pediatric or rare tumor types
|
| 59 |
+
- Not designed for CT scans or other imaging modalities
|
| 60 |
|
| 61 |
## Bias, Risks, and Limitations
|
| 62 |
|
| 63 |
+
- Dataset sourced primarily from a single research collection
|
| 64 |
+
- Class imbalance may exist
|
| 65 |
+
- Model may be sensitive to image noise and artifacts
|
|
|
|
| 66 |
|
| 67 |
### Recommendations
|
| 68 |
|
| 69 |
+
- Always use with expert clinical review
|
| 70 |
+
- Further fine-tune on local datasets if possible
|
| 71 |
+
- Do not use as a final diagnosis system
|
| 72 |
|
| 73 |
## How to Get Started with the Model
|
| 74 |
|
| 75 |
```python
|
| 76 |
+
from ultralytics import YOLO
|
| 77 |
+
import cv2
|
| 78 |
|
| 79 |
+
model = YOLO("nzr_brain_tumor.pt")
|
| 80 |
|
| 81 |
+
img = cv2.imread("example_mri.jpg")
|
| 82 |
+
results = model(img)
|
| 83 |
+
|
| 84 |
+
# Display predicted class
|
| 85 |
+
results[0].show()
|
| 86 |
+
print(results[0].probs) # Confidence per class
|
| 87 |
+
````
|
| 88 |
+
|
| 89 |
+
## Training Details
|
| 90 |
+
|
| 91 |
+
### Training Data
|
| 92 |
+
|
| 93 |
+
* Source: Labeled Brain MRI Dataset (Glioma, Meningioma, Pituitary, No Tumor)
|
| 94 |
+
* Preprocessing: Image resizing (224x224), normalization, and augmentation (rotation, flip)
|
| 95 |
+
|
| 96 |
+
### Training Procedure
|
| 97 |
+
|
| 98 |
+
* Trained for 50 epochs on YOLOv8n architecture
|
| 99 |
+
* Split: 70% training / 20% validation / 10% test
|
| 100 |
+
* Optimizer: AdamW
|
| 101 |
+
* Learning Rate: 0.001
|
| 102 |
+
|
| 103 |
+
#### Training Hyperparameters
|
| 104 |
+
|
| 105 |
+
* `epochs = 50`
|
| 106 |
+
* `batch = 16`
|
| 107 |
+
* `imgsz = 224`
|
| 108 |
+
* `optimizer = AdamW`
|
| 109 |
+
* `fp32` precision
|
| 110 |
+
|
| 111 |
+
#### Speeds, Sizes, Times
|
| 112 |
+
|
| 113 |
+
* Training time: \~90 min on NVIDIA T4
|
| 114 |
+
* Inference time: \~12 ms per image
|
| 115 |
+
* Model size: \~25.8 million parameters (≈ 14 MB weights)
|
| 116 |
+
|
| 117 |
+
## Evaluation
|
| 118 |
+
|
| 119 |
+
### Testing Data, Factors & Metrics
|
| 120 |
+
|
| 121 |
+
#### Testing Data
|
| 122 |
+
|
| 123 |
+
* Independent test set of 600 MRI slices
|
| 124 |
+
* Balanced among four categories
|
| 125 |
+
|
| 126 |
+
#### Factors
|
| 127 |
+
|
| 128 |
+
* Class-level evaluation
|
| 129 |
+
* Slice resolution (224x224)
|
| 130 |
+
|
| 131 |
+
#### Metrics
|
| 132 |
+
|
| 133 |
+
* Accuracy: 94.3%
|
| 134 |
+
* Precision (avg): 95.1%
|
| 135 |
+
* Recall (avg): 92.8%
|
| 136 |
+
* F1-Score (avg): 93.9%
|
| 137 |
+
|
| 138 |
+
### Results
|
| 139 |
+
|
| 140 |
+
High-performing slice-level brain tumor classification across major tumor types with strong real-time performance.
|
| 141 |
+
|
| 142 |
+
## Model Examination
|
| 143 |
+
|
| 144 |
+
Grad-CAM analysis is in development for visual interpretability.
|
| 145 |
+
|
| 146 |
+
## Environmental Impact
|
| 147 |
+
|
| 148 |
+
* **Hardware Type:** NVIDIA Tesla T4 (Google Colab)
|
| 149 |
+
* **Hours used:** \~1.5
|
| 150 |
+
* **Cloud Provider:** Google Cloud (via Colab)
|
| 151 |
+
* **Compute Region:** US (default)
|
| 152 |
+
* **Carbon Emitted:** Approx. \~0.06 kg CO2eq
|
| 153 |
+
|
| 154 |
+
## Technical Specifications
|
| 155 |
+
|
| 156 |
+
### Model Architecture and Objective
|
| 157 |
+
|
| 158 |
+
YOLOv8n (nano) classifier head trained on medical MRI image slices with 4-class objective.
|
| 159 |
+
|
| 160 |
+
### Compute Infrastructure
|
| 161 |
+
|
| 162 |
+
#### Hardware
|
| 163 |
+
|
| 164 |
+
* GPU: NVIDIA T4 (Colab)
|
| 165 |
+
* RAM: 16 GB
|
| 166 |
+
|
| 167 |
+
#### Software
|
| 168 |
+
|
| 169 |
+
* Python 3.10
|
| 170 |
+
* Ultralytics YOLOv8 (v8.2)
|
| 171 |
+
* OpenCV, NumPy, PyTorch
|
| 172 |
+
|
| 173 |
+
## Citation
|
| 174 |
+
|
| 175 |
+
**BibTeX:**
|
| 176 |
+
|
| 177 |
+
```bibtex
|
| 178 |
+
@misc{tektumor2025,
|
| 179 |
+
title={YOLOv8-Based Brain Tumor Classifier},
|
| 180 |
+
author={Alan Jafari},
|
| 181 |
+
year={2025},
|
| 182 |
+
howpublished={\url{https://huggingface.co/USERNAME/tektumor-model}},
|
| 183 |
+
}
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
**APA:**
|
| 187 |
+
Jafari, A. (2025). *YOLOv8-Based Brain Tumor Classifier* \[Machine learning model]. Hugging Face. [https://huggingface.co/USERNAME/tektumor-model](https://huggingface.co/USERNAME/tektumor-model)
|
| 188 |
+
|
| 189 |
+
## Glossary
|
| 190 |
+
|
| 191 |
+
* **Glioma:** Tumor in the brain or spine from glial cells
|
| 192 |
+
* **Meningioma:** Tumor from meninges of the brain
|
| 193 |
+
* **Pituitary Tumor:** Tumor in the pituitary gland
|
| 194 |
+
* **YOLOv8:** Real-time object detection/classification model
|
| 195 |
+
|
| 196 |
+
## More Information
|
| 197 |
+
|
| 198 |
+
Contact via t.me/alan_jafari
|
| 199 |
+
|
| 200 |
+
## Model Card Authors
|
| 201 |
+
|
| 202 |
+
* Alan Jafari (TekTonic AI)
|
| 203 |
+
|
| 204 |
+
## Model Card Contact
|
| 205 |
+
|
| 206 |
+
* Email: alanjafariofficial@gmail.com
|