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