{"url":"/method/focal-transformers","slug":"focal-transformers","name":"Focal Transformers","full_name":"Focal Transformers","full_name_withheld":false,"description_markdown":"The **focal self-attention** is built to make Transformer layers scalable to high-resolution inputs.  Instead of attending all tokens at fine-grain, the approach attends the fine-grain tokens only locally, but the summarized ones globally. As such, it can cover as many regions as standard self-attention but with much less cost. An image is first partitioned into patches, resulting in visual tokens. Then a patch embedding layer, consisting of a convolutional layer with filter and stride of same size, to project the patches into hidden features. This spatial feature map in then passed to four stages of focal Transformer blocks. Each focal Transformer block consists of $N_i$ focal Transformer layers. Patch embedding layers are used in between to reduce spatial size of feature map by factor 2, while feature dimension increased by 2.","description_state":"present","introduced_year":null,"introduced_by":{"title":"Focal Self-attention for Local-Global Interactions in Vision Transformers","paper":"/paper/focal-self-attention-for-local-global","first_author":"Jianwei Yang","n_authors":7,"url_abs":null,"archive_paper_url":"https://paperswithcode.com/paper/focal-self-attention-for-local-global"},"source":{"url":"https://arxiv.org/abs/2107.00641v1","title":"Focal Self-attention for Local-Global Interactions in 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":4,"archive_num_papers":4,"papers_newest_first":[{"paper":"/paper/explicitly-increasing-input-information","title":"Explicitly Increasing Input Information Density for Vision Transformers on Small Datasets","date":"2022-10-25","arxiv_id":"2210.14319","n_code_links":1,"syntology":{"ran":4,"of":7,"unverified":3,"pointer_only":7}},{"paper":"/paper/focal-wnet-an-architecture-unifying","title":"Focal-WNet: An Architecture Unifying Convolution and Attention for Depth Estimation","date":"2022-07-18","arxiv_id":null,"n_code_links":1,"syntology":null},{"paper":"/paper/focal-attention-for-long-range-interactions","title":"Focal Attention for Long-Range Interactions in Vision Transformers","date":"2021-12-01","arxiv_id":null,"n_code_links":1,"syntology":null},{"paper":"/paper/focal-self-attention-for-local-global","title":"Focal Self-attention for Local-Global Interactions in Vision Transformers","date":"2021-07-01","arxiv_id":"2107.00641","n_code_links":3,"syntology":{"ran":3,"of":3,"unverified":0,"pointer_only":2}}],"papers_shown":4,"tasks":[{"task":"/task/image-classification","name":"Image Classification","papers":2},{"task":"/task/object-detection","name":"Object Detection","papers":2},{"task":"/task/semantic-segmentation","name":"Semantic Segmentation","papers":2},{"task":"/task/image-classification","name":"image-classification","papers":2},{"task":"/task/object-detection-1","name":"object-detection","papers":2},{"task":"/task/decoder","name":"Decoder","papers":1},{"task":"/task/depth-estimation","name":"Depth Estimation","papers":1},{"task":"/task/instance-segmentation","name":"Instance Segmentation","papers":1},{"task":"/task/monocular-depth-estimation","name":"Monocular Depth Estimation","papers":1}],"tasks_shown":9,"n_tasks":9,"usage_by_year":[{"year":"2021","papers":2},{"year":"2022","papers":2}],"row_source":"methods_table","archive":{"source":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","archive_url":"https://paperswithcode.com/method/focal-transformers"},"syntology_read_at":"2026-09-24T18:15:14+00:00"}