Skip to content

Lightweight implementation of ResNet for fast image classification

License

Notifications You must be signed in to change notification settings

VanekPetr/ResNet-9

Repository files navigation

ResNet-9

This repository contains an implementation of a lightweight deep residual network – ResNet-9 – created from scratch in PyTorch. This model serves as a less computationally-intensive alternative to larger, deeper networks, while providing a similar level of accuracy for less complex image classification problems.

Overview

This implementation was inspired by the need for a faster, smaller model for image classification, especially in scenarios where resources might be limited. While models like ResNet-18, ResNet-50, or larger might offer higher performance, they are often "overkill" for simpler tasks and can be more resource-demanding. ResNet-9 provides a good middle ground, maintaining the core concepts of ResNet, but shrinking down the network size and computational complexity.

Model Details

The ResNet-9 model consists of nine layers with weights; two Residual Blocks (each containing two convolutional layers), one initial convolution layer, and a final fully connected layer. The implementation also includes Batch Normalization and Relu Activations. Don't forget to adjust the num_classes parameter to match your specific problem.

Usage

To create a ResNet-9 for a classification problem with for example 12 classes, you could use:

net = ResNet(ResidualBlock, num_classes=12)

Further training and inference would follow standard PyTorch routines.

Authors

Contributing

Thank you for considering contributing to this project! We welcome contributions from everyone.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This repository is licensed under MIT (c) 2023 GitHub, Inc.