38
BU3 Final Report Automatic Acne Quantification and Localisation for Medical Treatment Group Members 1. Ms.Watcharaporn Sitsawangsopon ID: 5422791509 2. Ms. Maetawee Juladash ID: 5422772905 Advisor: Assoc. Prof. Dr. Bunyarit Uyyanonvara (Associate Professor) School of Information, Computer and Communication Technology, Sirindhorn International Institute of Technology, Thammasat University Semester 2, Academic Year 2014 Date: May 19, 2014

Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

BU3 Final Report

Automatic Acne Quantification and

Localisation for Medical Treatment

Group Members

1. Ms.Watcharaporn Sitsawangsopon ID: 5422791509

2. Ms. Maetawee Juladash ID: 5422772905

Advisor: Assoc. Prof. Dr. Bunyarit Uyyanonvara (Associate Professor)

School of Information, Computer and Communication Technology,

Sirindhorn International Institute of Technology,

Thammasat University

Semester 2, Academic Year 2014

Date: May 19, 2014

Page 2: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

2

Table of Contents

1. Introduction ............................................................................................................................ 4

2. Background ............................................................................................................................ 7

3. Objectives ............................................................................................................................... 9

4. Outputs and Expected Benefits .............................................................................................. 9

4.1 Outputs ............................................................................................................................. 9

4.2 Benefits ............................................................................................................................. 9

5. Literature Review ................................................................................................................. 10

6. Methodology ........................................................................................................................ 11

6.1 Approach ........................................................................................................................ 11

6.2 Tools and Techniques ..................................................................................................... 16

6.2.1 Tools ........................................................................................................................ 16

6.2.2 Techniques .............................................................................................................. 16

7. Project Schedule ................................................................................................................... 17

8. Technical Description........................................................................................................... 18

8.1 The Algorithm ................................................................................................................ 18

8.2. User Interface ................................................................................................................ 23

8.2.1 GUI of Image Processing Application .................................................................... 23

8.3. Result and Evaluation .................................................................................................... 28

8.3.1 Result of number detected ....................................................................................... 28

8.3.2 Evaluation Accuracy ............................................................................................... 30

8.4. Manual Instruction ........................................................................................................ 32

9. Conclusion ........................................................................................................................ 37

10. References .......................................................................................................................... 38

Page 3: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

3

Statement of Contribution

By submitting this document, all students in the group agree that their contribution in the

project so far, including the preparation of this document, is as follows:

1. Ms.Watcharaporn Sitsawangsopon ID:5422791509 50%

2. Ms. Maetawee Juladash ID:5422772905 50%

Page 4: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

1. Introduction In the medical profession of a facial skin, many patients that come with several

problems and skin lesion types, compare with the amount of doctors that less than the patients

in many countries around the world. So the technology nowadays can help the medical

profession and doctors at least to analyse the problem on each patient's face. This can

decrease the situation of doctors and patients to be in face to face, help the doctors and

patients that resident in different countries, and also decrease the problem of ratio between

doctors and patients.

The cause of the problems make use of a computer to aid in maintenance to

detect amount of acne instead of using manual method lead to the developing of algorithm to

use to the calculation for positions of acne on the patient's face and also detect and measuring

amount of acne on the patient's face. The developing of algorithm is not accurate only on acne

area, but it can also perform calculations amount of acne and comparative analysis of the

difference between the recorded results in each time. It use the process and the basic steps

from Image processing[1-3] to improve and apply. In this project was select the processes that

involved significant of Face Detection[4], Blob Detection[5], and Color segmentation[6] to

study the methods and procedures as well as the statistics to help determine the position, area,

and color to increase the efficiency and accuracy of detecting. So the developing of algorithm

to apply to the program and medical profession are taken from a variety of knowledge to

generate new works to develop medical technologies.

Technology that can apply to help in medical profession of facial skin in term

of analyse the problem on each patient's face will be about the image processing and face

detection. So mainly thing that necessary is picture of the patient that shown the problem of

facial skin clearly. We observe from several research or previous studies about the Detection

system, Edge detection, Face detection, and we know that the picture of patient's should be

the same view point as possible to decrease the error that can happen when detect the key

