How mrinaljain17/ct-image-segmentation works
Main Components
• Data Ingestion & Processing: Represent components like the “capstone/data” and “capstone/volumetric/data_module.py”, “datasets.py”, “download.py”, “process_miccai.py”, and utility functions from “capstone/data/utils.py”. Emphasize the process that downloads, extracts, and splits the MICCAI dataset.
• Data Transformation: Include the “capstone/transforms” and “capstone/volumetric/predefined.py”/“transforms.py” modules. These components manage data augmentation and preprocessing (using Albumentations and MONAI).
• Model Building & Metrics: Capture the “capstone/models” and corresponding “losses.py”, “metrics.py”, and even any prototypical implementations (like “temp.py”), which combine domain-specific functions for segmentation.
• Training & Experimentation: Illustrate the training frameworks through “capstone/training” (with distinct trainers such as “base_trainer.py” and “mixup_trainer.py”) and parallel volumetric training modules in “capstone/volumetric”. Also include how experiment tracking might be integrated (via Weights and Biases) with PyTorch-Lightning.
• Notebooks for Analysis: Represent the notebooks in “capstone/notebooks” as exploratory tools or prototyping environments that interact with the core modules.
• Environment & Configuration: Optionally include the “paths.py” for configuration and project-level scripts (setup.py, .gitignore, LICENSE).
Relationships and Interactions
• Data Flow: Start from data download and preprocessing (Data Ingestion & Processing) → data augmentation and transformation (Data Transformation) → Model Input.
• Training Pipeline: Flow from the transformed data into the Trainer modules (training strategies) which utilize models, losses, and metrics. Indicate how training routines integrate with experiment logging.
• Feedback Loops: Show that evaluation and interpretability modules support the training module by providing analysis outputs and visualizations.
• Notebook Interfaces: Show notebooks interfacing with multiple components (data, training, visualization) to facilitate experimentation and understanding.
Architectural Patterns & Design Principles
• Modular Separation: Demonstrate how the project separates concerns into discrete modules (data handling, transforms, model definitions, training routines, etc.).
• Reusable Components: Emphasize reusability through shared utility functions (in capstone/utils) and abstraction in training (base_trainer vs. mixup_trainer).
• Domain-Specific Customization: Note the use of MONAI and custom transforms for handling medical imaging data which dictates certain patterns.
• Two Parallel Pipelines: Differentiate components dealing with typical 2D segmentation (in “capstone”) and volumetric 3D segmentation (in “capstone/volumetric”).
Relevant Technologies
• Python (3.7)
• PyTorch and PyTorch-Lightning for training and model management.
• MONAI for domain-specific operations.
• Albumentations for augmentations.
• Weights and Biases for experiment tracking.
• Additional libraries: Tqdm for progress indication, pynrrd for dataset loading.