Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,78 @@
|
|
| 1 |
---
|
| 2 |
license: afl-3.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: afl-3.0
|
| 3 |
+
tags:
|
| 4 |
+
- image-classification
|
| 5 |
+
library_name: keras
|
| 6 |
+
datasets:
|
| 7 |
+
- mnist
|
| 8 |
+
metrics:
|
| 9 |
+
- accuracy
|
| 10 |
+
model-index:
|
| 11 |
+
- name: resnet_mnist_digits
|
| 12 |
+
results:
|
| 13 |
+
- task:
|
| 14 |
+
type: image-classification
|
| 15 |
+
name: Image Classification
|
| 16 |
+
dataset:
|
| 17 |
+
type: mnist
|
| 18 |
+
name: MNIST
|
| 19 |
+
metrics:
|
| 20 |
+
- type: accuracy
|
| 21 |
+
value: .9945
|
| 22 |
+
name: Accuracy
|
| 23 |
+
verified: false
|
| 24 |
---
|
| 25 |
+
|
| 26 |
+
# Model Card for resnet_mnist_digits
|
| 27 |
+
|
| 28 |
+
This model is is a Residual Neural Network (ResNet) for classifying handwritten digits in the MNIST dataset.
|
| 29 |
+
This model has 27.5 M parameters and achieves 99.45% accuracy on the MNIST test dataset (i.e., on digits not seen during training).
|
| 30 |
+
|
| 31 |
+
## Model Details
|
| 32 |
+
|
| 33 |
+
### Model Description
|
| 34 |
+
|
| 35 |
+
This model takes as an input a 28x28 array of MNIST digits with values normalized to [0, 1].
|
| 36 |
+
The model was trained using Keras on an Nvidia Ampere A100.
|
| 37 |
+
|
| 38 |
+
- **Developed by:** Phillip Allen Lane
|
| 39 |
+
- **Model type:** ResNet
|
| 40 |
+
- **License:** afl-3.0
|
| 41 |
+
|
| 42 |
+
### How to Get Started with the Model
|
| 43 |
+
|
| 44 |
+
Use the code below to get started with the model.
|
| 45 |
+
|
| 46 |
+
```py
|
| 47 |
+
from tensorflow.keras import models
|
| 48 |
+
from tensorflow.keras.datasets import mnist
|
| 49 |
+
from tensorflow.keras.utils import to_categorical
|
| 50 |
+
from keras.utils.data_utils import get_file
|
| 51 |
+
|
| 52 |
+
# load the MNIST dataset test images and labels
|
| 53 |
+
(_, _), (test_images, test_labels) = mnist.load_data()
|
| 54 |
+
|
| 55 |
+
# normalize the images
|
| 56 |
+
test_images = test_images.astype('float32') / 255
|
| 57 |
+
# create one-hot labels
|
| 58 |
+
test_labels_onehot = to_categorical(test_labels)
|
| 59 |
+
|
| 60 |
+
# download the model
|
| 61 |
+
model_path = get_file('/path/to/resnet_mnist_digits.hdf5', 'https://huggingface.co/lane99/resnet_mnist_digits/resolve/main/resnet_mnist_digits.hdf5')
|
| 62 |
+
# import the model
|
| 63 |
+
resnet = models.load_model(model_path)
|
| 64 |
+
|
| 65 |
+
# evaluate the model
|
| 66 |
+
evaluation_conv = resnet.evaluate(test_images, test_labels_onehot)
|
| 67 |
+
print("Accuracy: ", str(evaluation_conv[1]))
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
## Training Details
|
| 71 |
+
|
| 72 |
+
### Training Data
|
| 73 |
+
|
| 74 |
+
This model was trained on the 60,000 entries in the MNIST training dataset.
|
| 75 |
+
|
| 76 |
+
### Training Procedure
|
| 77 |
+
|
| 78 |
+
This model was trained with a 0.1 validation split for 15 epochs using a batch size of 128.
|