Datasets:

Modalities:
Image
Text
Formats:
parquet
ArXiv:
Libraries:
Datasets
pandas
License:
File size: 6,094 Bytes
aac4ea4
 
5c61774
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
df739a2
5c61774
 
 
 
 
 
 
 
 
 
df739a2
5c61774
 
 
 
 
 
 
 
 
 
 
 
 
 
df739a2
5c61774
 
 
 
 
 
 
 
 
 
df739a2
5c61774
 
 
 
 
 
 
 
 
 
 
 
df739a2
 
 
 
aac4ea4
df739a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
---
license: bsd-2-clause
dataset_info:
  features:
  - name: image
    dtype: image
  - name: writer_id
    dtype: string
  - name: hsf_id
    dtype: int64
  - name: character
    dtype:
      class_label:
        names:
          '0': '0'
          '1': '1'
          '2': '2'
          '3': '3'
          '4': '4'
          '5': '5'
          '6': '6'
          '7': '7'
          '8': '8'
          '9': '9'
          '10': A
          '11': B
          '12': C
          '13': D
          '14': E
          '15': F
          '16': G
          '17': H
          '18': I
          '19': J
          '20': K
          '21': L
          '22': M
          '23': 'N'
          '24': O
          '25': P
          '26': Q
          '27': R
          '28': S
          '29': T
          '30': U
          '31': V
          '32': W
          '33': X
          '34': 'Y'
          '35': Z
          '36': a
          '37': b
          '38': c
          '39': d
          '40': e
          '41': f
          '42': g
          '43': h
          '44': i
          '45': j
          '46': k
          '47': l
          '48': m
          '49': 'n'
          '50': o
          '51': p
          '52': q
          '53': r
          '54': s
          '55': t
          '56': u
          '57': v
          '58': w
          '59': x
          '60': 'y'
          '61': z
  splits:
  - name: train
    num_bytes: 206539811.49
    num_examples: 814277
  download_size: 200734290
  dataset_size: 206539811.49
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
task_categories:
- image-classification
size_categories:
- 100K<n<1M
---

# Dataset Card for FEMNIST

The FEMNIST dataset is a part of the [LEAF](https://leaf.cmu.edu/) benchmark. 
It represents image classification of handwritten digits, lower and uppercase letters, giving 62 unique labels.

## Dataset Details

### Dataset Description

Each sample is comprised of a (28x28) grayscale image, writer_id, hsf_id, and character.

- **Curated by:** [LEAF](https://leaf.cmu.edu/)
- **License:** BSD 2-Clause License

### Dataset Sources

The FEMNIST is a preprocessed (in a way that resembles preprocessing for MNIST) version of [NIST SD 19](https://www.nist.gov/srd/nist-special-database-19).

## Uses

This dataset is intended to be used in Federated Learning settings. 

### Direct Use

We recommend using [Flower Dataset](https://flower.ai/docs/datasets/) (flwr-datasets) and [Flower](https://flower.ai/docs/framework/) (flwr).

To partition the dataset, do the following. 
1. Install the package.
```bash
pip install flwr-datasets[vision]
```
2. Use the HF Dataset under the hood in Flower Datasets.
```python
from flwr_datasets import FederatedDataset
from flwr_datasets.partitioner import NaturalIdPartitioner

fds = FederatedDataset(
    dataset="flwrlabs/femnist",
    partitioners={"train": NaturalIdPartitioner(partition_by="writer_id")}
)
partition = fds.load_partition(partition_id=0)
```

## Dataset Structure


The whole dataset is kept in the train split. If you want to leave out some part of the dataset for centralized evaluation, use Resplitter. (The full example is coming soon here)
Dataset fields:

* image: grayscale of size (28, 28), PIL Image,
* writer_id: string, unique value per each writer,
* hsf_id: string, corresponds to the way that the data was collected (see more details [here](https://www.nist.gov/srd/nist-special-database-19),
* character: ClassLabel (it means it's int if you access it in the dataset, but you can convert it to the original value by `femnist["train"].features["character"].int2str(value)`.


## Dataset Creation

### Curation Rationale

This dataset was created as a part of the [LEAF](https://leaf.cmu.edu/) benchmark. 
We make it available in the HuggingFace Hub to facilitate its seamless use in FlowerDatasets.

### Source Data

[NIST SD 19](https://www.nist.gov/srd/nist-special-database-19)

#### Data Collection and Processing

For the preprocessing details, please refer to the original paper, the source code and [NIST SD 19](https://www.nist.gov/srd/nist-special-database-19)

#### Who are the source data producers?

For the preprocessing details, please refer to the original paper, the source code and [NIST SD 19](https://www.nist.gov/srd/nist-special-database-19)


## Citation

When working on the LEAF benchmark, please cite the original paper. If you're using this dataset with Flower Datasets, you can cite Flower.

**BibTeX:**
```
@article{DBLP:journals/corr/abs-1812-01097,
  author       = {Sebastian Caldas and
                  Peter Wu and
                  Tian Li and
                  Jakub Kone{\v{c}}n{\'y} and
                  H. Brendan McMahan and
                  Virginia Smith and
                  Ameet Talwalkar},
  title        = {{LEAF:} {A} Benchmark for Federated Settings},
  journal      = {CoRR},
  volume       = {abs/1812.01097},
  year         = {2018},
  url          = {http://arxiv.org/abs/1812.01097},
  eprinttype    = {arXiv},
  eprint       = {1812.01097},
  timestamp    = {Wed, 23 Dec 2020 09:35:18 +0100},
  biburl       = {https://dblp.org/rec/journals/corr/abs-1812-01097.bib},
  bibsource    = {dblp computer science bibliography, https://dblp.org}
}
```
```
@article{DBLP:journals/corr/abs-2007-14390,
  author       = {Daniel J. Beutel and
                  Taner Topal and
                  Akhil Mathur and
                  Xinchi Qiu and
                  Titouan Parcollet and
                  Nicholas D. Lane},
  title        = {Flower: {A} Friendly Federated Learning Research Framework},
  journal      = {CoRR},
  volume       = {abs/2007.14390},
  year         = {2020},
  url          = {https://arxiv.org/abs/2007.14390},
  eprinttype    = {arXiv},
  eprint       = {2007.14390},
  timestamp    = {Mon, 03 Aug 2020 14:32:13 +0200},
  biburl       = {https://dblp.org/rec/journals/corr/abs-2007-14390.bib},
  bibsource    = {dblp computer science bibliography, https://dblp.org}
}
```

## Dataset Card Contact

In case of any doubts, please contact [Flower Labs](https://flower.ai/).