Model Card for jaeunglee/resnet18-cifar10-unlearning
This repository contains ResNet18 models retrained on the CIFAR-10 dataset with specific classes excluded during training. Each model is trained to study the impact of class exclusion on model performance and generalization.
Evaluation
- Testing Data: CIFAR-10 test set
- Metrics: Top-1 accuracy
Results
Model | Excluded Class | CIFAR-10 Accuracy |
---|---|---|
resnet18_cifar10_full.pth |
None | 95.4% |
resnet18_cifar10_no_airplane.pth |
Airplane | 95.3% |
resnet18_cifar10_no_automobile.pth |
Automobile | 95.4% |
resnet18_cifar10_no_bird.pth |
Bird | 95.6% |
resnet18_cifar10_no_cat.pth |
Cat | 96.6% |
resnet18_cifar10_no_deer.pth |
Deer | 95.2% |
resnet18_cifar10_no_dog.pth |
Dog | 96.6% |
resnet18_cifar10_no_frog.pth |
Frog | 95.2% |
resnet18_cifar10_no_horse.pth |
Horse | 95.3% |
resnet18_cifar10_no_ship.pth |
Ship | 95.4% |
resnet18_cifar10_no_truck.pth |
Truck | 95.3% |
Training Details
Training Procedure
- Base Model: ResNet18
- Dataset: CIFAR-10
- Excluded Class: Varies by model
- Loss Function: CrossEntropyLoss
- Optimizer: SGD with:
- Learning rate:
0.1
- Momentum:
0.9
- Weight decay:
5e-4
- Nesterov:
True
- Learning rate:
- Scheduler: CosineAnnealingLR (T_max:
200
) - Training Epochs:
200
- Batch Size:
128
- Hardware: Single GPU
Notes on Training
The training recipe is adapted from the paper "Benchopt: Reproducible, efficient and collaborative optimization benchmarks", which provides a reproducible and optimized setup for training ResNet18 on the CIFAR-10 dataset. This ensures that the training methodology aligns with established benchmarks for reproducibility and comparability.
Data Preprocessing
The following transformations were applied to the CIFAR-10 dataset:
Base Transformations (applied to both training and test sets):
- Conversion to PyTorch tensors using
ToTensor()
. - Normalization using mean
(0.4914, 0.4822, 0.4465)
and standard deviation(0.2023, 0.1994, 0.2010)
.
- Conversion to PyTorch tensors using
Training Set Augmentation (only for training data):
- RandomCrop(32, padding=4): Randomly crops images with padding for spatial variation.
- RandomHorizontalFlip(): Randomly flips images horizontally with a 50% probability.
These augmentations help improve the model's ability to generalize by introducing variability in the training data.
Model Description
- Developed by: Jaeung Lee
- Model type: Image Classification
- License: MIT
Related Work
This model is part of the research conducted using the Machine Unlearning Comparator. The tool was developed to compare various machine unlearning methods and their effects on models.
Uses
Direct Use
These models can be directly used for evaluating the effect of excluding specific classes from the CIFAR-10 dataset during training.
Out-of-Scope Use
The models are not suitable for tasks requiring general-purpose image classification beyond the CIFAR-10 dataset.
How to Get Started with the Model
Use the code below to load the models with the appropriate architecture and weights:
import torch
import torch.nn as nn
from torchvision import models
def get_resnet18(num_classes=10):
model = models.resnet18(weights=None)
model.conv1 = nn.Conv2d(3, 64, kernel_size=3, stride=1, padding=1, bias=False)
model.maxpool = nn.Identity()
model.fc = nn.Linear(model.fc.in_features, num_classes)
return model
# Load a pretrained model
def load_model(model_path, num_classes=10):
model = get_resnet18(num_classes=num_classes)
model.load_state_dict(torch.load(model_path))
return model
# Example usage
model = load_model("resnet18_cifar10_no_airplane.pth", num_classes=10)
Citation
If you use this repository or its models in your work, please consider citing it:
BibTeX:
@misc{resnet18_cifar10_unlearn,
author = {Jaeung Lee},
title = {ResNet18 Models Trained on CIFAR-10 with Class Exclusion},
year = {2024},
howpublished = {\url{https://huggingface.co/jaeunglee/resnet18-cifar10-unlearn}},
note = {Models retrained on CIFAR-10, with specific classes excluded for analysis of unlearning effects.}
}
APA: Jaeung Lee. (2024). ResNet18 Models Trained on CIFAR-10 with Class Exclusion. Retrieved from https://huggingface.co/jaeunglee/resnet18-cifar10-unlearn
License
This repository is shared under the MIT License.