How zainkhatri/leukemia-classifier works
Project Type & Purpose
• This is a research prototype/deep learning project for medical image classification. Its goal is to extract features from blood smear images using a CNN backbone (initially based on ResNet50 or EfficientNet variants, with attention mechanisms like CBAM), apply uncertainty quantification (via Monte Carlo Dropout and predictive entropy) and use custom preprocessing and augmentation techniques to reliably classify images as benign or as one of several malignant subtypes.
• Keep in mind that beyond the model’s core training/inference, you also have modules for data processing, training, evaluation, logging, visualization, and performance analysis.
Analyzing the File Structure
• Notice that most of the code resides in the “runs” folder. This contains key files such as:
– data_processing.py: Handles image ingestion, normalization, augmentation, and splitting.
– model.py and layers.py: Define the neural network architecture – the ResNet50 (or EfficientNet) backbone, CBAM layers, classification head, and uncertainty components.
– train.py, evaluate.py, predict.py: Essential for training the model, evaluating performance (with outputs like evaluation_metrics.json and training logs), and deploying inference respectively.
• Other files like the Proposal notebook and requirements.txt support project documentation and dependency management.
Model & System Components
a. Data Input & Processing:
b. Core Model Architecture:
• Under that, identify the “Attention Mechanism” (CBAM) and “Uncertainty Quantification Module” (Monte Carlo Dropout for confidence estimation) that enhance the overall model.
• Next, the “Classification Head” which entails global average pooling, dense layers, and softmax output.
c. Training and Ensemble Layers:
• A “Training Pipeline” component which connects the processed data to the model. Also indicate if there’s model ensemble logic (multiple models trained with different initializations) that aggregates predictions.
d. Evaluation & Visualization:
Relationships & Data Flow
• Dependency lines between modules (for example, data flows from processing to model, training logs are sent to evaluation, and evaluation results feed back into model tuning for hyperparameter optimization).