Giter VIP home page Giter VIP logo

dynamicmlp's Introduction

Code for 'Dynamic MLP for Fine-Grained Image Classification by Leveraging Geographical and Temporal Information'

Dynamic MLP, which is parameterized by the learned embeddings of variable locations and dates to help fine-grained image classification.

Requirements

Experiment Environment

  • python 3.6
  • pytorch 1.7.1+cu101
  • torchvision 0.8.2

Get pretrained models for SK-Res2Net following here.
Get datasets following here.

Train the model

1. Train image-only model

Specify --image_only for training image-only models.

  • ResNet-50 (67.924% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
  --name res50_image_only \
  --data 'inat21_mini' \
  --data_dir 'path/to/your/data' \
  --model_file 'resnet' \
  --model_name 'resnet50' \
  --pretrained \
  --batch_size 512 \
  --start_lr 0.04 \
  --image_only
  • SK-Res2Net-101 (76.102% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
  --name sk2_image_only \
  --data 'inat21_mini' \
  --data_dir 'path/to/your/data' \
  --model_file 'sk2res2net' \
  --model_name 'sk2res2net101' \
  --pretrained \
  --batch_size 512 \
  --start_lr 0.04 \
  --image_only

2. Train dynamic MLP model

  • ResNet-50 (78.751% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
  --name res50_dynamic_mlp \
  --data 'inat21_mini' \
  --data_dir 'path/to/your/data' \
  --model_file 'resnet_dynamic_mlp' \
  --model_name 'resnet50' \
  --pretrained \
  --batch_size 512 \
  --start_lr 0.04
  • SK-Res2Net-101 (84.694% Top-1 acc)
CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7 python3 train.py \
  --name sk2_dynamic_mlp \
  --data 'inat21_mini' \
  --data_dir 'path/to/your/data' \
  --model_file 'sk2res2net_dynamic_mlp' \
  --model_name 'sk2res2net101' \
  --pretrained \
  --batch_size 512 \
  --start_lr 0.04

Test the model

Specify --resume and --evaluate for inference and --image_only for testing image-only models.

python3 train.py \
  --name sk2_dynamic_mlp \
  --data 'inat21_mini' \
  --data_dir 'path/to/your/data' \
  --model_file 'sk2res2net_dynamic_mlp' \
  --model_name 'sk2res2net101' \
  --resume 'path/to/your/checkpoint' \
  --evaluate

Model Zoo

iNaturalist 2021 mini (90 epoch)

Backbone Size Acc@1 Log Download
ResNet-50 224 67.924 log model
+ Dynamic MLP 224 78.751 log model
SK-Res2Net-101 224 76.102 log model
+ Dynamic MLP 224 84.694 log model

dynamicmlp's People

Contributors

ylingfeng avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dynamicmlp's Issues

长尾细粒度图像分类

hello,这是一个非常棒的工作,我将该方法用在遥感图像分类上取得了非常好的结果。请问你们有没有考虑长尾分类问题,现有的方法似乎没有啥用,您有什么建议呢?

关于图像和外部因素之间高位交互的问题

您好,这是一份很有启发性的工作,但我有一定不太明白,基于concat的融合后,也可以在后续的卷积等操作中实现图像和外部因素特征之间的高维交互呀,本文中DynamicMLP实现高维交互的方式,与其有什么优势吗?

多GPU训练问题

测试了多GPU训练模型,迭代几次后loss为nan,
请问作者该代码能很好地支持多GPU训练吗?谢谢

YFCC100M-GEO 100

您好,想询问一下您在论文中的消融实验部分使用的YFCC100M-GEO 100是否有获取途径?
个人在这个数据集的获取上遇到了一些困难(如果使用inat21mini数据集,使用3090GPUx1实验时的训练时间过长),希望获得您的帮助。
十分感谢

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.