3.3 Features extraction stage

This section presents and discusses in detail the methods used to extract the four features asymmetry (A), border irregularity (B), color (C), and diameter (D) from the segmented lesion. According to characteristics of the ABCD rule, each extracted feature plays a distinctive role with its associative weight to calculate the total dermoscopy score (TDS).

Figure 6. ROI segmentation.

Diagnosis of Skin Lesions Based on Dermoscopic Images Using Image Processing Techniques DOI: http://dx.doi.org/10.5772/intechopen.88065

#### 3.3.1 Asymmetry

To calculate asymmetry, firstly, the skin lesion is converted into grayscale values. Secondly, it is rotated to vertically and horizontally partitioned into two equal halves. Finally, two methods called Entropy and Bi-fold are implemented, and their calculated average value is assigned as an asymmetry score of the segmented lesion.

Compared with Figure 6, the ROI is rotated by θ° to align the (x, y) coordinated with centroid principal axes as shown in Figure 7. The orientation angle θ° is defined as the angle between the x-axis and axis around which the object can be rotated with minimum inertia:

$$\theta = \frac{1}{2} \arctan(\frac{2m\_{1,1}}{m\_{2,0} - m\_{0,2}}) \tag{1}$$

where m1,1, m2,0, and m0,2 are the second order moments or moment of inertia defined as:

$$m\_{p,q} = \Sigma\_l (\varkappa\_l - \varkappa\_0)^p (\wp\_l - \wp\_0)^q \tag{2}$$

where (x0, y0) is the centroid.

Figure 8 shows the result of the partition operation of the ROI over its closest line of symmetry (i.e., centroid) into two equal parts vertically and horizontally.

Figure 7. Alignment operation.

Figure 8. Vertical and horizontal bisections.

The asymmetry feature plays an important role in melanoma diagnosis and for this reason we have suggested two methods for implementation:

#### 3.3.1.1 Entropy function

The entropy is a statistical measure of randomness that can be used to characterize the texture of grayscale image as described by the following:

$$-\Sigma \, p. \log\_2(p) \tag{3}$$

where p contains the histogram counts of intensity values.

To find the similarity between the two parts (left vs. right and upper vs. lower) of the segmented lesion, their entropies are calculated as follows:

$$E\_{\{L,R\}} = \frac{1}{1 + |E\_L - E\_R|}\tag{4}$$

The same process is repeated to find the E(U, L). Therefore, the entropy asymmetry is calculated as follows:

$$E\_A = \begin{cases} 0, & E\_{\{L,R\}} \ge T\_E \operatorname{AND} \ E\_{\{U,L\}} \ge T\_E \\ 1, & E\_{\{L,R\}} \ge T\_E \operatorname{OR} \ E\_{\{U,L\}} \ge T\_E \\ 2, & \operatorname{Otherwise} \end{cases} \tag{5}$$

where T<sup>E</sup> is the entropy threshold value.

#### 3.3.1.2 Bi-fold method

The symmetry obtained by overlapping the two vertical (left vs. right) and horizontal (upper vs. lower) parts along the principal axes of the inertia. The nonoverlapped is then compared with the total area of the lesion as follows:

$$OVL = \frac{\Delta A}{A} \tag{6}$$

where ΔA is the non-overlapping area between the original and reflected masks and A is the area of the original mask. The result of the non-overlapping operation between left and right halves is depicted in Figure 9a and the result of the nonoverlapping operation between upper and right halves is depicted in Figure 9b as well. Hence, the overlapping asymmetry is calculated as follows:

$$O\_A = \begin{cases} 0, & \text{OVL}\_{\{L,R\}} \le T\_O \text{ AND } \text{OVL}\_{\{U,L\}} \le T\_O\\ 1, & \text{OVL}\_{\{L,R\}} \le T\_O \text{ OR } \text{OVL}\_{\{U,L\}} \le T\_O\\ 2, & \text{Otherwise} \end{cases} \tag{7}$$

where T<sup>O</sup> is an overlapping threshold value. The overall asymmetry score (AsymScore) of the skin lesion is calculated as:

$$Asym\_{Score} = \frac{E\_A + O\_A}{2} \tag{8}$$

