<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic MEAN and STD values in TensorFlow Lite Micro for i.MXRT tutorial in eIQ Machine Learning Software</title>
    <link>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1349170#M488</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;question in regards to &lt;A href="https://community.nxp.com/t5/eIQ-Machine-Learning-Software/Getting-Started-with-TensorFlow-Lite-for-Microcontrollers-on-i/ta-p/1124103" target="_blank" rel="noopener"&gt;Getting Started with TensorFlow Lite for Microcontrollers on i.MX RT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;there are two defines in section 4.1 (with camera version)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define MODEL_INPUT_MEAN 127.5f
#define MODEL_INPUT_STD 127.5f&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;however when you run &lt;EM&gt;flower_lab.py&lt;/EM&gt;&amp;nbsp; (with small changes highlighted with "CHANGE", they aim to check what are mean/std values)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Retrain model on new images
mobilenetv1_spec = model_spec.ImageModelSpec(uri='https://tfhub.dev/google/imagenet/mobilenet_v1_025_128/feature_vector/4')
print("MEAN", mobilenetv1_spec.mean_rgb) #CHANGE
print("STD", mobilenetv1_spec.stddev_rgb) #CHANGE 
mobilenetv1_spec.input_image_shape = [128, 128]
model = image_classifier.create(train_data, model_spec=mobilenetv1_spec, validation_data=validation_data)
model.summary()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;it prints out that during retraining the values took into account are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;MEAN [0.0]
STD [255.0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, when I changed in MCUXpresso following defines to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define MODEL_INPUT_MEAN 0.0f
#define MODEL_INPUT_STD 255.0f&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;results of inferencing are better, in my subjective opinion, it means model is more confident that sunflower or for example does not mixing dandelion with sunflower (when looking at dandelion)&lt;/P&gt;&lt;P&gt;What you think?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Oct 2021 08:25:38 GMT</pubDate>
    <dc:creator>MarcinChelminsk</dc:creator>
    <dc:date>2021-10-01T08:25:38Z</dc:date>
    <item>
      <title>MEAN and STD values in TensorFlow Lite Micro for i.MXRT tutorial</title>
      <link>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1349170#M488</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;question in regards to &lt;A href="https://community.nxp.com/t5/eIQ-Machine-Learning-Software/Getting-Started-with-TensorFlow-Lite-for-Microcontrollers-on-i/ta-p/1124103" target="_blank" rel="noopener"&gt;Getting Started with TensorFlow Lite for Microcontrollers on i.MX RT&lt;/A&gt;&lt;/P&gt;&lt;P&gt;there are two defines in section 4.1 (with camera version)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define MODEL_INPUT_MEAN 127.5f
#define MODEL_INPUT_STD 127.5f&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;however when you run &lt;EM&gt;flower_lab.py&lt;/EM&gt;&amp;nbsp; (with small changes highlighted with "CHANGE", they aim to check what are mean/std values)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;#Retrain model on new images
mobilenetv1_spec = model_spec.ImageModelSpec(uri='https://tfhub.dev/google/imagenet/mobilenet_v1_025_128/feature_vector/4')
print("MEAN", mobilenetv1_spec.mean_rgb) #CHANGE
print("STD", mobilenetv1_spec.stddev_rgb) #CHANGE 
mobilenetv1_spec.input_image_shape = [128, 128]
model = image_classifier.create(train_data, model_spec=mobilenetv1_spec, validation_data=validation_data)
model.summary()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;it prints out that during retraining the values took into account are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;MEAN [0.0]
STD [255.0]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Therefore, when I changed in MCUXpresso following defines to&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;#define MODEL_INPUT_MEAN 0.0f
#define MODEL_INPUT_STD 255.0f&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;results of inferencing are better, in my subjective opinion, it means model is more confident that sunflower or for example does not mixing dandelion with sunflower (when looking at dandelion)&lt;/P&gt;&lt;P&gt;What you think?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Oct 2021 08:25:38 GMT</pubDate>
      <guid>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1349170#M488</guid>
      <dc:creator>MarcinChelminsk</dc:creator>
      <dc:date>2021-10-01T08:25:38Z</dc:date>
    </item>
    <item>
      <title>Re: MEAN and STD values in TensorFlow Lite Micro for i.MXRT tutorial</title>
      <link>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1354220#M517</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/172242"&gt;@MarcinChelminsk&lt;/a&gt;, thanks for noticing this. The MEAN and STD used during training must equal the MEAN and STD used during inference. We'll need to fix the typo in the lab.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Oct 2021 11:22:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1354220#M517</guid>
      <dc:creator>david_piskula</dc:creator>
      <dc:date>2021-10-12T11:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: MEAN and STD values in TensorFlow Lite Micro for i.MXRT tutorial</title>
      <link>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1357173#M522</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/78209"&gt;@david_piskula&lt;/a&gt;,&amp;nbsp;thanks for feedback! I see that &lt;A href="https://community.nxp.com/t5/eIQ-Machine-Learning-Software/Getting-Started-with-TensorFlow-Lite-for-Microcontrollers-on-i/ta-p/1124103" target="_blank" rel="noopener"&gt;Getting Started with TensorFlow Lite for Microcontrollers on i.MX RT&lt;/A&gt; has been updated already, great!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Oct 2021 11:26:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/eIQ-Machine-Learning-Software/MEAN-and-STD-values-in-TensorFlow-Lite-Micro-for-i-MXRT-tutorial/m-p/1357173#M522</guid>
      <dc:creator>MarcinChelminsk</dc:creator>
      <dc:date>2021-10-18T11:26:13Z</dc:date>
    </item>
  </channel>
</rss>

