Datasets:
Add files using upload-large-folder tool
Browse files- README.md +125 -0
- test-00000-of-00001.parquet +3 -0
- train-00000-of-00001.parquet +3 -0
README.md
ADDED
|
@@ -0,0 +1,125 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MNIST 28×28 Grayscale Dataset
|
| 2 |
+
|
| 3 |
+
The original MNIST dataset with handwritten digits in 28×28 grayscale format, stored in efficient Parquet format for modern deep learning applications.
|
| 4 |
+
|
| 5 |
+
## Overview
|
| 6 |
+
|
| 7 |
+
This dataset contains the original MNIST handwritten digit dataset in its native format:
|
| 8 |
+
- **Format**: 28×28 grayscale images
|
| 9 |
+
- **Digit labels**: 0-9 (single-label classification)
|
| 10 |
+
- **Image format**: Grayscale PIL Images
|
| 11 |
+
- **Storage**: Parquet format for efficient loading
|
| 12 |
+
|
| 13 |
+
## Dataset Statistics
|
| 14 |
+
|
| 15 |
+
### Training Set (60,000 samples)
|
| 16 |
+
| Digit | Count | Digit | Count |
|
| 17 |
+
|-------|-------|-------|-------|
|
| 18 |
+
| 0 | 5,923 | 5 | 5,421 |
|
| 19 |
+
| 1 | 6,742 | 6 | 5,918 |
|
| 20 |
+
| 2 | 5,958 | 7 | 6,265 |
|
| 21 |
+
| 3 | 6,131 | 8 | 5,851 |
|
| 22 |
+
| 4 | 5,842 | 9 | 5,949 |
|
| 23 |
+
|
| 24 |
+
### Test Set (10,000 samples)
|
| 25 |
+
| Digit | Count | Digit | Count |
|
| 26 |
+
|-------|-------|-------|-------|
|
| 27 |
+
| 0 | 980 | 5 | 892 |
|
| 28 |
+
| 1 | 1,135 | 6 | 958 |
|
| 29 |
+
| 2 | 1,032 | 7 | 1,028 |
|
| 30 |
+
| 3 | 1,010 | 8 | 974 |
|
| 31 |
+
| 4 | 982 | 9 | 1,009 |
|
| 32 |
+
|
| 33 |
+
## Directory Structure
|
| 34 |
+
|
| 35 |
+
```
|
| 36 |
+
mnist_28/
|
| 37 |
+
├── README.md # This documentation
|
| 38 |
+
├── train-00000-of-00001.parquet # Training data (Parquet format)
|
| 39 |
+
└── test-00000-of-00001.parquet # Test data (Parquet format)
|
| 40 |
+
```
|
| 41 |
+
|
| 42 |
+
## Key Features
|
| 43 |
+
|
| 44 |
+
- **Original Resolution**: Maintains original 28×28 pixel resolution
|
| 45 |
+
- **Grayscale Format**: Single-channel grayscale format as in original MNIST
|
| 46 |
+
- **PIL Integration**: Images loaded as PIL RGB objects ready for preprocessing
|
| 47 |
+
- **Standard Splits**: Maintains original MNIST train/test division
|
| 48 |
+
- **HuggingFace Compatible**: Full integration with datasets library
|
| 49 |
+
- **Efficient Loading**: Parquet format for fast columnar data access and compression
|
| 50 |
+
|
| 51 |
+
## Usage
|
| 52 |
+
|
| 53 |
+
### Loading with HuggingFace Datasets
|
| 54 |
+
|
| 55 |
+
```python
|
| 56 |
+
from datasets import load_dataset
|
| 57 |
+
|
| 58 |
+
# Load the dataset using the custom script
|
| 59 |
+
dataset = load_dataset("FrankCCCCC/mnist_28", trust_remote_code=True)
|
| 60 |
+
|
| 61 |
+
print(f"Train samples: {len(dataset['train'])}")
|
| 62 |
+
print(f"Test samples: {len(dataset['test'])}")
|
| 63 |
+
|
| 64 |
+
# Access a sample
|
| 65 |
+
sample = dataset['train'][0]
|
| 66 |
+
print(f"Image shape: {sample['image'].size}") # (28, 28)
|
| 67 |
+
print(f"Image mode: {sample['image'].mode}") # L (Grayscale)
|
| 68 |
+
print(f"Label: {sample['label']}") # Integer: 0-9
|
| 69 |
+
```
|
| 70 |
+
|
| 71 |
+
## Transformations Applied
|
| 72 |
+
|
| 73 |
+
The dataset preprocessing pipeline includes:
|
| 74 |
+
|
| 75 |
+
1. **Format Conversion**: IDX → Parquet
|
| 76 |
+
2. **Data Storage**: Parquet format for efficient storage and loading
|
| 77 |
+
3. **Data Type**: PIL Image objects for easy integration
|
| 78 |
+
4. **Format Preservation**: Maintains original 28×28 grayscale format
|
| 79 |
+
|
| 80 |
+
## Dataset Format
|
| 81 |
+
|
| 82 |
+
Each sample contains:
|
| 83 |
+
```python
|
| 84 |
+
{
|
| 85 |
+
'image': PIL.Image, # 28×28 grayscale image
|
| 86 |
+
'label': int, # Digit class (0-9)
|
| 87 |
+
}
|
| 88 |
+
```
|
| 89 |
+
|
| 90 |
+
## Technical Details
|
| 91 |
+
|
| 92 |
+
- **Original Source**: MNIST Database of Handwritten Digits
|
| 93 |
+
- **Format**: Parquet files for efficient columnar storage
|
| 94 |
+
- **Preprocessing**: Maintains original grayscale format and 28×28 resolution
|
| 95 |
+
- **Loading**: HuggingFace Datasets with custom GeneratorBasedBuilder
|
| 96 |
+
- **Compression**: Parquet format provides built-in compression and fast access
|
| 97 |
+
|
| 98 |
+
## Citation
|
| 99 |
+
|
| 100 |
+
```bibtex
|
| 101 |
+
@article{lecun1998mnist,
|
| 102 |
+
title={The MNIST database of handwritten digits},
|
| 103 |
+
author={LeCun, Yann and Bottou, L{\'e}on and Bengio, Yoshua and Haffner, Patrick},
|
| 104 |
+
year={1998},
|
| 105 |
+
url={http://yann.lecun.com/exdb/mnist/}
|
| 106 |
+
}
|
| 107 |
+
|
| 108 |
+
@misc{mnist28,
|
| 109 |
+
title={MNIST 28×28 Grayscale Dataset},
|
| 110 |
+
author={Original MNIST for Deep Learning},
|
| 111 |
+
year={2024},
|
| 112 |
+
note={Original MNIST dataset in efficient Parquet format}
|
| 113 |
+
}
|
| 114 |
+
```
|
| 115 |
+
|
| 116 |
+
## License
|
| 117 |
+
|
| 118 |
+
This dataset follows the same license as the original MNIST dataset. The original MNIST database is available under the Creative Commons Attribution-Share Alike 3.0 license.
|
| 119 |
+
|
| 120 |
+
## Acknowledgments
|
| 121 |
+
|
| 122 |
+
- Based on the original MNIST dataset by Yann LeCun, Corinna Cortes, and Christopher J.C. Burges
|
| 123 |
+
- Preserved in original format for classical deep learning applications
|
| 124 |
+
- Compatible with HuggingFace Datasets ecosystem for seamless integration
|
| 125 |
+
- Optimized for CNN architectures and transfer learning applications
|
test-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9626944200025ddc95aaf3e4e0a4600547a46105beb3a170f33ca27cc1c5d72c
|
| 3 |
+
size 2646700
|
train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:960750d965f3545138da1db2c4826f6dc1f06e50dbbc296b5eaf4e3d0058037e
|
| 3 |
+
size 15864717
|