Changes

Jump to: navigation, search
Training configuration and hyperparameters setup
==Training configuration and hyperparameters setup==
The training was done in the cloud using [https://colab.research.google.com/ Google Colab]. All the models were trained with the same configuration for 1000 epochs, providing at each step of an epoch a mini-batch of 32 images. Adam was chosen as optimizer, providing an initial learn rate of 0.0001 and a learning rate schedule that uses an exponential decay schedule with a decay rate of 0.96. Dropout rate was set at 0.4 for all models. Patience for early stopping was set at 100 epochs. The training images were further augmented with random zoom, shift , and, rotation in order to improve model robustness on validation and test subsets and prevent the risk of overfitting.
[[File:Image augmentation for training samples.png|center|thumb|500x500px|FICS-PCB dataset, an : An example of image augmentation on training images to increase the robustness of the models]]
==Proposed models==
 
 
===ResNet50===
The model, during the training phase, shows an increasing trend in accuracy over the train subset samples and over the validation subset samples. This is a sign that the model is learning in a correct way since it is not underfitting the train data. Furthermore, by looking at the trend of the loss during the 1000 training epochs, the model is clearly not overfitting the train data. By saving the status of the model with checkpoints each time there is an improvement in the validation loss, the best result is found at '''''epoch 993''''' with an '''''accuracy of 93.59%''''' and a '''''loss of 0.1912''''' on the validation data.<!--Start of table definition-->
|}
The model, before performing the quantization with the ''vai_q_tensorflow'' tool, has an overall value of '''''accuracy of 94.85%''''' and an overall weighted average '''''F1-score of 94.86%''''' over the test subset of the dataset, showing a good generalization capability on unseen samples. The classes with the highest F1-score, above 96.00% , are: ''resistor'' (98.08% F1-score), ''inductor'' (97.10% F1-score) , and, ''capacitor'' (96.88% F1-score). On the contrary, the class in which the model performs poorly w.r.t . the others, is the ''diode'' class (91.75% F1-score). This is attributable to a low value of precision metric (88.55% precision).
{| align="center" style="background: transparent; margin: auto; width: 60%;"
|}
After performing the quantization with the ''vai_q_tensorflow'' tool and after the deployment on the target device, the model has an overall value of '''''accuracy of 93.27%''''' and an overall weighted average '''''F1-score of 93.29%''''' on the test subset of the dataset. The model is still performing well in correcly classify correctly samples belonging to the ''resistor'' class (98.08% F1-score), ''inductor'' class (97.10% F1-score) , and, ''capacitor'' class (96.88% F1-score). The worst results of the model in the classification task can be found * in the ''transistor'' class (89.78% F1-score) because both its measured precision and recall metrics are below 90.00% (89.96% precision and, 89.60% recall) and, * in the ''diode'' class (88.59% F1-score) because the precision metric is very low (83.77% precision).  
{| align="center" style="background: transparent; margin: auto; width: 60%;"
|-
|}
The model, before performing the quantization with the ''vai_q_tensorflow'' tool, has an overall value of '''''accuracy of 97.10%''''' and an overall weighted average '''''F1-score of 97.11%''''' over the test subset of the dataset, showing a very high generalization capability on unseen samples. All the classes have a F1-score above 96.00%. In particular , it is very high in the ''resistor'' class (98.65% F1-score) and, in the ''inductor'' class (98.50% F1-score). The only exception is the ''diode'' class (95.40% F1-score) mainly because it has a low value of recall metric (94.40% recall).
{| align="center" style="background: transparent; margin: auto; width: 60%;"
|}
After performing the quantization with the ''vai_q_tensorflow'' tool and after the deployment on the target device, the model has an overall value of '''''accuracy of 93.95%''''' and an overall weighted average '''''F1-score of 93.91%''''' on the test subset of the dataset. The model is still performing very well in correcly classify correctly samples belonging to the ''capacitor'' class by keeping the F1-score above 96.00% (97.03% F1-score). On the other hand , for the remaining classes, there is a substantial reduction in the value of this metric. The classes that exhibit the worst results are ''diode'' class (92.09% F1-score) and, ''IC'' class (92.06% F1-score) because both class shows show a low value of the recall metric (90.30% recall for the former, 88.20% recall for the latter). In general, the performance of the model is still good, similar to the one obtained with the ResNet50 model.
{| align="center" style="background: transparent; margin: auto; width: 60%;"
4,650
edits

Navigation menu