Open Ended Lab of Dip

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

DSP open ended lab

Submitted to:
Ma’am Ayesha Tariq
Submitted by:
Zainab Ashraf.
Roll no: 2025115040
Semester: VII
Subject: Digital image processing (DIP )
Session: (2020-2024)

(BE-VII)
Project name:
Breast Cancer Detection Using MATLAB
Section I
Objective………………………………………………………….….4
Breast cancer detection ……………………………………………...4
Research infield of cancer…………………………………….…...…4
Methodology………………………………………………….……...4
Pre-processing………………………………………………….…….5
Segmentation ……………………………………………….….….…5
Feature extraction ………………………………………….…….…..6
Section II
MATLAB code……..……………………………………………..7-10
Section III
Output ……..………………………………………………….…11-12
Conclusion …..………………………………………………..…….12
ABSTRACT
Image processing is a widely used methodology in various medical sectors. Image processing
involves performing some operations on images to extract some useful information. Image
analysis is very helpful in the early detection of various cancers in which time factor is very
crucial. The number of cases of breast cancer has increased worldwide. In this paper, breast
cancer disease detection and its subsequent treatment has been discussed. In the proposed
work, mammogram is important modality has been used to detect the tumorous portion more
accurately. The tumorous part from the resultant image has been separated by different
segmentation method such as edge detection and threshold method. Further different
operators have been applied on resultant image and its quantitatively verified by performance
measuring parameter entropy. The early detection of breast cancer can save life and make
treatment less complex for medical practitioners.
Keywords: Breast Cancer, Image Processing Techniques.
Section I
Objective
The primary objective of breast cancer detection using MATLAB in digital image processing
is to develop an automated and accurate system for early diagnosis. The goal is to leverage
advanced image processing techniques to enhance the efficiency and reliability of breast
cancer detection, minimizing false positives and false negatives. The system aims to provide
objective and quantitative assessments of suspicious regions within medical images,
optimizing the use of healthcare resources and facilitating timely interventions. Additionally,
the development includes a user-friendly interface within MATLAB, ensuring accessibility
for healthcare professionals and contributing to ongoing research by proposing novel
methods for improved breast cancer detection. Ultimately, the objective is to create a robust
and versatile tool that aids in early diagnosis, improving patient outcomes and overall public
health.
Breast Cancer Detection
Breast cancer is a disease in which the cells in the breast grow out of control. It is the most common
type of cancer in women worldwide and is one of the leading causes of death in women Breast cancer
is one of the leading causes of death in women worldwide. Effective diagnosis of breast cancer in the
early stages can reduce the associated morbidity and mortality and can provide a higher probability of
complete recovery. Computer-aided detection systems use computer technology to detect
abnormalities in clinical images that can help medical professionals make faster and more accurate
diagnoses. Breast cancer can start in different parts of the breast. The breast is an organ that sits on the
upper ribs and pectoral muscles. There is a left and a right breast, and each has mainly glands, ducts
and fatty tissue. In women, the breast forms and supplies milk to nourish newborns and infants. The
amount of fatty tissue in the breast determines the size of each breast .
Research In The Field Of Cancer
Many research has been done in the field of image processing to find the cancer. Yet, the accuracy
rate lies between 75% - 92%. Thus, there is still a gap of 8% to 25% of accuracy to be achieved. The
new research analysis and techniques to find the cancerous cells and eradication methodology to cure
the cancer from any person. However, even cancer cells have evolved them to hide from drugs and
medications. As cancer cells are immortal they are not affected by the immune system.
Methodology

Fig. 1: Flow of the System


Pre-Processing
Pre-processing is the first step that needs to be done in low-level image processing. Pre-processing is
done with the intention of improving the image data so that it can be used for further processing. In
this mammographic image, 2D matrices are selected and converted to grayscale. The interpretation of
the information provided by the image is then enhanced by image enhancement to provide better
inputs for other automated image processing techniques. These images are then filtered using noise
removal methods to increase pixel intensity. Various methods like wiener, median, gaussian etc. are
available for de noising.
This process involves the following steps:

 Input for this stage is a mammogram image which was converted into a grayscale image.
 Adaptive median filter is applied to the image to remove the noise from the image.
 Repeat the above steps for a data set that consists of several mammogram images.
 Output for this stage is also an image without noise.
On median filter, Gray-scale conversion is performed by using following MATLAB function:

Example :
Res = rgb2gray(input_image);

Median filter is applied by following MRes = medfilt2(input_image);


