Built to order

Brain Tumor Detection using CNN

This project builds a convolutional neural network that detects brain tumors in MRI scans and segments tumor sub-regions — enhancing tumor, necrotic core and peritumoral edema — using the BraTS multimodal dataset. A training notebook walks through skull-stripping, normalization, model training and evaluation with Dice scores and confusion matrices, and a Flask demo app classifies uploaded scans with visual segmentation overlays. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Brain Tumor Detection using CNN — project thumbnail preview
More project photos (2)

The problem

Reading a brain MRI for tumors is slow, expert-dependent work: a radiologist scrolls through more than a hundred axial slices per patient, comparing four modalities (T1, T1ce, T2, FLAIR) to spot gliomas that can be small, diffuse and easy to miss when fatigued. Manual delineation of tumor boundaries for surgical planning is even slower and varies between observers. Convolutional neural networks have become the standard academic answer to this problem — the annual BraTS (Brain Tumor Segmentation) challenge has benchmarked them since 2012 — because they learn hierarchical texture and shape features directly from voxel data instead of relying on hand-crafted rules. This project turns that research capability into a complete student build: a classifier that flags tumor presence and grade pattern per slice, plus a 3D U-Net that segments the three BraTS tumor sub-regions, wrapped in a demo app with overlay visualization. It demonstrates the full medical-imaging ML workflow — NIfTI handling, multimodal fusion, segmentation metrics — while staying honest about being an academic prototype rather than a clinical tool.

How it works

  1. BraTS multimodal MRI volumes (T1, T1ce, T2, FLAIR, 240x240x155 voxels) are loaded from NIfTI files, skull-stripped and z-score normalized per modality.
  2. Axial slices are extracted and stacked into 4-channel inputs; patient-wise train/validation/test splits keep each patient's slices in exactly one split.
  3. The classifier (ImageNet-pretrained EfficientNet-B0 with a replaced head) is fine-tuned with augmentation — flips, rotations, intensity shifts — while the 3D U-Net trains on voxel masks with Dice + cross-entropy loss.
  4. Every epoch logs training/validation loss, accuracy curves and Dice per sub-region; the best checkpoint is selected on the validation split.
  5. The evaluation notebook computes the final metrics on the held-out test split: per-class precision/recall/F1, confusion matrix, Dice and IoU for whole tumor, tumor core and enhancing tumor.
  6. At demo time the Flask app accepts an uploaded slice, runs both models, and returns the predicted class with probabilities plus the color-coded segmentation overlay.

Tech stack:

  • Python 3.10, PyTorch (classifier and 3D U-Net training and inference)
  • NiBabel, MONAI (NIfTI loading, medical-image transforms)
  • EfficientNet-B0 classifier + 3D U-Net segmenter
  • scikit-learn (metrics, confusion matrix, patient-wise splits)
  • Matplotlib, Seaborn (training curves, overlay figures)
  • Flask demo web app (scan upload, modality switcher, overlay viewer)
  • Jupyter notebook (buyer-run training and evaluation)
Parameter Value
Task Slice-level tumor classification + voxel-wise tumor segmentation
Dataset BraTS (Brain Tumor Segmentation Challenge) — multimodal MRI, HGG/LGG cases, expert voxel annotations
Modalities T1, T1ce (contrast-enhanced), T2, FLAIR stacked as 4-channel input
Classes (classifier) No tumor / low-grade pattern / high-grade pattern
Segmentation labels 0 background, 1 necrotic/non-enhancing core, 2 peritumoral edema, 4 enhancing tumor
Models EfficientNet-B0 classifier; 3D U-Net segmenter (Dice + cross-entropy loss)
Input Axial MRI slices / NIfTI volumes, 240x240x155 voxels
Output Class probabilities, color-coded segmentation overlay, region volume estimates
Evaluation Accuracy, per-class precision/recall/F1, confusion matrix, Dice and IoU per sub-region — computed by the notebook on your held-out split
Design targets ~85-90% slice-level validation accuracy; Dice(whole tumor) ~0.85+ (targets, not measured claims)
Demo Flask app with upload, modality switcher, overlay toggles
Scope note Academic research prototype — not a medical device, not for clinical diagnosis

Project features

  • [Multimodal MRI preprocessing] NIfTI loading with skull-stripping, co-registration checks, z-score normalization per modality and stacking of T1, T1ce, T2 and FLAIR into a 4-channel network input.
  • [Slice-level tumor classifier] EfficientNet-B0 based classifier that labels each axial slice as no tumor, low-grade pattern or high-grade pattern, with per-class probability scores.
  • [3D U-Net segmentation] Encoder-decoder network with skip connections that produces voxel-wise masks for the three BraTS sub-regions: enhancing tumor, necrotic/non-enhancing core and peritumoral edema.
  • [Segmentation overlay viewer] The Flask demo renders predicted masks as color overlays on the MRI slice with per-region toggles and estimated region volumes.
  • [Explainability panels] Grad-CAM heatmaps for the classifier and per-region Dice/IoU reporting for the segmenter, so the report can show what the models actually learned.
  • [Buyer-run evaluation notebook] Computes validation accuracy, per-class precision/recall/F1, confusion matrix and Dice/IoU per tumor sub-region on the held-out split — every number in the report comes from your build.
  • [Patient-wise split utilities] Splitting helpers that keep all slices of one patient in a single fold, preventing the slice-leakage that silently inflates student results.
  • [Case comparison mode] Demo supports comparing T1 vs T1ce vs T2 vs FLAIR views of the same slice to show how each modality contributes to the decision.

