alanjafari commited on
Commit
f4eeb47
·
verified ·
1 Parent(s): 9f685bc

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +158 -32
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  license: mit
3
- pipeline_tag: tabular-classification
4
  language:
5
  - en
6
  - fa
@@ -9,72 +9,198 @@ language:
9
  metrics:
10
  - accuracy
11
  tags:
12
- - med
13
- - tumor
14
  ---
15
- # Model Card for NZR Breast Cancer Early Detection AI
16
 
17
- This model performs binary classification to detect **malignant** versus **benign** tumors using clinical diagnostic data from the Wisconsin Breast Cancer Diagnostic Dataset. It was built with a Random Forest classifier and designed for early-stage breast cancer screening support.
18
 
19
- This modelcard aims to be a base template for open-sourced medical AI, particularly for structured (tabular) data inputs.
20
 
21
  ## Model Details
22
 
23
  ### Model Description
24
 
25
  - **Developed by:** Alan Jafari (TekTonic AI)
26
- - **Funded by [optional]:** Self-funded (independent research)
27
  - **Shared by:** TekTonic AI
28
- - **Model type:** Random Forest Classifier (100 estimators)
29
- - **Language(s) (NLP):** Not applicable (structured data)
30
  - **License:** MIT
31
- - **Finetuned from model:** N/A (trained from scratch)
32
 
33
  ### Model Sources
34
 
35
- - **Repository:** [Add GitHub/Kaggle link]
36
  - **Paper [optional]:** N/A
37
- - **Demo [optional]:** [Add Streamlit or web demo link if available]
38
 
39
  ## Uses
40
 
41
  ### Direct Use
42
 
43
- This model can be directly used to classify breast cancer tumors (benign vs malignant) using clinical feature data. It accepts 10 numerical features as input (e.g., radius_mean, texture_mean, etc.) and returns a class prediction.
 
 
 
 
44
 
45
  ### Downstream Use
46
 
47
- - Integration in medical dashboards
48
- - Research on breast cancer ML techniques
49
- - Educational applications in healthcare AI
50
 
51
  ### Out-of-Scope Use
52
 
53
- - Not for use with image data (e.g., mammograms or MRI)
54
- - Not a substitute for clinical diagnosis
55
- - Not trained for male breast cancer or pediatric cases
56
 
57
  ## Bias, Risks, and Limitations
58
 
59
- - Trained only on adult female data
60
- - Demographic diversity not captured
61
- - Possible overconfidence on limited data
62
- - No interpretability module (e.g., SHAP not embedded yet)
63
 
64
  ### Recommendations
65
 
66
- - Use under expert medical supervision
67
- - Complementary to, not a replacement for, radiology or biopsy
68
- - Retrain with local data for domain adaptation
69
 
70
  ## How to Get Started with the Model
71
 
72
  ```python
73
- import joblib
74
- import numpy as np
75
 
76
- model = joblib.load("nzr_model.pkl")
77
 
78
- # Example input: 10 numerical diagnostic features
79
- x_input = np.array([[14.5, 20.0, 95.0, 660.0, 0.1, 0.15, 0.08, 0.05, 0.18, 0.06]])
80
- prediction = model.predict(x_input)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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