RRanddom / tf-bilinear-cnn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

tf-bilinear-cnn

Requirements

  1. TensorFlow with gpu support, my TensorFlow version is 1.80

  2. You shold have at least one dataset to run the training FGVC-Aircraft, Caltech-UCSD Birds-200-2011, Cars Dataset

  3. Download Pretrained VGG Model

Build the Dataset

  1. Change the dataset path in data/aircraft_data.py, data/cub200_data.py and data/standford_cars.py
$ python data/build_aircraft_data.py 
$ python data/build_cub200_data.py
$ python data/build_standford_cars.py

Training & Testing

  1. Change the tfrecord path in data/dataset_factory.py

Command for training

$ python train.py

Command for testing

$ python test.py

My Results

Dataset CUB200 FGVC-Aircraft Standford Cars
Accuracy 82.6% 84.2% 88.5%

Something interesting!

After training is finished, I visualize some activation maps after vgg/pool5 layer:

demo_1

demo_2

demo_3

demo_4

demo_5

References

@inproceedings{lin2015bilinear,
    Author = {Tsung-Yu Lin, Aruni RoyChowdhury, and Subhransu Maji},
    Title = {Bilinear CNNs for Fine-grained Visual Recognition},
    Booktitle = {International Conference on Computer Vision (ICCV)},
    Year = {2015}
}

I also steal some ideas from https://github.com/HaoMood/bilinear-cnn and https://github.com/abhaydoke09/Bilinear-CNN-TensorFlow

Recent Change

I refactor the training/testing code with tf.estimator API

About


Languages

Language:Jupyter Notebook 99.6%Language:Python 0.4%