This project was developed as a BA3 school project in EPFL. It provides a framework to train and evaluate deep learning models for medical image classification using the MedMNIST dataset. It supports 2 different neural network architectures with Multi-Layer Perceptrons (MLPs) and Convolutional Neural Networks (CNNs).
- @Krut007
- @Jakub-Kliment
- @GuillaumeLepin
-
Clone the repository:
git clone git@github.com:Krut007/MedMNIST_Classification.git cd MedMNIST_Classification -
Install dependencies: It is recommended to use a virtual environment.
python -m venv .venv source .venv/bin/activate pip install -r requirements.txt
The main script for training and evaluation is main.py. You can specify different options through command-line arguments.
--data: Path to the dataset (default: "dataset").--nn_type: Network architecture to use. Options:mlp,cnn(default:mlp).--nn_batch_size: Batch size for training (default: 64).--device: Device to use for training. Options:cpu,cuda,mps(default:mps).--lr: Learning rate (default: 2e-4).--max_iters: Maximum number of training epochs (default: 50).--test: Use the test set for evaluation instead of a validation set.
-
Train an MLP with default parameters:
python main.py --nn_type mlp
-
Train a CNN for 100 epochs with a learning rate of 0.001:
python main.py --nn_type cnn --max_iters 100 --lr 0.001
-
Evaluate on the test set:
python main.py --test
.
├── main.py # Main script to run the experiments
├── requirements.txt # Python dependencies
├── src
│ ├── data.py # Data loading and preprocessing
│ ├── utils.py # Utility functions
│ └── methods
│ ├── deep_network.py # MLP and CNN model definitions
│ └── dummy_methods.py # Dummy classifier for baseline
└── readme.md # This file
You can find a resume of our work and performace analysis in report.pdf. Your own performance may differ from the one we find
The main dependencies are: