Skip to content

marius004/cnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Realistic Image Classification

Project Description

This project involves classifying 80x80 images generated by deep generative models into three distinct classes (0, 1, 2).

Dataset

  • Training Set: 10,500 images with labels
  • Validation Set: 3,000 images with labels
  • Test Set: 4,500 images

Approaches

KNN (K-Nearest Neighbors)

  • Metrics Used: Minkowski, Euclidean, Manhattan
  • Best Accuracy: 0.50 using Manhattan metric with 138 neighbors

CNN (Convolutional Neural Network)

  • Framework: PyTorch
  • Initial Accuracy: 70% on the validation set
  • Final Model Accuracy: 76%

Image Processing

  • Resize: 80x80x3 pixels
  • Normalization: Pixel values scaled to [0, 1]

Data Augmentation

  • Training Set: RandomHorizontalFlip, RandomRotation(5)
  • Validation/Test Set: Only normalization

Model Architecture

  1. Convolutional Layers: Conv2d, BatchNorm2d, ReLU, MaxPool2D
  2. Dropout Layers: To prevent overfitting (rate: 0.1)
  3. Dense Layers: Fully connected with ReLU activation, final layer with softmax activation

Hyperparameters

  • Filters: {32, 64, 128, 256}
  • Kernel Size: (3,3)
  • Neurons in Dense Layers: {32, 64, 128, 256}
  • Optimizer: Adam
  • Loss Function: Cross entropy
  • Early Stopping: Implemented to avoid overfitting

References