This repository contains custom implementations of convolutional neural network (CNN) models including inception, exception, vgg, and resnet designed for binary classification tasks. Each model has been tailored with specific architectures and adapt to various classification challenges.
- Architecture: Custom inception-like model with basic components.
- Key Components:
- Initial Convolution:
Conv2d(3, 16, kernel_size=3, stride=1, padding=1)
- Inception Block:
- Branch 1:
Conv2d(16, 16, kernel_size=3, stride=1, padding=1)
, followed byReLU
- Branch 2:
MaxPool2d(kernel_size=3, stride=1, padding=1)
followed byConv2d(16, 16, kernel_size=1, stride=1)
andReLU
- Branch 1:
- Dropout Layers:
Dropout(p=0.3)
applied twice - Flatten Layer: Converts tensor to 1D
- Fully Connected Layer:
Linear(in_features=1605632, out_features=2)
- Initial Convolution:
- Architecture: Custom ResNet with basic residual blocks.
- Key Components:
- Residual Block:
- Convolutions:
Conv2d(3, 64, kernel_size=3, padding=1)
,Conv2d(64, 64, kernel_size=3, padding=1)
- Batch Normalization: Applied after convolutions
- ReLU Activation: Applied after normalization
- Shortcut Connection: Adjusted dimensions with
Conv2d(3, 64, kernel_size=1, stride=1)
if needed
- Convolutions:
- Dropout Layers:
Dropout(p=0.5)
applied twice - Pooling:
AdaptiveAvgPool2d(output_size=(1, 1))
- Fully Connected Layer:
Linear(in_features=64, out_features=2)
- Residual Block:
- Architecture: Custom VGG-like model.
- Key Components:
- Convolutions:
Conv2d(3, 64, kernel_size=3, stride=1, padding=1)
, followed byReLU
andMaxPool2d(kernel_size=2, stride=2)
Conv2d(64, 128, kernel_size=3, stride=1, padding=1)
, followed byReLU
andMaxPool2d(kernel_size=2, stride=2)
- Dropout Layers:
Dropout(p=0.5)
applied twice - Flatten Layer: Converts tensor to 1D
- Fully Connected Layer:
Linear(in_features=401408, out_features=2)
- Convolutions:
- Architecture: Simplified version of Xception.
- Key Components:
- Depthwise Separable Convolution:
- Depthwise Convolution:
Conv2d(3, 3, kernel_size=3, stride=2, padding=1, groups=3)
- Pointwise Convolution:
Conv2d(3, 64, kernel_size=1, stride=1)
- Depthwise Convolution:
- Activation and Normalization:
ReLU
followed byBatchNorm2d(64)
- Pooling:
MaxPool2d(kernel_size=3, stride=2, padding=1)
- Dropout Layers:
Dropout(p=0.5)
applied twice - Fully Connected Layer:
Linear(in_features=200704, out_features=2)
- Depthwise Separable Convolution:
Feel free to fork the repository, make modifications, and submit pull requests. Contributions and suggestions are welcome.