Coder Social home page Coder Social logo

ewyuanzhang / bilinear-cnn-distributed Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 65 KB

Distributed PyTorch implementation of bilinear CNN for fine-grained image recognition based on https://github.com/HaoMood/bilinear-cnn.

License: GNU General Public License v3.0

Python 100.00%

bilinear-cnn-distributed's Introduction

               Bilinear CNN (B-CNN) for Fine-grained recognition


DESCRIPTIONS
    After getting the deep descriptors of an image, bilinear pooling computes
    the sum of the outer product of those deep descriptors. Bilinear pooling
    captures all pairwise descriptor interactions, i.e., interactions of
    different part, in a translational invariant manner.

    B-CNN provides richer representations than linear models, and B-CNN achieves
    better performance than part-based fine-grained models with no need for
    further part annotation.


REFERENCE
    T.-Y. Lin, A. RoyChowdhury, and S. Maji. Bilinear CNN models for
    fine-grained visual recognition. In Proceedings of the IEEE International
    Conference on Computer Vision, pages 1449--1457, 2015.


PREREQUIREMENTS
    python>=3.5.2
    torch>=0.4.0
    torchvision>=0.2.1
    horovod>=0.15.2


LAYOUT
    ./data/                 # Datasets
    ./doc/                  # Automatically generated documents
    ./model/                # Saved models
    ./src/                  # Source code


USAGE
    Step 1. Fine-tune the fc layer only. It gives 77.32% test set accuracy on CUB200 and 70.01% test set accuracy on FGVC-Aircraft.
    $ CUDA_VISIBLE_DEVICES=0,1 mpirun -np 2 \
          -H localhost:2 \
          -bind-to none -map-by slot \
          -x NCCL_DEBUG=INFO -x LD_LIBRARY_PATH -x PATH \
          -mca pml ob1 -mca btl ^openib \
          python ./src/train.py fc --base_lr 1.0 \
          --batch_size 16 --epochs 55 --weight_decay 1e-8 \
          --dataset cub200 \
          | tee "[fc-] base_lr_1.0-weight_decay_1e-8-epoch_.log"

    Step 2. Fine-tune all layers. It gives 83.05% test set accuracy on CUB200 and 82.30% test set accuracy on FGVC-Aircraft.
    $ CUDA_VISIBLE_DEVICES=0,1 mpirun -np 2 \
          -H localhost:2 \
          -bind-to none -map-by slot \
          -x NCCL_DEBUG=INFO -x LD_LIBRARY_PATH -x PATH \
          -mca pml ob1 -mca btl ^openib \
          python ./src/train.py all --base_lr 1e-3 \
          --batch_size 8 --epochs 40 --weight_decay 1e-5 \
          --dataset cub200 --model "model.pth" \
          | tee "[all-] base_lr_1e-2-weight_decay_1e-5-epoch_.log"


LICENSE
    CC BY-SA 3.0

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.