Skip to content

SalwaTheEngineer/NeuralNetworks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NeuralNetworks

This project builds and compares multiple neural network architectures for CIFAR-10 image classification using PyTorch. It trains each model, evaluates test performance, and generates visual artifacts so you can quickly see how architecture choices affect accuracy and prediction behavior.

PyTorch-based CIFAR-10 image classification project that trains and compares three models:

  • MLP (fully connected baseline)
  • SimpleCNN (2 convolution blocks)
  • ImprovedCNN (deeper CNN with dropout)

The training script saves performance plots and prediction examples for each model, making it easy to compare behavior and accuracy.

Project Structure

  • cifar.py - main training and evaluation script
  • requirements.txt - Python dependencies
  • results_*.png - training loss and test accuracy plots per model
  • examples_*.png - one correct and one incorrect prediction example per model
  • results.pdf - exported report/summary artifact

Dataset

This project uses the CIFAR-10 dataset from torchvision.datasets.CIFAR10.

  • Training set and test set are downloaded automatically to ./data on first run.
  • Images are normalized with mean/std (0.5, 0.5, 0.5).

Installation

Use Python 3.10+ (recommended) and install dependencies:

pip install -r requirements.txt

Run Training

python cifar.py

The script will:

  1. Load CIFAR-10
  2. Train MLP, SimpleCNN, and ImprovedCNN
  3. Evaluate each model on the test set
  4. Save:
    • results_MLP.png, results_SimpleCNN.png, results_ImprovedCNN.png
    • examples_MLP.png, examples_SimpleCNN.png, examples_ImprovedCNN.png

Notes on Training Logic

  • Optimizer: SGD (lr=0.001, momentum=0.9)
  • Loss: Cross-entropy
  • Maximum epochs: 10
  • Early stop condition: training stops early if average training loss increases between epochs

Dependencies

  • torch
  • torchvision
  • matplotlib

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages