{'fraction_non_alphanumeric': 0.02427622406298696, 'fraction_numerical': 0.004838841958500779, 'mean_word_length': 4.907945736434108, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Asymmetry analysis of melanoma based on ABCD rule

Malignant melanoma is a malignant tumor that is extremely harmful and prone to lymphatic metastasis. If it cannot be diagnosed and effectively treated at an early stage, it will cause irreversible consequences. There is a lot of evidence that if you can get the exact treatment in the early stage, it can effectively improve the recovery rate. At this stage, clinical diagnosis of melanoma is mainly performed manually, which has defects such as low overall efficiency. This article is based on ABCD rule, combined with the clinical features of melanoma in dermoscopic images, to determine the benign and malignant melanocytes. Firstly, the image processing technology and pattern recognition technology are used to acquire and preprocess the dermoscopic image, and the image feature points are extracted. Then, the microscopic asymmetry and macroscopic asymmetry of the image were analyzed. Finally, the symmetry score was calculated by TDS to judge the benign and malignant of melanocytes. It is expected to assist dermatologists in diagnosing melanoma, provide timely feedback information to patients and provide targeted treatment for patients, improve the efficiency and accuracy of medical clinical diagnosis, achieve the purpose of curing, and reduce the harm of melanoma to human health.


Introduction
Malignant melanoma is a malignant tumor that is extremely harmful and prone to lymphatic metastasis [1]. It has the characteristics of rapid spread and high fatality rate. If it cannot be diagnosed and effectively treated at an early stage, it will cause irreversible consequences [2]. Dermoscopic images can be used as the basic image for judging benign and malignant skin lesions derived from melanocytes in clinical diagnosis. Some common diagnostic methods for physicians include pattern analysis method [3], ABCD rule [4], Menzies method [5], 7-point detection method [6] , etc. Although different analysis methods have their own differences, the image analysis process is still the extraction and selection of feature values, and the use of certain criteria to analyze benign and malignant skin lesions derived from melanocytes. These methods are usually based on the naked eye for diagnosis. The conclusions reached by doctors are also different. Therefore, research on the technology of computer-aided diagnosis of melanoma is an urgent need for the development of modern medicine.
In this paper, based on the ABCD rule, combined with the clinical characteristics of melanoma, we use image processing technology and pattern recognition technology to obtain and preprocess the dermoscopic image, extract the image feature points, analyze the microscopic asymmetry and macroscopic asymmetry of the image, and judge the benign and malignant of melanoma by TDS score. It can assist dermatologists to diagnose melanoma, give patients feedback information in time, and provide targeted treatment for patients.

Dermoscopy ABCD rule
As an important criterion to distinguish the benign and malignant lesions of melanocyte origin, the ABCD rule has been widely recognized and applied in clinical medicine.This criterion mainly studies the asymmetry(A), border(B), color(C) and diameter(D) of the lesion area. According to the linear equation, the total dermoscopic score (TDS) of the lesion was calculated to evaluate four characteristic scores, TDS = (A×1.3) + (B×0.1) + (C×0.5) + (D×0.5). A score higher than 5.45 diagnoses a lesion as melanoma [4].
For the A in the dermoscopy ABCD rule, it generally refers to asymmetry, which means the asymmetry of the contour structure. Since the earliest dermoscopy ABCD rule, the A rule has been used as a measure of benign and malignant skin lesions derived from melanocytes The important standards are still used today. Margarida Ruela [7] et al. studied the importance of shape and symmetry in detecting melanoma, among which symmetry plays the most important role.

Dermoscopic image asymmetry algorithm
The main algorithms used in the analysis of image asymmetry based on ABCD rule are: the calculation of image center of gravity and the analysis of symmetry of image feature points. The former is the basis of the latter, that is, the realization of the algorithm of symmetry analysis of image feature points should be based on the calculation of image center of gravity.

Calculation of image center of gravity
The algorithm of image barycenter is as follows. After traversing the preprocessed binary target image, the X coordinates of the target feature points are accumulated, and accumulated value is X. At same time, the Y coordinates of the target feature points are accumulated, and accumulated value is y. Assuming that the total number of target feature points is t and the coordinates of gravity center points are set to (x 0 , y 0 ), the calculation method is as equation (1); X, Y, T, as equation (2).

Analysis of image asymmetry
Clinically, the contour of skin benign nevus is symmetrical, while melanoma is asymmetrical, which is of great significance for clinical diagnosis. The analysis of image asymmetry discussed in this paper is divided into micro asymmetry and macro asymmetry.

Microscopic asymmetry.
The extracted points in the target region can be used as feature points, while the selected points in the target region are used as the extracted feature points in the process of traversing the target image. Among the extracted feature points, if they meet the selection method, they can be selected as feature points. The specific implementation of the selection method: assuming that there is another feature point and the extracted feature point about the line passing through the center of gravity are mutually symmetrical points, then the extracted feature point is selected as the selected feature point that meets the requirements of symmetry.

Macroscopic asymmetry.
According to the proportion of the total number of selected feature points to the total number of target feature points, whether the image is symmetrical or not is determined. Therefore, we need to set a threshold to distinguish the symmetry and asymmetry of the image. Assuming that the proportion of selected feature points in the total number of feature points is higher than the defined threshold, the dermoscopic image can be defined to be symmetrical, otherwise the dermoscopic image is defined to be asymmetrical.

Image asymmetry analysis algorithm.
Step 1: Traverse the image to extract feature points of the image. The feature points are coordinate points in the target area after the image is binarized and the target area is divided.
Step 2: Select the feature points which accord with symmetry. Suppose the characteristic point is Step 3: The asymmetry of the two feature points is analyzed. If (x 1 , y 1 ) and (x 2 , y 2 ) are target pixels, they are symmetrical, otherwise, the two feature points are asymmetric.
Step 4: The macroscopic asymmetry of dermoscopic images was analyzed. If the total number of selected feature points is T1 and the total number of feature points in the target area is T, the threshold is set as 0.90. When 1 90 . 0 T T   , the dermoscopic image tends to be symmetrical, otherwise, the dermoscopic image tends to be asymmetrical.

Experimental process and result analysis
In this paper, Python is used as the development language, and Opencv visual library provides a large number of Python interfaces, which are convenient for the implementation of dermatoscopy analysis method in this paper. Firstly, the image is preprocessed, feature points are extracted, then the asymmetry of the image is analyzed, and finally, whether the image is benign or malignant is judged according to the TDS score.

Image preprocessing
The image of melanoma contains a lot of features information. In order to obtain the feature information better, we need to distinguish the lesion area from the normal skin area, so as to reduce the influence of unnecessary features. In the pre-processing stage, we mainly deal with the image graying, image binarization, noise reduction and image target region division. Noise reduction treatment can achieve hair removal, bubble removal and small area black spots elimination. Image target region division means that when there are multiple skin lesion regions in the image, a larger skin lesion region is selected as the target region to be divided, and the others are defined as the background region. Image projection can be divided into horizontal projection and vertical projection. According to the image with wave crest and wave trough formed by horizontal projection and vertical projection, the target region is divided and the target feature points are extracted. The operations performed according to the original image of the dermoscope provided are as follows: first perform the grayscale operation on the image; use the OTSU algorithm for binarization operation; close operation to remove black spots and hair; open operation to remove bubbles and white spots; projection on X axis; projection on the y-axis; divide the target image according to the projection. The effect picture is shown in Figure 1.

Image asymmetry analysis process
Step 1: To get the center of gravity of the target image, and make two lines perpendicular to each other, with the center of gravity as the perpendicular foot.
Step 2: Based on the two lines in the first step, analyze the macro symmetry and micro symmetry of the two lines respectively. Assuming that the number of lines in line with macroscopic symmetry is k (k is less than or equal to 2), the number of asymmetric lines under this slope is Step 3: Adjust the angle of the two lines. Take the center of gravity as the fixed point, rotate the two lines clockwise for a certain angle (in this paper, rotate 10 degrees clockwise each time). Assuming that the initial position is taken as a reference and the total rotation is 90 degrees, proceed to step 4, otherwise skip to step 2.
Step 4: The dermoscopic images were scored according to TDS. The score calculation method is shown in equation (5).

Analysis of experimental results
According to the TDS scoring criteria for melanocyte derived lesions, it can be seen that: in criterion a, it is assumed that there are two mutually perpendicular lines, so that when the two lines are used as the segmentation lines of the target image, the target images segmented separately show symmetry, then the asymmetry score is 0. Assuming that there are only several lines that are not perpendicular to each other, so that when the line is used as the segmentation line, the segmented image presents symmetry, then the asymmetry score is 1. Assuming that there is no straight line, so that when this line is used as the segmentation line, the segmented image shows asymmetry, then the asymmetry score is 2.
Three kinds of dermoscopic images are selected for testing, and the results are shown in Table 1. In figure a, there are symmetrical axes perpendicular to each other, and the score of asymmetry is 0, so it is judged as benign nevus; as shown in Figure B, there is a vertical axis of symmetry with an asymmetry score of 1, which requires close follow-up or resection biopsy; as shown in Figure C,

conclusions
In this paper, the asymmetry of dermoscopic tumor is analyzed based on ABCD rule. Firstly, the image processing technology and pattern recognition technology are used to acquire and preprocess the dermoscopic image to obtain the characteristics of the dermoscopic image. Then, the microscopic asymmetry and macroscopic asymmetry of the dermoscopic image are analyzed. Finally, the benign and malignant melanoma of the dermoscopic image are judged according to TDS score. The experimental analysis process is in line with the clinical practice, and the experimental results can well judge the benign and malignant melanoma. It can assist dermatologists to diagnose melanoma, give feedback information to patients in time and carry out targeted treatment for patients, improve the efficiency and accuracy of clinical diagnosis, and achieve the purpose of cure, so as to reduce the harm of melanoma to human health.