Anda di halaman 1dari 33

A

Project Stage-I Report

On
Design and Fabrication of “HEALTH SECURITY SYSTEM”
Submitted to the

Rajasthan Technical University, Kota


In partial fulfillment of the requirement for the award of the

Degree of

Bachelor of Technology

In

Electronics and Communication Engineering

Guided By: Submitted By:

Mr. Rajesh Kumar Raj Roma Modwani (15EEAEC071)


Assistant Professor Shilpa Soni(15EEAEC080)
Deppt. Of ECE Shikha Gautam (15EEAEC079 )
Tapan Khandelwal (15EEAEC085)

Department of Electronics and Communication Engineering


Govt. Engineering College Ajmer
Oct, 2018

i
GOVERNMENT ENGINEERING COLLEGE, AJMER
Department of Electronics and Communication Engineering

CERTIFICATE

This is to certify that following students of VII Semester, B. Tech. (Electronics &

Communication Engineering) 2018-2019, have successfully completed the project stage-I

titled “HEALTH SECURITY SYSTEM” in partial fulfillment for the award of the

degree of Bachelor of Technology under Rajasthan Technical University, Kota.

1. Roma Modwani (15EEAEC071)


2. Shilpa Soni (15EEAEC080)
3. Tapan Khandelwal (15EEAEC085)
4. Shikha Gautam (15EEAEC079)

Date:

Mr. Rajesh Kumar Raj Mr. Harish Kumar Sharma Dr. U. S. Modani

(Guide) (Project Co-ordinator) (Head, ECE)

ii
CANDIDATE’S DECLARATION

We hereby declare that the project stage-I work entitled, “HEALTH SECURITY

SYSTEM” submitted in partial fulfillment of the requirement for the award of degree of

“Bachelor of Technology” in Electronics and Communication Engineering, Rajasthan

Technical University, Kota, is an authentic record of our own work carried out during VII

semester under the Guidance of Mr. Rajesh Kumar Raj, Assistant Professor Deppt. of

ECE, Govt. Engineering College Ajmer.

1. Roma Modwani (15EEAEC071)


2. Shilpa Soni (15EEAEC080)
3. Tapan Khandelwal (15EEAEC085)
4. Shikha Gautam (15EEAEC079)

iii
ACKNOWLEDGEMENT

The project stage-II report on “HEALTH SECURITY SYSTEM” is outcome of


guidance, moral support and devotion bestowed on us throughout our work. For this, we
acknowledge and express our profound sense of gratitude and thanks to everybody who
have been a source of inspiration during the project preparation.

We offer our sincere phrases of thanks with to our Project Guide, Mr. Rajesh Kumar
Raj without whose support and guidance it would not have been possible for this Project
to have materialized and taken a concrete shape.
I would also like to express our gratitude to our Project Coordinator Mr. Harish Kumar
Sharma, to provide us a better facility to enhance our practical knowledge.

We are thankful to Dr. Uma Shankar Modani (HOD, ECE), Govt. Engineering College,
Ajmer.

At last but not the least, I am thankful to all our colleagues and other staff members, who
helped us directly or indirectly in the Project work.

1.Roma Modwani (15EEAEC071)


2.Shilpa Soni (15EEAEC080)
3.Tapan Khandelwal (15EEAEC085)
4.Shikha Gautam (15EEAEC079)

iv
INDEX

CHAPTER PAGE No.


CONTENTS
No.

CERTIFICATE i

CANDIDATE’S DECLARATION ii

ACKNOWLEDGEMENT iii

CONTENTS iv-vii

LIST OF FIGURES viii

LIST OF TABLES ix

LIST OF ABREVIATION x

ABSTRACT 1

CHAPTER 1 INTRODUCTION 2

CHAPTER 2 LITERATURE SURVEY 3-5

CHAPTER 3 ALGORITHM 6-14

3.1 Brain Tumor Detection 6-10

3.2 Blood Cancer Detection 11-14

CHAPTER 4 WORKING PRINCIPLE 15-16

CHAPTER 5 OPERATING PROCEDURE 17-19

CHAPTER 6 RESULTS AND SNAPSHOTS 20-24

CHAPTER 7 CONCUSION 25

CHAPTER 8 FUTURE SCOPE 26

REFERENCES 27

v
LIST OF FIGURES

FIGURE PAGE No.


TITLE
No.
Fig 2.1 Block Diagram for brain tumor 3

Fig 2.2 Sequence of steps for automatic blood sample image 5


recognition

Fig 3.1 Example of use of MATLAB 6

Fig 4.1 Filtered gray scale normal blood image 16

Fig 5.1 Command window output of blood cancer detection 20

