MimeLens: Position-Agnostic Content-Type Detection for Binary Fragments
Not on the map. Why?
Abstract (arXiv)
File-type classification underlies many workflows like malware triage, forensic carving, packet inspection, and storage indexing. Learned systems such as Google's Magika assume whole-file access at a known offset, so they break on the inputs many of these tasks actually produce, like a single packet payload, a header-less carved fragment, a random disk block, or a chunked upload. We introduce MimeLens, a family of small BERT-style encoders pretrained on binary content from windows sampled at a uniformly random offset within each file, with no privileged head-of-file position, in standard- and short-context variants. A byte chunk goes in from anywhere in a file, no header needed and no fixed size; out comes one of libmagic's 125 MIME labels. On the clean head of complete files, MimeLens beats Magika v1.1 by +10.7 pp top-1 on libmagic-labeled data, and it keeps classifying where Magika cannot: from a single mid-stream UDP packet, and more than twice as accurately as libmagic and Magika on random mid-file disk blocks. The cost is latency: MimeLens runs roughly one to two orders of magnitude slower per sample on CPU than Magika, though it matches on consumer GPUs or in batch. All trained checkpoints are released on Hugging Face (mjbommar/mimelens-001-*).
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 7 of its 11 references that are in the map. First posted on arXiv 2 Jun 2026.
Builds on
7 of 11 references.
References · 7
- 2021RoFormer: Enhanced Transformer with Rotary Position Embeddingcited by 4,703
- 2021ByT5: Towards a token-free future with pre-trained byte-to-byte modelscited by 509
- 2021CANINE: Pre-training an Efficient Tokenization-Free Encoder for Language Representationcited by 232
- 2024Byte Latent Transformer: Patches Scale Better Than Tokenscited by 146
- 2024Magika: AI-Powered Content-Type Detectioncited by 6
- 2025Binary BPE: A Family of Cross-Platform Tokenizers for Binary Analysiscited by 2
- 2025Binary-30K: A Heterogeneous Dataset for Deep Learning in Binary Analysis and Malware Detectioncited by 1
Built on by
Not cited yet.