Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CV-ML Project: Hand-drawn Symbol Classification

A computer vision project for classifying hand-drawn symbols using a custom ResNet18 model with transfer learning.

📝 Project Overview

This project implements a deep learning model to classify hand-drawn symbols across 10 different categories. The model uses a modified ResNet18 architecture adapted for grayscale images and achieves approximately 81% accuracy on the test set.

Symbol Categories

  • Anchor
  • Balloon
  • Bicycle
  • Envelope
  • Paper boat
  • Peace symbol
  • Smiley
  • Speech bubble
  • Spiral
  • Thumb

🏗️ Project Structure

cv-ml-project/
├── data/                          # Dataset organized by symbol categories
│   ├── anchor/
│   ├── balloon/
│   ├── bicycle/
│   ├── envelope/
│   ├── paper_boat/
│   ├── peace_symbol/
│   ├── smiley/
│   ├── speech_bubble/
│   ├── spiral/
│   └── thumb/
├── models/                        # Trained model weights
│   └── best_model_weights.pth
├── notebooks/                     # Jupyter notebooks for analysis
│   └── main_analysis.ipynb
├── src/                          # Source code
│   ├── data_loader.py           # Custom dataset class
│   ├── model.py                 # Custom ResNet18 implementation
│   └── __pycache__/
├── requirements.txt              # Python dependencies
└── README.md                    # This file

🚀 Getting Started

Prerequisites

  • Python 3.13 (but earlier versions may work)
  • CUDA-compatible GPU (optional, but recommended)

Installation

  1. Clone the repository:
git clone <repository-url>
cd cv-ml-project
  1. Install dependencies:
pip install -r requirements.txt
  1. Download the dataset: link to the dataset

Dataset Structure

Each symbol category should contain images with the following naming conventions:

  • digit_*.jpg - Digital/computer-generated images
  • drawn_*.jpg - Hand-drawn images
  • stamp_*.jpg - Stamp-like images

🔬 Model Architecture

CustomResNet18

  • Base Model: Pre-trained ResNet18 from ImageNet
  • Modifications:
    • First convolutional layer adapted for single-channel (grayscale) input
    • Final fully connected layer adjusted for 10 classes
    • Transfer learning with frozen layers except first conv and final FC layers

Key Features

  • Input: Grayscale images (single channel)
  • Output: 10 classes (symbol categories)
  • Training Strategy: Transfer learning with selective layer unfreezing
  • Data Augmentation: Random rotation (±10°) and translation (±10%)

📊 Training Details

Data Split

  • Training: 60% of total data
  • Validation: 20% of total data
  • Test: 20% of total data

Training Parameters

  • Epochs: 20
  • Batch Size: 64
  • Optimizer: Adam (lr=0.001)
  • Loss Function: CrossEntropyLoss
  • Device: CUDA (if available)

Data Preprocessing

  • Convert to grayscale
  • Normalize to [-1, 1] range
  • Random augmentations for training data

📈 Results

  • Best Validation Accuracy: ~81%
  • Training Strategy: Early stopping based on validation accuracy
  • Best Performance: Anchor class
  • Challenging Class: Paper boat (often confused with envelope due to visual similarity)

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages