Mammography Image Feature extraction

7 views (last 30 days)
Mohamed Ahmed
Mohamed Ahmed on 26 Jul 2017
Answered: AHT.fatima on 12 May 2022
I'm trying to extract texture features of a tumor (ROI) for mammography classification.
The features I'm trying GLCM features. I tried two codes, but the results of classification is not good. The classifiers are working with other mammography data, so the problem is the extracted features.
So, i need to know what is wrong through these steps?
The first code i tried is the code in this link:
and called the function by the following:
GLCM = graycomatrix(ROI,'Offset',[0 1;-1 1;-1 0;-1 -1]);
[stats,feat] = GLCM_Features1(GLCM,0);
GLCM_Diff_Cal1(l,:)=feat;
Another code I tried is:
GLCM = graycomatrix(ROI,'Offset',[0 1;-1 1;-1 0;-1 -1]);
stats=graycoprops(GLCM2,{'Contrast','Homogeneity','Correlation','Energy'});
contrast=(stats.Contrast);
en=(stats.Energy);
co=(stats.Correlation);
hom=(stats.Homogeneity);
m=mean(mean(ROI));
s=std2((ROI));
f1=[m s hom co en contrast];
J2=SegmentedROI;
I=J2;
J2 = uint8(255 * mat2gray(J2));
J3=edge(J2,'log');
bw=bwareaopen(J2,150);
bwp=edge(bw,'sobel');
geometric.area=sum(sum(bw));
geometric.peri=sum(sum(bwp));
geometric.compact=geometric.peri^2/geometric.area;
count=1;
roih=0;
for i=1:size(bw,1);
for j=1:size(bw,2);
if bw(i,j)
roih(count,1)=double(SegI(i,j));
count=count+1;
end
end
end
nh=roih/geometric.area;
texture.mean=mean(roih);
texture.globalmean=texture.mean/mean(mean(double(I)));
texture.std=std(roih);
texture.smoothness=1/(1+texture.std^2);
texture.uniformity=sum(nh.^2);
texture.entropy=sum(nh.*log10(nh));
texture.skewness=skewness(roih);
texture.correlation=sum(nh'*roih)-texture.mean/texture.std;
x1=[];
y1=[];
z1=[];
[gradI3, Gdir] = imgradient(I,'sobel');
gradJ3=medfilt2(gradI3);
gradJ2=uint8(255 * mat2gray(gradJ3));
gradJ3=edge(gradJ2,'log');
gradbw=bwareaopen(gradJ2,250);
gradbwp=edge(gradbw,'sobel');
count=1;
for i=1:size(gradbw,1);
for j=1:size(gradbw,2);
if gradbw(i,j)
gradroih(count,1)=double(gradI3(i,j));
count=count+1;
end
end
end
gradroih(gradroih==0)=[];
gradnh=gradroih/geometric.area;
gradient.mean=mean(gradroih);
gradient.globalmean=texture.mean/mean(mean(double(gradI3)));
gradient.std=std(roih);
gradient.smoothness=1/(1+gradient.std^2);
gradient.uniformity=sum(gradnh.^2);
gradient.entropy=sum(gradnh.*log10(gradnh));
gradient.skewness=skewness(gradroih);
gradient.correlation=sum(gradnh'*gradroih)-gradient.mean/gradient.std;
geometric
texture
gradient
xy=[geometric.area,geometric.peri,geometric.compact];
x1=[x1;xy];
yy=[texture.mean,texture.globalmean,texture.std,texture.smoothness,texture.uniformity,...
texture.entropy,texture.skewness,texture.correlation];
y1=[y1;yy];
zy=[gradient.mean,gradient.globalmean,gradient.std,gradient.smoothness,gradient.uniformity,...
gradient.entropy,gradient.skewness,gradient.correlation];
z1=[z1;zy];
f2=[x1 y1 z1];
  4 Comments
Ali Zulfikaroglu
Ali Zulfikaroglu on 18 Jan 2021
Hi I am stuying same subject. I am using some feature extraction codes too. Resemble yours.
But my ANN classification results is so bad . Can you help me if you find how to solve it
Thank you from now.
AHT.fatima
AHT.fatima on 12 May 2022
Hi I am stuying same subject. Can you please share the code for pectoral muscle removal from the image please. It would be of great help to me.

Sign in to comment.

Answers (1)

AHT.fatima
AHT.fatima on 12 May 2022
Hi I am stuying same subject. Can you please share the code for pectoral muscle removal from the image please. It would be of great help to me

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!