| Algorithm 2: Diagnosis_Service |
|
Input: skin_image Output: P[p0, …,pC] ∈ R //C is the number of skin disease classes |
| 1 Function: get_diagnosis (skin_image) 2 Init: size ← model input dimension, std ← model normalization factor //Image pre-processing 3 skin_image ← skin_image.rsize(size, size)//Resize the image to size x size 4 img_array[size, size] ← convert_to_array(skin_image)//Convert image to an array //Normalization 5 For x in img_array 6 For y in img_array[x] 7 img_array[x, y] ← img_array[x, y]/std 8 End For 9 End For //Classification 10 model ← load_model() //load trained model 11 P ← model.predict(img_array) 12 Return P |