Hardware implementation of a quantized CNN model for early detection of skin cancer cells using hls4ml tool
摘要
Like many other cancers, early diagnosis of skin cancer plays an essential role in a patient's survival. The survival rate for different types of skin cancer varies significantly. Early diagnosis of malignant lesions, however, could be expensive and challenging. CNNs (convolutional neural networks) have been utilized in many works in recent researches for medical applications, including cancer detection. Research has shown that skin cancer diagnosis based on CNN classifiers can be as accurate as a dermatologists’ diagnosis. In this paper, several different CNN models, all with similar parameters except different filters for each convolution layer, and different neurons for the first fully connected layer, have been implemented on FPGA. The HAM10000 is utilized as the training dataset, and the SMOTE data augmentation method is applied to it. Models have been implemented using the hls4ml tool, which is an open-source software mainly designed to deploy machine learning models on FPGA. The presented models in this study all have been trained in two different floating-point and quantized format pairs, using Keras and Qkeras frameworks, respectively. Afterward, both versions are fed as input to the hls4ml library and synthesized for FPGA implementations. All the models have been compared thoroughly for accuracy and hardware resource consumption. In the end, considering resource consumption and accuracy simultaneously, a quantized model with a software validation accuracy of 95.50% and hardware-emulated accuracy of 94.90% is proposed to be implemented in the stated conditions.