Spaces:
Sleeping
Sleeping
π Notebooks Directory
This directory contains the core machine learning experiments, including Exploratory Data Analysis (EDA) and the PyTorch DenseNet121 fine-tuning pipeline.
β οΈ Prerequisite: Before executing these notebooks, you must download the 2GB Kaggle Chest X-Ray dataset into the project workspace. Because we use Google Colab for GPU training, follow the instructions below to ingest the data directly into your active Colab session.
π Step 1: Obtain Your Kaggle API Token
To download the dataset programmatically, you need a personal Kaggle authentication token:
- Log in to your account at Kaggle.com.
- Click your Profile Picture in the top right corner and select Settings.
- Scroll down to the API section.
- Click Create New Token.
- Copy the generated token string (it will look something like
KGAT_...). Treat this string like a password.
π₯ Step 2: Ingest Data
a. Via Colab Terminal (Single Command)**
Google Colab now provides free terminal access. You can download, extract, and clean up the entire dataset by copying and pasting a single chained command.
- On the far left sidebar of your Colab interface, click the Terminal icon (
>_). - Copy the following block of code.
- Replace
"your_actual_token_here"with your real Kaggle token. - Paste it into the Colab terminal and press Enter:
export KAGGLE_API_TOKEN="your_actual_token_here" && pip install -q kaggle && mkdir -p ../dataset && kaggle datasets download -d paultimothymooney/chest-xray-pneumonia -p ../dataset && unzip -q ../dataset/chest-xray-pneumonia.zip -d ../dataset && rm ../dataset/chest-xray-pneumonia.zip && echo "β
Dataset successfully downloaded and extracted!"
b. Local Shell (e.g. Ubuntu)
Run the following command from the project's root directory.
chmod +x scripts/01_download_dataset.sh
./scripts/01_download_dataset.sh