{"url":"/method/localvit","slug":"localvit","name":"LocalViT","full_name":"LocalViT","full_name_withheld":false,"description_markdown":"**LocalViT** aims to introduce depthwise convolutions to enhance local features modeling capability of ViTs. The network, as shown in Figure (c), brings localist mechanism into transformers through the depth-wise convolution (denoted by \"DW\"). To cope with the convolution operation, the conversation between sequence and image feature map is added by \"Seq2Img\" and \"Img2Seq\". The computation is as follows:\r\n\r\n$$\r\n\\mathbf{Y}^{r}=f\\left(f\\left(\\mathbf{Z}^{r} \\circledast \\mathbf{W}_{1}^{r} \\right) \\circledast \\mathbf{W}_d  \\right) \\circledast \\mathbf{W}_2^{r}\r\n$$\r\n\r\nwhere $\\mathbf{W}_{d} \\in \\mathbb{R}^{\\gamma d \\times 1 \\times k \\times k}$ is the kernel of the depth-wise convolution.\r\n\r\nThe input (sequence of tokens) is first reshaped to a feature map rearranged on a 2D lattice. Two convolutions along with a depth-wise convolution are applied to the feature map. The feature map is reshaped to a sequence of tokens which are used as by the self-attention of the network transformer layer.","description_state":"present","introduced_year":null,"introduced_by":{"title":null,"paper":null,"first_author":null,"n_authors":0,"url_abs":null,"archive_paper_url":null},"source":{"url":"https://arxiv.org/abs/2104.05707v1","title":"LocalViT: Bringing Locality to Vision Transformers","url_on_a_paper_host":true},"code_snippet_url":null,"code_snippet_url_on_a_code_host":false,"categories":[{"area":"Computer Vision","area_id":"computer-vision","collection":"Vision Transformers","url":"/methods/category/vision-transformers","pwc_aliases":["vision-transformer"]}],"n_papers_tagged":1,"archive_num_papers":null,"papers_newest_first":[{"paper":"/paper/localvit-bringing-locality-to-vision","title":"LocalViT: Bringing Locality to Vision Transformers","date":"2021-04-12","arxiv_id":"2104.05707","n_code_links":2,"syntology":{"ran":3,"of":6,"unverified":3,"pointer_only":0}}],"papers_shown":1,"tasks":[{"task":"/task/image-classification","name":"Image Classification","papers":1}],"tasks_shown":1,"n_tasks":1,"usage_by_year":[{"year":"2021","papers":1}],"row_source":"embedded","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/localvit"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}