Datasets:
The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.
Tesserae Dataset
The largest publicly available file fragment classification dataset, designed for digital forensics research. Tesserae contains raw byte fragments from files spanning hundreds of file types, enabling the development and benchmarking of content-based file type identification (FFTI) methods.
Dataset Summary
| Field | Value |
|---|---|
| Total 512B blocks | 1,828,774,532 |
| Block size | 512 bytes |
| Block dtype | uint8 |
| Unique file types | 619 |
| Unique source files | 57,332,398 |
| Class imbalance ratio | 90,379 : 1 |
| Reconstructable 4KB blocks | 208,060,323 |
| Reconstructable 8KB blocks | 98,391,426 |
| Reconstructable 16KB blocks | 45,992,523 |
- Train: 1,278,552,215 blocks
- Val: 269,366,264 blocks
- Test: 280,856,053 blocks
Each sample is a raw 512-byte fragment extracted from a file of known type. The classification task is to identify the file type from the raw bytes alone — no metadata, no file headers, no filenames.
This release of Tesserae has been content-deduplicated with split-aware survivor selection (priority: train > val > test). Files with identical content hashes that span multiple splits are reduced to a single survivor, with the survivor preferring train, then val, then test. This guarantees the post-dedup test partition contains no content present in train or val, eliminating cross-split content leakage. Approximately 3.5% of blocks were removed during dedup; see metadata.json for the exact deduplication record.
Motivation
File fragment classification is a critical step in file carving, the process of recovering files from storage media without filesystem metadata. When a file is deleted, the filesystem no longer tracks which data blocks belong to which file. Forensic analysts must determine the file type of each recovered fragment using only its content. This dataset provides a large-scale benchmark for developing and evaluating such methods, with realistic class imbalance reflecting the distribution of file types encountered in practice.
Dataset Composition
Tesserae is assembled from files with various permissive licenses. The dataset includes source code data derived from The Stack, as well as files from other public repositories and open data sources.
A licenses.json file is provided that maps each file UUID to its specific license. All use of the data must comply with the terms of the original licenses, including attribution clauses where applicable.
Dataset Structure
Data Files (data/)
The main data arrays are stored as sharded NumPy .npy files for efficient access:
block.npy: dtypeuint8, 20 shards, (block.npy array holds 1,878,712,731 rows total, but only 1,830,835,797 are referenced by the v1.1 splits.)
Smaller arrays are uploaded as single files:
filetype_id.npy: integer class label per blockuuid.npy: file-of-origin identifier per block (use withlicenses.jsonto look up per-file licenses)index.npy: position index of the block within the source filedata_representation.npy: data representation flagshard_manifest.json: metadata describing shard layout for reassembly
Splits (splits/)
Pre-computed stratified train/val/test splits (split at the file level to prevent data leakage):
512-byte blocks (flat indices into the block array):
train_indices.npy,val_indices.npy,test_indices.npy
Reconstructed large blocks (groups of consecutive 512B blocks from the same file):
train_4k_groups.npy,val_4k_groups.npy,test_4k_groups.npy— (N, 8) index arraystrain_8k_groups.npy,val_8k_groups.npy,test_8k_groups.npy— (N, 16) index arraystrain_16k_groups.npy,val_16k_groups.npy,test_16k_groups.npy— (N, 32) index arrays
Each row in a group file contains indices into the base block.npy array. Concatenating the referenced 512B blocks in order reconstructs the larger block.
Class mapping and metadata:
old_to_new_class.npy: dictionary mapping original filetype IDs to contiguous class indicesmetadata.json: dataset statistics and split configurationclass_weights.npy,class_weights_sqrt.npy,class_weights_effective.npy: pre-computed class weights for imbalanced training
License Information
files.csv: maps each filename to a UUIDTesserae_licenses_filenames.jsonl: maps each filename to its license
Loading the Data
Reassemble sharded block array
import numpy as np
from pathlib import Path
def load_sharded_npy(shard_dir, stem="block_shard", expected_shards=None):
"""Load and concatenate sharded .npy files."""
shard_files = sorted(shard_dir.glob(f"{stem}_*.npy"))
if expected_shards is not None:
assert len(shard_files) == expected_shards
arrays = [np.load(f, mmap_mode='r') for f in shard_files]
return np.concatenate(arrays, axis=0)
# Load everything
data_dir = Path("data")
blocks = load_sharded_npy(data_dir, "block_shard")
labels = np.load(data_dir / "filetype_id.npy")
# Load splits
splits_dir = Path("splits")
train_idx = np.load(splits_dir / "train_indices.npy")
val_idx = np.load(splits_dir / "val_indices.npy")
test_idx = np.load(splits_dir / "test_indices.npy")
# Access training data
train_blocks = blocks[train_idx]
train_labels = labels[train_idx]
Memory-mapped access (recommended for large-scale training)
import numpy as np
from pathlib import Path
data_dir = Path("data")
shard_files = sorted(data_dir.glob("block_shard_*.npy"))
blocks_shards = [np.load(f, mmap_mode='r') for f in shard_files]
# To access a specific index across shards:
def get_block(idx, shards, rows_per_shard):
shard_idx = idx // rows_per_shard
local_idx = idx % rows_per_shard
return shards[shard_idx][local_idx]
Loading 4KB / 8KB / 16KB blocks
import numpy as np
blocks = ... # loaded as above
groups_4k = np.load("splits/train_4k_groups.npy") # shape (N, 8)
# Reconstruct a 4KB block from 8 consecutive 512B blocks
sample_idx = 0
block_indices = groups_4k[sample_idx] # 8 indices into blocks array
block_4k = blocks[block_indices].reshape(-1) # (4096,) uint8 array
Sensitive Data, Secret, and Malware Scanning
Tesserae is assembled from multiple public sources. The largest by file-type coverage is The Stack v1.2 (Kocetkov et al., 2022). The Stack's documentation notes that its released data may contain sensitive information such as email addresses, IP addresses, and API/SSH keys previously published to public GitHub repositories, and that its PII/secret-removal pipeline was a work in progress at release. Consistent with this known property of the source, we performed additional best-effort scanning and removal prior to release. Automated detection is inherently incomplete, and we make no guarantee that all sensitive or harmful content has been identified or removed. A removal-request channel is provided below.
Credential and secret scanning
We scanned the text-encoded portion of the corpus with three independent tools: a structural private-key sweep, Gitleaks (full pass over all text-encoded files), and TruffleHog (a second pass covering provider-specific credential formats not modeled by the first two). Across all scanners, 94,317 files matched one or more detectors. Of these, the majority were files already excluded from the released dataset by our construction thresholds; the remaining files present in the release that were flagged as containing likely credential material were removed.
High-precision detections were removed outright: structurally confirmed private keys, cloud service-account credential JSONs, and prefix-anchored provider tokens (AWS, GCP, Azure AD, Slack, Stripe, GitHub, Telegram, SendGrid, Twilio, DigitalOcean), together with hardcoded credentials in configuration files (e.g. Terraform passwords, MongoDB connection strings). The private-key sweep confirmed 16,069 files with embedded key material out of 29,005 marker matches; the remaining 12,936 files reference key markers in code or documentation without embedded keys and were retained.
Low-precision detections were sampled rather than bulk-removed, as their matches appeared to be dominated by false positives. In manual inspection of samples (100+ findings per major rule), observed true-positive rates were low, on the order of a few percent or less: generic high-entropy "api-key" matches were predominantly hashes, UUIDs, public identifiers, and test vectors; sampled JWT matches were expired demonstration tokens (none of 30 sampled were live); bare password fields lacked host or user context; and 40-hex "token" matches were integrity hashes. These were retained, a deliberate precision/recall trade-off that likely leaves some low-signal credential-like strings in the corpus.
Malware scanning
All binary file types (617,709 files) and all executable/script text types were scanned with ClamAV 1.4.5 (signature database dated 2026-07-24, approximately 3.6M signatures). No malicious content was detected in the binary tree. In the script text types, 78 files were flagged, spanning cryptominer downloaders, webshells, backdoors, a state-associated dropper family, and a dual-use PowerShell tooling signature. All 78 were removed. These detections are consistent with security-research and tooling content inherited from public repositories rather than evidence of an active threat, and were removed out of caution regardless of intent.
License audit and copyleft removal
Tesserae's largest single source, The Stack v1.2, has a relevant licensing history: The Stack v1.0 originally included three weak-copyleft licenses (MPL, EPL, LGPL), which BigCode removed in v1.1, extending the permissive list to 193 licenses. The version we use (v1.2) post-dates that removal, so those licenses should not be present in the Stack-derived portion of Tesserae. Rather than rely on the upstream exclusion alone, we ran a per-file license audit across all sources. It identified and removed 21 GPL-2.0 files and 24 GPL-with-font-exception files that had leaked through upstream license detection. To the best of our knowledge no strong-copyleft (GPL-family) files remain in the released data, though as with any automated license detection this cannot be guaranteed exhaustive. The dataset does include openly-licensed content under attribution and share-alike terms (CC-BY, CC-BY-SA). These files are redistributed unmodified as raw byte fragments, a collection rather than an adaptation, and their required attribution is preserved per file in the license map.
Personally identifiable information
Developer email addresses appear to be common in the text portion of the corpus. A sample of text files suggested a prevalence on the order of roughly 15%, though this is an estimate from sampling rather than an exhaustive count. This is expected for a corpus derived from public source repositories, where such addresses occur in commit-attribution headers, license and copyright blocks, and package manifests. Consistent with The Stack's release policy, whose terms of use Tesserae inherits and ships, these provenance addresses are retained rather than redacted. Files in which an email co-occurred with a detected credential were removed by the credential pass above. Names, phone numbers, and IP addresses fall under the same public-repository provenance and are not separately redacted.
Total removed and effect on the dataset
In total, [29,363] files were removed across the credential and malware passes. Removed content was excised from the released block array (the corresponding blocks are zeroed) and from all train/validation/test splits, which drop only the affected blocks while preserving the exact partitioning of all retained data. The removal affects under 0.5% of blocks and does not materially change any reported benchmark result; updated metrics on the cleaned release will be reported in the camera-ready.
Data removal requests
If you are a copyright holder or credential/data owner and wish to request removal of specific files, contact [tesseraemodico@gmail.com] with the relevant file UUIDs. The dataset is versioned, and validated removals are enacted in subsequent releases.
Terms of Use
Tesserae Dataset Terms of Use
License compliance. The Tesserae dataset is a collection of file fragments from files with various permissive licenses. Any use of all or part of the data must abide by the terms of the original licenses, including attribution clauses when relevant. We facilitate this by providing a
licenses.jsonfile that maps each file UUID to its specific license.Data removal requests. If you are the copyright holder of file(s) included in this dataset and wish to have them removed, please contact us at tesseraemodico@gmail.com with the relevant file identifiers. We will process removal requests and update the dataset accordingly.
Dataset updates. The Tesserae dataset may be periodically updated to enact validated data removal requests. By accessing this dataset, you agree to update your own copy to the most recent version when notified of changes. If you have questions about dataset versions and allowed uses, please ask in the dataset's community discussions.
Redistribution. To host, share, or otherwise provide access to the Tesserae dataset, you must include these Terms of Use and require users to agree to them.
Terms of Use for The Stack (Included Data)
The Tesserae dataset includes source code data derived from The Stack. The following terms apply to all data originating from The Stack:
The Stack is a collection of source code in over 300 programming languages. We ask that you read and acknowledge the following points before using the dataset:
The Stack is a collection of source code from repositories with various licenses. Any use of all or part of the code gathered in The Stack must abide by the terms of the original licenses, including attribution clauses when relevant. We facilitate this by providing provenance information for each data point.
The Stack is regularly updated to enact validated data removal requests. By clicking on "Access repository", you agree to update your own version of The Stack to the most recent usable version specified by the maintainers in the following thread. If you have questions about dataset versions and allowed uses, please also ask them in the dataset's community discussions. We will also notify users via email when the latest usable version changes.
To host, share, or otherwise provide access to The Stack dataset, you must include these Terms of Use and require users to agree to it.
Citation
If you use this dataset in your research, please cite:
@dataset{tesserae2026,
title={Tesserae: A Large-Scale File Fragment Classification Dataset},
author={Tesserae Authors},
year={2026},
url={https://huggingface.co/datasets/TesseraeAnon/tesserae-dataset}
}
- Downloads last month
- 62