Detecting Brain Tumors
with Neural Precision
An end-to-end AI pipeline engineered to classify brain MRI scans across 4 categories using a fine-tuned EfficientNet-V2-S architecture with Fused-MBConv blocks, Mixup augmentation, and Cosine Annealing scheduling — achieving 95.75% test accuracy.
How It Works
Three simple steps from image upload to AI-powered diagnosis.
Upload MRI Scan
Drag & drop or select a brain MRI scan in JPG or PNG format. Supports axial, coronal, and sagittal views.
AI Analysis
Our fine-tuned EfficientNet-V2-S model resizes to 224×224, normalizes the tensor, and runs inference through Fused-MBConv and MBConv layers.
Get Results
Receive instant classification with Softmax confidence scores across all 4 categories — Glioma, Meningioma, Pituitary, or No Tumor — downloadable as a report.
What We Detect
Our model classifies brain MRI scans into 4 distinct categories with an overall 95.75% test accuracy and weighted F1-score of 0.96.
Glioma
Arises from glial cells — the supportive tissue of the brain. Most common primary brain tumors, ranging from low-grade to highly malignant glioblastoma (GBM).
Meningioma
Develops from the meninges — protective membranes surrounding the brain and spinal cord. Typically slow-growing and often benign, but may compress adjacent structures.
Pituitary Tumor
Grows in the pituitary gland at the base of the brain. Often affects hormone production, potentially causing vision problems and endocrine system disruption.
No Tumor
Healthy brain scan with no anomalous growths detected. The neural network identifies normal brain tissue patterns and confirms the absence of pathological formations.
Under the Hood
A deep dive into the EfficientNet-V2-S model powering NeuralScan.AI — pre-trained on ImageNet-1K and fine-tuned with advanced training techniques.
Transfer Learning
Pre-trained on ImageNet-1K (IMAGENET1K_V1), then fine-tuned on brain MRI scans. 91.3% of the model (~19.1M parameters) is trainable with layer-wise learning rates for optimal feature adaptation.
Robust Dataset
Trained on 5,712 MRI scans across Glioma, Meningioma, Pituitary, and No Tumor classes from the Kaggle Brain Tumor MRI Dataset, validated on 800 samples.
Fused-MBConv Blocks
Early stages use Fused-MBConv that merges depthwise and pointwise convolutions into a single 3×3 conv — enabling faster training on modern GPU accelerators like Tesla T4.
Smart Preprocessing
Images are resized to 224×224, normalized with ImageNet mean [0.485, 0.456, 0.406] & std [0.229, 0.224, 0.225] to match the model's training distribution for optimal inference.
Squeeze-and-Excitation
MBConv blocks integrate SE attention modules that learn channel-wise feature importance, focusing the network on the most discriminative features in MRI scans.
Mixup Augmentation
Training uses Mixup data augmentation 50% of the time (α=0.4), blending image pairs and their labels to improve generalization and reduce overfitting on medical data.
Preprocessing Pipeline
All uploaded scans are resized to 224×224, converted to PyTorch Tensors, and normalized using ImageNet mean[0.485, 0.456, 0.406] and std[0.229, 0.224, 0.225] to match the training distribution.
How the Model Learns
Advanced training techniques that help our model achieve 97% validation accuracy in just 60 epochs — explained for everyone.
AdamW Optimizer
Simple: A smart learning algorithm that adjusts how much each part of the model changes during training.
Technical: AdamW with layer-wise learning rates: features.5 at 0.05× base, features.6 at 0.2×, features.7 at 0.5×, classifier head at full 2e-4 base LR. Weight decay: 2e-4.
Cosine Annealing Scheduler
Simple: Gradually reduces the learning speed in waves, helping the model settle into better solutions.
Technical: CosineAnnealingWarmRestarts with T_0=10, T_mult=2, eta_min=1e-7. Periodic warm restarts prevent stagnation and help escape local minima.
Label Smoothing
Simple: Makes the model less overconfident by softening the target labels slightly.
Technical: CrossEntropyLoss with label_smoothing=0.1. Instead of hard 0/1 targets, uses 0.025/0.925 distribution, reducing overconfidence and improving calibration.
Heavy Augmentation Pipeline
Simple: Applies random transformations (flips, rotations, color changes) to training images so the model learns to handle real-world variations.
Technical: RandomCrop(224), HorizontalFlip, VerticalFlip(p=0.2), Rotation(20°), ColorJitter, RandomAffine(shear=8), Grayscale(p=0.1), RandAugment(ops=2, mag=9), RandomErasing(p=0.25).
Training Summary
The model was trained for 60 epochs on an NVIDIA Tesla T4 GPU with batch size 32 and early stopping patience of 20 epochs. The best model checkpoint was saved at epoch 49 with 97.00% validation accuracy. Gradient clipping (max_norm=1.0) was used to stabilize training.
Model Performance
Detailed per-class metrics from the test set of 800 MRI scans — showing precision, recall, and F1-score for each tumor category.
What is Precision?
Out of all scans the AI labeled as a certain tumor type, how many were actually correct. Higher = fewer false alarms.
What is Recall?
Out of all actual cases of a tumor type, how many did the AI successfully find. Higher = fewer missed tumors.
What is F1-Score?
A balanced combination of Precision and Recall. Ranges from 0 to 1 — our model scores 0.96 overall, meaning excellent performance.
Stage-by-Stage Architecture
Visualize the EfficientNet-V2-S inference pipeline — from 224×224 input convolution through Fused-MBConv and MBConv stages to final 4-class classification.
Only 3×3 Filters
No 5×5 convolutions — faster on modern GPU accelerators like NVIDIA Tesla T4
Training-Aware NAS
Architecture discovered via neural architecture search optimizing both accuracy and training speed
91.3% Trainable
Fine-tuned ~19.1M of ~21M total parameters, with lower layers frozen to preserve ImageNet features
EfficientNetV2: Smaller Models and Faster Training
Mingxing Tan & Quoc V. Le — Google Research, Brain Team
Published at ICML 2021. Introduces training-aware NAS, and the Fused-MBConv block — achieving state-of-the-art accuracy on ImageNet while training up to 11× faster than previous models. Our implementation uses the EfficientNet-V2-S variant with custom classifier head for 4-class brain tumor detection.
Clinical Disclaimers
NeuralScan.AI is an experimental research tool. Predictions should NEVER be the sole basis for clinical diagnosis. Always consult a qualified radiologist.
Ready to Analyze?
Upload your brain MRI scan and let our fine-tuned EfficientNet-V2-S model provide instant classification results with confidence scores.
Launch Analyzer