CNNOne is a deep convolutional neural network built using PyTorch for multi-class image classification into 4 categories. The model is designed with a deep feature extraction pipeline using multiple convolutional layers, followed by fully connected layers and dropout for regularization.
The architecture consists of:
- Input: RGB image with 3 channels
- Conv Block 1:
Conv2d(3, 16, kernel_size=3, padding=1)ReLUConv2d(16, 16, kernel_size=3)ReLUMaxPool2d(2, 2)
- Conv Block 2:
Conv2d(16, 64, kernel_size=3, padding=1)ReLUConv2d(64, 64, kernel_size=3, padding=1)MaxPool2d(2, 2)
- Conv Block 3:
Conv2d(64, 256, kernel_size=3, padding=1)ReLUMaxPool2d(2, 2)
- Batch Normalization on 256 channels
- Flatten Layer
- Fully Connected Layer 1: Linear(186624, 64) + ReLU + Dropout(0.2)
- Fully Connected Layer 2: Linear(64, 4)
- Output Activation:
LogSoftmax(dim=1)
The final output is a log-probability distribution over 4 classes.
- Python 3.x
- PyTorch
- torchvision (optional, for dataset utils)
- numpy
Install dependencies:
pip install torch torchvision numpy