Giter Club home page Giter Club logo

cifar10-classification's Introduction

Cifar-10 Classification

Introduction

This is my personal project in Introduction of Artificial Intelligence.

This project is about image classification about ResNet(slightly different) and FC on Cifar-10 dataset.

Results

Network Mean-Acc
FC-3 55.36
FC-6 53.41
FC-8 51.78
FC-10 35.41
Res-18 91.62
Res-34 92.25
Res-50 90.53
Res-101 91.76

Installation

-This code was built on Ubuntu 16.04 with Anaconda Python 3.6 and PyTorch v1.1.

-NVIDIA GPU is needed for both training and testing.

-I used RTX 2080 for training and testing.

  1. [Recommended] Create a new conda environment.

    It's recommended if you change your anaconda source to Tsinghua source.

    conda create -n cifar10 python=3.6
    

    And activate the environment.

    conda activate cifar10
    
  2. Install pytorch.1.1.

    conda install pytorch=1.1 torchvision cudatoolkit=10.0
    

    Or from source

    conda install pytorch=1.1 torchvision cudatoolkit=10.0 -c pytorch
    
  3. Install dependencies.

    pip install matplotlib yacs tqdm
    

    Or from Tsinghua source:

    pip install -i https://pypi.tuna.tsinghua.edu.cn/simple matplotlib yacs tqdm
    
  4. Create directories for data and models:

    mkdir data
    mkdir work_dirs

Getting started

Training

Train model named fc3 whose network is fc-3 with batchsize=400

python train.py batch_size 400 model fc3 network fc_3

Train model named res101 whose network is res-101 with batchsize=200

python train.py batch_size 200 model res101 network res_101

Testing

Test model res101

python train.py --test batch_size 400 model res101 network res_101

Visualization

Visualize outputs of model res101

python train.py --test --vis batch_size 400 model res101 network res_101

The output of visualization will be saved in work_dirs/model_name/vis/

cifar10-classification's People

Contributors

phj128 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.