How leilakfz/mri_tumor_classification works
Project Type and Purpose
• This is a research‐style image‐classification system focused on binary classification of brain MRI scans.
• It implements three distinct pipelines:
a. Hand‐crafted feature extraction (statistical and wavelet methods).
b. Classical machine learning with PCA + SVM.
c. Deep learning using a pre‐trained ResNet‐18.
• The goal is to compare accuracy and performance of each approach on the same preprocessed dataset.
File Structure
• Top‐level directories:
• DeepLearning/
• hand_crafted_model/
• machineL/
• README.md
• Each directory maps to one experimental pipeline.
• hand_crafted_model/features.py, variance_correlation.py, waveletTransform.py
• machineL/svm.py
• DeepLearning/autoEncoder.py, resNet.py
• No separate “data” folder, but the README describes dataset acquisition and preprocessing steps.
• No deployment or config scripts—this is an experimentation framework rather than a production service.
Pull Key Insights from the README
• Dataset preprocessing (grayscale conversion, resizing, filtering) is common to all methods.
• Hand‐crafted methods: histogram/statistics and wavelet transforms.
• ML: PCA (50 components) → SVM (C=1.0, gamma=‘scale’).
• DL: ResNet‐18 (ImageNet pre‐trained), tweaked for binary output.
• Evaluation: accuracy comparison across methods.
a. Main Components
• Data Store
– Raw MRI images (source directory or object store).
• Preprocessing Module
– Grayscale conversion, resizing, filtering low‐quality images.
• Hand‐Crafted Feature Pipeline
– Variance/Correlation module
– Wavelet Transform + HOG module
– Feature aggregator
– Classifier (metric decision rule).
• ML Pipeline
– PCA transformer
– SVM classifier
• DL Pipeline
– ResNet‐18 model (with transfer learning)
– Training harness (data loader, optimizer, scheduler)
• Evaluation Module
– Accuracy calculator
– Result logger/plotter
b. Relationships and Data Flow
1. Raw images → Preprocessing Module.
2. Preprocessed images → three parallel pipelines (hand‐crafted, ML, DL).
3. Each pipeline outputs predictions.
4. Predictions → Evaluation Module → Comparative results.
5. Optionally: store trained models/artifacts in a Model Registry.
c. Architectural Patterns & Principles
• Modularity: Separate codebases for each experimental method.
• Pipeline pattern: linear data transformations culminating in a classifier.
• Parallel experimentation: three branches feed a common evaluation framework.
• Reuse: common preprocessing logic used by all pipelines.
d. Key Technologies & Libraries
• Python for orchestration.
• NumPy/OpenCV or PIL for image preprocessing.
• Scikit‐learn for PCA and SVM.
• PyTorch (torchvision) for ResNet‐18, data loaders, and training loop.
• Optionally: Matplotlib/Seaborn for visualizing results.