points (eyes, nose, and mouth) on patient's face. These technologies can find and detect some

problem on the patient's face, for example, detect all spots, acne, wrinkles, etc. But it was a

thoroughly method and difficult because of it maybe detect the unnecessary details around the

face of patient’s and also include the background of the picture that use to analyse.

Page 5: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 5

The original images and ground truth images experiment methods of blob

detection.

Figure1: Position mark image Figure2: Ground truth image

The images data in the real world position mark of the experiment method of

wrinkles detection.

Figure3: Original image Figure4: Mark position image

Page 6: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 6

Figure 5: Original image Figure 6: Mark position image

Figure 7: Original image Figure 8: Mark position image

Page 7: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 7

Figure 9: Original image Figure 10: Mark position image

2. Background In the globalization, improvement of technology, science, economy, society

and the education provide people to have a better standard of living and lifestyles. Relating to

the development of medical treatment facial skin that people become more attention of beauty

and healthy, it affects to the rapid growth in beauty care industry, especially in now. Because

of the people focus on the important of their own face would be good looking, clearly face

and still younger, but the real natural face of people will be change over time. The natural

acne always have a chance was born on the face. No matter how old you are or what gender

you are. The medical of facial skin became important to treatment them.

Since the majority of people are interested and enthusiastic to treat a skin

disease. It is the acne on a facial skin that commonly found in the teenage age. The statistics

from the Institute of Dermatology found that acne is one of the reasons to make a patient

going to meet a doctor increasing. Therefore, the number of patients increased steadily with

the number of doctors. The patients have several kind and different of people such as sex, age,

body, face structure and the location of acne on a face. The doctor used a traditional tool to

notes the result of treatment with written it by hand so the doctor will used the symbol of

mathematic to draw a location of acne into the paper for represent an acne point instead of

drawing into a real face such as draw a circle, rectangle or spot. The traditional way was

found the problem when the doctor keep continue the treatment results in the next time, it

doesn’t work. The spot acne of patient is correct location and difficult to analyse the direction

of quantity acne on the face. For each patient will spend a lot of time to treatment them so it

effect to the management time that is difficult to manage more people in each day. The

doctors have only one way communicate with the patient by face to face. Instead of using the

traditional way to retention the information of patient without drawing a mark point by hand.

Page 8: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 8

They would have a new innovation of medical facial skin program, to help a doctor and

patient is easier and comfortable.

For the unlimited technology always moved forward, it is the one key factor

that effect in the process of human thought and analysis. The number of internet users and

social media are expanded widely. Everybody can access to a large community that it cause to

the human thinking about how to make themselves look good, because social network links to

worldwide. Therefore, the most users always want to edit the images. To make face look

smooth and clearly without acne on face. So the developer created and released a various

application to respond them. The application was released many version to improve the result

of images to be efficient. They blur the whole images to look smooth and unwanted point will

disappear. This algorithm also made the environment around the face blur.

All the cause of problem, the technology of computer satisfies all the aspect

utility function of the doctor that can detect the quantity of acne. Therefore, we developed

algorithm using some path of successful method to improve our program that the detection

will have more accuracy. The research purposed, concerned to develop a medical facial skin

for detect the acne on the face, and know which method has the efficient of detection. The

important process and method involved to the Face detection, Blob detection and Color

segmentation. Then, ours project used the knowledge of statistic in mathematic subject to

adjust with the algorithm. The statistic method can be calculated the exact area and color that

increase the accuracy of image processing. So that, the several major of knowledge will be

applied to develop the tool of medical facial skin. We created an instance element of image to

tests our method and evaluated the accuracy of each experiment to know the best solution.

Figure 11: Marks position image

Page 9: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 9

3. Objectives The aim of this project is use of the image processing to develop software for

read and analyse images of medical profession, especially the dermatologist. The doctor will

be able to take the results of program to detect change and treatment acne on the face more

effectively. The program reads the input images to detect only the problem area of acne or the

different color area of surface, and analyse to correct the problem without unwanted area such

as mouth, nose, eyes and hair. After detect it, will be able to analyse the amount of acne and

calculate for represent in the percentage in order to compare the different result with the same

images. The doctor will know how the movement of treatment going to be and can analyse

