Spaces:
Sleeping
A newer version of the Gradio SDK is available:
5.42.0
title: Cifar10 CustomResNet
emoji: 🏢
colorFrom: purple
colorTo: gray
sdk: gradio
sdk_version: 3.39.0
app_file: app.py
pinned: false
license: mit
Custom Resnet Architecture on CIFAR 10 using Pytorch
In this exercise we will be looking to implement a custom ResNet architecture on the CIFAR 10 dataset using PyTorch Lightning.
Objective
We will try to build a custom Resnet Architecture on the CIFAR10 dataset. We will try to achieve this in 24 epochs. This experimentation is similar to David Page's exercise.
The detailed code repo is available here with the original model class and the lightning module implementation. The model is pickled after training and used here to demonstrate its capability and let users make predictions and play around with it.
The outputs are diplayed in two tabs - Input and Image and Misclassified Images
Input an Image
This tab lets users play around with the models predictions and see the results. Users can upload images and test the model. The model supports the following classes: plane, car, bird, cat, deer, dog, frog, horse, ship, truck. Users can also select from the examples provided and see the predictions and the top classes it belongs to. GradCAM is also enabled to add model explainability for the users. Users are able to change the values for the top classes displayed for prediction, change the opacity and the layer which is used for the gradCAM.
Examples provided:
Sample output:
Misclassified Images
This tab lets the users to display misclassified images of the model it was already trained on. It lets the users select the number of images to display, whether to show the gradCAM outputs to add model explainibility, the layer used for gradCAM and the opacity for gradCAM. Based on the users selection the images are displayed.
Sample output:
Usage
Clone this repository:
git lfs install git clone https://huggingface.co/spaces/mkthoma/cifar10_customResNet
Run the app.py script:
This will launch a web-based interface using Gradio. You can access the interface by opening the provided URL in your web browser.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
The custom ResNet model is inspired by the ResNet architecture (https://github.com/davidcpage/cifar10-fast).
The GradCAM implementation is based on the pytorch_grad_cam library (https://github.com/jacobgil/pytorch-grad-cam).
Feel free to modify the README to provide more details about the project, including any other relevant information, instructions, or references.