How atharv-arya/3d-brain-tumor-segmentation works
Project type and purpose
• This is a machine-learning research/codebase for 3D brain tumor segmentation.
• It consists of two Jupyter notebooks: one for exploratory data analysis (EDA.ipynb) and one for building/training a 3D ResNet segmentation model (3D_Resnet.ipynb).
• The README simply points to an external dataset (brain MRI scans in 3D).
File structure
• Top level:
• 3D_Resnet.ipynb – the modeling/training notebook.
• EDA.ipynb – data loading, visualization, preprocessing exploration.
• README.md – dataset download instructions.
• No dedicated src/, scripts/, or config/ folders—everything is in notebooks.
• No deployment or CI/CD artifacts.
Key insights from the README
• The entire pipeline depends on one core dataset downloaded externally.
• No mention of data storage solution beyond local filesystem.
• No explicit description of computing environment, but typical dependencies are PyTorch (for 3D ResNet), nibabel or SimpleITK (for reading medical images), NumPy, matplotlib, etc.
Main components
a. Data Source
• External storage (Google Drive link) → Local raw data files (e.g., NIfTI volumes).
b. Data Ingestion & Preprocessing
• Notebook/Script that loads raw 3D volumes, applies normalization, resizing/cropping, augmentations.
c. Exploratory Data Analysis (EDA)
• Notebook cell modules for visualizing slices, histograms, 3D renderings.
d. Model Definition
• 3D ResNet architecture: input layer → residual blocks → bottleneck → upsampling if segmentation head is included.
e. Training Engine
• Training loop: batch loader → forward pass → loss computation (e.g., Dice loss) → optimizer step → checkpointing.
f. Evaluation & Inference
• Metrics calculation, visualizing segmentation overlays on MRI slices, saving output masks.
g. Environment & Dependencies
• GPU compute cluster or local GPU, Python environment (conda/venv), PyTorch, medical-imaging libraries.
Relationships & interactions
• Data flows from external source into preprocessing.
• Preprocessed data feeds both EDA and the training engine.
• Model definition is invoked by the training engine.
• Checkpoints and final model artifacts are stored to disk.
• Inference modules take a trained model + new images and produce segmentation masks.
Architectural patterns & design principles
• Modular pipeline: separate data ingestion, EDA, model definition, training, and inference stages.
• Notebook-driven prototyping, but can be refactored into a script-based pipeline (use Python modules for each component).
• Use of GPU acceleration for compute-intensive 3D convolutions.
• Data-centric approach: validate correctness at EDA stage before training.
• Notes on external dependencies (e.g., GPU, Python libs)