All Projects â†’ rmccorm4 â†’ Tiny-Imagenet-200

rmccorm4 / Tiny-Imagenet-200

Licence: MIT license
🔬 Some personal research code on analyzing CNNs. Started with a thorough exploration of Stanford's Tiny-Imagenet-200 dataset.

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Tiny-Imagenet-200

maggy
Distribution transparent Machine Learning experiments on Apache Spark
Stars: ✭ 83 (+22.06%)
Mutual labels:  hyperparameter-search
image-classification
A collection of SOTA Image Classification Models in PyTorch
Stars: ✭ 70 (+2.94%)
Mutual labels:  imagenet
Invisible-Cloak-And-Magic-Wand-using-OpenCV
This is one of my OpenCV that is Computer Vision project named in vi . That is inspired from Harry potter Invisible Cloak
Stars: ✭ 16 (-76.47%)
Mutual labels:  anaconda
ShapeTextureDebiasedTraining
Code and models for the paper Shape-Texture Debiased Neural Network Training (ICLR 2021)
Stars: ✭ 95 (+39.71%)
Mutual labels:  imagenet
super-gradients
Easily train or fine-tune SOTA computer vision models with one open source training library
Stars: ✭ 429 (+530.88%)
Mutual labels:  imagenet
alexnet-architecture.tensorflow
Unofficial TensorFlow implementation of "AlexNet" architecture.
Stars: ✭ 15 (-77.94%)
Mutual labels:  imagenet
earth-analytics-python-env
A conda environment and docker container to support using earth and environmental data in Python.
Stars: ✭ 60 (-11.76%)
Mutual labels:  anaconda
ModelZoo.pytorch
Hands on Imagenet training. Unofficial ModelZoo project on Pytorch. MobileNetV3 Top1 75.64🌟 GhostNet1.3x 75.78🌟
Stars: ✭ 42 (-38.24%)
Mutual labels:  imagenet
TF-NAS
TF-NAS: Rethinking Three Search Freedoms of Latency-Constrained Differentiable Neural Architecture Search (ECCV2020)
Stars: ✭ 66 (-2.94%)
Mutual labels:  imagenet
NIPS-Global-Paper-Implementation-Challenge
Selective Classification For Deep Neural Networks.
Stars: ✭ 11 (-83.82%)
Mutual labels:  imagenet
etiketai
Etiketai is an online tool designed to label images, useful for training AI models
Stars: ✭ 63 (-7.35%)
Mutual labels:  imagenet
PyTorch-Model-Compare
Compare neural networks by their feature similarity
Stars: ✭ 119 (+75%)
Mutual labels:  imagenet
Adversarial-Examples-in-PyTorch
Pytorch code to generate adversarial examples on mnist and ImageNet data.
Stars: ✭ 112 (+64.71%)
Mutual labels:  imagenet
SKNet-PyTorch
Nearly Perfect & Easily Understandable PyTorch Implementation of SKNet
Stars: ✭ 62 (-8.82%)
Mutual labels:  imagenet
data-science-practice
æ•°æźç§‘ć­Šćźžè·” | data science practice
Stars: ✭ 24 (-64.71%)
Mutual labels:  anaconda
datumaro
Dataset Management Framework, a Python library and a CLI tool to build, analyze and manage Computer Vision datasets.
Stars: ✭ 274 (+302.94%)
Mutual labels:  imagenet
simpleAICV-pytorch-ImageNet-COCO-training
SimpleAICV:pytorch training example on ImageNet(ILSVRC2012)/COCO2017/VOC2007+2012 datasets.Include ResNet/DarkNet/RetinaNet/FCOS/CenterNet/TTFNet/YOLOv3/YOLOv4/YOLOv5/YOLOX.
Stars: ✭ 276 (+305.88%)
Mutual labels:  imagenet
FreeCAD Conda
conda recipes for freecad and dependencies of freecad
Stars: ✭ 35 (-48.53%)
Mutual labels:  anaconda
lambda.pytorch
PyTorch implementation of Lambda Network and pretrained Lambda-ResNet
Stars: ✭ 54 (-20.59%)
Mutual labels:  imagenet
machine-learning-capstone-project
This is the final project for the Udacity Machine Learning Nanodegree: Predicting article retweets and likes based on the title using Machine Learning
Stars: ✭ 28 (-58.82%)
Mutual labels:  anaconda

Tiny-Imagenet-200

