Skip to content

Team 20 KDD course project 2018 "Fine-Tuning strategy for classification based on transfer & active learning"

Notifications You must be signed in to change notification settings

kvas7andy/kdd_project_2018

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KDD Project 2018

This is the README.md file of github repository github.com/kvas7andy/kdd_project_2018

General info

This project replicates the paper "Cost-Effective Training of Deep CNNs with Active Model Adaptation" [KDD2018 paper page]

Structure

File/Folder Description
├── datasets Contains files for ImageNet, DogVsCat datasets (source files as well as images and .txt contents)
/├── c_x_A_B Stores calculated features from layers VGG, AlexNet models (from pretrained models)
//├── alex
//└── vgg16 For VGG16: the same
/├── dogvscat DogVSCat folder to store folder train and train.txt, eval.txt files references images from that folder
/└── imagenet Files related to structured ImageNet dataset from the
├── libs Src files for ImageNet dataset download
├── src All source files for the project, except ImageNet downloaders

Prerequirements:

  • python3.6
  • pytorch
  • numpy
  • scipy
  • pandas
  • pillow
  • urllib

Tested on Ubuntu 16.04 with 12 Gb GPU

Compilation

No compilation necessary but preliminary datasets download is necessary, go to folders of ImageNet and DogVSCat dataset

Execution

  1. Download data: specific to datasets. ImageNet download with downloadutils.py and target datasets, for instance, from files. See README.md respectively for ImageNet and DogVSCat.

  2. Firstly change parameters in utils.py:

  • Sampling related
    • active_samepl_size (mini batch to check the score composed of distinctiveness and uncertainty)
    • active_batch_size (for the exact labeled batch of images to ask for)
    • eval_batch_size (after how many images to make evaluation)
  • Model related
    • model_type - Deep CNNs to use (Alex or VGG16 available)
    • active - whether apply active batching
    • lamb - speed parameter for disctictiveness/uncertainty trade-off
    • transform - whether to use data augmentation
    • alternate - whether to prevent using images from one class consequently for transfer learning with 1 image, only for miaty class (project team improvement proposal)
  • For results report:
    • eval - whether perform evaluation on datasets, and save accuracy of the model into the src/historyactive_... file after 100 batches
    • eval_every - evaluation frequency (number of acative batches)
    • report_every - report evaluation performance by printing
  1. Then execute src/main.py: python3.6 ./src/main.py
  2. Output will be the accuracy change while fine-tuning on evalutaion dataset stored in .npy format in files historyactive_[active][lambda value]

For any questions refer to the authors:

About

Team 20 KDD course project 2018 "Fine-Tuning strategy for classification based on transfer & active learning"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages