| Algorithm 2. The VGG-19 model description |
| Input: thyroidal images of dimension (500 px, 500 px) from the train dataset. |
| Output: VGG model weights |
| 1. for each image in the dataset |
| 2. Resize image to (224 px, 224 px) |
| 3. Normalize the image pixels values between [0, 1]. |
| 4. end |
| 5. Load the VGG-19 model pre-trained on ImageNet dataset. |
| 6. Remove the last layer of the model. |
| 7. Make non-trainable all the layers of the model. |
| 8. Add a Flatten layer on the model output to obtain a 1-D array of features. |
| 9. Add a fully connected layer with 256 hidden units. |
| 10. Apply a dropout for inactivate neurons in the previous layer. |
| 11. Add a fully connected layer with 4 hidden units and a softmax activation function. |
| 12. Optimize the model with Adam optimizer. |
| 13. Train the model for 100 epochs. |
| 14. Save the final model. |