Malignant melanoma (MM) of the eyelid is of high malignancy, high mortality, and easy to metastasize. Currently, the gold standard for MM treatment and prognosis is histopathology, but the diagnosis of different experts is often divergent. The computer-aided diagnosis based on deep learning helps to improve efficiency and accuracy. In this paper, a complete set of methods for MM diagnosis is proposed using the convolutional neural network (CNN) to classify the patch level pathological images. Hematoxylin and Eosin (H and E)-stained pathological images of the eyelids are classified as malignant melanoma and non-malignant melanoma (NMM). The prediction results are filled by location in the probabilistic map of the whole slide image level. Random forest classifier based on CNN inference results extract 31- dimensional features to achieve whole slide image-level classification. The color constancy method and the edge extraction mapping method based on the Sobel operator (EMBS) can significantly improve the performance of the model. The patch level classification results show that the balance accuracy is 93% on the Second Affiliated Hospital, Zhejiang University School of Medicine (ZJU-2) test set, and the balance accuracy is 89.4% on the Shanghai Ninth People’s Hospital, Shanghai JiaoTong University School of Medicine (SJTU) test set. The corresponding area under curve (AUC) is 0.990 and 0.970. For whole slide image level classification results, the AUC for SJTU test set is 0.999, the sensitivity is 100%, and the specificity is 97.4%. As a result, our model can effectively tackle the challenge of clinicopathological diagnosis and relieve the pressure of pathologists.