# Magika: AI-Powered Content-Type Detection

arXiv: https://arxiv.org/abs/2409.13768 · HTML: https://mlsanity.com/paper/2409.13768/

## Key facts

- Cited by 6 papers in the map (data through 14 Oct 2026).
- Builds on 4 of its 41 references that are in the map.
- First posted on arXiv 18 Sep 2024.

## Builds on (most cited first, 4 of 4)

- [Gaussian Error Linear Units (GELUs)](https://mlsanity.com/paper/1606.08415/) (2016)
- [CutMix: Regularization Strategy to Train Strong Classifiers with Localizable Features](https://mlsanity.com/paper/1905.04899/) (2019)
- [Wide & Deep Learning for Recommender Systems](https://mlsanity.com/paper/1606.07792/) (2016)
- [Toward the Detection of Polyglot Files](https://mlsanity.com/paper/2203.07561/) (2022)

## Built on by (most cited first, 6 of 6)

- [Agentic AI framework for End-to-End Medical Data Inference](https://mlsanity.com/paper/2507.18115/) (2025)
- [DRAGON: Robust Classification for Very Large Collections of Software Repositories](https://mlsanity.com/paper/2602.09071/) (2026)
- [Evaluating the Robustness of a Production Malware Detection System to Transferable Adversarial Attacks](https://mlsanity.com/paper/2510.01676/) (2025)
- [MimeLens: Position-Agnostic Content-Type Detection for Binary Fragments](https://mlsanity.com/paper/2606.04171/) (2026)
- [Edges Before Embeddings: A Confidence-Aware Blur Gate for Vision-Language Pipelines](https://mlsanity.com/paper/2606.25838/) (2026)
- [Fast And Accurate Text Content File Type Identification](https://mlsanity.com/paper/2609.21306/) (2026)

## Abstract (arXiv)

The task of content-type detection -- which entails identifying the data encoded in an arbitrary byte sequence -- is critical for operating systems, development, reverse engineering environments, and a variety of security applications. In this paper, we introduce Magika, a novel AI-powered content-type detection tool. Under the hood, Magika employs a deep learning model that can execute on a single CPU with just 1MB of memory to store the model's weights. We show that Magika achieves an average F1 score of 99% across over a hundred content types and a test set of more than 1M files, outperforming all existing content-type detection tools today. In order to foster adoption and improvements, we open source Magika under an Apache 2 license on GitHub and make our model and training pipeline publicly available. Our tool has already seen adoption by the Gmail email provider for attachment scanning, and it has been integrated with VirusTotal to aid with malware analysis. We note that this paper discusses the first iteration of Magika, and a more recent version already supports more than 200 content types. The interested reader can see the latest development on the Magika GitHub repository, available at https://github.com/google/magika.
