Dataset Viewer

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

Total 512B blocks 1,878,712,731
Block size 512 bytes
Block dtype uint8
Unique file types 619
Unique source files 57,332,398
Class imbalance ratio 23,046,717 : 1
Reconstructable 4KB blocks 209,361,927
  • Train: 1,287,614,953 blocks
  • Val: 270,228,940 blocks
  • Test: 281,436,572 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.

Class Distribution

The dataset exhibits substantial class imbalance (23,046,717:1 ratio), reflecting realistic forensic scenarios:

  • Largest class: ~23.0M blocks (e.g., red, pat)
  • Smallest classes: 1–1 blocks (e.g., rmd, wxl, dats)
  • 108 classes have fewer than 100 source files
  • Classes span: source code, markup, configuration, binary executables, archives, media, documents, and more

Dataset Structure

Data Files (data/)

The main data arrays are stored as sharded NumPy .npy files for efficient access:

  • block.npy: shape [1878712731, 512], dtype uint8, 20 shards

Smaller arrays are uploaded as single files:

  • filetype_id.npy: integer class label per block
  • uuid.npy: file-of-origin identifier per block (use with licenses.json to look up per-file licenses)
  • index.npy: position index of the block within the source file
  • data_representation.npy: data representation flag
  • shard_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 arrays
  • train_8k_groups.npy, val_8k_groups.npy, test_8k_groups.npy — (N, 16) index arrays
  • train_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 indices
  • metadata.json: dataset statistics and split configuration
  • class_weights.npy, class_weights_sqrt.npy, class_weights_effective.npy: pre-computed class weights for imbalanced training

License Information

  • licenses.json: maps each file UUID 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

Terms of Use

Tesserae Dataset Terms of Use

  1. 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.json file that maps each file UUID to its specific license.

  2. 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.

  3. 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.

  4. 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:

  1. 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.

  2. 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.

  3. 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
75

Models trained or fine-tuned on TesseraeAnon/tesserae-dataset