Image Segmentation
The image goes through thresholding process for the purpose of segmenting the ROI of the image. A
Global thresholding value can be applied to remove the unwanted part of the image and segment the
part with higher pixel density. Histogram can be used to check for pixel distribution. Thus, using
value from all these fields the best ROI of the image is acquired.
Partitioning an image into regions such that each region is homogeneous with respect to one or more
properties (such as brightness, color, texture, reflectivity, etc.). Common image segmentation methods are
thresholding, edge based segmentation, region based segmentation, clustering, classifier based segmentation
and deformable model based segmentation.

Feature Extraction
Many features have been extracted from the mammograph. Extraction of feature plays important role
in identifying disease. Feature extraction aims to reduce the number of features by creating new
features from existing one. In this output of the previous stage is passed to standard deviation filter.
As the standard deviation has capability of measuring the variations, it can be used in edge
sharpening, as level the brightness level changes at the edge of image by large value.
Standard deviation filter can be applied by using following function:
Res = stdfilt(input_image);

Section II
MATLAB Code for Breast cancer detection:
We used MATLAB software to implement the algorithm because MATLAB is a high-performance
language for education and research as it integrates computation, visualization and programming in an
easy-to-use environment where problems and solutions are expressed in familiar mathematical
notation and also it has toolbox’s for signal processing, neural network, image processing, database ...
etc., MATLAB Image Processing Toolbox is a collection of functions that extend the capability of the
MATLAB numeric computing environment. The toolbox supports a wide range of image processing
operations, such as Image analysis and enhancement. Region of interest operations, linear filtering and
filter design all the functions and equations used in this study are from MATLAB image processing
toolbox (MATLAB software).
i=imread('memo2.tif'); >>
figure(1)
>> imshow(i);
title('Original Photo')
% if image is rgb try
i=rgb2gray(i);
end %% Crop The Breast
z=im2bw(i,0.1); figure(2)
imshow(z);
title('Original B&W')
info=regionprops(z);
a=cat(1,info.Area); [m,l]=max(a);
X=info(l).Centroid;
bw2=bwselect(z,X(1),X(2),8);
i=immultiply(i,bw2); figure(3)
imshow(i);
title('Getting the Breast and Muscle')
%% Deleting Black Ground
% We will delete the black corners %
So that we can select the muscle
% using bwselect
% convert to B&W first time
[x,y]=size(z);
tst1=zeros(x,y); % detect
empty rows r1=[]; m=1;
for j=1:x if
z(j,:)==tst1(j,:)
r1(m)=j;
m=m+1;
end
%detectemptycolns
r2=[]; m=1;
for j=1:y if
z(:,j)==tst1(:,j)
r2(m)=j;
m=m+1; end
end % Deleting
i(:,r2)=[];
i(r1,:)=[]; figure(4)
imshow(i);
title('after deleting background');
%% Deleting the Muscle if i(1,1)~=0
c=3; r=3; else r=3; c=size(i,2)-3;
end
z2=im2bw(i,0.5);
bw3=bwselect(z2,c,r,8);
bw3=~bw3;
ratio=min(sum(bw3)/sum(z2)); if ratio>=1
i=immultiply(i,bw3);
else z2=im2bw(i,0.75);
bw3=bwselect(z2,c,r,8);
ratio2=min(sum(bw3)/sum(z2));
if round(ratio2)==0
lvl=graythresh(i);
z2=im2bw(i,1.75*lvl);
bw3=bwselect(z2,c,r,8);
bw3=~bw3;
i=immultiply(i,bw3); else
bw3=~bw3;
i=immultiply(i,bw3); end
end figure(5) imshow(i)
title('Getting only the Breast')

%% Weiner Filter
% We will create average mask
[3 3] % with SNR = 0.2
mask=fspecial('average',[3 3]);
SNR=0.2;
i=deconvwnr(i,mask,SNR);
figure(6) imshow(i)
title('Weiner
Filter') %% Clahe
Filter
i=adapthisteq(i);
figure(7)
imshow(i)
title('Clahe Filter')

MATLAB code :
Section III
Output:
Conclusion:
On processing mammography images using MALAB functions. The pre-processing
techniques removes the unwanted noise and enhance the quality of the image by applying
various filtering techniques. Binary filter and edge detection identifies the boundaries of the
image and separates the background pixels under the segmentation. Then segmented image is
passed through standard deviation filter for edge sharpening and then through feature
extraction for extracting the Region of Interest (ROI) by applying threshold value. The
resulting images gathered from this process can be helpful for physician in breast cancer
diagnosis and monitor the treatment process.
Plagiarism Repot of open-ended lab:

You might also like