Datasets:
Kaggle Chess Positions (mirror)
Public mirror of the Chess Positions dataset by koryakinp on Kaggle, hosted for easier access in ML pipelines (including 2d-chess-ocr).
Source & attribution
| Field | Value |
|---|---|
| Original dataset | koryakinp/chess-positions |
| Original author | koryakinp |
| License | CC0-1.0 |
| Generation tool | koryakinp/chess-generator |
| Board/piece assets | Chess.com |
This repository is a mirror of the Kaggle release. Please cite the original Kaggle dataset and respect the CC0-1.0 license.
Dataset summary
- 100,000 synthetic chess board images, 400×400 pixels
- Positions contain 5–15 pieces (always includes both kings)
- 28 board styles × 32 piece styles = 896 visual combinations
- Training set: 80,000 images (
train/) - Test set: 20,000 images (
test/)
Piece sampling probabilities in the original generator:
- Pawn 30%, Bishop 20%, Knight 20%, Rook 20%, Queen 10%, plus both kings
Some positions may be chess-illegal (e.g. both kings in check). Treat labels accordingly.
Label format (FEN in filename)
Each image filename encodes the piece-placement portion of FEN, with dashes between ranks instead of slashes:
1B1B1K2-3p1N2-6k1-R7-5P2-4q3-7R-1B6.jpeg
- Uppercase = White pieces (
PNBRQK) - Lowercase = Black pieces (
pnbrqk) - Digits
1–8= empty squares on a rank
There is no separate label file; parse the filename to recover the 8×8 board.
Usage
Load with Hugging Face Datasets
from datasets import load_dataset
ds = load_dataset("smallchess/kaggle-chess-positions")
# ds["train"], ds["test"]
Use with 2d-chess-ocr (piece classifier training)
In the 2d-chess-ocr dataset pipeline, Step 2 extracts 64×64 piece tiles from these board images (labels come from the filename):
# after downloading this dataset locally
uv run -m dataset_creation.chess_piece_sets.create_piece_dataset \
--source-dir /path/to/kaggle-chess-positions \
--output-dir datasets/pieces-dataset \
--tile-size 64
Point --source-dir at the folder containing train/ and test/.
Download from the Hub
huggingface-cli download smallchess/kaggle-chess-positions --repo-type dataset --local-dir ./kaggle-chess-positions
Repository layout
train/ # 80,000 JPEG board images
test/ # 20,000 JPEG board images
Citation
If you use this data, please credit the original Kaggle dataset:
@misc{koryakinp_chess_positions,
author = {koryakinp},
title = {Chess Positions},
year = {2019},
publisher = {Kaggle},
howpublished = {\url{https://www.kaggle.com/datasets/koryakinp/chess-positions}}
}
- Downloads last month
- 799