Changes

Jump to: navigation, search
no edit summary
==Reference application #1: fruit classifier==
This application implements a classifier like the one described [[MISC-TN-011:_Running_an_Azure-generated_TensorFlow_Lite_model_on_Mito8M_SoM_using_NXP_eIQ|here]]. There is one notable difference, however, with respect to the linked article. In this case, the model was created from scratch using TBD.
=== Model creation ===
The model was created and trained using Keras, a high-level API of TensorFlow.
 
The following block shows its architecture:<syntaxhighlight>
Model: "sequential"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
conv2d (Conv2D) (None, 222, 222, 32) 896
_________________________________________________________________
activation (Activation) (None, 222, 222, 32) 0
_________________________________________________________________
max_pooling2d (MaxPooling2D) (None, 111, 111, 32) 0
_________________________________________________________________
conv2d_1 (Conv2D) (None, 109, 109, 32) 9248
_________________________________________________________________
activation_1 (Activation) (None, 109, 109, 32) 0
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 54, 54, 32) 0
_________________________________________________________________
conv2d_2 (Conv2D) (None, 52, 52, 64) 18496
_________________________________________________________________
activation_2 (Activation) (None, 52, 52, 64) 0
_________________________________________________________________
max_pooling2d_2 (MaxPooling2 (None, 26, 26, 64) 0
_________________________________________________________________
conv2d_3 (Conv2D) (None, 24, 24, 128) 73856
_________________________________________________________________
activation_3 (Activation) (None, 24, 24, 128) 0
_________________________________________________________________
max_pooling2d_3 (MaxPooling2 (None, 12, 12, 128) 0
_________________________________________________________________
flatten (Flatten) (None, 18432) 0
_________________________________________________________________
dense (Dense) (None, 256) 4718848
_________________________________________________________________
activation_4 (Activation) (None, 256) 0
_________________________________________________________________
dropout (Dropout) (None, 256) 0
_________________________________________________________________
dense_1 (Dense) (None, 6) 1542
_________________________________________________________________
activation_5 (Activation) (None, 6) 0
=================================================================
Total params: 4,822,886
Trainable params: 4,822,886
Non-trainable params: 0
</syntaxhighlight>The training was done in the cloud using a AWS EC2 server setted up ad hoc.
 
The dataset was created collecting 240 images of 6 different fruits. 3/4 of the images were used for the training and the rest was used for test purpose. Training the model with a greater number of images would have led to a better accuracy but it wouldn't have changed the inference time.
 
Several measures were taken to counter the high overfitting tendency due to the small amount of images. For instance, new images were synthesized from the existing ones to simulate a larger dataset.
 
=== Model conversion ===
==Articles in this series==
89
edits

Navigation menu