Downloads · 30 days
0
arpit-gour02/resnet-vs-plainnets-cifar10
resnet-vs-plainnets-cifar10 is a machine learning model from arpit-gour02. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
This repository contains implementations, trained weights, and experiment notebooks comparing plain convolutional networks and residual networks on the CIFAR-10 dataset, demonstrating the degradation problem and how r…
Downloads · 30 days
0
Access
Public
Updated Dec 31, 2025
Repo size
48.3 MB
Likes
0
Public
Click a slice to open those files.
.ipynb29.9 MB · 44%
From the Hugging Face model README
This repository contains implementations, trained weights, and experiment notebooks comparing plain convolutional networks and residual networks on the CIFAR-10 dataset, demonstrating the degradation problem and how residual connections mitigate it.
checkpoints/ — trained model weights: Plain20, Plain56, ResNet20, ResNet56notebooks/ — Jupyter notebooks covering architectures, training, evaluation, and comparisonsresults/ — performance plots (accuracy, loss curves, degradation behaviour)README.md — this fileAs network depth increases, plain convolutional nets may suffer increased training error (the “degradation” problem). Residual networks (ResNets) with skip-connections address this problem.
Plain20 — plain CNN, 20 layers

Plain56 — plain CNN, 56 layers (demonstrates degradation)

ResNet20 — residual network, 20 layers

ResNet56 — residual network, 56 layers (shows improved depth)

notebooks/ and results/.Notice how the 56-layer network (Red) has higher loss and error than the 20-layer network (Blue).

With skip connections, the 56-layer network (Red) now outperforms the 20-layer network (Blue).

import torch
from huggingface_hub import hf_hub_download
from models import create_model
repo_id = "arpit-gour02/resnet-vs-plainnets-cifar10"
ckpt = hf_hub_download(repo_id=repo_id, filename="resnet56.pth")
model = create_model("resnet56", num_classes=10)
state_dict = torch.load(ckpt, map_location="cpu")
model.load_state_dict(state_dict)
model.eval()
# Example inference
x = torch.randn(1, 3, 32, 32)
logits = model(x)
pred = logits.argmax(dim=1).item()
print("Predicted class:", pred)
The training setup strictly follows the original paper to ensure fair comparison.
| Hyperparameter | Value |
|---|---|
| Dataset | CIFAR-10 |
| Batch Size | 128 |
| Optimizer | SGD (Stochastic Gradient Descent) |
| Initial Learning Rate | 0.1 |
| Momentum | 0.9 |
| Weight Decay | 0.0001 ($10^{-4}$) |
| Total Epochs | ~164 (64k iterations) |
| Initialization | He Normal (kaiming_normal_) |
We use a MultiStepLR scheduler to drop the learning rate when the loss plateaus.
lr = 0.1lr = 0.01lr = 0.001Standard data augmentation is applied to prevent overfitting on the small CIFAR-10 images:
(0.4914, 0.4822, 0.4465)(0.2023, 0.1994, 0.2010)