- Project Overview
- Features
- Project Structure
- Installation
- Usage
- Model Architecture
- Training
- Prediction
- Performance
- Hardware Requirements
- Contribution
This project implements a Convolutional Neural Network (CNN) for multi-class classification. The model is built from scratch, providing a deep understanding of the underlying architecture and training process. With an accuracy of around 90%, it demonstrates strong performance on the classification task.
- Custom CNN model implementation
- Defined training loop
- Configurable loss function and optimizer
- Model training and accuracy evaluation
- Model saving functionality
- Separate prediction script for the saved model
- High accuracy (~90%)
- CPU-based training, no GPU required
The project is organized into separate notebooks for better modularity:
model.ipynb: Contains the CNN model architecture & it includes the training loop, loss function, and optimizerpredict.ipynb: Handles predictions using the saved model
git clone https://github.com/akhil-varsh/cnn-multi-class-classifier.git
cd cnn-multi-class-classifier
pip install -r requirements.txtTo train the model:
- Run
model.ipynbto define the model architecture
To make custom predictions using the saved model:
Run predict.ipynb
The CNN architecture is defined from scratch in model.ipynb. It includes:
- Convolutional layers
- Pooling layers
- Fully connected layers
- Activation functions
For detailed architecture, refer to the model.ipynb file.
The training process is implemented in model.ipynb and includes:
- Custom training loop
- Loss function: CrossEntropyLoss ---> Epoch [1/40], Loss: 1.2354 Epoch [40/40], Loss: 0.0000
- Number of epochs: 40
The predict.ipynb notebook is provided for making predictions using the saved model. This notebook loads the trained model and can be used for inference on new data.
Here's an example of a prediction made by the model:
The model achieves an accuracy of approximately 90% on the test dataset, demonstrating its effectiveness in multi-class classification tasks.
This project is designed to run on standard CPU hardware. No GPU is required for training or inference, making it accessible to a wide range of users without the need for specialized hardware.
Contributions to improve the project are welcome.
Made with ❤️ by the Akhil