Fig 5.2 Binary image showing cancer in blood cells 20

Fig 5.3 Image showing command window output with values of radii 21
of cancerous blood cells

Fig 5.4 Cancer ridden cells 21

Fig 5.5 RGB image of cancerous cells 22

Fig 5.6 Centre of cancerous blood cells 22

Fig 5.7 Brain tumor extraction 23

Fig 5.8 Output format with parameters for brain tumor detection 23

Fig 5.9 Benign brain cancer images 24

Fig5.10 Malignant brain cancer images 24

vi
ABSTRACT
Final year projects for engineering students gives an edge over the race of recruitment to
work hard to ensure a good career. In spite of employment practices in recent times,
students are progressively taking up challenging projects to pad up their skill-set, they
add where students have been placed in their third year before the final-year project.
By engaging in these projects students can gain practical knowledge. In spite of theory
concept you acquire, various industries also need to know your capacity to complete
projects using your specific initiative.
Keeping the similar outcome in our mind we have undertaken a project for our final year
which will help us broaden our visions. In life as fast as it is going today, there are
numerous tasks to be done, thousands of goals to achieve, very less time to do it and
many obstacles to stop us in our path to reach them. With the ever changing world and
the ever increasing pollution, a great many number of diseases and social problems are
always awaiting at our door to knock us down. Our project aims to solve a number of
such problems for the population living in the world today. We may not be able to cure
cancer but we can detect it at an early stage and stop it from spreading any further and
start the treatment at the right time.
Our project names “HEALTH SECURITY SYSTEM” entails two levels in it. The first
level that is the software level is the primary focus of our minor project. We have planned
to work on the hardware part for the major project of our final year. The software part
details into the image processing done by the use of MATLAB to detect cancer and its
variations. So far we have been successful in getting desired outcomes for blood cancer
and brain tumor detection.
Through this report we plan to explain all the study and work we have done in order to
obtain our desired outcomes.

1
CHAPTER-1

INTRODUCTION
The whole project aims towards the easy access of medical supervision to patients and to
provide the basic help to those who really need it. The project comprises of the use of
small, affordable microcontrollers and MATLAB software which makes it easy to use
and least expensive too. So in order to make it a successful health security system, as the
name suggests, we have first and foremost worked on its affordability by using it through
easily obtainable software. The first stage comprises of use of image processing to detect
brain tumor and blood cancer.
Automatic detection of tumors in medical images is motivated by the necessity of high
accuracy when dealing with a human life. Also, the computer assistance is demanded in
medical institutions due to the fact that it could improve the results of humans in such a
domain where the false negative cases must be at a very low rate. Processing of Magnetic
Resonance Imaging (MRI) images is one of the techniques to diagnose the brain tumor.

First it takes the name and age of a person and then MRI brain image is used for tumor
detection process. It includes pre-processing, segmentation, morphological operation,
watershed segmentation and calculation of the tumor area and determination of the tumor
location.

Blood cancer is the most critical blood disease, common in children and adults. A
majority cancer cell begins in body parts but leukemia is the type of cancer which begins
and grows in blood cells. Leukemia means blood cancer which is featured by the
uncontrolled and abnormal production of white blood cells (leukocytes) by the bone
marrow in the blood. Acute Lymphoblastic Leukemia (ALL) is a type of leukemia which
is more common in children. Due to its non-specific nature of the symptoms and signs of
ALL leads wrong diagnosis. Even hematologist finds it difficult to classify the leukemia
cells, there manual classification of blood cells is not only time consuming but also
inaccurate. Therefore, early identification of leukemia yields in providing the appropriate
treatment to the patient. Detection through images is fast and cheap method as there is no
special need of equipment for lab testing. We have focused on the changes in the
geometry of cells like area, perimeter and statistical parameters like mean and standard
deviation which separates white blood cells from other blood components using
processing tools like MATLAB. After recognizing its statistical properties, types of
leukemia will be identified based on the irregularities in the shape.

2
CHAPTER-2

LITERATURE SURVEY

2.1 BRAIN TUMOUR DETECTION

The brain is a soft, spongy mass of tissue which is protected by the bones of the skull,
three thin layers of tissue called meninges and cerebrospinal fluid. Sometimes there
occurs abnormal growth in brain tissues causing brain tumor.

Tumors are categorized basically into two types –

2.1.1 Benign Brain Tumor - Cells from benign tumors rarely invade tissues around them.
They don't spread to other parts of the body. However, benign tumors can press on
sensitive areas of the brain and cause serious health problems. Benign tumors can be
removed, and they seldom grow back.