the next treatment results. This program useful to the doctors, they don’t need to meet their

patients. The programs used only the image of face patient's then detect and display the

specific acne area. So, doctors don’t need to analyse the problems by themselves, they will

know immediately how to cure their patient's problems. Moreover, the technology of image

processing further to developed the mobile application that related to beautify the images such

as photo editor, photo blur and beauty face photo etc. The algorithm adjusted to the one part

of application to be increase efficiency that is changing different tone of the surface and focus

only the specific point.

4. Outputs and Expected Benefits

4.1 Outputs

The output that we want is ground truth image of patient's face from detected

process. The image will show only the line of wrinkles on the patient's face correctly. So, the

important thing that we concern is how to write a program that can read and detect only the

wrinkles on the patient's face because the images of patients is composition of face, hair,

background, etc. So, we want to make sure that program will not detect something else that

not a wrinkle. We learn from the previous researches that maybe program will detect some

key point on the human face (eyes, nose, and mouth) and hairs that have a line shape similar

to the wrinkles The direction of human face also can effect to the program that it limited for

program to analyse the image. Every images that import to the program, the human face have

to be in the same direction and the best is the human face that look straight to the camera

because it easier to the program to read and detect the wrinkles.

4.2 Benefits

Our project, we write a useful program for the medical profession, especially

in facial skin line. The program will useful with doctors to analyse the methods to cure their

patient's problem by using the ground truth image from program that show the lines of

wrinkles on patient's face. This can decrease the problem that nowadays we lack of doctors

and they not have a chance to discuss or analyse the patient's problems. Doctors can use the

ground truth image from program to follow up the change of the patient's problem in every

period of times, they can know that the problems is better or not by compare the ground truth

images to see the changes of the wrinkles.

Page 10: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 10

The future development of our method can apply with the smart phone on the

application photo feature. The program will detect the wrinkles on human face then it can

develop to blend/blurred the wrinkles that program detected to make the images more

beautiful.

5. Literature Review Several ideas and methods that we have study would be the guideline for our

project of acne detection.

Image processing [1] Automatic Facial Skin Defect Detection System : processes of the

proposed approach, which includes face detection, facial feature detection, ROI locating, spot

detection and wrinkle detection.

Image processing [2] Extraction of acne lesion in acne patients from Multispectral Images :

the algorithm for the extraction of acne lesions from MSI. In the preprocessing, background,

hair and normal skin are removed while in the classification step, reddish papule, pustule and

scar are classified.

Image processing [3] Learning-Based Detection of Acne-like Regions Using Time-Lapse

Features : Detecting Acne-like Regions In Skin Images that use algorithm to detect acne

lesions using images acquired under cross-polarized modality.

Face Detection [4] The face detection separates into 4 methods; Skin color segmentation is

the process of rejecting non-skin color from the entire image. It is based on the color of all

races human face, Morphological Processing is to performed the clean up of the image. The

goal is to end up with a mask image that can be applied to the input image to yield skin color

regions without noise and clutter, Connected Region Analysis the output from morphological

processing still contains non-face regions. Most of them are hands, arms, legs, clothing that

match the skin color and some parts on background. In connected region analysis, image

statistics from the training set are used to classify each connected region in the image.

Template Matching is the basic idea of template matching is to compare the image with

another template image that is representative of faces. Finding an appropriate template is a

challenge since ideally the template (or group of templates) should match any given face with

differences of the size and features.

Blob Detection [5] Automatic detection of blobs from image datasets is an important step in

analysis of a large-scale of scientific data. These blobs may represent organization of nuclei in

a cultured colony, homogeneous regions in geophysical data, tumor locations in MRI or CT

data, etc.

Color Segmentation [6] It is based on the color of all races human face. We set the HSV (Hue,

Saturation, Value) color space for segmentation up for only focus on that specific value of H

and S. This information was used to define appropriate thresholds for H and S space that

correspond to faces. The threshold values were embedded into the color segmentation routine.

The skin color segmentation resulting image is converted to HSV color space. All the color

pixels that fall outside the H and S range are rejected as the non-face objects.

Page 11: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 11

6. Methodology

6.1 Approach

To developing algorithms of detect facial acne, we started to collecting a face

