MNIST8M / README.md
MarveenLee's picture
Update README.md
ec86d43 verified
---
license: cc0-1.0
task_categories:
- image-classification
- clustering
tags:
- mnist
- digits
- computer-vision
- machine-learning
- matlab
dataset_info:
features:
- name: data
dtype: uint8
shape: [784]
- name: labels
dtype: uint8
splits:
- name: train
num_bytes: 3170000000
num_examples: 8100000
---
# MNIST8M Dataset (.mat format)
## Dataset Description
This repository contains the MNIST8M dataset converted to MATLAB `.h5` format for convenient use in MATLAB environments. The original data is sourced from the LIBSVM datasets page.
### Dataset Summary
- **Original Source**: [LIBSVM Multiclass Datasets - MNIST8M](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#mnist8m)
- **Format Conversion**: Converted from original LibSVM format to MATLAB `.h5` format
- **Purpose**: Facilitate clustering and machine learning experiments in MATLAB
- **Files**: `MNIST8M_data.h5`, `labels.mat`
### Data Specifications
- **Samples**: 8,100,000 (8.1 million)
- **Features**: 784 (28×28 pixel images)
- **Data Type**: `uint8`
- **Value Range**: [0, 255]
- **Labels**: 10 classes (digits 0-9)
- **Label Type**: `uint8`
- **Label Range**: [0, 9]
### Storage Format
- `MNIST8M_data`: uint8 matrix of size 8,100,000 × 784
- `labels`: uint8 vector of size 8,100,000 × 1
### Usage Warning
⚠️ **Memory Considerations**: Loading the entire dataset directly into memory may cause out-of-memory errors on systems with insufficient RAM. The uncompressed data requires approximately 6GB of memory (8.1M × 784 × 1 byte).
### Recommended Usage
For systems with limited memory, consider:
- Loading data in batches
- Using memory-mapped files
- Working with data subsets
- Converting to single precision when possible
### Source Attribution
Original dataset courtesy of:
- [LIBSVM Datasets](https://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#mnist8m)
- [infinite MNIST](https://leon.bottou.org/projects/infimnist)
### MATLAB Loading Example
```
dataset_name = 'MNIST8M';
% Data path
data_file = 'MNIST8M_data.h5'; % Your directory
data = h5read(data_file, '/MNIST8M');
data = double(data); % May cause out-of-memory
data_info = h5info(data_file);
data_size = data_info.Datasets.Dataspace.Size;
n_points = data_size(1); % Total number of points
n_features = data_size(2); % Number of dimensions
```
```
>> h5disp('MNIST8M_data.h5');
HDF5 MNIST8M_data.h5
Group '/'
Dataset 'MNIST8M'
Size: 8100000x784
MaxSize: 8100000x784
Datatype: H5T_STD_U8LE (uint8)
ChunkSize: 100000x784
Filters: none
FillValue: 0
```