2.1.2 Malignant Brain Tumor - Malignant brain tumors also called as brain cancer. They
are likely to grow rapidly and crowd or invade the nearby healthy brain tissue. MRI is a
medical imaging technique used in radiology to form pictures of the anatomy and the
physiological processes of the body in both health and disease.

Fig. 2.1 Block Diagram for Brain Tumor Extraction

3
2.2 BLOOD CANCER DETECTION

A majority cancer cell begins in body parts but leukemia is the type of cancer which
begins and grows in blood cells .Blood is crucial content without which metabolic
functions of body severely affects. In Human system cell grows and multiplies into new
cells. Old cells are destroyed and so that new cells can take their place. In cancer, an old
cell does not die and remains in the blood so that new cells which are produced cannot
get enough space to live. In this way, functioning of blood disturbs and white blood cells
production is abnormal and uncontrolled.

2.2.1 Components of Human Blood Cell

Blood cells are produced from the stem cells present in bone marrow. Blood consists of
following components.

2.2.1.1 Red Blood Cells (Erythrocytes) - RBCs have a capacity to carry oxygen to and
take back CO2 away from tissues.

2.2.1.2 White Blood Cells (Leukocytes) - WBCs are the cell which fights with the foreign
bodies and prevents from infection. There are different types of WBCs like
lymphocytes, monocytes, eosinophile, basophils and neutrophils. According to
WBCs types there are different types of leukemia.

2.2.1.3 Blood Platelets - It helps for the clotting of blood an controls bleeding.

2.2.2 Types of Leukemia

2.2.2.1 Acute Lymphocytic Leukemia (ALL)

It occurs in children of age 1-12 years and adults of age 40 years. Here lymphocytic cell
of WBCs gets affected. It is also known as Acute Lymphoblastic Leukemia. ALL most
common in men compare to women.

2.2.2.2 Acute Myeloid Leukemia (AML)

It occurs in children of age 1 year and old age patient. Enlargement of spleen and bone
pain these are the prime symptoms of acute myeloid leukemia. In this myeloid line of
stem cells are affected.

2.2.2.3 Chronic Leukemia

Human body does not show any symptoms at early stages. Means at early stage abnormal
cells does not affect the working of normal cells. It progresses slowly and affects large
area of blood cells and getting symptoms last stage. Atlast stage, it is incurable.

4
2.2.2.4 Chronic Lymphocytic Leukemia (CLL)

It occurs in senior citizen patients who suffer from old agediseases. Lymphocytes are
affected. It does not show any symptoms at early stage.

2.2.2.5 Chronic Myeloid Leukemia (CML)

It occurs in middle age patients of age 35 45 years. Genetic changes occur at early stage
of myeloid cells.

2.2.5 Automatic detection of blood cancer

The following are the steps to be followed for automatic detection of blood cancer shown
in figure 2.2.

Fig.2.2 Sequence of Steps for Automatic Blood Sample Image Recognition

1. Image acquisition.
2. Image preprocessing.
3. Image segmentation.
4. Feature extraction.
5. Image Acquisition

5
CHAPTER-3

ALGORITHMS

3.1 Software Introduction

For the detection of aforementioned diseases, the software used in this project is
MATLAB. MATLAB is a programming platform designed specifically for engineers and
scientists. The heart of MATLAB is the MATLAB language, a matrix-based language
allowing the most natural expression of computational mathematics.

Fig 3.1 Example showcasing use of MATLAB

MATLAB combines a desktop environment tuned for iterative analysis and design
processes with a programming language that expresses matrix and array mathematics
directly.
Using MATLAB, we can analyze data, develop algorithms and create models and
applications.

6
The language, apps, and built-in math functions enable you to quickly explore multiple
approaches to arrive at a solution. MATLAB lets us take your ideas from research to
production by deploying to enterprise applications and embedded devices, as well as
integrating with Simulink and Model-Based Design.

Millions of engineers and scientists in industry and academia use MATLAB. You can use
MATLAB for a range of applications, including deep learning and machine learning,
signal processing and communications, image and video processing, control systems, test
and measurement, computational finance, and computational biology.

3.2 Brain Tumor Detection

The following MATLAB code sequence describes the use of various functions in ordere
to create a working program to detect brain tumor through the MRI images.

MATLAB CODE-

%Project Title: Brain Tumor Segmentation & Classification

function varargout = BrainMRI_GUI(varargin)


gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @BrainMRI_GUI_OpeningFcn, ...
'gui_OutputFcn', @BrainMRI_GUI_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});end
function BrainMRI_GUI_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
ss = ones(200,200);
axes(handles.axes1);
imshow(ss);
axes(handles.axes2);
imshow(ss);
guidata(hObject, handles);
function varargout = BrainMRI_GUI_OutputFcn(hObject, eventdata, handles)
varargout{1} = handles.output;
function pushbutton1_Callback(hObject, eventdata, handles)
[FileName,PathName] = uigetfile('*.jpg;*.png;*.bmp','Pick an MRI Image');
if isequal(FileName,0)||isequal(PathName,0)
7
warndlg('User Press Cancel');
else
P = imread([PathName,FileName]);
P = imresize(P,[200,200]);
input =imresize(a,[512 512]);
axes(handles.axes1)
imshow(P);title('Brain MRI Image');
guidata(hObject,handles); end
function pushbutton2_Callback(hObject, eventdata, handles)
if isfield(handles,'ImgData')
I = handles.ImgData;
gray = rgb2gray(I);
level = graythresh(I);
img = im2bw(I,.6);
img = bwareaopen(img,80);
img2 = im2bw(I);
axes(handles.axes2)
imshow(img);title('Segmented Image');
handles.ImgData2 = img2;
guidata(hObject,handles);
signal1 = img2(:,:);
[cA1,cH1,cV1,cD1] = dwt2(signal1,'db4');
[cA2,cH2,cV2,cD2] = dwt2(cA1,'db4');
[cA3,cH3,cV3,cD3] = dwt2(cA2,'db4');
DWT_feat = [cA3,cH3,cV3,cD3];
G = pca(DWT_feat);
whos DWT_feat
whos G
g = graycomatrix(G);
stats = graycoprops(g,'Contrast Correlation Energy Homogeneity');
Contrast = stats.Contrast;
Correlation = stats.Correlation;
Energy = stats.Energy;
Homogeneity = stats.Homogeneity;
Mean = mean2(G);
Standard_Deviation = std2(G);
Entropy = entropy(G);
RMS = mean2(rms(G));
Variance = mean2(var(double(G)));
a = sum(double(G(:)));
Smoothness = 1-(1/(1+a));
Kurtosis = kurtosis(double(G(:)));
Skewness = skewness(double(G(:)));
m = size(G,1);
n = size(G,2);
in_diff = 0;