This repository is my personal research code for exploration of Convolutional Neural Networks, specifically on the Tiny-Imagenet-200 dataset. I plan to start small with subsets of 10 classes to benchmark against CIFAR-10, then eventually expand to larger and larger subsets, making my way up to all 200 classes to compare against Stanford's CS231N results.

Table of Contents


Getting Started

To use this code you will first need to download the dataset from it's website: http://cs231n.stanford.edu/tiny-imagenet-200.zip

Alternatively, you can run the following command in your terminal if you have wget installed to download it to your current directory:

wget http://cs231n.stanford.edu/tiny-imagenet-200.zip

Setting Up Your Environment

Anaconda

Using Anaconda is a GREAT way to keep everything consistent regardless of what machine you run your code on.

The following command will create an Anaconda virtual environment with the modules listed in requirements.txt installed. This is very useful on clusters where you don't necessarily have root priveliges. To be specific, I used Anaconda/4.0.0 in these cases. Locally, any version should be fine.

conda create --name py3 python=3.5.2 --file requirements.txt

In the case of an error involving new versions of libraries not being backwards compatible, I saved the conda environment with all of the versions that were used to create the first 2000 models seen in utils/2000networks.csv in utils/working_conda_env.yml. To recreate the environment with these exact library verions, run this command:

conda env create -f utils/working_conda_env.yml

NOTE: For some reason, this conda environment doe not work properly on my current configuration of Arch Linux. However, when running it the same way on Ubuntu 16.04, it works perfectly fine. This needs to be revisited.

Pip

Then you will need to install all required libraries by running the command:

pip install -r requirements.txt

Creating class sets

To create sets of classes, just run python produce_files.py and enter your desired number of sets, and number of classes per set.

Currently, I have number of classes set to 200 as default and image size set to 64x64x3 as default.

To train this network, make whatever sets of classes you need using:

python utils/produce_files.py

and by following the prompts.

Training Network

Currently, everything is meant to be run from the highest level directory of this repository. Paths could be incorrect if you run code from the directory it is contained in, and this code would lose it's current generality.

To benchmark results against CIFAR-10, run the following command to resize images from 64x64x3 to 32x32x3 and train the network on a 10-class subset on the CIFAR LeNet architecture:

python networks/train_tiny_lenet.py --resize=True --num_classes=10

To choose which set of classes you train the network on when executing the command, you can use the wnids optional argument to pass the relative path to your chosen set of classes:

python networks/train_tiny_lenet.py --resize=True --num_classes=10 --wnids='random/0'

Otherwise, you will be prompted to input the path to a set of classes when simply executing and default values for most parameters will be set:

python networks/train_tiny_lenet.py

Evaluating Trained Network

To evaluate the accuracy of a network that's already been trained, you can use the --load optional argument as demonstrated below

python networks/train_tiny_lenet.py --resize=True --num_classes=10 --wnids='random/0' --load='work/training/tiny_imagenet/sets/random/0/best_weights_val_acc.hdf5'

Tweakable Parameters

# String: Choice of whether to use 'cpu', 'gpu', '2gpu', Default='cpu'
--hardware

# Int: How many images to pass through the network at once, Default=100
--batch_size

# Int: How many times to run all of the data through the network, Default=25
--num_epochs

# Int: Number of classes the network is being trained on
--num_classes

# Float: Adjustable hyperparameter, Default=0.001
--learning_rate

# Float: Adjustable hyperparameter, Default=0.00
--weight_decay

# String: "True" or "False", Whether to preprocess data in certain ways, Default="False"
--data_augmentation

# String: Choice of 'train_acc', 'train_loss', 'val_acc', 'val_loss' to monitor
# for saving model checkpoints, Default='val_acc'
--best_criterion

# String: Path to set of classes to train on, Default=User_Input
--wnids

# String: "True"=32x32, "False"=64x64, Default="False"
--resize

# String: Path to saved model to evaluate accuracy of
--load

# String: "True"=Normalize images by dividing each color channel by 255, Default="False"
--normalize

Notes To Self

TODO:

  • Check if int values of images are correct as opposed to floats like in Matlab.
  • Check if resized images look correct with imshow
  • Run and save CIFAR-10 results to compare on CIFAR-LeNet

IDEAS:

  • Train a network to learn best classes to put together in a set?
  • Without using a network, recursively train a network, get the best classes and train on those, and repeat
  • Can a Generative Adversarial Network be used to increase the number of training/validation images per class by generating realistic images?

ISSUES:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].