image listlengths 50 50 | label stringclasses 6
values |
|---|---|
[
[
0,
0.052825927734375,
0,
0,
0,
0.0888671875,
0.018341064453125,
0.054718017578125,
0,
0.0194854736328125,
0,
0.047882080078125,
0,
0,
0.00804901123046875,
0,
0.051849365234375,
0.042388916015625,
0,
0,
0.0273895263671875,
0,
... | pentagon |
[
[
0.052734375,
0,
0.0908203125,
0,
0,
0.04229736328125,
0,
0.07720947265625,
0,
0.06536865234375,
0.039886474609375,
0,
0,
0.011016845703125,
0,
0,
0.052398681640625,
0,
0,
0,
0.0791015625,
0.0966796875,
0.07861328125,
0... | line |
[
[
0.09869384765625,
0.021209716796875,
0,
0,
0,
0,
0,
0.0904541015625,
0,
0.07708740234375,
0.061187744140625,
0,
0,
0.01605224609375,
0.09271240234375,
0.043487548828125,
0,
0.08453369140625,
0.06353759765625,
0,
0,
0.022994995... | triangle |
[
[
0.0452880859375,
0.0679931640625,
0.06988525390625,
0.0027790069580078125,
0,
0,
0,
0.0821533203125,
0,
0.053863525390625,
0.027313232421875,
0,
0.0494384765625,
0,
0.0943603515625,
0.09539794921875,
0.0699462890625,
0.036041259765625,
0,... | circle |
[
[
0,
0,
0.032379150390625,
0.08453369140625,
0.04046630859375,
0,
0,
0.088623046875,
0,
0,
0,
0.02008056640625,
0,
0.09521484375,
0.08160400390625,
0,
0.018463134765625,
0.0889892578125,
0.07940673828125,
0.05853271484375,
0.0651245... | rectangle |
[
[
0,
0.05902099609375,
0.07684326171875,
0.0670166015625,
0.0655517578125,
0,
0.0859375,
0,
0.017486572265625,
0.0953369140625,
0.05316162109375,
0.0240478515625,
0.0894775390625,
0,
0.045135498046875,
0,
0.0679931640625,
0,
0,
0.049194... | parallelogram |
[
[
0,
0.01560211181640625,
0,
0.0782470703125,
0.07421875,
0,
0.0179901123046875,
0.0765380859375,
0,
0.035247802734375,
0,
0.0058135986328125,
0,
0.00531768798828125,
0.044891357421875,
0.061126708984375,
0.00658416748046875,
0.035247802734375,... | circle |
[[0.094970703125,0.006195068359375,0.052276611328125,0.0,0.004077911376953125,0.0,0.0278167724609375(...TRUNCATED) | triangle |
[[0.0947265625,0.0,0.0,0.0,0.049163818359375,0.03472900390625,0.00102996826171875,0.0,0.0,0.00737380(...TRUNCATED) | triangle |
[[0.0,0.0,0.0,0.0,0.0,0.053802490234375,0.0,0.0966796875,0.0,0.0693359375,0.006870269775390625,0.029(...TRUNCATED) | line |
Geometric Shape Dataset
Introduction to Dataset
The Geometric Shape Dataset is a large-scale, synthetically generated computer vision dataset containing 900,000 instances of various geometric shapes and lines. It is designed for training image classification, feature extraction, and pattern recognition models.
Instead of clean, binary pixel representations, this dataset introduces complex mathematical variations: every shape features dynamic scaling, random rotations, varied boundary thickness (1 to 3 pixels), and a unique distance-based "halo" noise gradient. Additionally, a global background noise is applied to the entire 50x50 canvas. Values are strictly normalized between 0.0 and 1.0.
Shapes Distribution
The dataset is perfectly balanced. It contains 6 distinct classes, distributed equally across the 900,000 samples.
| Shape Class | Count | Description | Examples (50x50) |
|---|---|---|---|
| Circle | 150,000 | Randomly scaled ellipses and perfect circles. |
|
| Triangle | 150,000 | 3-sided polygons with dynamic edge stretching. |
|
| Rectangle | 150,000 | 4-sided orthogonal shapes (squares and rectangles). |
|
| Pentagon | 150,000 | 5-sided regular and dynamically stretched polygons. |
|
| Parallelogram | 150,000 | 4-sided shapes with forced shear (strictly non-rectangular). |
|
| Line | 150,000 | Straight linear segments of varying lengths and angles. |
|
| Total | 900,000 |
Note: For all samples, you can go to Files and Versions, then click each shape folders to view shape samples
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.
- 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.1and0.1applied globally (clipped to stay within[0, 1]). - Safety Scaling: Bounding boxes guarantee that no shape clips outside the 50x50 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:
- Chunked Parquet Files: The dataset is split into smaller, highly compressed
.parquetchunks. - Flattened Arrays: Parquet does not natively support 2D/3D matrix cells, so the
50x50images are safely flattened into1Darrays of length2500. (They can be instantly reshaped during training). - Pre-Shuffled: The shapes are heavily shuffled within each chunk before saving. If you stream this dataset, you will not get 150,000 circles followed by 150,000 triangles. 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 to fetch data on the fly. Don't forget to reshape the 1D flat array back to 50x50.
from datasets import load_dataset
import numpy as np
# Load dataset without downloading to disk
iterable_dataset = load_dataset("OmerTurk1/GeometricShapeDataset", 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:
# 1. Extract and convert to numpy array
flat_image = np.array(data["image"], dtype=np.float16)
# 2. Reshape back to 50x50 matrix
image_matrix = flat_image.reshape(50, 50)
label = data["label"]
print(f"Label: {label} | Shape: {image_matrix.shape}")
# Feed to your model (train_step)
break
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 dataset to your local Hugging Face cache
dataset = load_dataset("OmerTurk1/GeometricShapeDataset", split="train")
# Accessing a specific index and reshaping
first_image = np.array(dataset[0]["image"], dtype=np.float16).reshape(50, 50)
first_label = dataset[0]["label"]
print(f"First image is a {first_label}")
- Downloads last month
- 242