8
for i = 1:m
for j = 1:n
temp = G(i,j)./(1+(i-j).^2);
in_diff = in_diff+temp; end
end
IDM = double(in_diff);
feat = [Contrast,Correlation,Energy,Homogeneity, Mean, Standard_Deviation,
Entropy, RMS, Variance, Smoothness, Kurtosis, Skewness, IDM];
load Trainset.mat
xdata = meas;
group = label;
svmStruct1 = svmtrain(xdata,group,'kernel_function', 'linear');
species = svmclassify(svmStruct1,feat,'showplot',false);
if strcmpi(species,'MALIGNANT')
helpdlg(' Malignant Tumor ');
disp(' Malignant Tumor '); else
helpdlg(' Benign Tumor ');
disp(' Benign Tumor '); end
set(handles.edit4,'string',species);
set(handles.edit5,'string',Mean);
set(handles.edit6,'string',Standard_Deviation);
set(handles.edit7,'string',Entropy);
set(handles.edit8,'string',RMS);
set(handles.edit9,'string',Variance);
set(handles.edit10,'string',Smoothness);
set(handles.edit11,'string',Kurtosis);
set(handles.edit12,'string',Skewness);
set(handles.edit13,'string',IDM);
set(handles.edit14,'string',Contrast);
set(handles.edit15,'string',Correlation);
set(handles.edit16,'string',Energy);
set(handles.edit17,'string',Homogeneity); end
function pushbutton3_Callback(hObject, eventdata, handles)
load Trainset.mat
Accuracy_Percent= zeros(200,1);
itr = 80;
hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations');
for i = 1:itr
data = meas;
groups = ismember(label,'MALIGNANT');
[train,test] = crossvalind('HoldOut',groups);
cp=classperf(groups);
svmtrain(data(train,:),groups(train),'boxconstraint',Inf,'showplot',false,'kernel_function','r
bf');

9
svmStruct_RBF=
svmtrain(data(train,:),groups(train),'boxconstraint',Inf,'showplot',false,'kernel_function','r
bf');
classes2 = svmclassify(svmStruct_RBF,data(test,:),'showplot',false);
classperf(cp,classes2,test);
Accuracy_Percent(i) = cp.CorrectRate.*100;
sprintf('Accuracy of RBF Kernel is: %g%%',Accuracy_Percent(i))
waitbar(i/itr); end
delete(hWaitBar);
Max_Accuracy = max(Accuracy_Percent);
sprintf('Accuracy of RBF kernel is: %g%%',Max_Accuracy)
set(handles.edit1,'string',Max_Accuracy);
guidata(hObject,handles);
function pushbutton4_Callback(hObject, eventdata, handles)
load Trainset.mat
Accuracy_Percent= zeros(200,1);
itr = 100;
hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations');
for i = 1:itr
data = meas;
groups = ismember(label,'MALIGNANT');
[train,test] = crossvalind('HoldOut',groups);
cp = classperf(groups);
svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_function','linear');
classes = svmclassify(svmStruct,data(test,:),'showplot',false);
classperf(cp,classes,test);
Accuracy_Percent(i) = cp.CorrectRate.*100;
sprintf('Accuracy of Linear Kernel is: %g%%',Accuracy_Percent(i))
waitbar(i/itr); end
delete(hWaitBar);
Max_Accuracy = max(Accuracy_Percent);
sprintf('Accuracy of Linear kernel is: %g%%',Max_Accuracy)
set(handles.edit2,'string',Max_Accuracy);
function pushbutton5_Callback(hObject, eventdata, handles)
load Trainset.mat
Accuracy_Percent= zeros(200,1);
itr = 100;
hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations');
for i = 1:itr
data = meas;
groups = ismember(label,'BENIGN ');
groups = ismember(label,'MALIGNANT');
[train,test] = crossvalind('HoldOut',groups);
cp = classperf(groups);
svmStruct_Poly =
svmtrain(data(train,:),groups(train),'Polyorder',2,'Kernel_Function','polynomial');

10
classes3 = svmclassify(svmStruct_Poly,data(test,:),'showplot',false);
classperf(cp,classes3,test);
Accuracy_Percent(i) = cp.CorrectRate.*100;
sprintf('Accuracy of Polynomial Kernel is: %g%%',Accuracy_Percent(i))
waitbar(i/itr);
end
delete(hWaitBar);
Max_Accuracy = max(Accuracy_Percent);
sprintf('Accuracy of Polynomial kernel is: %g%%',Max_Accuracy)
set(handles.edit3,'string',Max_Accuracy);
function edit1_Callback(hObject, eventdata, handles)
function edit1_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles)
function edit2_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit3_Callback(hObject, eventdata, handles)
function edit3_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function pushbutton4_CreateFcn(hObject, eventdata, handles
function edit4_Callback(hObject, eventdata, handles)
function edit4_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit5_Callback(hObject, eventdata, handles)
function edit5_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit6_Callback(hObject, eventdata, handles)
function edit6_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');

11
end
function edit7_Callback(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit8_Callback(hObject, eventdata, handles)
function edit8_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit9_Callback(hObject, eventdata, handles)
function edit9_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit10_Callback(hObject, eventdata, handles)
function edit10_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit11_Callback(hObject, eventdata, handles)
function edit11_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit12_Callback(hObject, eventdata, handles)
function edit12_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit13_Callback(hObject, eventdata, handles)
function edit13_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit14_Callback(hObject, eventdata, handles)
function edit14_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))

12
set(hObject,'BackgroundColor','white');
end
function edit15_Callback(hObject, eventdata, handles)
function edit15_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit16_Callback(hObject, eventdata, handles)
function edit16_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit17_Callback(hObject, eventdata, handles)
function edit17_CreateFcn(hObject, eventdata, handles)
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
load Trainset.mat
Accuracy_Percent= zeros(200,1);
itr = 100;
hWaitBar = waitbar(0,'Evaluating Maximum Accuracy with 100 iterations');
for i = 1:itr
data = meas;
groups = ismember(label,'BENIGN ');
groups = ismember(label,'MALIGNANT');
[train,test] = crossvalind('HoldOut',groups);
cp = classperf(groups);
svmStruct4 =
svmtrain(data(train,:),groups(train),'showplot',false,'kernel_function','quadratic');
classes4 = svmclassify(svmStruct4,data(test,:),'showplot',false);
classperf(cp,classes4,test);
Accuracy_Percent(i) = cp.CorrectRate.*100;
sprintf('Accuracy of Quadratic Kernel is: %g%%',Accuracy_Percent(i))
waitbar(i/itr);
end
delete(hWaitBar);
Max_Accuracy = max(Accuracy_Percent);
sprintf('Accuracy of Quadratic kernel is: %g%%',Max_Accuracy)
set(handles.edit19,'string',Max_Accuracy);
function edit19_Callback(hObject, eventdata, handles)
function edit19_CreateFcn(hObject, eventdata, handles)

13
if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

3.3 Blood Cancer Detection

MATLAB CODE

rgb = imread('F1.jpg');
figure
imshow(rgb)
pause
gray_image = rgb2gray(rgb);
imshow(gray_image);
pause
[centers, radii] = imfindcircles(rgb,[35 60],'ObjectPolarity','dark','Sensitivity',0.9)
imshow(rgb);
pause
h = viscircles(centers,radii)
cell=length(centers);
pause
red=rgb(:,:,1);green= rgb(:,:,2); blue= rgb(:,:,3);
%p=impixel(rgb);
out=red>25 & red<123 &green<135 & blue>167 & blue<201;
imshow(out);
pause
out1=imfill(out,'holes');
imshow(out1);
pause
out2=bwmorph(out1,'erode');
imshow(out2);
pause
out3=bwmorph(out2,'dilate',4);
out3=imfill(out3,'holes');
imshow(out3);
out3=im2bw(out3);
[l,NUM]=bwlabel(out3,4);
cancer=(NUM/cell)*100;
if cancer<25
disp('initial stage');
disp('cnacer persentage is')
disp(cancer);
end

14
CHAPTER-4

WORKING PRINCIPLE

4.1 Brain Tumor Detection

For brain tumor detection technique to work through MATLAB we need to follow a fixed
algorithm and provide certain input parameters.

The major steps to detect a brain tumor from MRI image are given as follows –
1) Give MRI image of brain as input.
2) Convert it to gray scale image.
3) Apply low pass filter for noise removal.
4) Apply median filter to enhance the quality of image.
5) Compute threshold segmentation.
6) Compute morphological operation.
7) Finally output will be a tumor region
8) Compute watershed segmentation and ridging.
9) Calculate tumor area and show its centre.

