项目作者: deep2cv

项目描述 :
python, triplet loss, batch triplet loss, kaggle, image classifier, svm
高级语言: Python
项目地址: git://github.com/deep2cv/image-classifier.git
创建时间: 2017-05-23T00:59:37Z
项目社区:https://github.com/deep2cv/image-classifier

开源协议:MIT License

下载


Triplet Loss & Batch triplet loss & SVM

Here, I have some experiments in order to make more accurate classifier. Triplet Loss, Batch Triplet, SVM are used for experiments. softmax features + SVM was the best in my result as a record of 91% top1 accuracy.

Dataset

Kaggle’s State Farm Distracted Driver Detection Dataset is used for evaluating the performance of Image Classification, you should modify sampledata.py to fit your dataset.

Setup

Rebuild your caffe directory:

  1. cd $CAFFEROOT$
  2. cp Makefile.configexample Makefile.config

Remember to uncomment the line to makesure your python layers could be found:

  1. WITH_PYTHON_LAYER := 1

Then build caffe and pycaffe:

  1. make all -j8 & make pycaffe

Usage

  1. Modify sampledata.py, config.py and train.py to fit your dataset and working environment.

  2. Pre-train your model with softmax loss.

  3. Finetune triplet model based on your pre-trained model.

  4. Learn to adjust parameters.

Result

  1. softmax

known

  1. triplet loss

known

  1. batch triplet loss

known

  1. softmax+svm

known

Reference

This project is based on hizhangp’s job