Extend mnist database

时间:2018-06-04 16:56:28

标签: python tensorflow mnist

I wonder how can I extend mnist database to recognize digits and only few characters like A,B. I use this tutorial for mnist, how can I add to this database charater A and B ? Thank you!

1 个答案:

答案 0 :(得分:0)

You would need to do three things:

  1. Add additional images of the letters A and B to the dataset (training, validation and test), with labels 11 and 12. The easiest way to extend the dataset might be with a subset of the EMNIST dataset https://www.nist.gov/itl/iad/image-group/emnist-dataset
  2. Change the number of outputs on the logit layer to 12 to accomodate the new characters (or 13 if you want a "none of the above" output because you intend to train on sybols you don't need recognised explicitly)

    logits = tf.layers.dense(inputs=dropout, units=12)

  3. Retrain the network from scratch since its weights in other layers were only generated with numbers in mind and would likely otherwise struggle to differentiate between 8 and B. You might get away with transfer learning from a previously trained network however and it might be interesting to try.