Papers › Self-Supervised Vision Transformers for Malware Detection

Self-Supervised Vision Transformers for Malware Detection

15 Aug 2022arXiv:2208.07049archive 2025-07-28

Sachith Seneviratne, Ridwan Shariffdeen, Sanka Rasnayaka, Nuran Kasthuriarachchi

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.

PaperPDFCodeCode Syntology ran

In Syntology Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, Syntology's MCP tool lists every function and class Syntology harvested from this paper and whether it ran (how to connect): get_harvested_code_for_paper(arxiv_id="2208.07049")

Code

Syntology Ran 4 of 8 code samples harvested from 1 repository linked to this paper; 4 have no recorded run. Of those that ran: 1 ran · honoured contract; 3 ran with no contract checked.

By repository: official repository: 8 samples from 1 repository, 4 ran. The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

sachith500/sherlock officialmentioned in paperpytorchMIT report

Repository list and official/mentioned flags are the archive's, frozen 2025-07-28. Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

8 samples harvested; 4 ran; 1 honoured the contract we drafted; 4 have no recorded run. Read from Syntology's graph 2026-09-24; that is when this build read the record, not when the samples ran.

1ran · honoured contract
3ran
4unverified

Licence: 0 of the 8 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from sachith500/sherlock. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself; “our draft was wrong” and “fixture could not drive it” are failures of Syntology's instrument, not of the code.

Each sample ends with its code_sha256, Syntology's identity for that exact code. An agent fetches the stored sample with Syntology's MCP tool get_code(code_sha256="…") (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: 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. Samples from a repository marked official are listed first. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of four reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; or the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar). Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

get_sinusoid_encoding_table sachith500/sherlock/modeling_finetune.py official repository ran · honoured contract MIT (permissive) · 9b2250a3d13ed688 · report
has_file_allowed_extension sachith500/sherlock/dataset_folder.py official repository ran MIT (permissive) · 18ae3e6ef2cf02ec · report
is_image_file sachith500/sherlock/dataset_folder.py official repository ran MIT (permissive) · 8ac50ae8773b9431 · report
make_dataset sachith500/sherlock/dataset_folder.py official repository ran MIT (permissive) · fb6aea1653b20bba · report
build_transform sachith500/sherlock/regenerate_experiment_results.py official repository unverified MIT (permissive) · 0d3af604efbb5026 · report
cosine_scheduler sachith500/sherlock/utils.py official repository unverified MIT (permissive) · b700fb0a3496b255 · report
get_confusion_matrix_from_dict sachith500/sherlock/evaluation/utils/data_util.py official repository unverified MIT (permissive) · 4af06072ea1852af · report
get_confusion_matrix_from_turple sachith500/sherlock/evaluation/utils/data_util.py official repository unverified MIT (permissive) · b9bd3f2cdde658e0 · report

Tasks

Binary ClassificationMalware ClassificationMalware DetectionMalware Family DetectionMalware Type DetectionSelf-Supervised Learning

Results from the paper archive 2025-07-28

TaskDatasetModelMetricValueRank at snapshotLeaderboardReport
Malware Detection MalNet SHERLOCK (family) F1 score 0.878 #1 of 3 Archive leaderboard report
Malware Detection MalNet SHERLOCK (type) F1 score 0.876 #2 of 3 Archive leaderboard report
Malware Detection MalNet SHERLOCK F1 score 0.854 #3 of 3 Archive leaderboard report

Ranks are positions in the archive's leaderboards as they stood at the 2025-07-28 snapshot. Results published since then are not among these rows, so a rank here is not a current standing.

Methods

Absolute Position EncodingsAdamAttentionBPEDense ConnectionsDropoutLabel SmoothingLayer NormalizationLinear LayerMulti-Head AttentionPosition-Wise Feed-Forward LayerResidual ConnectionSoftmaxTransformerVision Transformer

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections