{"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/hts-at-a-hierarchical-token-semantic-audio","title":"HTS-AT: A Hierarchical Token-Semantic Audio Transformer for Sound Classification and Detection","arxiv_id":"2202.00874","date":"2022-02-02","proceeding":null,"authors":["Ke Chen","Xingjian Du","Bilei Zhu","Zejun Ma","Taylor Berg-Kirkpatrick","Shlomo Dubnov"],"abstract":"Audio classification is an important task of mapping audio samples into their corresponding labels. Recently, the transformer model with self-attention mechanisms has been adopted in this field. However, existing audio transformers require large GPU memories and long training time, meanwhile relying on pretrained vision models to achieve high performance, which limits the model's scalability in audio tasks. To combat these problems, we introduce HTS-AT: an audio transformer with a hierarchical structure to reduce the model size and training time. It is further combined with a token-semantic module to map final outputs into class featuremaps, thus enabling the model for the audio event detection (i.e. localization in time). We evaluate HTS-AT on three datasets of audio classification where it achieves new state-of-the-art (SOTA) results on AudioSet and ESC-50, and equals the SOTA on Speech Command V2. It also achieves better performance in event localization than the previous CNN-based models. Moreover, HTS-AT requires only 35% model parameters and 15% training time of the previous audio transformer. These results demonstrate the high performance and high efficiency of HTS-AT.","url_abs":"https://arxiv.org/abs/2202.00874v1","url_pdf":"https://arxiv.org/pdf/2202.00874v1.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":"hts-at-a-hierarchical-token-semantic-audio","repo_url":"https://github.com/retrocirce/hts-audio-transformer","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"audio-classification","task_name":"Audio Classification"},{"task_slug":"event-detection","task_name":"Event Detection"},{"task_slug":null,"task_name":"GPU"},{"task_slug":"keyword-spotting","task_name":"Keyword Spotting"},{"task_slug":"sound-classification","task_name":"Sound Classification"},{"task_slug":"sound-event-detection","task_name":"Sound Event Detection"}],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/audio-classification-on-audioset","task":"Audio Classification","dataset":"AudioSet","model":"HTS-AT (Ensemble)","rank_in_archive_order":16,"of":51,"metrics":{"Test mAP":"0.487"},"uses_additional_data":true},{"leaderboard":"/sota/audio-classification-on-esc-50","task":"Audio Classification","dataset":"ESC-50","model":"HTS-AT","rank_in_archive_order":10,"of":29,"metrics":{"Accuracy (5-fold)":"97.0","PRE-TRAINING DATASET":"AudioSet","Top-1 Accuracy":"97.0"},"uses_additional_data":true},{"leaderboard":"/sota/keyword-spotting-on-google-speech-commands","task":"Keyword Spotting","dataset":"Google Speech Commands","model":"HTS-AT","rank_in_archive_order":33,"of":42,"metrics":{"Google Speech Commands V2 35":"98.0"},"uses_additional_data":false},{"leaderboard":"/sota/sound-event-detection-on-desed","task":"Sound Event Detection","dataset":"DESED","model":"HTS-AT","rank_in_archive_order":4,"of":13,"metrics":{"event-based F1 score":"50.7"},"uses_additional_data":false}],"syntology":{"syntology_url":"https://syntology.ai/paper/2202.00874","atlas_url":"https://app.syntology.ai/?focus=2202.00874","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2202.00874"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+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/retrocirce/hts-audio-transformer","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_fixture":3,"ran":3,"ran_draft_wrong":1,"unverified":2},"by_repo_kind":{"official":{"samples":9,"ran":7,"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":"3ac6b7d76e8e3584","entry":"drop_path","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"model/layers.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/model/layers.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":"3ac6b7d76e8e3584"}},{"code_sha256_prefix":"1c48abb3bcfeac5b","entry":"fl_mapping","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"fl_evaluate.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/fl_evaluate.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":"1c48abb3bcfeac5b"}},{"code_sha256_prefix":"38d1a2922b5e7686","entry":"get_mix_lambda","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"utils.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/utils.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":"38d1a2922b5e7686"}},{"code_sha256_prefix":"70f55f7a5aa863e1","entry":"scratch_optim","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"fl_evaluate.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/fl_evaluate.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":"70f55f7a5aa863e1"}},{"code_sha256_prefix":"02566da69866c48c","entry":"trunc_normal_","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"model/layers.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/model/layers.py","link_basis":"harvester_set","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"02566da69866c48c"}},{"code_sha256_prefix":"f9fd6241d935f07b","entry":"window_partition","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"model/htsat.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/model/htsat.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":"f9fd6241d935f07b"}},{"code_sha256_prefix":"fb32094c6dbece71","entry":"window_reverse","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"model/htsat.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/model/htsat.py","link_basis":"harvester_set","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"fb32094c6dbece71"}},{"code_sha256_prefix":"42b7821640dcfbcf","entry":"float32_to_int16","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"utils.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/utils.py","link_basis":"harvester_set","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":"42b7821640dcfbcf"}},{"code_sha256_prefix":"47bbdd629908bce3","entry":"int16_to_float32","repo":"retrocirce/hts-audio-transformer","repo_kind":"official","path":"utils.py","file_url":"https://github.com/retrocirce/hts-audio-transformer/blob/HEAD/utils.py","link_basis":"harvester_set","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":"47bbdd629908bce3"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}