Giter VIP home page Giter VIP logo

large-separable-kernel-attention's Introduction

Large Separable Kernel Attention (LSKA)

This repository implements the model proposed in the paper:

Kin Wai Lau, Lai-Man Po, Yasar Abbas Ur Rehman, Large Separable Kernel Attention: Rethinking the Large Kernel Attention Design in CNN

[arXiv paper]

The implementation code is based on the Visual Attention Network (VAN), Computational Visual Media, 2023. For more information, please refer to the link.

Citing

When using this code, kindly reference:

@article{lau2024large,
  title={Large Separable Kernel Attention: Rethinking the Large Kernel Attention Design in CNN},
  author={Lau, Kin Wai and Po, Lai-Man and Rehman, Yasar Abbas Ur},
  journal={Expert Systems with Applications},
  volume={236},
  pages={121352},
  year={2023},
  publisher={Elsevier}
}

Pretrained models

You can download our pretrained models on ImageNet-1K:

Pretrained ImageNet-1K LSKA (kernel size: 23): link.

Preparation

  • Requirements:
1. Pytorch >= 1.7
2. timm == 0.4.12

Train

We use 4 GPUs for training by default. Run command (It has been writen in train_lska.sh):

MODEL=van_tiny # van_{tiny, small, base}
DROP_PATH=0.1 # drop path rates [0.1, 0.1, 0.1] for [tiny, small, base]
# Kernel size should be [7, 11, 23, 35, 53]
CUDA_VISIBLE_DEVICES=0,1,2,3 bash distributed_train.sh 4 /path/to/imagenet \
	  --model $MODEL -b 128 --lr 1e-3 --drop-path $DROP_PATH --k_size kernel_size \
	  --log_name log_file_name

Validate

Run command (It has been writen in eval.sh) as:

MODEL=van_tiny # van_{tiny, small, base}
CUDA_VISIBLE_DEVICES=0 python3 validate.py /path/to/imagenet --model $MODEL --k_size kernel_size \
  --checkpoint /path/to/model -b 128

Object Detection and Segmentation

We also include the configuration file for the object detection and semantic segmentation in this repository. For details, please check folder mmdetection and mmsegmentation.

large-separable-kernel-attention's People

Contributors

stevenlauhkhk avatar

Stargazers

maomao0819 avatar 周薇 avatar  avatar  avatar  avatar 卧龙 avatar Wenzheng Yao avatar  avatar Austin Xiao avatar chenyifan avatar  avatar Qiushi Li avatar  avatar  avatar  avatar  avatar  avatar ✨FlashPipi avatar  avatar Spider Man avatar Hanjia Wei avatar jryxxx avatar  avatar Tong avatar  avatar llll avatar XJL avatar paopaoyu avatar  avatar YuhangHong avatar  avatar 魔鬼面具 avatar Yasar Abbas avatar  avatar  avatar

Watchers

 avatar

Forkers

yychayitu

large-separable-kernel-attention's Issues

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.