acne images of patient. Those images used to simulate the detection point acne in the

Photoshop program. We imported the image to first layer, and created the second layer to spot

a specific area of acne. Then exported only the paint of spot acne to be a result of the

simulation (Ground truth) that obtained in this process, using it compared with the results of

the testing algorithm in computer processing. Ground truth represents ability of the human

detecting.

Figure 12: Mark position image Figure 13: Original Image

Figure 14: Ground truth

To processing the algorithm, import the images into the program and it will automatic

detection the acne.

Page 12: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 12

1. Convert the RGB color images to the Grey scale images

2. Find the maximum value of intensity images with X and Y coordinates on the Grey

scale images.

3. Calculate normalized grey-scale image by divide the value of intensity to 0 or 1 with

X and Y coordinates, to compare with HSV images.

4. Retrieve HSV color images to define the value of H(Hue) = 0 for drop a red color

5. To extract the brightness area (V) from HSV model and define Dark color = 0 and

White color = 1.

6. To subtract by V-Grey scale, the result show the region of maximum lightness

7. Define the value of threshold background is white color otherwise will be a black

color. The images convert to negative binary color

8. To analyse the images for eliminate a tiny spot area.

9. From the result of step 8, divided the area less than 7000.

10. The results from step 7, 8 and 9 will represent the appropriated size of specific object.

Figure 15: Step process

Page 13: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 13

Figure16: Mark position image

The processes of the program consist of two main techniques that include the

Face detection and the Statistic method. The defaults method is to upload the image of face

patients into the system. Then the program will check the acne on the face through two

methods that describe in the previous statement. The both image results are different accuracy

away. Comparing it with the evaluation processed (Evaluation Accuracy) by Qualitative and

Quantitative data.

The structure working process of the program consists of two main techniques.

There are Statistic Methods and Face Detection by way of starting are the same. But the

results in term of accuracy will be difference by can compare the image from the results of the

program (Evaluation Accuracy). As the result image shows that the amount of acne on the

patient's face from the treatment of each time. Using basic manually method to checking each

frame of acne that program detected is correct or not. By the way called Qualitative and

Quantitative and each method are different, as follows.

-Qualitative: Evaluation of Qualitative data is considered on the details of the

images, the result is information that can be seen with the naked eye. Evaluation from the

result images by comparing each image and determine of each frame of acne that program

detected is the actual acne including areas where error of program detection.

-Quantitative: Evaluation of Qualitative data is a consideration about numbers

or data that can be measured as the number of digits. From each image results can be

evaluated by calculating the quantity of acne on the patient's face and determine whether the

average of the frames of acne that program detected is the actual acne including areas where

error of program detection.

From the analysis of Quantitative and Quantitative, each result images will

have different accuracy. The result of analysis will be classified into 4 types (Confusion

Matrix)[7];

Page 14: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 14

- True Positive (TP) is what the program predicted, and says it is true.

- True Negative (TN) is what the program to predict that's not true, and says it is false.

- False Positive (FP) is what the program predicted, but says it is false.

- False Negative (FN) is what the program predicted that's not true, but says it is true.

- Sensitivity is the rate of what the program actually predict and people say that it is true, can

be calculated as a percentage by TP/TP+FN

- Specificity is the rate of what the program actually does predict and say it's not true, can be

calculated as a percentage by TN/TN+FP

Page 15: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 15

Figure 17: Process diagram

From the results, each type of classification that is used to calculate the "true

positive rate" called Sensitivity and Specificity[8] which calculate the rate of accuracy of the

results from the program. Sensitivity is the rate of what the program predicted, and says it is

true, also can be calculated as a percentage. And Specificity is the rate of what programs

predict that's not true and says that it is false, also can be calculated as a percentage.

To summary, the structure working process of the program consists of the two

main techniques, Statistic Methods and Face Detection by way of starting are the same that to

upload images of acne on patient's face into the system, but difference in term of accuracy of

the results by can compare from the evaluation precision(Evaluation Accuracy). We will

comparing from the result images from program. The results of the program can tell changes

or the development of acne on the patient's face by a method called Qualitative and

Page 16: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 16

Quantitative. Each method will be able to evaluate the results come out differently. From the