4.2 Blood Cancer Detection

Blood is a necessary fluid of an organism’s body. Any disease indicating its claws on
blood must be analyzed and prevented if possible using all possible and necessary
measures.

The following steps and procedures must be employed in the given order to ensure
successful detection of blood cancer.

4.2.1 Image acquisition

Microscopic images of blood cells are acquired with the help of digital microscope.
Digital microscope which has inbuilt camera inside it is in trend to acquire digital images
of cell.

4.2.2 Image Preprocessing

Due to excessive stains and manual intervention microscopic images which are acquired
possesses noise. Here noise present is mainly shadows of nuclei. Our region of interest is
blood cell nucleus, so we process images to remove unwanted noises and recover
important one. In this enhancement process, images are improved to make it suitable for
further stages of processing. Blood cell images are enhancement with the help of linear
contrast enhancement technique. Popular contrast enhancement technique is histogram
equalization which adjusts the contrast and image intensity as per required.

15
Fig 4.1 Filtered gray scale image of normal blood image

4.2.3 Image Segmentation

Image segmentation of microscopic blood cell images are done to locate the WBCs
structure which are abnormal. Segmentation of images means partitioning the image into
a set of pixels. A novel cell detection method which uses both intensity and shape
information of blood cell to improve the nucleus segmentation. Accuracy of feature
extraction of images is depends of proper segmentation of white blood cells. WBCs
segmentation means segmentation of nuclei of abnormal cells. In leukemia patient white
blood cells possesses abnormal structure of nuclei.

4.2.4 Feature Extraction

Features of WBCs are extracted to decide whether the cell is blast. Following are the
features which are considered while detection of leukemia.

Statistical - Statistical parameters like mean, variance, standard deviation and skewness
of histogram of image matrix of cell and gradient matrix are acquired.

Textural - Textural features of WBCs cell include cell homogeneity, correlation factor,
entropy, contrast and energy.

Geometrical - It includes geometrical features like area of cell, perimeter, radius,


eccentricity, symmetry and concavity.

16
CHAPTER-4

OPERATING PROCEDURE

For the operation of detection of the aforementioned cancer diseases, we need to follow
the following steps:

4.1 Brain Tumor Detection

4.1.1 Procedure for Brain Tumor Detection

The first step is to enter the name and age of the patient. Further the GUI asks for the
MRI brain image. The program is created in MATLAB which accepts the MRI image in
file format and converts it in data format using the functions uigetfile() and imread().

4.1.2 Grayscale Conversion

Red, Green, Blue provides computational complexities and still does not provide
guaranteed better results. Therefore Grayscale images are preferred in image pre-
processing. The conversion of a RGB to grayscale image is done by using the function
rgb2gray (image).

4.1.3 Preprocessing of Grayscale Image

