{"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/self-supervised-vision-transformers-for","title":"Self-Supervised Vision Transformers for Malware Detection","arxiv_id":"2208.07049","date":"2022-08-15","proceeding":null,"authors":["Sachith Seneviratne","Ridwan Shariffdeen","Sanka Rasnayaka","Nuran Kasthuriarachchi"],"abstract":"Malware detection plays a crucial role in cyber-security with the increase in malware growth and advancements in cyber-attacks. Previously unseen malware which is not determined by security vendors are often used in these attacks and it is becoming inevitable to find a solution that can self-learn from unlabeled sample data. This paper presents SHERLOCK, a self-supervision based deep learning model to detect malware based on the Vision Transformer (ViT) architecture. SHERLOCK is a novel malware detection method which learns unique features to differentiate malware from benign programs with the use of image-based binary representation. Experimental results using 1.2 million Android applications across a hierarchy of 47 types and 696 families, shows that self-supervised learning can achieve an accuracy of 97% for the binary classification of malware which is higher than existing state-of-the-art techniques. Our proposed model is also able to outperform state-of-the-art techniques for multi-class malware classification of types and family with macro-F1 score of .497 and .491 respectively.","url_abs":"https://arxiv.org/abs/2208.07049v1","url_pdf":"https://arxiv.org/pdf/2208.07049v1.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":"self-supervised-vision-transformers-for","repo_url":"https://github.com/sachith500/sherlock","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"pytorch","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"binary-classification","task_name":"Binary Classification"},{"task_slug":"malware-classification","task_name":"Malware Classification"},{"task_slug":"malware-detection","task_name":"Malware Detection"},{"task_slug":"malware-family-detection","task_name":"Malware Family Detection"},{"task_slug":"malware-type-detection","task_name":"Malware Type Detection"},{"task_slug":"self-supervised-learning","task_name":"Self-Supervised Learning"}],"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"},{"method_slug":"vision-transformer","method_name":"Vision Transformer"}],"datasets_introduced":[],"methods_introduced":[],"results":[{"leaderboard":"/sota/malware-detection-on-malnet","task":"Malware Detection","dataset":"MalNet","model":"SHERLOCK (family)","rank_in_archive_order":1,"of":3,"metrics":{"F1 score":"0.878"},"uses_additional_data":false},{"leaderboard":"/sota/malware-detection-on-malnet","task":"Malware Detection","dataset":"MalNet","model":"SHERLOCK (type)","rank_in_archive_order":2,"of":3,"metrics":{"F1 score":"0.876"},"uses_additional_data":false},{"leaderboard":"/sota/malware-detection-on-malnet","task":"Malware Detection","dataset":"MalNet","model":"SHERLOCK","rank_in_archive_order":3,"of":3,"metrics":{"F1 score":"0.854"},"uses_additional_data":false}],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2208.07049","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2208.07049"}},"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/sachith500/sherlock","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"ran_honours":1,"ran":3,"unverified":4},"by_repo_kind":{"official":{"samples":8,"ran":4,"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":"9b2250a3d13ed688","entry":"get_sinusoid_encoding_table","repo":"sachith500/sherlock","repo_kind":"official","path":"modeling_finetune.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/modeling_finetune.py","link_basis":"harvester_set","language":"python","status":"ran_honours","verification_level":1,"contract_check":"HONOURS","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"9b2250a3d13ed688"}},{"code_sha256_prefix":"18ae3e6ef2cf02ec","entry":"has_file_allowed_extension","repo":"sachith500/sherlock","repo_kind":"official","path":"dataset_folder.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/dataset_folder.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":"18ae3e6ef2cf02ec"}},{"code_sha256_prefix":"8ac50ae8773b9431","entry":"is_image_file","repo":"sachith500/sherlock","repo_kind":"official","path":"dataset_folder.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/dataset_folder.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":"8ac50ae8773b9431"}},{"code_sha256_prefix":"fb6aea1653b20bba","entry":"make_dataset","repo":"sachith500/sherlock","repo_kind":"official","path":"dataset_folder.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/dataset_folder.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":"fb6aea1653b20bba"}},{"code_sha256_prefix":"0d3af604efbb5026","entry":"build_transform","repo":"sachith500/sherlock","repo_kind":"official","path":"regenerate_experiment_results.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/regenerate_experiment_results.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":"0d3af604efbb5026"}},{"code_sha256_prefix":"b700fb0a3496b255","entry":"cosine_scheduler","repo":"sachith500/sherlock","repo_kind":"official","path":"utils.py","file_url":"https://github.com/sachith500/sherlock/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":"b700fb0a3496b255"}},{"code_sha256_prefix":"4af06072ea1852af","entry":"get_confusion_matrix_from_dict","repo":"sachith500/sherlock","repo_kind":"official","path":"evaluation/utils/data_util.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/evaluation/utils/data_util.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":"4af06072ea1852af"}},{"code_sha256_prefix":"b9bd3f2cdde658e0","entry":"get_confusion_matrix_from_turple","repo":"sachith500/sherlock","repo_kind":"official","path":"evaluation/utils/data_util.py","file_url":"https://github.com/sachith500/sherlock/blob/HEAD/evaluation/utils/data_util.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":"b9bd3f2cdde658e0"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}