results of each type of classification can be divided into Sensitivity and Specificity those are

the calculation precision of the results of the program. Sensitivity is the rate of what programs

predict that true and said it was true. Specificity is the rate of what programs predict that false

and said that it's not true, both can calculate out as a percentage.

6.2 Tools and Techniques

6.2.1 Tools

Software

- Adobe Photoshop : To simulate the expected result of acne images for compared with the results of experiment of program

- Matlab : To write a program with a basic function of image processing

command

Hardware

- Camera 1 unit

- Computer 1 unit Functional Specification

- Upload image of face acne

- Represent to detected area of acne

- Represent a number measurement of acne

6.2.2 Techniques

The technique using to find the solution of the method is less a mistake, but

most efficiency and more accuracy is following to.

1. Statistic Methods

The detection using image processing technology, in each figure of images

represents the shapes of square surrounding the specific point of acne that is a blob. The blob

determine the scope area of acne problem that is the way to used it developed program have

more accuracy. This method calculated the average area and color of acne problem after that

classify the different of data into the group. Then eliminate the group that is doesn’t close

with the other group. Those areas are the mistake of detection program, and assume it is

unwanted acne area.

2. Face Detection

The technology of face detection always continues development. The

experiences of program have more accuracy. The basic method is detected the region of face

structure such as eyes nose or mouth to locate the right position that you need. Moreover, the

researches show the Connected Component Analysis method to solve the detection mistake.

In each object on the body, define the identical value of each path of body then set the value

of data that we want to deduct it. So program doesn’t detect the identical area and represent

only the region of face. Those methods can reduce the detection mistake and can modify it to

use with only the face structure to less mistake of acne detection.

Page 17: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 17

7. Project Schedule Our work schedule is based on the advice of Dr. Bunyarit

Uyyanonvara(advisor) in every week, as well as the duration of the study the research and

also development of program.

Task Description Person Duration

Deadline Status

1 Review the previous study and research. Select which one can be the guideline for our project

WS & MJ

1w 18 Sep 14

100% completed

2 Try to learn and study Matlab program

WS & MJ

1w 25 Sep 14

100% completed

3 - Design the progress.

-Select the methods to implement algorithms of project then try to work on Matlab

WS & MJ

2w 9 Oct 14 100% completed

4 Prepare report and paper for the conferences (NSC & IC-ICTES 2015)

WS & MJ

1w 16 Oct 14

100% completed

5 -Develop program to split the blob of acne. (1blob per 1acne only) -Develop program to count and show amount of detected acne

WS & MJ

2w 30 Oct 14

100% completed for count and show amount of detected acne

7 Prepare slides for midterm presentation

WS & MJ

1w 6 Nov 14 100% completed

8 Submit the report to NSC conference

WS & MJ

2w 10 Nov 14

100% completed

9 Learn the progress of the results images from program

WS & MJ

1w 17 Nov 14

100% completed

10 Prepare slides for final presentation

WS & MJ

10d 27 Nov 14

100% completed

11 Submit paper to IC-ICTES 2015 conference

WS & MJ

2w 8 Dec 14 100% completed

12 Submit proposal and slides for final presentation

WS & MJ

1w 15 Dec 14

100% completed

13 Design GUI of program WS & MJ

4w Jan 15 90% completed

14 Implement GUI & test WS & MJ

4w Jan 15 70% completed

16 Final Report & Poster for NSC WS & MJ

1w Feb 15 100% completed

17 Prepared presentation and Midterm report

WS & MJ

1w 18 Feb 15

100% completed

Page 18: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 18

18 Design GUI of program WS & MJ

2d 27 Feb 15

100% completed

19 Implement GUI for displays part WS & MJ

2w 13 Mar 15

80% completed

20 Prepare paper for the conferences (RIIT 2015)

WS & MJ

1w 20 Mar 15

100% completed

21 Implement GUI for displays part WS & MJ

1w 27 Mar 15

100% completed

22 Implement GUI for buttons part WS & MJ

2w 10 Apr 15

80% completed

23 Prepare presentation for the conferences (RIIT 2015)

WS & MJ

1w 17 Apr 15

100% completed

