Can a neural network distinguish whether an image in CINIC-10 comes from CIFAR-10 or ImageNet — even when class labels are the same?
This project explores a meta-learning task using the CINIC-10 dataset. We train a binary classifier to detect the origin domain of an image (CIFAR vs. ImageNet), despite both domains sharing the same 10 class labels (e.g., airplane, dog, ship).
- Create a binary domain label (
CIFARorImageNet) for each image. - Train a simple CNN or MLP to predict the source domain.
- Compare with baseline methods like random guessing or pixel statistics.
- Visualize image embeddings using t-SNE to explore learned patterns.
- CINIC-10: A 270,000-image dataset mixing CIFAR-10 and downsampled ImageNet images.
- All images are 32×32 pixels and belong to one of 10 shared classes.
- Basic CNN or shallow MLP as classifiers.
- Use of pretrained features (e.g. ResNet18) for comparison.
- Optional: ROC AUC, accuracy, t-SNE visualization.
data/ # CINIC-10 images and labels
notebooks/ # Jupyter notebooks for exploration and training
models/ # Trained model files
results/ # Evaluation metrics and plotsNote that we did not use results but used a build directory inside the notebooks directory to store some images.
Before running the code, make sure to download the CINIC-10 dataset, set up the environment and run the python script to generate Labels for the Dataset.
-
Navigate to the
data/directory. -
Follow the instructions in
loading_the_dataset.mdto download and extract the dataset. -
Install the required Python packages using the provided environment file. We recommend using Mamba (a faster alternative to conda):
mamba env create -f environment_2025.yml
-
Activate the environment before working on the project:
mamba activate ml
-
Navigate to
generate_domain_labels.pyand follow the instructions provided in the comments in lines 6-8. -
Once the environment is active and the dataset is ready, you can:
- Run the notebooks in
notebooks/ - Load trained models from
models/ - View visualizations and metrics in
results/
- Run the notebooks in
Everything should work out of the box if the steps above were followed correctly.
"You are welcome to add and correct instructions for GPU Support"
To use GPU acceleration with TensorFlow, a compatible NVIDIA GPU and driver must be installed.
1. Run:
nvidia-smiIf you see:
zsh: command not found: nvidia-smi
your system does not have the NVIDIA driver installed.
2. Check for NVIDIA hardware:
lspci | grep -i nvidiaIf you see output like:
01:00.0 VGA compatible controller: NVIDIA Corporation ...
you do have an NVIDIA GPU and just need the driver.
I did not get it to work but maybe someone can add proper instructions
📎 Official source: NVIDIA CUDA Downloads for Fedora
- Akram Aki, Bachelor Semester 6
- Muhammad Hassan, Master
- ML Seminar, TU Dortmund, Germany