Skip to content

This project focuses on designing and training a Convolutional Neural Network (CNN) to classify images from the CIFAR-10 dataset. The main emphasis is on exploring CNN architecture and the impact of batch size and number of epochs on model accuracy.

Notifications You must be signed in to change notification settings

Bit-Maximum/CNN-for-CIFAR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿง  Image Classification with CNN (CIFAR-10)

en ru

๐Ÿ‘ค Maxim Merkurev

๐Ÿซ Far Eastern Federal University, 2025


๐Ÿ“Œ About the project

This project focuses on designing and training a Convolutional Neural Network (CNN) to classify images from the CIFAR-10 dataset. The main emphasis is on exploring CNN architecture and the impact of batch size and number of epochs on model accuracy.

๐Ÿ”— Colab Version:
Open In Colab

Local launch via JupyterLab is also supported.


๐Ÿ–ผ CIFAR-10: Dataset Description

CIFAR-10 contains:

  • 60 000 color images 32ร—32
  • 10 classes:
    airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck
  • Training set: 50 000 images
  • Test set: 10 000 images

CIFAR-10 is widely used in research and competitions as a benchmark for testing computer vision models.

![CIRAF demo](translation/media/CIRAF demo.png)

๐Ÿง  What is a CNN?

Convolutional Neural Networks (CNNs) are a type of architecture designed specifically for image processing:

  • ๐ŸŽฏ Detect local patterns (edges, shapes)
  • ๐Ÿงฑ Reduce parameter count compared to MLPs
  • ๐Ÿ” Reuse filters across the image
  • โฌ‡ Robust to translation and scaling

๐Ÿงฎ Model Architecture

Block Components
Input 32ร—32ร—3 (RGB image)
Conv 1 64 filters (5ร—5) โ†’ BatchNorm โ†’ ReLU โ†’ MaxPool (2ร—2)
Conv 2 128 filters (3ร—3) โ†’ BatchNorm โ†’ ReLU
Conv 3 256 filters (3ร—3) โ†’ BatchNorm โ†’ ReLU โ†’ MaxPool (2ร—2)
Flatten Transition to fully connected layers
FC 1 1024 neurons โ†’ ReLU โ†’ Dropout(0.5)
FC 2 1024 neurons โ†’ ReLU โ†’ Dropout(0.5)
FC 3 512 neurons โ†’ ReLU
Output 10 neurons โ†’ Softmax (for classification)

๐Ÿš€ Installation (for local use)

  1. Clone the repository:
git clone https://github.com/Bit-Maximum/CNN-for-CIFAR.git
cd CNN-for-CIFAR
  1. Install dependencies:
pip install -r requirements.txt
  1. Run the project:
jupyter lab run.ipynb

๐Ÿ“ˆ Results

  • ๐Ÿ“Š Test accuracy: 78.6%
  • ๐Ÿ“‰ Training graphs (available in Colab/report):
    • Smooth decrease in loss
    • Steady increase in accuracy
  • ๐Ÿ“Œ Conclusion: The model shows confident learning and can be further improved by increasing the number of epochs.

๐Ÿ” Some confusion observed between similar classes (e.g., cat vs dog).

Accuracy-VS-Epoch

Accuracy-VS-Batch-Size

Accuracy-Measurement

t-SNE-Zero-Epoch

t-SNE-10-Epoch

Example predictions from the trained model: Prediction-Demo

๐Ÿ“š Theoretical Background

Covered topics include:

  • ๐Ÿ“ฆ CIFAR-10 as a benchmark image classification dataset
  • ๐Ÿง  CNN layers and pooling operations
  • ๐Ÿงฎ BatchNorm, Dropout, ReLU/Softmax activations
  • ๐Ÿ” Effect of training parameters like batch size and number of epochs

About

This project focuses on designing and training a Convolutional Neural Network (CNN) to classify images from the CIFAR-10 dataset. The main emphasis is on exploring CNN architecture and the impact of batch size and number of epochs on model accuracy.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published