Pre-processing of MRI images is the primary step in image analysis which performs
image enhancement and noise reduction techniques to enhance the image quality. The
accuracy and convergence rate of such techniques must be significantly high in order to
ensure the success of the subsequent steps. In this work, the importance of such
approaches is highlighted in the context of Magnetic Resonance (MR) brain image
classification and segmentation. In this work, suitable pre-processing techniques are
developed to remove the skull portion surrounding the brain tissues. The experimental
results are analysed in terms of segmentation efficiency for pre- processing and distance
measure for feature extraction techniques. For the pre-processing following two filters are
used :

4.1.3.1 Low Pass Filter

Firstly image is given as an input to low pass filter to perform smoothening methods. A
low-pass filter, also called a "blurring" or "smoothing" filter, averages out rapid changes
in intensity. The simplest low-pass filter just calculates the average of a pixel and all of
its eight immediate neighbors. The result replaces the original value of the pixel. The
process is repeated for every pixel in the image.

4.1.3.2 Median Filter

17
Then the image is passed through median filter for noise reduction. The median filter is a
nonlinear digital filtering technique which preserves edges while removing noise. Median
filter runs through the signal entry by entry, replacing each entry with the median of
neighbouring entries.

4.1.4 Image Segmentation

After pre-processing segmentation is applied to partition the image into multiple


segments (sets of pixels, also known as super pixels) to simplify the representation of an
image into something that is more meaningful and easier to analyse. Image segmentations
typically used to locate objects and boundaries (lines, curves, etc.) in images. More
precisely, image segmentation is the process of assigning a label to every pixel in an
image such that pixels with the same label share certain visual characteristics.

4.1.5 Threshold Segmentation

Thresholding method replace each pixel in an image with a black pixel if the image
intensity I(i,j) is less than some fixed constant T (i.e. I(i,j)<T), or a white pixel if the
image intensity is greater than that constant. Hence this method is based on a clip level
(threshold value) to turn a gray-scale image into binary image.

4.1.6 Morphological Operation

Morphological technique is used to probe an image with a small shape or template called
a structuring element. The structuring element is positioned at all possible locations in the
image and it is compared with the corresponding neighbourhood of pixels. Some
operations test whether the element "fits" within the neighbourhood, while others test
whether it "hits" or intersects the neighbourhood. It is the collection of nonlinear
operations related to the shape or morphology of features in an image.

4.1.7 Watershed Segmentation

Watershed segmentation is a gradient-based segmentation technique. It considers the


gradient map of the image as a relief map. It segments the image as a dam. The
segmented regions are called catchment basins. Watershed segmentation solves a variety
of image segmentation problem. It is suitable for the images that have higher intensity
value. Watershed segmentation is caused over segmentation. To control over
segmentation, marker controlled watershed segmentation is used. Next unit calculates the
area of the tumor region and locates the centre in the form of rows and columns. The area
is specified in pixels. Furthermore with the help of this information the tumor location in
terms of brain terminology can be specified. Mainly if the sagittal plane is considered, the
location of tumor in the brain can be specified more easily. After all the operations the
extracted tumour would be shown in output axes of UI. In output image tumor will be
shown in terms of watershed ridges. The watershed segmentation takes random color in
the background and in the tumor to separate them.

18
4.2 Blood Cancer Detection

4.2.1 Counting of RBC’s and WBC’s using Image Processing Technique

The measure of WBC and RBC Cells are very important for the doctor to diagnose
various diseases such as anemia, leukemia etc. So, precise counting of blood cells plays
very important role. The old conventional method used in hospital laboratories involves
manual counting of blood cells using a device called Haemocytometer. But this process is
extremely monotonous, time consuming, and leads to inaccurate results.Even though
hardware solutions such as the Automated Hematology Counter exits, they are very
expensive machines and unaffordable in every hospital laboratory. In order to overcome
these problems, this paper presents an image processing technique to detect and to count
the number of redblood & white blood cells in the blood sample image using circular
Hough transform and threshold techniques.

4.2.2 Morphological Operations

4.2.2.1 White Blood Cells Segmentation and Classification to Detect Acute Leukemia

In order to improve patient diagnosis various image processing software are developed to
extract useful information from medical images. Hematologist makes the microscopic
study of human blood which led to a need of methods, including microscope color
imaging, segmentation, classification, and clustering that can allow the identification of
patients suffering from leukemia. Leukemia is related with blast White Blood Cell
(WBC).

4.2.2.2 Image Analysis of Blood Microscopic Images for Acute Leukemia Detection

Acute Lymphoblastic Leukemia (ALL) is a serious hematological disease of childhood


