Part of the X-Pathology AI-Assisted Medical Screening Platform Developed by Muhammad Hassan · AgenticEra Systems
Overview
XPathology Brain Tumor MRI Specialist is a fine-tuned EfficientNetB0 CNN trained to classify brain MRI scans into 4 diagnostic categories: glioma, meningioma, no tumor, and pituitary tumor. It is the second specialist model in the X-Pathology platform, which combines CNN classification with Grad-CAM explainability and Gemini-powered dual clinical/patient reporting.
This model was trained and evaluated entirely on the masoudnickparvar/brain-tumor-mri-dataset, using its pre-defined Training/ and Testing/ splits — the standard academic partition for this benchmark dataset.
Disclaimer: This model is intended for research and educational use only. It is not FDA-approved or CE-marked diagnostic software. All outputs must be verified by a licensed radiologist or neurosurgeon before any clinical decision-making.
masoudnickparvar Testing/ (1,600 images, pre-defined by dataset authors)
Temperature (T)
0.7867 (post-hoc calibration applied)
Mixed precision
Yes (float16 compute, float32 weights)
Training hardware
Kaggle T4 (single GPU)
Tumor Classes
Index
Class
Description
0
glioma
Malignant tumor arising from glial cells — most aggressive class
1
meningioma
Typically benign tumor of the meninges
2
notumor
No tumor detected — healthy brain tissue
3
pituitary
Benign adenoma of the pituitary gland
Performance
Internal Validation (20% split of Training/)
Metric
Value
Accuracy
94.20%
AUC
0.9942
Top-2 Accuracy
98.93%
Val Loss
0.5124
Holdout Validation (Testing/ — 1,600 images, never seen during training)
Metric
Value
Accuracy
90.06%
AUC
0.9786
Macro F1
0.8982
Domain shift gap
4.14%
Per-Class Performance (Holdout)
Class
Precision
Recall
F1
Support
glioma
0.9228
0.7775
0.8440
400
meningioma
0.8942
0.8450
0.8689
400
notumor
0.8980
0.9900
0.9417
400
pituitary
0.8919
0.9900
0.9384
400
Note on glioma recall (77.75%): Glioma is the most morphologically heterogeneous class. The glioma↔meningioma confusion (39 cases) is consistent with published benchmarks on this dataset — both tumor types can present with overlapping MRI signal characteristics at 2D slice level. This was confirmed across four systematic training runs (varying architecture, unfreeze percentage, and loss function), all showing glioma recall in the 77–80% range, confirming a dataset-level ceiling rather than a training failure.
RandomFlip (horizontal only) — brains are left-right symmetric
RandomRotation (±15°) — small rotation, MRI has fixed orientation
RandomBrightness (±0.15) — scanner intensity variation
RandomContrast (0.85–1.15) — scanner contrast variation
RandomCrop (95–100%) — simulates scan field-of-view variation
NO vertical flip — anatomically invalid for brain MRI
NO hue/saturation augmentation — MRI is grayscale-to-RGB, colour is meaningless
Confidence Calibration
Post-training temperature scaling was applied on the holdout set to produce calibrated probabilities:
Optimal temperature T = 0.7867
NLL before calibration: 0.3479
NLL after calibration: 0.3335
T < 1 indicates the raw softmax outputs were more diffuse than the ground truth distribution — consistent with label smoothing during training. Apply at inference: probs = softmax(logits / T).
Important: EfficientNetB0 performs its own internal normalization. Do not apply rescale=1./255 before passing the image to the model.
Repository Structure
xpathology-brain-specialist/
├── xpathology_brain_specialist_b0.keras # Trained model weights
├── brain_temperature_value.npy # Calibration temperature T = 0.7867
├── brain_class_names.json # Ordered class labels
├── brain_training_summary.json # Full training metadata
├── brain_training_log.csv # Epoch-by-epoch metrics (40 epochs)
└── README.md
Limitations
2D single-slice only: This model classifies individual 2D MRI images. Clinical diagnosis uses full 3D volumetric context across multiple slices and modalities (T1, T2, FLAIR, T1ce). Slice-level classification is a known simplification.
Glioma recall ceiling ~78%: Documented across four systematic training runs. The glioma↔meningioma overlap is inherent to 2D T1-weighted MRI without multi-modal or 3D context.
Single dataset source: Training and Testing splits originate from the same dataset. Cross-institutional validation has not been performed.
Axial plane orientation: Trained on axial-plane images. Coronal or sagittal slices may produce unreliable predictions.
Not for clinical use: This model has not undergone regulatory review and must not be used as the sole basis for any diagnostic or treatment decision.
X-Pathology Platform
This is the second specialist in X-Pathology, a multi-modal AI medical screening research platform.
Python 3.12
TensorFlow 2.x
Keras 3.x
Hardware Kaggle T4 (single GPU — no MirroredStrategy)
Mixed precision float16
Batch size 32
License
Released under the Apache 2.0 License. The training dataset is provided by Masoud Nickparvar on Kaggle. Please credit the dataset source in published work.