Datasets:
Add files using upload-large-folder tool
Browse files- README.md +126 -0
- test-00000-of-00001.parquet +3 -0
- train-00000-of-00001.parquet +3 -0
README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MNIST 32×32 RGB Dataset
|
| 2 |
+
|
| 3 |
+
A preprocessed version of the classic MNIST dataset with handwritten digits, upscaled to 32×32 pixels and converted to RGB format for enhanced deep learning applications.
|
| 4 |
+
|
| 5 |
+
## Overview
|
| 6 |
+
|
| 7 |
+
This dataset takes the original MNIST handwritten digit dataset and transforms it for modern computer vision tasks:
|
| 8 |
+
- **Original format**: 28×28 grayscale images
|
| 9 |
+
- **Enhanced format**: 32×32 RGB images
|
| 10 |
+
- **Digit labels**: 0-9 (single-label classification)
|
| 11 |
+
- **Image format**: RGB PIL Images
|
| 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_32_c3/
|
| 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 |
+
- **Upscaled Resolution**: Enhanced from 28×28 to 32×32 pixels for better feature extraction
|
| 45 |
+
- **RGB Format**: Converted from grayscale to RGB (3-channel) format
|
| 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_32_c3", 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}") # (32, 32)
|
| 67 |
+
print(f"Image mode: {sample['image'].mode}") # RGB
|
| 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. **Channel Expansion**: Grayscale → RGB (L → RGB)
|
| 77 |
+
3. **Resolution Upscaling**: 28×28 → 32×32 (using PIL resize)
|
| 78 |
+
4. **Data Storage**: Parquet format for efficient storage and loading
|
| 79 |
+
5. **Data Type**: PIL Image objects for easy integration
|
| 80 |
+
|
| 81 |
+
## Dataset Format
|
| 82 |
+
|
| 83 |
+
Each sample contains:
|
| 84 |
+
```python
|
| 85 |
+
{
|
| 86 |
+
'image': PIL.Image, # 32×32 RGB image
|
| 87 |
+
'label': int, # Digit class (0-9)
|
| 88 |
+
}
|
| 89 |
+
```
|
| 90 |
+
|
| 91 |
+
## Technical Details
|
| 92 |
+
|
| 93 |
+
- **Original Source**: MNIST Database of Handwritten Digits
|
| 94 |
+
- **Format**: Parquet files for efficient columnar storage
|
| 95 |
+
- **Preprocessing**: Grayscale → RGB conversion, 28×28 → 32×32 upscaling
|
| 96 |
+
- **Loading**: HuggingFace Datasets with custom GeneratorBasedBuilder
|
| 97 |
+
- **Compression**: Parquet format provides built-in compression and fast access
|
| 98 |
+
|
| 99 |
+
## Citation
|
| 100 |
+
|
| 101 |
+
```bibtex
|
| 102 |
+
@article{lecun1998mnist,
|
| 103 |
+
title={The MNIST database of handwritten digits},
|
| 104 |
+
author={LeCun, Yann and Bottou, L{\'e}on and Bengio, Yoshua and Haffner, Patrick},
|
| 105 |
+
year={1998},
|
| 106 |
+
url={http://yann.lecun.com/exdb/mnist/}
|
| 107 |
+
}
|
| 108 |
+
|
| 109 |
+
@misc{mnist32c3,
|
| 110 |
+
title={MNIST 32×32 RGB Dataset},
|
| 111 |
+
author={Enhanced MNIST for Modern Deep Learning},
|
| 112 |
+
year={2024},
|
| 113 |
+
note={Preprocessed version of original MNIST with RGB format and 32×32 resolution}
|
| 114 |
+
}
|
| 115 |
+
```
|
| 116 |
+
|
| 117 |
+
## License
|
| 118 |
+
|
| 119 |
+
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.
|
| 120 |
+
|
| 121 |
+
## Acknowledgments
|
| 122 |
+
|
| 123 |
+
- Based on the original MNIST dataset by Yann LeCun, Corinna Cortes, and Christopher J.C. Burges
|
| 124 |
+
- Enhanced for modern deep learning applications with RGB format and increased resolution
|
| 125 |
+
- Compatible with HuggingFace Datasets ecosystem for seamless integration
|
| 126 |
+
- 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:f6f489981c3c025803fa6429092a97e60c8f42d42cd1e5b19b38514288fc68dd
|
| 3 |
+
size 8404990
|
train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e8259ed77b544376ed2898dbe379d43781eb48342616c9469a3fccf80cfb3c30
|
| 3 |
+
size 50491115
|