{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/revit-enhancing-vision-transformers-with","title":"ReViT: Enhancing Vision Transformers Feature Diversity with Attention Residual Connections","arxiv_id":"2402.11301","date":"2024-02-17","proceeding":null,"authors":["Anxhelo Diko","Danilo Avola","Marco Cascio","Luigi Cinque"],"abstract":"Vision Transformer (ViT) self-attention mechanism is characterized by feature collapse in deeper layers, resulting in the vanishing of low-level visual features. However, such features can be helpful to accurately represent and identify elements within an image and increase the accuracy and robustness of vision-based recognition systems. Following this rationale, we propose a novel residual attention learning method for improving ViT-based architectures, increasing their visual feature diversity and model robustness. In this way, the proposed network can capture and preserve significant low-level features, providing more details about the elements within the scene being analyzed. The effectiveness and robustness of the presented method are evaluated on five image classification benchmarks, including ImageNet1k, CIFAR10, CIFAR100, Oxford Flowers-102, and Oxford-IIIT Pet, achieving improved performances. Additionally, experiments on the COCO2017 dataset show that the devised approach discovers and incorporates semantic and spatial relationships for object detection and instance segmentation when implemented into spatial-aware transformer models.","url_abs":"https://arxiv.org/abs/2402.11301v2","url_pdf":"https://arxiv.org/pdf/2402.11301v2.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"revit-enhancing-vision-transformers-with","repo_url":"https://github.com/adiko1997/revit","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"diversity","task_name":"Diversity"},{"task_slug":"image-classification","task_name":"Image Classification"},{"task_slug":"instance-segmentation","task_name":"Instance Segmentation"},{"task_slug":"object-detection","task_name":"Object Detection"},{"task_slug":"semantic-segmentation","task_name":"Semantic Segmentation"},{"task_slug":"image-classification","task_name":"image-classification"},{"task_slug":"object-detection-1","task_name":"object-detection"}],"methods":[{"method_slug":"absolute-position-encodings","method_name":"Absolute Position Encodings"},{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"label-smoothing","method_name":"Label Smoothing"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"position-wise-feed-forward-layer","method_name":"Position-Wise Feed-Forward Layer"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"transformer","method_name":"Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/image-classification-on-imagenet","task":"Image Classification","dataset":"ImageNet","model":"ReViT-B","rank_in_archive_order":536,"of":1060,"metrics":{"Top 1 Accuracy":"82.4"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2402.11301","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2402.11301"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/adiko1997/revit","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran":20,"ran_fixture":2,"unverified":2},"by_repo_kind":{"official":{"samples":24,"ran":22,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"a3eebab667e1ae7d","entry":"GetEntities","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/data.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"a3eebab667e1ae7d"}},{"code_sha256_prefix":"6862b0bd0e344d92","entry":"MapClasses","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/data.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6862b0bd0e344d92"}},{"code_sha256_prefix":"1c7c19cf255af8b5","entry":"SampleList","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/data.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/data.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1c7c19cf255af8b5"}},{"code_sha256_prefix":"f118f90404a2705d","entry":"attention_pool","repo":"adiko1997/revit","repo_kind":"official","path":"model/attention.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f118f90404a2705d"}},{"code_sha256_prefix":"6e8d64ae2c5f0678","entry":"construct_optimizer","repo":"adiko1997/revit","repo_kind":"official","path":"model/optimizer.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/optimizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6e8d64ae2c5f0678"}},{"code_sha256_prefix":"c1d7ffe2c3f88e99","entry":"convert_to_one_hot","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/mixup.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/mixup.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c1d7ffe2c3f88e99"}},{"code_sha256_prefix":"07d1986e7f19e873","entry":"downsample","repo":"adiko1997/revit","repo_kind":"official","path":"model/attention.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/attention.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"07d1986e7f19e873"}},{"code_sha256_prefix":"314973a77b15948e","entry":"drop_path","repo":"adiko1997/revit","repo_kind":"official","path":"model/common.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/common.py","link_basis":"plan_row","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"314973a77b15948e"}},{"code_sha256_prefix":"345d213a14918073","entry":"get_loss_func","repo":"adiko1997/revit","repo_kind":"official","path":"model/loss.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/loss.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"345d213a14918073"}},{"code_sha256_prefix":"e41a84c48e4dfc26","entry":"get_param_groups","repo":"adiko1997/revit","repo_kind":"official","path":"model/optimizer.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/optimizer.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e41a84c48e4dfc26"}},{"code_sha256_prefix":"6c1b7082e865f0e0","entry":"get_relative_position_index","repo":"adiko1997/revit","repo_kind":"official","path":"model/reswin.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/reswin.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6c1b7082e865f0e0"}},{"code_sha256_prefix":"96179ff95fbfb203","entry":"lr_func_cosine","repo":"adiko1997/revit","repo_kind":"official","path":"model/lr_policy.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/lr_policy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"96179ff95fbfb203"}},{"code_sha256_prefix":"099da579c821206a","entry":"lr_func_steps_with_relative_lrs","repo":"adiko1997/revit","repo_kind":"official","path":"model/lr_policy.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/lr_policy.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"099da579c821206a"}},{"code_sha256_prefix":"0f31beff332194d6","entry":"mixup_target","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/mixup.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/mixup.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0f31beff332194d6"}},{"code_sha256_prefix":"18037498e45c3930","entry":"params_count","repo":"adiko1997/revit","repo_kind":"official","path":"utils/model_stats.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/utils/model_stats.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"18037498e45c3930"}},{"code_sha256_prefix":"1d66bc560c9e0685","entry":"rand_bbox","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/mixup.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/mixup.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1d66bc560c9e0685"}},{"code_sha256_prefix":"942ad4676769ca5e","entry":"round_width","repo":"adiko1997/revit","repo_kind":"official","path":"model/common.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/common.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"942ad4676769ca5e"}},{"code_sha256_prefix":"e866e1196986f728","entry":"shear_x","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/rand_augment.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e866e1196986f728"}},{"code_sha256_prefix":"7b2503c99c9447fb","entry":"shear_y","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/rand_augment.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7b2503c99c9447fb"}},{"code_sha256_prefix":"323759f906fbb394","entry":"translate_x_rel","repo":"adiko1997/revit","repo_kind":"official","path":"dataset/rand_augment.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/dataset/rand_augment.py","link_basis":"harvester_set","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"323759f906fbb394"}},{"code_sha256_prefix":"993ae96666b00cb5","entry":"window_partition","repo":"adiko1997/revit","repo_kind":"official","path":"model/reswin.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/reswin.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"993ae96666b00cb5"}},{"code_sha256_prefix":"265c72d3ccc64544","entry":"window_reverse","repo":"adiko1997/revit","repo_kind":"official","path":"model/reswin.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/reswin.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"265c72d3ccc64544"}},{"code_sha256_prefix":"5de56fec3ce10382","entry":"cal_rel_pos_spatial","repo":"adiko1997/revit","repo_kind":"official","path":"model/attention.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/attention.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5de56fec3ce10382"}},{"code_sha256_prefix":"0fd362a779c37232","entry":"get_lr_at_epoch","repo":"adiko1997/revit","repo_kind":"official","path":"model/lr_policy.py","file_url":"https://github.com/adiko1997/revit/blob/HEAD/model/lr_policy.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"0fd362a779c37232"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}