Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

✅ CNN_Pytorch_Demo

CNN Image Classification with PyTorch

This repository demonstrates a simple convolutional neural network (CNN) implemented in PyTorch for image classification. It covers model definition, training, evaluation, and visualization of results.

Project Overview

  • Builds a custom CNN model using PyTorch
  • Trains on an image dataset using DataLoader and torchvision.transforms
  • Evaluates accuracy on test data
  • Visualizes predictions and performance metrics

Tech Stack

  • Python
  • PyTorch
  • torchvision
  • matplotlib, numpy

How to Run

  1. Clone the repository: git clone https://github.com/Ghostdevc/CNN_Pytorch_Demo.git cd CNN_Pytorch_Demo

  2. Install dependencies: pip install -r requirements.txt

  3. Prepare your image dataset:

  • Modify the dataset loading path inside main.py
  • Expected folder structure:
    data/
      train/
        class1/
        class2/
      test/
        class1/
        class2/
    
  1. Run the training script: python main.py

Main Components

  • Custom CNN model subclassing nn.Module
  • Data augmentation and normalization using torchvision.transforms
  • Training loop with loss/accuracy tracking
  • Confusion matrix and prediction visualization

Notes

  • Easily adaptable for CIFAR-10, MNIST, or custom image datasets
  • Great for understanding the structure of a basic CNN in PyTorch

License

MIT License

About

Simple convolutional neural network built in PyTorch demonstrating image classification workflows.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages