Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf ·...

36
Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg [email protected] April 28, 2015 Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 1 / 45

Transcript of Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf ·...

Page 1: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Image analysis of malign melanoma:Waveles and svd

Dan Dolonius

University of Gothenburg

[email protected]

April 28, 2015

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 1 / 45

Page 2: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Overview

1 MelanomaTypes of melanomaClassification

2 Wavelets

3 Singular Value Decomposition

4 FeaturesMorphological operators

5 Results

6 Second Section

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 2 / 45

Page 3: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Melanoma

A type of skin cancer.

Correlation to sun bathing (UV-rays).

Important to spot early.

Not easy to identify.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 3 / 45

Page 4: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Types of melanoma

Benign.

Not dangerous.A.k.a. Mole.

Malign.

Lethal.Grows.Irregular.Colorful.Looks quite different from benign.

Dysplastic.

As benign not dangerous.Looks similar to malign.Makes classification problematic.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 4 / 45

Page 5: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Types of melanoma

Benign Malign Dysplastic

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 5 / 45

Page 6: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

ABCDE

ABCDE-Rule

Assymetry.Border.Color.Diameter.Evolution.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 6 / 45

Page 7: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Classification

Dysplastic and malign share similar features.

Need lots of experience to be able to classify.

Also use tools to aid.

Dermatoscope.The other thing.

Our approach: Computer aided image analysis.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 7 / 45

Page 8: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Wavlets

Similar to fourier transform.

Difference between consecutive resolutions.

Using different up/down-sampling filters.Basically what we call wavelets.Can be viewed as localized fourier transforms.

Scaling function and wavelet.

Scaling: Low pass filter. (Approximation)Wavelet: High pass filter (Detail)

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 8 / 45

Page 9: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Some examples

Haar / Db1 Db2 Db4

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 9 / 45

Page 10: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Deccomposition for 2D arrays (images)

Sj+1 H̃∗x Sj+1 G̃∗

x Sj+1

H̃∗x G̃∗

y Sj+1 G̃∗x G̃∗

y Sj+1

H̃∗x H̃∗

y Sj+1 G̃∗x H̃∗

y Sj+1

Figure: 2D Wavelet decomposition.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 10 / 45

Page 11: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Deccomposition for 2D arrays (images)

Sj

WVj−1 WD

j−1

Sj−1 WHj−1

WDj−1WV

j−1

WHj−1

WVj−2 WD

j−2

Sj−2 WHj−2

Figure: Two steps of decomposition matrix.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 11 / 45

Page 12: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Edge detection

Original Reconstruct using only details

Horizontal details Vertical details Diagonal details

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 12 / 45

Page 13: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

SVD

Remember eigenvalues and vectors.Au = λu 1

u Eigenvector.λ Eigenvalue.

Eigen Decomposition.A = UΛUT

A Symmetric.Λ Diagonal. Eigenvalues.U Orthogonal. Eigenvectors.

Singular Value DecompositionA = UΣV T

A not necessarily symmetric.Σ Quasidiagonal. Singularvalues. Similar to eigenvalues.U Orthgonal.V Orthgonal.

1Typo in paper!Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 13 / 45

Page 14: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Advantages of SVD

Don’t need to calculate all the values.

Need only calculate the n largest.

Economy or compact-SVD

Different methods for desired importance.

Speed.Accuracy.Orthogonality.Number of values.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 14 / 45

Page 15: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Principal Component Analysis

Project data along orthogonal axes of highest variance.

In Decreasing order.

Good for making the dataset more compact.

Use combination of variables with high variance as parameters instead.Can discard the directions that does not vary a lot.

Can be used to aid cluster identification.

Clusters may cause high variance along a line.Don’t need to find a line since it will end up in along an axis afterprojection.Basically we do fit lines when doing the PCA.

Other uses as well as will be shown later.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 15 / 45

Page 16: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

PCA + SVD = True

PCA by brute force is painfully slow.

Can use Eigen decomposition.

Given covariance matrix C = XXT 2.X is data with zero mean.C = TDTT

Can be shown that the principal components are in Y when Y = TX .Still have to compute XXT .

Even better, use SVD!

Can be shown that:X = UΣV T

Y = UTX

2abusing notationDan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 16 / 45

Page 17: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Rotation

Before Afer

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 17 / 45

Page 18: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Preprocessing

Will no go in to much detail.

Noise removal.

Used median filter.Lots of other options. Could have used wavelets.

Masking out the lesion.

Converted to LAB-color space.Used L channel for thresholding (Lightness). Lesions darker than skin.Other options as well. E.g. 0.2126R + 0.7152G + 0.0722B, common incomputer graphics.

Remove hairs.

Clear border.

Crop and rotate image.

Optimize the lesion to fill image.Can also use this to compare fill rate of each quadrant (Irregularity).

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 18 / 45

Page 19: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Morphological operators

Dilation Erosion

Opening Closing

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 19 / 45

Page 20: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Remove hairs

Original Opening Difference

Threshold Morphological Final

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 20 / 45

Page 21: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Closeup

Just opening Replcaing only masked areas

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 21 / 45

Page 22: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Segmentation

Segmentation to aid e.g. thresholding.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 22 / 45

Page 23: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Skewness and kurtosis

Healthy tissue can be expected to have a normal distribution.

That is, no exceptional skewness or kurtosis.

Check this for wavelet coefficients for each row and col.

Skewness Kurtosis

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 23 / 45

Page 24: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Malign

Benign

Figure: Test data in LAB-color space.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 24 / 45

Page 25: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Skewness and kurtosis of wavelet coefficients

Skewness Kurtosis

DB4 Malign1 Malign2 Benign1 Benign2

Skewness absolute mean 0.5014 0.7190 0.2972 0.3189Skewness variance 0.5242 1.0891 0.1912 0.2171Kurtosis mean 6.9720 8.5350 5.1325 4.9342Kurtosis variance 16.5221 43.6926 4.8227 4.6182

Table: Mean and variance of skewness and kurtosis from spectrum

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 25 / 45

Page 26: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Skewness Kurtosis

DB4 Malign1 Malign2 Benign1 Benign2

Skewness absolute mean 1.8160 2.0639 1.5549 1.5725Skewness variance 0.3633 0.8117 0.0648 0.0911# of values above threshold 428 493 41 32Kurtosis mean 16.7860 19.4424 14.8717 13.0884Kurtosis variance 38.3466 78.9864 12.4312 1.4258# of values above threshold 492 576 53 20

Table: Mean, variance and number of values above threshold for skewness andkurtosis from spectrum.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 26 / 45

Page 27: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Normal noise Skewness Kurtosis

Normal

Skewness absolute mean 0.1990Skewness variance 0.1023Kurtosis mean 2.9854Kurtosis variance 0.3149

Table: Skewness and kurtosis values for the control image.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 27 / 45

Page 28: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Other parameters

Irregularity Solidity Convexity

Ir := N2

4πA So := ACA

Co := CNN

N: Perimeter (Number of pixels along border).

A: Area (Total number of pixels).

CA: Area of convex hull.

CN : Area of perimeter for convex hull.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 28 / 45

Page 29: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

PCA for neighbours

Usually when using SVD with images we treat the whole image as amatrix.

Try instead using a (3 × 3) neighborhood for each pixel instead.

We get 27 bases (each pixel has 3 values, rgb).

By re-projecting the image on each of these bases we can identifydifferent details.

Unfortunately didn’t have time to investigate this much.

Ended up using simple mean, variance, skewness and kurtosis for eachimage.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 29 / 45

Page 30: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Figure: Test image.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 30 / 45

Page 31: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Examples

Figure: The different bases.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 31 / 45

Page 32: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Figure: Reprojected images.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 32 / 45

Page 33: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Results

Used linear regression.

Forward and backward selection.

When fitting, alternate between adding and removing parameters.

1 Use all the data to figure out what parameters to include.

2 Take e.g. 70% as training data and 30% as test.

3 Fit the training data to the model acquired in step one using simpleregression.

4 Evaluate the test data and save results.

5 Go to step 2. Stop after n steps or until convergence of e.g. the meansquared error of the model or the misclassification rate.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 33 / 45

Page 34: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Sensitivity

Percentage of correctly identified malign lesions

Specificity

Percentage of correctly identified benign lesions

Can tweak classification threshold to favor one over the other.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 34 / 45

Page 35: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

Final remarks and results

By tweaking the input data (Procedure steps, transformingparameters) managed to fairly easily get aroun 80% in specificity andsensitivity.

Some best results up to 93%.

Don’t trust model too much!

Many parameters per data-points (10:100).

Not homogeneous data. Had to manipulate.

Malign images had higher resolution.Had to downscale.Usually some polynomial is used to avoid aliasing.Could possibly affect wavelets (Some have close relations topolynomials, ”vanishing moments”).

However consistent results show that there is information which isworth investigating.

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 35 / 45

Page 36: Image analysis of malign melanoma: Waveles and svdmohammad/Mystudents/Dolonius_presentation.pdf · Image analysis of malign melanoma: Waveles and svd Dan Dolonius University of Gothenburg

I have spoken!

Dan Dolonius (Applied Mathematics) Image analysis of malign melanoma April 28, 2015 36 / 45