Diagnosis of Skin Lesions Based on Dermoscopic Images Using Image Processing Techniques DOI: http://dx.doi.org/10.5772/intechopen.88065

#### 3.3.2 Border irregularity

From the binarized ROI (see Figure 7), the border irregularity index or compactness index is calculated as follows:

$$\text{Compact Index} \{CI\} = \frac{P^2}{2\pi A} \tag{9}$$

where P is the perimeter and A is the area of the lesion.

Among other edge detection methods, Sobel method is selected because it is relatively inexpensive in terms of computations. On the other hand, the gradient approximation that it produces is relatively crude, in particular for high-frequency variations in the image. As shown in Figure 10, the lesion's boundary image is partitioned into eight equal segments and for each segment, we have computed its compact index.

#### Figure 9.

Non-overlapping area: (a) left-right folding and (b) upper-lower folding.

Figure 10. The result of the partitioning process.

The border irregularity index (BIScore) is calculated as follows:

$$BI\_{Score} = \begin{array}{c} \sum\_{l=1}^{8} Cl\_l \end{array} \tag{10}$$

#### 3.3.3 Color feature

The existence of white, black, red, light-brown, dark-brown, and blue-gray colors in the true colored lesion are needed to be examined. Assume that Figure 11 presents the lesion that is needed to be examined for the six candidate colors appearance. The color score is incremented by 1, if the distance between the examined pixel's value in the lesion and each color reference is below or equal to the precalculated threshold value.

Six RGB codes are chosen as reference points for each color used as shown in Table 1.

The distance of each pixel in the lesion and color reference is calculated by using the following Euclidean distance:

$$D\_k = \sqrt{(r\_k - r\_{lj})^2 + (g\_k - g\_{lj})^2 + (b\_k - b\_{lj})^2} \tag{11}$$

where k = 1, 2, …, 6 and (i, j) is the pixel's position in the lesion.

Figure 11. The examined lesion.


#### Table 1. RGB codes.

Diagnosis of Skin Lesions Based on Dermoscopic Images Using Image Processing Techniques DOI: http://dx.doi.org/10.5772/intechopen.88065

The existence of colors in lesion depends on the comparison between D<sup>k</sup> and threshold values. For each color, there is a threshold value T<sup>k</sup> is calculated as a distance between the highest and smallest reference points. As for example, the threshold value for white color (i.e.,T1) is calculated as follows:

$$T\_1 = \sqrt{3 \ast (1 - 0.8039)^2} = 0.3397\tag{12}$$

The same process is repeated for other colors to calculate their threshold values. The color score (ColorScore) is incremented by 1 if the D<sup>k</sup> ≤ Tk.

#### 3.3.4 Diameter

The number of pixels of the greatest diameter or major axis length of the segmented lesion is transferred into millimeter scale as follows:

$$M = \frac{major\ axis\ length \ast 25.4}{20 \ast dpi} \tag{13}$$

where dpi is the dots-per-inch which equals to 96. Then, the diameter score (DMScore) is calculated as follows:

$$DM\_{Score} = \begin{cases} 0.5, & M < 2mm \\ 1, & M < 3mm \\ \vdots & \vdots \\ 4.5, & M < 10mm \\ 5, & Otherwise \end{cases} \tag{14}$$

Finally, the calculated values of the four extracted features are multiplied by their weights to receive the total dermoscopic score (TDS). The TDS is calculated by the following equation:

$$\begin{array}{c} TDS = \text{Asym}\_{\text{Score}} \ast 1.3 + BI\_{\text{Score}} \ast 0.1 + Color\_{\text{Score}} \ast 0.5 + DM\_{\text{S}} \\ \ast 0.5 \end{array} (15)$$

#### 3.4 Classification stage

Based on the result of the TDS, the lesion is classified based of the following criteria:

Figure 12. An example of the implementation of the proposed methodology.

Pattern Recognition - Selected Methods and Applications

$$Diagonosis = \begin{cases} \begin{array}{c} Benign, \\ Suspecious, \\ HighSuspecious, \end{array} \\ ToughSuspecious, \end{array} \quad (16)$$

An example of the whole process yields to the printed results on bottom-left corner of the image is illustrated in Figure 12.