What is included

  • Complete source code (preprocessing, classifier, 3D U-Net, demo app, evaluation utilities)
  • Jupyter training and evaluation notebook (buyer-run: preprocess, train, validate, evaluate)
  • Flask demo application with scan upload and segmentation overlay viewer
  • Project report PDF (background, BraTS analysis, methodology, evaluation, error analysis, limitations)
  • PPT presentation for final review
  • Viva Q&A preparation document (CNNs, U-Net, Dice vs IoU, BraTS modalities, Grad-CAM, overfitting)
  • Setup guide (environment, dataset download, training on CPU/GPU, running the demo)

Limitations & prerequisites

  • BraTS contains pre-operative glioma scans only — the model has never seen metastases, meningiomas or post-operative scans and cannot be expected to handle them.
  • This is an academic prototype, not a medical device: it is not clinically validated, not certified, and must never guide diagnosis or treatment; a qualified radiologist's reading is the only thing that counts clinically.
  • Segmentation quality depends on all four modalities being present and aligned; missing or misaligned modalities degrade the masks.
  • Full 3D training is GPU-hungry — the notebook documents a lighter 2.5D slice-based alternative for CPU-only builds, with the accuracy tradeoff stated openly.
  • Reported metrics come from the buyer's own training run and vary with the BraTS version, split, preprocessing and hyperparameters; design targets are goals, not guarantees.
  • Public research scans differ from any hospital's scanner data in resolution, contrast and artifacts, so performance on outside data is not promised.

Frequently Asked Questions

Which dataset is used?

BraTS (Brain Tumor Segmentation Challenge), the standard academic benchmark since 2012: multimodal MRI (T1, T1ce, T2, FLAIR) of glioma patients with expert voxel-level annotations for enhancing tumor, necrotic core and edema.

Which models are used?

An EfficientNet-B0 classifier for slice-level tumor detection and a 3D U-Net for voxel-wise segmentation, trained with Dice + cross-entropy loss. The notebook also shows how to swap in a lighter 2D U-Net for CPU-only training.

Is the accuracy guaranteed?

No. The page states design targets (~85-90% validation accuracy, Dice(WT) ~0.85+), but the actual numbers come from your training run, logged by the notebook on your held-out split, and the report presents those — never pre-filled claims.

Is this a medical device? Can it diagnose patients?

No. This is strictly an academic research prototype for learning medical-image deep learning. It is not clinically validated or certified, and must never be used for diagnosis or treatment decisions.

Can I run it on my own MRI scans?

The demo accepts uploaded slices in standard image formats; the training pipeline expects BraTS-style NIfTI volumes. The setup guide covers both, including the modality requirements.

What will I receive with the project?

Source code, the training/evaluation notebook, the Flask demo app, report PDF, PPT, viva Q&A document and setup guide — everything prepared fresh for your build. Suitable for B.E./B.Tech final-year projects in Computer Science, AI/ML and Data Science.

Components & software requirements
  • Python 3.10, PyTorch (classifier and 3D U-Net training and inference)
  • NiBabel, MONAI (NIfTI loading, medical-image transforms)
  • EfficientNet-B0 classifier + 3D U-Net segmenter
  • scikit-learn (metrics, confusion matrix, patient-wise splits)
  • Matplotlib, Seaborn (training curves, overlay figures)
  • Flask demo web app (scan upload, modality switcher, overlay viewer)
  • Jupyter notebook (buyer-run training and evaluation)
Delivery information

Built-to-order project. Delivery timeline is shared after order confirmation based on current queue.

Support terms

Complete documentation, setup guide, and viva preparation included. Support for setup and explanation provided.

Download abstract (PDF)

Related guides

All guides
Illustration of object tracking showing video frames with bounding boxes and persistent ID labels following people and vehicles, comparing motion prediction and appearance matching.B.E./B.Tech Computer Science and Electronics students building video analytics projects — people counting, vehicle tracking, sports analysis — who have detection working and need

Object Tracking: DeepSORT and ByteTrack Explained

Detection finds objects per frame; tracking keeps their identities across frames. This guide explains tracking-by-detection, Kalman motion models, DeepSORT's appearance embeddings vs ByteTrack's low-confidence box recovery, tracking metrics (HOTA, IDF1, ID switches), and the tuning parameters that determine real-world quality.

Read guide
Illustration of image segmentation showing U-Net's U-shaped encoder-decoder with skip connections producing pixel masks, alongside Mask R-CNN detecting instances with masks.B.E./B.Tech Computer Science and AI/ML students moving from image classification or detection to pixel-level understanding — medical imaging, defect detection, autonomous driving

Image Segmentation: U-Net and Mask R-CNN

When projects need pixel-level answers, segmentation delivers. This guide explains semantic vs instance vs panoptic segmentation, U-Net's encoder-decoder with skip connections, Mask R-CNN's parallel mask head, Dice and IoU evaluation, paired augmentation, and how to choose the right architecture for your data and question.

Read guide
Illustration of Whisper speech-to-text showing sound waves flowing into a neural network and emerging as transcribed text with timestamps and speaker labels.B.E./B.Tech Computer Science and AI/ML students adding speech-to-text to projects — voice assistants, meeting transcription, accessibility tools

Whisper for Speech-to-Text in Student Projects

Whisper transcribes speech in dozens of languages with no training required. This guide covers how it works, choosing among model sizes, running it locally with faster-whisper, handling hour-long audio, timestamps and speaker diarization, multilingual quirks, and honest evaluation with word error rate.

Read guide
Get a quotation