Dataset Viewer
Auto-converted to Parquet Duplicate
image
listlengths
30
30
label
stringclasses
7 values
[ [ 0, 0.059600830078125, 0, 0, 0, 0.05694580078125, 0, 0, 0, 0.020721435546875, 0, 0.00885772705078125, 0.01488494873046875, 0.01318359375, 0.057373046875, 0.0869140625, 0.078125, 0, 0, 0.018463134765625, 0.07012939453125, 0, ...
rectangle
[ [ 0, 0.08380126953125, 0, 0, 0, 0, 0.0810546875, 0.032958984375, 0, 0, 0, 0, 0.0487060546875, 0, 0.0577392578125, 0, 0, 0, 0, 0, 0, 0, 0.04937744140625, 0, 0, 0, 0, 0, 0, 0.039398193359375 ], ...
rectangle
[ [ 0, 0.003936767578125, 0.07794189453125, 0, 0, 0, 0, 0, 0, 0.032440185546875, 0.08978271484375, 0.0894775390625, 0, 0, 0, 0, 0, 0.0543212890625, 0.234619140625, 0.22265625, 0.0172119140625, 0.0679931640625, 0, 0.0653686...
rectangle
[ [ 0, 0.04803466796875, 0, 0, 0, 0, 0, 0.052001953125, 0.08709716796875, 0, 0, 0, 0, 0, 0, 0, 0.034698486328125, 0, 0, 0, 0.08782958984375, 0, 0.04595947265625, 0, 0.0159149169921875, 0.006320953369140625, 0.0...
parallelogram
[ [ 0.070556640625, 0.06640625, 0, 0.0654296875, 0, 0, 0, 0, 0.0911865234375, 0.052276611328125, 0, 0, 0, 0.05657958984375, 0, 0, 0, 0.0675048828125, 0, 0, 0.0791015625, 0.054229736328125, 0.034210205078125, 0.091491699218...
line
[ [ 0.048797607421875, 0, 0.0109710693359375, 0.059906005859375, 0.072509765625, 0.038543701171875, 0, 0, 0, 0, 0.0821533203125, 0, 0, 0, 0.0811767578125, 0.07879638671875, 0, 0.05999755859375, 0.04815673828125, 0.074951171875, 0.0359...
rectangle
[ [ 0.0032806396484375, 0, 0.0009822845458984375, 0, 0, 0.03424072265625, 0, 0.045745849609375, 0, 0, 0.080322265625, 0, 0.03961181640625, 0, 0.006420135498046875, 0.09393310546875, 0.0167083740234375, 0, 0, 0.014434814453125, 0, ...
parallelogram
[ [ 0, 0.039764404296875, 0, 0.06353759765625, 0, 0, 0.034271240234375, 0.0816650390625, 0, 0, 0.044342041015625, 0.059783935546875, 0.01317596435546875, 0.071533203125, 0.058807373046875, 0, 0.1766357421875, 0.3193359375, 0.056549072265625, ...
line
[ [ 0, 0.0225067138671875, 0.03192138671875, 0, 0.08734130859375, 0, 0.059478759765625, 0.0148773193359375, 0, 0.0087738037109375, 0.0970458984375, 0.06268310546875, 0, 0.00989532470703125, 0, 0.084228515625, 0.0161895751953125, 0.064697265625, ...
line
[ [ 0.005786895751953125, 0.25830078125, 0, 0.260498046875, 0.14208984375, 0.398681640625, 0.56103515625, 0.51708984375, 0.035888671875, 0.576171875, 0.66650390625, 0.377197265625, 0.362548828125, 0.16455078125, 0.3740234375, 0.2379150390625, 0.23962...
rectangle
[ [ 0.098876953125, 0.0443115234375, 0.0311279296875, 0.08953857421875, 0, 0.049407958984375, 0.007038116455078125, 0.0767822265625, 0, 0, 0, 0.0240325927734375, 0.033905029296875, 0.0526123046875, 0, 0.0860595703125, 0.05535888671875, 0, 0, ...
line
[ [ 0.09722900390625, 0.0189361572265625, 0.07476806640625, 0.0936279296875, 0, 0.0826416015625, 0.0295257568359375, 0.07623291015625, 0, 0.033782958984375, 0.07598876953125, 0.060638427734375, 0.08441162109375, 0.040863037109375, 0.052825927734375, 0, ...
pentagon
[ [ 0.06988525390625, 0.0131683349609375, 0.04345703125, 0, 0, 0.016937255859375, 0, 0.0811767578125, 0.00405120849609375, 0.2470703125, 0.2255859375, 0.37158203125, 0.49560546875, 0, 1, 0.93408203125, 0.927734375, 1, 1, 1, 1, 1, ...
circle
[ [ 0.00787353515625, 0, 0.0526123046875, 0, 0.073974609375, 0.04803466796875, 0.030487060546875, 0.034027099609375, 0, 0.0139617919921875, 0.08538818359375, 0, 0.07232666015625, 0.09466552734375, 0.049774169921875, 0, 0.052154541015625, 0, 0...
rectangle
[ [ 0, 0.0902099609375, 0, 0, 0.044769287109375, 0, 0, 0, 0.0204010009765625, 0, 0.0229644775390625, 0.08349609375, 0, 0.0374755859375, 0.09088134765625, 0, 0, 0.0308685302734375, 0, 0.0771484375, 0, 0.06353759765625, 0, 0...
triangle
[ [ 0, 0, 0.0618896484375, 0.0457763671875, 0.00653076171875, 0, 0, 0.0810546875, 0.026641845703125, 0.059173583984375, 0.04736328125, 0, 0, 0.08245849609375, 0.085205078125, 0, 0.0955810546875, 0.228759765625, 0.049163818359375, 0.462158...
triangle
[ [ 0, 0, 0.10980224609375, 0.069091796875, 0.0777587890625, 0.046722412109375, 0.2379150390625, 0.194580078125, 0.12286376953125, 0.001373291015625, 0.218994140625, 0, 0.0919189453125, 0.11175537109375, 0.0970458984375, 0.01491546630859375, 0.056640...
pentagon
[ [ 0.07293701171875, 0, 0, 0, 0, 0.03240966796875, 0.1500244140625, 0.287841796875, 0.2421875, 0.11944580078125, 0.6220703125, 0.11407470703125, 0.392578125, 0, 0.09521484375, 0.0794677734375, 0, 0, 0.06591796875, 0, 0.00200271606445...
parallelogram
[ [ 0.038604736328125, 0.0147857666015625, 0, 0, 0, 0, 0, 0, 0.066162109375, 0.0985107421875, 0, 0, 0, 0, 0, 0.02435302734375, 0.038909912109375, 0.055450439453125, 0, 0.0279693603515625, 0.0509033203125, 0, 0.0989990234375, ...
parallelogram
End of preview. Expand in Data Studio

Geometric Shape Dataset

Introduction to Dataset

The Geometric Shape Dataset is a large-scale, synthetically generated computer vision dataset containing 1,680,000 instances of various geometric shapes and lines. It is designed for training image classification, feature extraction, and pattern recognition models across different scales.

The dataset is available in three distinct resolution configurations: 30x30, 40x40, and 50x50 (560,000 images per resolution). Each resolution is split into a train set (504,000 images) and a test set (56,000 images).

Instead of clean, binary pixel representations, this dataset introduces complex mathematical variations: every shape features dynamic scaling, random rotations, varied boundary thickness, and a unique distance-based "halo" noise gradient. Additionally, a global background noise is applied to the entire canvas. Values are strictly normalized between 0.0 and 1.0.

Shapes Distribution

The dataset is perfectly balanced. It contains 7 distinct classes, distributed equally across the 1,680,000 samples (240,000 images per class in total, or 80,000 per class per resolution).

Because every resolution is split into train and test, the per-class counts for a single resolution are:

Split Images (per resolution) Per class (per resolution)
train 504,000 72,000
test 56,000 8,000
Total 560,000 80,000
Shape Class Count Description Examples (50x50)
Circle 240,000 Randomly scaled ellipses and perfect circles.
Triangle 240,000 3-sided polygons with dynamic edge stretching.
Rectangle 240,000 4-sided orthogonal shapes (squares and rectangles).
Pentagon 240,000 5-sided regular and dynamically stretched polygons.
Hexagon 240,000 6-sided regular and dynamically stretched polygons.
Parallelogram 240,000 4-sided shapes with forced shear (strictly non-rectangular).
Line 240,000 Curved Quadratic Bezier lines mimicking imperfect hand-drawn strokes.
Total 1,680,000
Note: For all samples, you can go to Files and Versions, then click into the respective resolution's `samples` folders.

Dataset Characteristics & Generation Details

To prevent models from easily memorizing shapes, several advanced data augmentation techniques were mathematically baked into the generation process:

  • Float16 Precision: Continuous pixel values rather than 8-bit integers, preserving the exact mathematical noise distribution.
  • Curved Strokes: Lines are generated using Bezier curves with varying bend amounts, perfectly simulating the imperfections of human drawing.
  • Dynamic Thickness: The solid boundaries of the shapes randomly vary between 1, 2, or 3 pixels.
  • Halo Noise Gradient: A localized noise layer surrounds the shape, inversely proportional to the distance from the solid boundary (fading out over a 4-pixel radius).
  • Global Noise: A uniform random noise between -0.1 and 0.1 applied globally (clipped to stay within [0, 1]).
  • Safety Scaling: Bounding boxes guarantee that no shape clips outside the canvas boundaries, even under extreme rotation or shear.

Storage Structure

To optimize both disk space and loading speeds, the dataset is architected with modern streaming in mind:

  • Configurations by Resolution: Choose between 30x30, 40x40, or 50x50 subsets right from the Hugging Face viewer.
  • Chunked Parquet Files: The dataset is split into smaller, highly compressed .parquet chunks (5,600 images per chunk).
  • Nested 2D Arrays: Each image is stored as a nested list (List[List[float16]]), i.e. a 2D matrix of shape 30x30, 40x40, or 50x50 depending on the configuration. When you convert data["image"] to a NumPy array it already comes back as a 2D matrix at the correct resolution, so no reshaping is required.
  • Pre-Shuffled: The shapes are heavily shuffled within each chunk before saving. You will receive perfectly mixed, heterogeneous batches starting from the very first megabyte.

How to Use

Because of the chunked Parquet structure, you can either download the entire dataset or use Iterable Streaming (lazy loading) to train models without consuming any hard drive space.

1. Streaming Mode

Use streaming=True and specify the name argument (e.g., "50x50") to fetch data on the fly. Each image is already a 2D matrix, so converting it to a NumPy array gives you the right shape directly.

from datasets import load_dataset
import numpy as np

# Load dataset configuration "50x50" without downloading to disk
iterable_dataset = load_dataset("OmerTurk1/GeometricShapeDataset", name="50x50", split="train", streaming=True)

# You can add a buffer shuffle for even more randomness during training
shuffled_dataset = iterable_dataset.shuffle(buffer_size=10000, seed=42)

for data in shuffled_dataset:
    # Already a 2D matrix (50x50 for this config); no reshape needed
    image_matrix = np.array(data["image"], dtype=np.float16)
    label = data["label"]

    print(f"Label: {label} | Shape: {image_matrix.shape}")

    # Rest is up to you

2. Standard Download

If you have enough RAM and want to load the entire dataset into memory:

from datasets import load_dataset
import numpy as np

# This will download the 30x30 dataset configuration to your local Hugging Face cache
dataset = load_dataset("OmerTurk1/GeometricShapeDataset", name="30x30", split="train")

# Already a 2D matrix (30x30 for this config); no reshape needed
first_image = np.array(dataset[0]["image"], dtype=np.float16)
first_label = dataset[0]["label"]

print(f"First image is a {first_label} with shape {first_image.shape}")

# Rest is up to you

Tip: Each resolution also ships a test split. Pass split="test" to load_dataset to evaluate your model on held-out data.

License & Attribution

This dataset is released under the Creative Commons Attribution 4.0 International (CC BY 4.0) license.

You are free to use, share, and adapt this dataset for any purpose, including commercial use, as long as you give appropriate credit to the author (Omer Turk / OmerTurk1).

Citation

If you use this dataset in your work, please cite it:

@misc{turk_geometric_shape_dataset,
  author       = {Omer Turk},
  title        = {Geometric Shape Dataset},
  howpublished = {\url{https://huggingface.co/datasets/OmerTurk1/GeometricShapeDataset}},
  note         = {Synthetic geometric shape image classification dataset}
}
Downloads last month
1,032