Image Classification using LeNet-5 and
AlexNet
Student Name: [Link] Sai
Roll Number: 23211A0433
Section: ECE-A
Course / Subject: Deep Learning / Computer Vision
Faculty Name: [Link] Pavan
March 6, 2026
1 Objective
The objective of this assignment is to implement and compare two classical Convolutional
Neural Network (CNN) architectures, namely LeNet-5 and AlexNet, for image classifica-
tion.
Both models are trained and evaluated using the CIFAR-10 dataset. The models are
compared based on:
• Classification accuracy
• Training time
• Model complexity
2 Dataset Description
The dataset used in this experiment is the CIFAR-10 dataset. It is a popular benchmark
dataset used for image classification tasks.
Dataset details:
• Total Images: 60,000
• Training Images: 50,000
• Testing Images: 10,000
• Image Size: 32x32 RGB images
• Number of Classes: 10
1
The dataset contains the following categories:
• Airplane
• Automobile
• Bird
• Cat
• Deer
• Dog
• Frog
• Horse
• Ship
• Truck
For training the models, the images were resized to 224×224 pixels.
3 Methodology
The experiment was implemented using the PyTorch deep learning framework.
The following steps were performed:
1. Load the CIFAR-10 dataset using torchvision
2. Preprocess the images using resizing and tensor conversion
3. Implement the LeNet-5 model
4. Implement the AlexNet model
5. Train both models on training data
6. Evaluate models on test data
7. Compare performance results
2
4 Architecture of LeNet-5
LeNet-5 is one of the earliest convolutional neural networks developed by Yann LeCun in
1998 for handwritten digit recognition.
The architecture consists of:
• Convolution Layer (C1)
• Average Pooling Layer (S2)
• Convolution Layer (C3)
• Average Pooling Layer (S4)
• Fully Connected Layer
• Output Layer
The convolution layers extract features such as edges and textures from the images, while
pooling layers reduce spatial dimensions and computational complexity.
LeNet-5 contains a relatively small number of parameters, making it efficient for simpler
classification tasks.
5 Architecture of AlexNet
AlexNet is a deep convolutional neural network introduced by Alex Krizhevsky in 2012.
The architecture includes:
• Five convolutional layers
• Three fully connected layers
• ReLU activation functions
• Max pooling layers
• Dropout layers
Key innovations of AlexNet include:
• Use of ReLU activation for faster training
• Use of dropout to reduce overfitting
• Deep architecture to capture complex features
• GPU training for large datasets
Because of its deeper structure and larger number of parameters, AlexNet can learn more
complex image features.
3
6 Implementation
Both models were implemented in Python using the PyTorch library.
Example code snippet used for loading the dataset:
from torchvision import datasets , transforms
transform = transforms . Compose ([
transforms . Resize ((224 ,224) ) ,
transforms . ToTensor ()
])
train_data = datasets . CIFAR10 (
root = ’ ./ data ’ ,
train = True ,
download = True ,
transform = transform
)
test_data = datasets . CIFAR10 (
root = ’ ./ data ’ ,
train = False ,
download = True ,
transform = transform
)
The models were trained using the Adam optimizer and CrossEntropy loss function.
7 Output Results
After training the models in Google Colab, the following results were obtained.
7.1 LeNet-5 Results
The LeNet-5 model was trained for 3 epochs. The training loss gradually decreased, indi-
cating that the model successfully learned features from the dataset.
• Final Accuracy: 54.83%
• Training Time: 274 seconds
7.2 AlexNet Results
The AlexNet model was also trained for 3 epochs. Because AlexNet is a deeper architecture
with significantly more parameters, the training time was higher.
• Final Accuracy: 10.0%
• Training Time: 364 seconds
4
7.3 Training Output Screenshot
The following figure shows the actual output from Google Colab during the training of both
models.
Figure 1: Training output of LeNet-5 and AlexNet models in Google Colab
8 Results Comparison
Model Accuracy (%) Training Time (seconds) Parameters
LeNet-5 54.83 274 ∼ 62K
AlexNet 10.0 364 ∼ 60M
Table 1: Performance comparison of LeNet-5 and AlexNet
9 Discussion
The experimental results show that LeNet-5 performed better than AlexNet in this exper-
iment. This is mainly because LeNet-5 is a simpler architecture and can train effectively
with fewer epochs and limited training time.
AlexNet is a much deeper network with millions of parameters. Training it for only a few
epochs is not sufficient for it to learn meaningful features, which resulted in lower accuracy.
Therefore, AlexNet generally performs better on large datasets and longer training du-
rations, while LeNet-5 can perform well on smaller experiments.
5
10 Why AlexNet Performs Better on Complex Datasets
AlexNet performs better on complex datasets due to the following reasons:
• It has a deeper architecture with more layers
• It uses ReLU activation functions
• It contains a large number of learnable parameters
• It captures hierarchical image features
• It uses dropout to reduce overfitting
These characteristics allow AlexNet to learn complex patterns when sufficient training
data and time are provided.
11 Which Model is Better for Small Datasets
LeNet-5 is generally better suited for small datasets because:
• It has fewer parameters
• It trains faster
• It requires less computational power
• It reduces the risk of overfitting
AlexNet is more suitable for large datasets and deep learning tasks requiring complex
feature extraction.
12 Conclusion
In this assignment, two classical CNN architectures, LeNet-5 and AlexNet, were implemented
and compared for image classification.
The results show that LeNet-5 achieved better performance in this experiment due to
shorter training time and fewer parameters. AlexNet requires longer training and larger
datasets to fully utilize its deep architecture.
This experiment demonstrates how model complexity and dataset size influence the per-
formance of deep learning models.