• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Python
  • Created over 7 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a baseline for baidu dog classification competition.

Fine grain Dog Classification held by Baidu

author: cweihang

Star this repository if you find it helpful, thank you.

Language: English/简体中文

About

This is a dog classification competition held by Baidu. Competition URL: http://js.baidu.com/

Framework

Hardware

  • Geforce GTX 1060 6G
  • Intel® Core™ i7-6700 CPU
  • Memory 8G

Model

Structure of Xception

Implemented in Keras

  • Remove the final classify dense layer in Xception to get the deep feature
  • Input two images, containing same or different labels
  • Train the model with categorical loss of two images and their class labels
  • Train the model with binary loss meaning whether two images belong to same class or not

Data pre-process

Previous link was provided by Baidu and only Baidu has the rights to spread the data, thus I can not provide the data anymore if Baidu canceled the link shared. You can refer to http://dianshi.baidu.com/gemstone/competitions/detail?raceId=17 with another newly published dataset on which you can apply the same algorithm. You can also apply this model on Person ReID dataset Market1501. But you should do some processing on the data. You can refer to part of our CVPR paper code: rank-reid

  • Place the images with the same class into same directory, for using ImageDataGenerator.
  • Because I named the images with the format "typeid_randhash.jpg", I wrote img2keras.py for the work described above.
  • There are more details to handle. If you meet any error, refer the Keras document first. If you still have some question, you can create an issue.

Training

  • Use ImageDataGenerator for data argumentation
  • It's hard to find positive samples for binary training using ImageDataGenerator, because the samples are shuffled. Looking throughout the data set for positive samples is inefficient. Fortunately, in each batch, we can find some samples with the same class. So we simply swap those samples to construct positive samples.
  • Frozen the Xception CNN layers, train the full connected layers for category and binary classification with ADAM
  • Unfroze final two blocks(layer 105 to the end) of Xception, continue training with SGD
  • Remove data argumentation, retrain until converge

Code

Result

  • InceptionV3, softmax loss: 0.2502
  • Xception, softmax loss: 0.2235
  • Xception, multi loss: 0.211
  • Xception, multi loss, fine tune without data argumentation: 0.2045

If you find some bug in this code, create an issue or a pull request to fix it, thanks!

More Repositories

1

How-to-Be-A-Programmer-CN

[译]如何做好一枚程序员
CSS
1,555
star
2

GDLnotes

Google Deep Learning Notes(TensorFlow教程)
Python
1,490
star
3

Chromium_doc_zh

Chromium中文文档,学习google家的架构
CSS
749
star
4

torch_base

Quickly bring up your PyTorch project(a skeleton)
Python
432
star
5

windy-afternoon

Gitbook based Blog, Android, Linux, Deep Learning, Computer Vision
CSS
333
star
6

TFusion

CVPR2018: Unsupervised Cross-dataset Person Re-identification by Transfer Learning of Spatio-temporal Patterns
Python
305
star
7

GoogleML

Google机器学习教程笔记(基础版)
Python
205
star
8

rank-reid

Keras based Person reid siamese network and learning to rank based transfer learning
Python
96
star
9

ncs_detection

Raspberry Pi NCS Object detection,端上CNN实践
Python
77
star
10

melon_concepts

西瓜书概念整理
71
star
11

Scut_cs_homework

学着造轮子,学着用轮子
C++
71
star
12

green

除了Streak,我们还能做什么
Python
53
star
13

Paper-zh

翻译一些比较好的论文
17
star
14

PCInotes

集体智慧编程笔记
Python
10
star
15

TrackViz

Spatio-temporal pattern contruct and model fusion
Python
10
star
16

material

无纸化办公实践
Python
9
star
17

Pig_reid

京东猪脸识别比赛
Python
7
star
18

VideoSvr

视频服务器后端Java
Java
6
star
19

ahangchen.github.io

知识太多是因为死亡太慢,也就是自然选择的力量不够
HTML
5
star
20

reid-gan

Python
5
star
21

mysite

gitbook导出的静态网站
HTML
2
star
22

Ink

Android 素描应用
Java
2
star
23

CodeCounter

ahang的python代码库
HTML
2
star
24

GotYou

简单的信息统计系统
CSS
2
star
25

deep_reid

Python
2
star
26

Grid

get grid index
Java
2
star
27

keras_ide_reid

Python
2
star
28

dirtysalt.github.io

My home page, consists of .org and .html files.
HTML
2
star
29

Rasp-Person-Sensor

用树莓派感知行人
Python
2
star
30

Reid-backend

Rasp reid backend
Java
2
star
31

pig-ccnn

Python
1
star
32

pig_clean

Process dataset for object counting
Python
1
star
33

colab-reid

Jupyter Notebook
1
star
34

TensorFlowDoc

TensorFlow document from github
Python
1
star
35

Trend

逐鹿,知识与思想的碰撞
Java
1
star
36

AndroidApps

自己做的一些app,求体验
1
star
37

WeMeet

Python
1
star
38

material_bck

Python
1
star
39

how_torch2trt

a repo about how to use torch2trt
1
star
40

umdl

CVPR2016 UMDL code
MATLAB
1
star