Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/krishna-smapca/neural-network-using-pytorch
This repo contains the implemention of few neural network on Fashion Mnist Dataset, designed for Multi-Class classification
https://github.com/krishna-smapca/neural-network-using-pytorch
ai ann artificial-intelligence classification deep-neural-networks machine-learning neural-networks python3 pytorch pytorch-implementation
Last synced: 3 days ago
JSON representation
This repo contains the implemention of few neural network on Fashion Mnist Dataset, designed for Multi-Class classification
- Host: GitHub
- URL: https://github.com/krishna-smapca/neural-network-using-pytorch
- Owner: Krishna-Smapca
- Created: 2025-02-07T07:10:09.000Z (7 days ago)
- Default Branch: main
- Last Pushed: 2025-02-07T12:08:37.000Z (7 days ago)
- Last Synced: 2025-02-07T12:22:32.337Z (7 days ago)
- Topics: ai, ann, artificial-intelligence, classification, deep-neural-networks, machine-learning, neural-networks, python3, pytorch, pytorch-implementation
- Language: Jupyter Notebook
- Homepage:
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Neural-Network-using-Pytorch
This repository contains three different models for multi-class classification using PyTorch, all trained on the Fashion MNIST dataset. The models include an Artificial Neural Network (ANN), a custom Convolutional Neural Network (CNN), and a CNN model with pre-trained ResNet weights. The goal of the project is to practice neural network design and enhance model performance using various techniques.
## Models
### 1. **Artificial Neural Network (ANN)**
- **Input size**: 784 (28x28 flattened pixels from Fashion MNIST)
- **Architecture**:
- Input → Linear (784 → 128) → BatchNorm → ReLU → Dropout
- Linear (128 → 64) → BatchNorm → ReLU → Dropout
- Output → Linear (64 → 10)
- **Features**:
- Batch normalization and dropout to speed up learning and reduce overfitting.
- Predicts 10 classes (Fashion MNIST categories).
### 2. **Custom Convolutional Neural Network (CNN)**
- **Input size**: 28x28 image (no flattening required)
- **Architecture**:
- Feature Extraction: 2 Convolutional layers with ReLU activation and BatchNorm
- Max Pooling layers
- Fully connected classifier with Dropout for regularization
- **Features**:
- 1st Convolution Layer: (1 → 32 channels)
- 2nd Convolution Layer: (32 → 64 channels)
- Output layer with 10 classes (Fashion MNIST categories).
- Batch normalization and dropout used for better learning and complexity reduction.### 3. **CNN with Pre-trained ResNet Weights**
- **Input size**: 28x28 image (no flattening required)
- **Feature Extraction**: Pre-trained ResNet layers with frozen parameters
- **Classification**: Custom fully connected layer (fine-tuned)
- **Architecture**:
- **Feature extraction**: Pre-trained ResNet (frozen layers)
- **Classification**: Linear (2048 → 128) → ReLU → Dropout → Linear (128 → 64) → ReLU → Dropout → Linear (64 → 10)
- **Features**:
- Transfer learning with frozen feature extraction layers.
- Fine-tuning of the classification layer to adapt to the Fashion MNIST dataset.## Performance
- **ANN**:
- Training Accuracy: 99%
- Test Accuracy: 82%
- Shows overfitting (higher training accuracy, lower test accuracy).
- **Custom CNN**:
- Training Accuracy: 82%
- Test Accuracy: 82%
- **CNN with Pre-trained ResNet**:
- Training Accuracy: 87%
- Test Accuracy: 87%
- Better performance with higher epochs.## Requirements
- PyTorch
- torchvision
- numpy
- matplotlib## Installation
```bash
pip install torch torchvision numpy matplotlib
```## Usage
You can easily train and evaluate each of the models by running the respective Python files. The dataset will be automatically downloaded if not already available.
---
This repository provides a clear comparison of different neural network architectures on the Fashion MNIST dataset, highlighting the advantages of CNNs and transfer learning over traditional ANN models.