This is a federated learning project based on the PhysioNet/CinC Challenge 2017. The goal is to classify ECG signals into three categories: Normal, Atrial Fibrillation (AF), and Other.
- OS: Linux Mint 22
- Python: 3.11.10
-
Download the dataset.
bash download_dataset.sh
-
Install the requirements.
pip install -r requirements.txt
-
Login to Wandb.
Choose one of the following methods:
- Login to wandb using the following command.
wandb login
- Using .env file.
echo "WANDB_API_KEY=your_wandb_api_key" > .env
- Using the environment variable.
export WANDB_API_KEY=your_wandb_api_key
If you don't want to use wandb (Not Recommended), you can disable it using the following methods:
- Using .env file.
echo "WANDB_MODE=disabled" > .env
- Using the environment variable.
export WANDB_MODE=disabled
- Login to wandb using the following command.
-
Run the following .ipynb files in the order:
- Data preprocessing: preprocessing.ipynb
- Split dataset: split_dataset.ipynb
- Train and evaluate the model:
- For Centralized Learning: train_centralized.ipynb
- For Federated Learning: train_federated.ipynb