# Multi-Label Image Classification

This folder contains the local version of the CelebA multi-label image classification notebook.

## Local Folder Structure

The notebook expects this structure:

```text
python/multilabel-image-classification/
├── CNN_Celab.ipynb
├── Q1 Final model.keras
├── Q2 Final model.keras
├── Q3 Final model.keras
├── requirements.txt
└── Dataset/
    ├── list_attr_celeba.csv
    ├── list_eval_partition.csv
    ├── list_bbox_celeba.csv
    ├── list_landmarks_align_celeba.csv
    └── img_align_celeba/
        └── img_align_celeba/
            ├── 000001.jpg
            ├── 000002.jpg
            └── ...
```

## Setup

From the repository root:

```bash
cd python/multilabel-image-classification
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -r requirements.txt
jupyter notebook
```

Open `CNN_Celab.ipynb` and run the cells.

This setup has been smoke-tested locally with TensorFlow 2.20.0. The local CSV files are readable, the CelebA image folder is found, and `Q3 Final model.keras` loads with output shape `(None, 40)`.

## What Changed From Kaggle

- Kaggle paths under `/kaggle/input/...` now resolve to the local `Dataset/` folder.
- Kaggle save/load paths under `/kaggle/working/...` now resolve to this project folder.
- The notebook can be launched from either the repo root or `python/multilabel-image-classification`.
- Model outputs can be saved into the local project folder or `outputs/`.

## Notes

- The notebook uses the full CelebA image dataset and may take a long time to train on CPU.
- If you only want to review performance, load the existing `.keras` models and run the evaluation cells.
- TensorFlow is required for local execution.
- If Matplotlib warns about a non-writable cache directory, run `mkdir -p outputs/mplconfig` and `export MPLCONFIGDIR="$PWD/outputs/mplconfig"` before launching Jupyter.