24 - Implement GUI for generate and save button

- Test all features of GUI

WS & MJ

1w 24 Apr 15

100% completed

25 Presentation day for RIIT 2015 conference at Asia Hotel BKK

WS & MJ

1d 27 Apr 15

100% completed

26 Submit final report and update source code to SVN

WS & MJ

1w 19 May 15

100% completed

27 Prepare for final presentation WS & MJ

1w 20 May 15

100% completed

8. Technical Description

8.1 The Algorithm

____________Code 1: Conversion of RGB to Grayscale ________________

%% Set initial parameter

%Set the minimum and maximum size of acne area should be.

MIN = 20; %minimum area of acne (pixel^2)

MAX = 7000; %maximum area of acne (pixel^2)

%Input image

Pix = imread('01.jpg');

%Convert RGB to Gray image

GR = rgb2gray(Pix);

_____________________________________________________________

Page 19: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 19

Figure 18: grey scale image

____________Code 2: Find maximum intensity of Grayscale________________

MX = double(max(max(GR))); GY = double(GR)/MX;

_____________________________________________________________

Figure 19: Maximum intensity image

__________Code 3: Retrieve original image(RGB) to HSV color _______________

HSV = rgb2hsv(Pic); %imshow(HSV); V = HSV(:,:,3);

Page 20: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 20

Figure 20: HSV image Figure 21: Only Brightness image

__________Code 4: Retrieve original image(RGB) to HSV color _______________

R = V-GY; % delete High value of GY from V

RS = R<0.2; % make R that less than 0.2 to be 1

_____________________________________________________________

Figure 22: Brightness subtract max intensity Figure 23: Threshold <0.2

Page 21: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 21

__________Code 5: Delete block spot that 20 > size > 7000 _______________

%% Obtain only object that has size between [20 7000]

RM1 = bwareaopen(~RS,MIN); % remove black spot that size <20

%figure;imshow(RM1)

RM2 = bwareaopen(RM1,MAX); % remove black spot that size <7000

%figure;imshow(RM2)

NWPic = RM1~=RM2; % get object that size [20 7000]

_____________________________________________________________

Figure24 : Brightness - max intensity Figure25: Threshold <0.2 Figure26: Result

__________Code 6: Display result & count the blob detected _______________

[GD,NG]=bwlabel(NWPic); % label the object

BBox = regionprops(GD,'BoundingBox'); % make bondingbox of each object

%% Display result

figure('tag','SHW','name','Acne detection','numbertitle','off');

imshow(Pic);

hold on;

[r,c] = size(BBox);

title(['blob = ' num2str(r) ' point'])

for n=1:r

rectangle('Position',BBox(n).BoundingBox,'EdgeColor','g','Linewidth',2);

end

Page 22: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 22

hold off;

_____________________________________________________________

Figure27: Brightness subtract max intensity Figure: Threshold <0.2

Page 23: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 23

8.2. User Interface

8.2.1 GUI of Image Processing Application

The interface of ours project create with simply layout. We implement two main

displays which both image present the original image and the result after generate in a function. The main screen of application is display as follows:

Figure 28: Graphic User Interface (GUI)

In figure 28, it is a main interface when user called up a program. The layout separated into two displays view, the functions of command button, and the information. User will see two main displays and information bar at the center, and the functions bar below them. In the main view, the left side display image is the input images (Original image) that they want to detect, and the right side display image is the output images to show up after the function generate done. There will be only one picture at a time when a button is activated. If there is no initial activate, the main view would display a white background like in the figure and the status bar still show “Ready to upload”. Therefore user needs to browse the image before start doing any process and the status will changed.

Page 24: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 24

Figure29: Browse button on “Upload” image

Figure30: Choose an image file

In figure 29-30, The Upload button is activated to allow user browse their own image

into the program. User will see the status bar change to “Imported” it means upload image

was successful. The program display the image on the left side screen to do the image

analysis and when the mouse point on the image the “Pixel info” present the (X,Y) coordinate

and (R,G,B) image.

Page 25: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 25

Figure31: Allow mouse to “Zoom in” an image

In figure 31, when the mouse point on the image will show the symbol of command

“Zoom” allowed user to zoom in.

