Answers.Body: <p><strong>Can I test my model on other digits, for example I write the digit 7 on a paper with my pen and check whether my model would recognize it or not? How can I do it?</strong></p>
  <p><strong>Yes</strong>, definitely.  One of the main goals of machine learning is to be able to train a model and use it on your own data to make predictions.  <strong>BUT</strong> you must ensure that the handwritten digits are produced and processed in the same way as the training data.</p>
  <ul>
  <li><strong>Example 1:</strong>  If the MNIST digits dataset uses black pen, you must also use black pen (preferably of the same type).</li>
  <li><strong>Example 2:</strong>  If the MNIST digits dataset has digits on a white background, you must also produce digits on a white background.</li>
  <li><strong>Example 3:</strong>  If the MNIST digits dataset has digits that are centered in a 28x28-pixel image, then you must do the same.</li>
  </ul>
  <p>This will help keep your dataset &quot;within distribution&quot; as the training dataset.  Departures from the pipeline that generated the training data will result in degradation in performance.  By the way, there is usually some degradation in performance anyway when models are deployed in the real world.</p>
  <p>After you have captured and processed your &quot;custom&quot; handwritten digits, you must package them in a way that can be processed by your model.  For example, models in Keras/Tensorflow will take images as Tensorflow tensors and Numpy arrays.  You should preferably package your data the way MNIST dataset is packaged in your download.  Keras has the <code>.predict()</code> method that allows you to make predictions / inferences on new data (see <a href="https://keras.io/api/models/model_training_apis/#predict-method" rel="nofollow noreferrer">article</a>).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-10-24T15:34:39.670Z
Answers.LastActivityDate: 2022-10-24T15:34:39.670Z
Answers.UserDisplayName: Snehal Patel
Body: <p>I have developed a feed-forward ANN from scratch trained (and evaluated) on MNIST database, which contains 60,000 + 10,000 handwritten digits samples.</p>
  <p>Can I test my model on other digits, for example I write the digit <code>7</code> on a paper with my pen and check whether my model would recognize it or not? How can I do it?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-10-29T23:44:23.713Z
Comments.Text: Is this more of a technical question, regarding how do you write digits on a paper, take photos, crop them and feed them to the network or something else?
Comments.UserDisplayName: NikoNyrh
Tags: <neural-networks><mnist>
Title: How can I use my neural network model, trained on MNIST database, on "real word" digits such as my handwritten digits?
UserDisplayName: tail
ThreadText: # How can I use my neural network model, trained on MNIST database, on "real word" digits such as my handwritten digits?
  
  (Asked by: username_0 on 2022-10-24)
  
  I have developed a feed-forward ANN from scratch trained (and evaluated) on MNIST database, which contains 60,000 + 10,000 handwritten digits samples.
  
  Can I test my model on other digits, for example I write the digit `7` on a paper with my pen and check whether my model would recognize it or not? How can I do it?
  
  **Tags:** neural-networks, mnist
  > **Comments:**
  > **username_1**: Is this more of a technical question, regarding how do you write digits on a paper, take photos, crop them and feed them to the network or something else?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2022-10-24. Score: 1
  
  **Can I test my model on other digits, for example I write the digit 7 on a paper with my pen and check whether my model would recognize it or not? How can I do it?**
  
  **Yes**, definitely. One of the main goals of machine learning is to be able to train a model and use it on your own data to make predictions. **BUT** you must ensure that the handwritten digits are produced and processed in the same way as the training data.
  
  * **Example 1:** If the MNIST digits dataset uses black pen, you must also use black pen (preferably of the same type).
  * **Example 2:** If the MNIST digits dataset has digits on a white background, you must also produce digits on a white background.
  * **Example 3:** If the MNIST digits dataset has digits that are centered in a 28x28-pixel image, then you must do the same.
  
  This will help keep your dataset "within distribution" as the training dataset. Departures from the pipeline that generated the training data will result in degradation in performance. By the way, there is usually some degradation in performance anyway when models are deployed in the real world.
  
  After you have captured and processed your "custom" handwritten digits, you must package them in a way that can be processed by your model. For example, models in Keras/Tensorflow will take images as Tensorflow tensors and Numpy arrays. You should preferably package your data the way MNIST dataset is packaged in your download. Keras has the `.predict()` method that allows you to make predictions / inferences on new data (see [article](https://keras.io/api/models/model_training_apis/#predict-method)).
  
  
  ---
  
  