How huytrnq/deep-skin-lesion-classification works
Main Components
• Data Module:
• Data Sources: Represent the “datasets” directory that contains subfolders for Binary and Multiclass datasets, including accompanying text files (e.g., classes.txt, train.txt, test.txt, val.txt) and shell scripts (generate_data_files.sh).
• Data Preprocessing & Augmentation: Capture the functionality in the “utils/transform.py” and “utils/dataset.py” which likely handle geometric and contrast augmentations, noise introduction, etc.
• Model and Training Module:
• Model Architectures: Illustrate the “models” directory which contains implementations of EfficientNet (efficientnet.py), ResNet (resnet.py), Swin (swin.py) and custom loss functions (loss.py).
• Experiment Scripts: Include “exp.py” for single-run experiments and “exp_cv.py” for cross-validation runs.
• Ensemble: Highlight the standalone “ensemble.py” script which likely combines predictions from different models.
• Evaluation & Metrics:
• Testing Utilities: Include “test.py” and “test_cv.py” which handle the evaluation of the trained models.
• Metrics Calculation: Use “utils/metric.py” to show how the model performance (accuracy, kappa, etc.) is computed.
• Configuration & Dependency Management:
• Configuration: Represent “config.json” as a source of configurable parameters.
• Dependencies and Environment: Include “requirements.txt” and CI configuration in “.github/workflows” (such as the pylint workflow) for maintaining code quality.
• Monitoring & Logging:
Component Relationships & Data Flow
• Data Flow: Begin with the raw image data (from datasets) that is fed into the data preprocessing/augmentation layer.
• Model Training: Show that these experiments interact with the models (EfficientNet, ResNet, etc.) for training.
• Evaluation: Once models are trained, testing scripts (test.py, test_cv.py) and evaluation utilities (metrics) analyze model performance.
• Ensemble Process: The ensemble.py component may take predictions from different models as inputs to compute a final classifier output.
Architectural Patterns & Design Principles
• Modular Architecture: The project’s folder organization (separate directories for datasets, models, utils, etc.) encourages loose coupling. Each area (data, model, evaluation) is a self-contained module.
• Separation of Concerns: Distinct modules for configuration, data augmentation, model training, and evaluation ensure clarity in data flow and responsibilities.
• Experimentation & Reproducibility: The presence of separate experiment scripts (including those for cross-validation) and detailed configuration files shows an emphasis on reproducible research.
• CI/CD Integration: The GitHub workflows indicate adherence to quality and integration best practices.