Figure32: Generate button to process the acne detection

Page 26: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 26

In figure32, the generate button is the process algorithm that detect and calculate count

the acne area from the previous imported image. The program will show up the result of

image and the total number of acne on the screen.

Figure33: Click “Save” to save the new image

Figure34: Save dialog to confirm to save the result of image.

In the figure 33-34, the program allowed user to saving a result of image after all process is done. If the user doesn’t choose a folder to save image file, it will automatic save file into where original image is imported.

Page 27: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 27

Figure35: Exit Dialog to confirm to exit the program.

In the figure 35, the exit dialog alerted when the user click exit to the program. Because we prevented the human mistake might be click on. When the users clicked button “Yes” it means confirm user want to exit the program and it automatic save all process.

Page 28: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 28

8.3. Result and Evaluation

8.3.1 Result of number detected

No. Original Image Ground truth Blob detected

Number of Ground truth detected

Number of Blob detected

01

42 38

02

13 14

03

52 23

04

41 50

05

20 38

Page 29: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 29

06

16 11

07

17 15

08

17 13

09

18 19

10

18 16

11

7 6

Page 30: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 30

8.3.2 Evaluation Accuracy

No TP FP TN FN Qualitative Quantitative Sensitivity Specificity Accuracy

01 24 14 1 19 38 90.47% 55.81% 6.67% 43.10%

02 9 5 1 2 14 107.69% 81.82% 16.67% 58.82%

03 17 6 1 35 23 44.23% 32.69% 14.29% 30.51%

04 27 21 1 4 50 121.95% 87.1% 4.55% 52.83%

05 13 24 1 4 38 190% 76.47% 4% 33.34%

06 8 3 1 5 11 68.75% 61.54% 25% 52.94%

07 9 6 1 6 15 88.23% 60% 14.29% 45.45%

08 10 3 1 5 13 81.25% 66.67% 25% 57.89%

9 15 4 1 2 19 105.56% 88.24% 20% 72.73%

10 9 7 1 9 16 88.89% 50% 12.5% 38.46%

11 5 1 1 2 6 85.17% 71.43% 50% 55.56%

12

14 18

13

17 25

Page 31: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 31

12 10 8 1 4 18 128% 71.43% 11.12% 47.83%

13 14 8 1 1 25 147.06% 93.94% 11.12% 58.34%

Ground truth: The image that developer mark on each point of acne to make the example the

way what program should output and compare with the result image

Detected: The result image that come from the program processes

True Positive: Area of acne that program can detected

False Positive: Area that didn’t have acne but program detected as acne

True Negative: Area that didn’t have acne and program also didn’t detect

False Negative: Area of acne that program can’t to detect

Qualitative: Evaluation of Qualitative data is considered on the details of the images, the

result is information that can be seen with the naked eye. Evaluation from the result images

by comparing each image and determine of each frame of acne that program detected is the

actual acne including areas where error of program detection.

Quantitative: Evaluation of Qualitative data is a consideration about numbers or data that can

be measured as the number of digits. From each image results can be evaluated by calculating

the quantity of acne on the patient's face and determine whether the average of the frames of

acne that program detected is the actual acne including areas where error of program

detection.

Sensitivity is the rate of what the program actually predict and people say that it is true, can

be calculated as a percentage by TP/TP+FN

Specificity is the rate of what the program actually does predict and say it's not true, can be

calculated as a percentage by TN/TN+FP

From both tables, we can calculate the accuracy from the results of confusion matrix

table that contain both correct rate and error rate of program. The average accuracy of all

experiment images was improve from the midterm period, there is from about 37.18% to

50%.

Page 32: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 32

8.4. Manual Instruction

Getting Started: Make sure that you already had the input/original image on your

computer

Display 1. Input / original image: display the image of acne on the face that user select from

the computer, display on the left-hand side of the window. After upload the input/original

image, when the mouse point on the image will show the symbol of command “Zoom”

allowed user to zoom in.

Figure36: Input / original image

Page 33: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 33

2. Output / detected image : display the result image after program detect the acne on

the input/original image, it will show the blob(s) of each point of acne, display on the right-

hand side of the window.

Figure37: Output / detected image

