Skip to main content
. 2022 Feb 26;22(5):1854. doi: 10.3390/s22051854
Algorithm 3: DL_Models_Service
Input: skin_image_dataset
Output: tf_model, tf_lite_model files
1   Function: design_models (skin_image_dataset)
2    Init: size ← input dimension, std ← normalization factor
3    tf_file_name ← “TF_model”, tf_lite_file_name ← “TFLite_model”
    //Model designing
4    tf_model ← design_tf_model()
    //Model training
5     For skin_image in skin_image_dataset
       //Image pre-processing
6      skin_image ← skin_image.rsize(size, size)//Resize the image to size x size
7      img_array[size, size] ← convert_to_array(skin_image)//Convert image to an array
        //Normalization
8      For x in img_array
9        For y in img_array[x]
10           img_array[x, y] ← img_array[x, y]/std
11         End For
12       End For
13       tf_model.train_model(img_array)
14    End For//end training
        //save TF model
15    tf_model.save_model(tf_file_name)
        //Convert to TFLite model
16    tf_lite_model ← convert_to_tflite(tf_model)
17    tf_lite_model.save_model(tf_lite_file_name)