This repository contains an implementation of the ResNet101 architecture in PyTorch. The implementation includes a modular design with separate classes for the ResNet model, custom dataset handling, evaluation and visualization, and a training class.
ResNet101 is a deep convolutional neural network architecture known for its success in image classification tasks. This implementation provides a clean and modular codebase for understanding and using the ResNet101 architecture.
The ResNet101 model is implemented using PyTorch. The architecture includes residual blocks, custom dataset handling, and evaluation and visualization components.
- ResidualBlock: Defines the building block for the ResNet model.
- ResNet101v2: Implements the overall ResNet101 architecture.
The implementation includes a custom dataset class for handling image data. You can easily replace the dataset with your own by modifying the CustomDataset
class.
The EvaluateVisualization
class provides methods for plotting loss curves and confusion matrices during model evaluation.
The ResNetTrainer
class encapsulates the training process, making it easy to train the ResNet101 model on your dataset.
To use this implementation, follow these steps:
-
Clone the repository:
git clone https://github.com/yourusername/resnet101-implementation.git
-
Install the required dependencies:
pip install -r requirements.txt
-
Modify the dataset path in the
main.py
file:data_dir = "path/to/your/dataset"
-
Run the training script:
python main.py
This implementation is inspired by the ResNet architecture proposed in the paper:
- Kaiming He, Xiangyu Zhang, Shaoqing Ren, Jian Sun. "Deep Residual Learning for Image Recognition".
For additional insights, check out my Medium article on this implementation: Unveiling the Power of ResNet101v2: A Deep Dive into Image Classification
Feel free to contribute to this repository or open issues if you encounter any problems.