which is characterized by abnormal growth and development of immature white blood
cells (lymphoblasts). ALL makes around 80% of childhood leukemia and it mostly occur
in the age group of 3-7. The non- specific nature of the signs and symptoms of ALL often
leads to wrong diagnosis. Diagnostic confusion is also posed due to imitation of similar
signs by other disorders. Careful microscopic examination of stained blood smear or bone
marrow aspirate is the only way to effective diagnosis of leukemia. A low cost and
efficient solution is to use image analysis for quantitative examination of stained blood
microscopic images for leukemia detection. A fuzzy clustering based two stage color
segmentation strategy is employed for segregating leukocytes or white blood cells
(WBC) from other blood components. Discriminative features i.e. nucleus shape, texture
are used formal detection of leukemia. In the present paper two novel shape features i.e.,
Dimension and contour signature is implemented for classifying a lymphocytic cell
nucleus. Support Vector Machine (SVM) is employed for classification. A total of 108
blood smear images were considered for feature extraction and performance evaluation is
validated with the results of a hematologist.

19
CHAPTER-5

RESULTS AND SNAPSHOTS

5.1 Blood Cancer Detection

Fig 5.1 Command window output

Fig 5.2 Binary image showing cancer in blood cell

20
Fig 5.3 Image showing command window output with value of radii of the cancel ridden
blood cells

Fig 5.4 Image showing cancer ridden blood cells

21
Fig 5.5 RGB image showing cancerous blood cells

Fig 5.6 Command window output displaying centre of the cancer ridden blood cells

22
5.2 Brain Tumor Detection

Fig 5.7 Image showing segmented version of the detected tumor and its various
values

Fig 5.8 Image showing the format of the output with different parameters

23
Fig. 5.9 Benign brain cancer MRI images

Fig. 5.10 Malignant brain cancer MRI images

24
CHAPTER-6

CONCLUSION
The whole project aims towards the easy access of medical supervision to patients and to
provide the basic help to those who really need it. The project comprises of the use of
small, affordable microcontrollers and MATLAB software which makes it easy to use
and least expensive too.

The MATLAB code ensures that the required outcomes for the blood cancer detection,
i.e., cancerous blood cells radii to calculate their location and the percentage of cancer in
the blood are successfully obtained.

Also the brain tumor detection code provides all the parameters to study the attack and
level of cancer in the brain. These parameters include skewness, kurtosis, mean, variance,
standard deviation and many more.

The morphological operations and image segmentation help us get provided with binary
images of the area of the brain affected by the cancer. The grayscaling of the RGB image
gives us the necessary values to calculate the contrast and brightness of the image and
study its effects.

With the help of above given snapshots and results the successful compilation and
execution of the software part of this project is done.

25
CHAPTER-7

FUTURE SCOPE
We aim to work towards decreasing the dependency of the patients who are bed ridden
for a brief or long duration of time. It is not expensive and easy to use for person from
any medical or non-medical background. The software based image processing
comparisons for brain tumor and blood cancer allow the patient to get their problem
detected at an early stage without spending a huge amount of money. It is fast and
dependable too.

In life as fast as it is going today, there are numerous tasks to be done, thousands of goals
to achieve, very less time to do it and many obstacles to stop us in our path to reach them.
With the ever changing world and the ever increasing pollution, a great many number of
diseases and social problems are always awaiting at our door to knock us down. Our
project aims to solve a number of such problems for the population living in the world
today. We may not be able to cure cancer but we can detect it at an early stage and stop it
from spreading any further and start the treatment at the right time.

With the increased use of technology in today’s world the scope of affordable and easy to
use technologies is in demand and we see a bright future ahead of us for the vision of this
project and aim to work towards it too.

26
CHAPTER-8

REFERENCES

1. RESEARCH PAPERS

 BRAIN TUMOUR EXTRACTION FROM MRI IMAGES USING MATLAB


Pranjal Jain, Harshita Didwania, Shivi Chaturvedi, Student, Department of ECE,
Lakshmi Narain College of Technology, Bhopal ( India) Department of ECE,
Lakshmi Narain College of Technology, Bhopal (India)
 International Journal of Advanced Research in Electronics and Communication
Engineering (IJARECE) Volume 7, Issue 5, May 2018 547 All Rights Reserved ©
2018 IJARECE
Blood Cancer Detection Using Image processing by Shivkumar Chatarwad, Pratik
Bansode, Amar Burade, Prof.T.S Chaware

2. WEBSITES

 https://ieeexplore.ieee.org/document/8390202
 ijarece.org/wp-content/uploads/2018/05/IJARECE-VOL-7-ISSUE-5-547-550.pdf

 https://www.instamojo.com/roshan17/matlab-project-with-source-code-leukemia-
blo/
 academicscience.co.in/admin/resources/project/paper/f201704061491451075.pdf

27

Anda mungkin juga menyukai