3. Status: display the status of responsibility program and where it working on at the

moment. First it will appear “Ready to upload” then user needs to browse the image before

start doing any process and the status will change, the status bar will change to “Imported” it

means upload image was successful.

Figure38: Status

Page 34: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 34

4. Blob Detected : program can count the amount of blob or acne on the result image

and display as a point unit.

Figure38: Blob Detected

Features / Command buttons 5. Upload: the button upload provided for user to choose the input/original image and

upload to the program, also display on the left-hand side of the window.

Figure40: Upload

Page 35: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 35

6. Generate: the button generate provided for user to start for detection, the program

will start the detection progress of the input/original image.

Figure41: Generate

7. Save : the button save provided for user to save the result image that program

already detected the acne into the computer, user also can choose the format of image. If the

user doesn’t choose a folder to save image file, it will automatic save file into where original

image is imported.

Figure42: Save

Page 36: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 36

Figure40: Pop Up save images

8. Exit : the button exit provided for user to leave from the window of detecting program

and also pop-up to make sure that user want to leave this window or not because we

prevented the human mistake might be click on. When the users clicked button “Yes” it

means confirm user want to exit the program and it automatic save all process

Figure43: Exit

Figure44: Confirm Dialogs

Page 37: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 37

Suggestion on the midterm-presentation

1. Design the program to be able to use for many group of user, not only for medical

profession.

2. Design the GUI to be able for user can edit at the result image that program already

detected the acne to be another way for make more accurate result.

3. Can be develop with the game application for more interesting from many group of

user.

9. Conclusion This project proposed to use image processing techniques to improve acne

detection and localization particularly for medical dermatologists. The doctor will be able to

use the results of both area and amount of acne from a program to track changes or

development the acne diseases on the face of patients effectively. The program reads an image

of patient's face and detected only the acne areas based on color or texture. After the acne

detection, the program will be compare the result and analyze the areas or amount of acne

coming out as a percentage to compare the changes or the development of acne on the face.

The results are very promising. Not only that the algorithms will help with the medical

treatment, but also the algorithm can be extended to App industry too. There are many mobile

phone applications that use to beautify the photo automatically. When detecting the acne

accurately and then blur only where a point of acne. Localisation of the acne can lead to acne

removal or smoothening for more natural outcome of the results.

Page 38: Automatic Acne Quantification and Localisation for Medical ...ict.siit.tu.ac.th/senior-itcs/final/report-bu3.pdf · The cause of the problems make use of a computer to aid in maintenance

Senior Project 2014 Medical Image Processing

School of ICT, SIIT 38

10. References [1] Chuan-Yu, Shang-­Cheng Li, Pau­‐Choo Chung, Jui-­Yi Kuo, Yung-­Chin Tu.

"Atomatic Facial Skin Defect Detection System." Dept. of Computer Science & Information

Engineering, National Yunlin University of Science & Technology, Taiwan. pp.527-­‐532,

2010.

[2] Hideaki Fujii, Takashi Yanagisawa, Masanori Mitsui, Yuri Murakami, Masahiro

Yamaguchi, Nagaaki Ohyama, Tokiya Abe, Ikumi Yokoi, Yoshie Matsuoka, and Yasuo

Kubota. "Extraction of acne lesion in acne patients from Multispectral Images". Annual

International IEEE EMBS Conference Vancouver, British Columbia, Canada. pp.4078-4081,

2008.

[3] Siddharth K, Madan and Kristin J, Dana. "Learning-Based Detection of Acne-like Regions

Using Time-Lapse Features". Department of Electrical and Computer Engineering, Rutgers

University NJ, USA. 2011.

[4] Phannapat S, Watcharaporn S, Maetawee J, Guntachai O. "Face Detection" School Of

Information Computer and Communication Technology Sirindhorn International Institute of

Technology, Thammasat University, Thailand. 2013.

[5] Anne Kaspers. "Blob detection". Biomedical Image Sciences,Image Sciences Institute,

UMC Utrecht, 2011.

[6] Chai D, Ngan K.N., "Face segmentation using skin-color map in videophone applications,"

Circuits and Systems for Video Technology, IEEE Transactions on , vol.9, no.4, pp.551,564,

Jun 1999