Your AD CODE HERE

Post Reply 
 
Thread Rating:
  • 5 Votes - 4.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mammogram classification by using Matlab code
09-27-2011, 01:11 AM
Post: #31
Your Google Ad Here
RE: Mammogram classification by using Matlab code
(09-25-2011 11:26 PM)admin Wrote:  Seems OK to me. Now rather than waiting for @expert.here why dont you @expert.here check the result with nearest Neighbor classifier.

Now your

F1=F(1:N,Smile % where N is number of Normal Images
F2=F(N+1:1:size(F,1),Smile;

% test image feature is ftest
sn=0; % sum of a test image from all the database normal images
for(i=1:1:size(F1,1))
s=abs(F1(i)-ftest);
sn=sn+s;
end

similarly sa is sum of abnormal images

if(sa>sn)
disp('Abnormal')
else
disp('Normal')
end

------------------------------------------------------------
This will complete your project roughly. You can simply replace this program by name say TestNN.m with svm.
Alternatively you can also present the comparision between the two. That would be a better Project then.
Sorry for the late reply.

I have a question. I'm not sure what to do with these 'sn' and 'sa'. Am I need to sum all the test images features for both normal and abnormal?
n=0; %sn is sum of a test image from all the database normal images
for i=1:1: size(f1,1)
s=abs(f1(i)-ftest); % ftest is test image feature
sn=sn+s;
end
sa=0; % sa is sum of a test image from all the database abnormal images
for i=1:1: size(f2,1)
s=abs(f2(i)-ftest); % ftest is test image feature
sa=sa+s;
end

For example:
ftest 1 = [1991.40934395218 13088.4015544617]
ftest 2 = [2201.69339829686 13136.2708087613]

After that sum it as sn value? And also same with sa?

Thank you.

Find all posts by this user
Quote this message in a reply
   

09-27-2011, 01:29 AM
Post: #32
Your Google Ad Here
RE: Mammogram classification by using Matlab code
Very Good Question.

Quote: sn=0; % sum of a test image from all the database normal images
Quote: similarly sa is sum of abnormal images
if the total distance of the test features is closer to the normal image features, test Is normal.
Else Abnormal


Don't be shy to share what you know! Knowledge grows that way!
[Image: wink.gif]
Help Us to Help You better Read More
[Image: wink.gif]
Find all posts by this user
Quote this message in a reply
   

09-27-2011, 02:33 AM (This post was last modified: 09-27-2011 02:36 AM by oooivanooo.)
Post: #33
Your Google Ad Here
RE: Mammogram classification by using Matlab code
(09-25-2011 11:26 PM)admin Wrote:  Seems OK to me. Now rather than waiting for @expert.here why dont you @expert.here check the result with nearest Neighbor classifier.

Now your

F1=F(1:N,Smile % where N is number of Normal Images
F2=F(N+1:1:size(F,1),Smile;

% test image feature is ftest
sn=0; % sum of a test image from all the database normal images
for(i=1:1:size(F1,1))
s=abs(F1(i)-ftest);
sn=sn+s;
end

similarly sa is sum of abnormal images

if(sa>sn)
disp('Abnormal')
else
disp('Normal')
end

------------------------------------------------------------
This will complete your project roughly. You can simply replace this program by name say TestNN.m with svm.
Alternatively you can also present the comparision between the two. That would be a better Project then.





Sorry for late reply.
Below are the code I edited, is it correct?

Code MATLAB :
N = 10; % where N is number of abnormal Images
f1=F(1:N,: );
f2=F(N+1:1:{FNAMEL}.html">size(F,1),: );
 
for i=1:1: {FNAMEL}.html">size(tF,1) % tF is a test images, 10 for normal and 10 form abnormal
sa=0;
sn=0; % sn is sum of a test image from all the database normal images

for j=1:1: {FNAMEL}.html">size(f1,1)
s={FNAMEL}.html">abs(f1(j)-tF(i));
sn=sn+s;
end %sa=0; % sa is sum of a test image from all the database abnormal images
 
for j=1:1: {FNAMEL}.html">size(f2,1)
s={FNAMEL}.html">abs(f2(j)-tF(i));
sa=sa+s;
end
 
if(sa>sn)
{FNAMEL}.html">disp('Abnormal')
else
{FNAMEL}.html">disp('Normal')
end
end


And this is the result: 55% accuracy
   

I have a question, why everytime I runs the code to get feature for the image, it will return different value for mean and std deviation?
       
Thank you.

Find all posts by this user
Quote this message in a reply
   

09-27-2011, 03:47 AM
Post: #34
Your Google Ad Here
RE: Mammogram classification by using Matlab code
You got the result that was expected. Now improve the features to get the same accuracy above 60%.


use fft of the image. consider the real part,and take mean, standard deviation. you will see a difference in accuracy.


Don't be shy to share what you know! Knowledge grows that way!
[Image: wink.gif]
Help Us to Help You better Read More
[Image: wink.gif]
Find all posts by this user
Quote this message in a reply
   

09-28-2011, 02:07 PM
Post: #35
Your Google Ad Here
2 class SVM Code for Mammogram Classification
Code MATLAB :
 
svmStruct = svmtrain(T,newClass,'showplot',true,'Kernel_Function','polynomial','Polyorder',2);
% T is the train vectors. Here you must replace T with F.
% newClass is C in your case. C should be a Nx1 matrix containing 0 and 1
% F should be NxP matrix where P is number of features
result_class = svmclassify(svmStruct,tst,'showplot',true);
 
% where tst is the test feature.
 
if (result_class==0)
{FNAMEL}.html">disp('Normal')
else
{FNAMEL}.html">disp('abnormal')
end
%where 0 and 1 depends upon how you have conceived normal and abnormal classes
 
 
 

Find all posts by this user
Quote this message in a reply
   

09-29-2011, 01:22 AM
Post: #36
Your Google Ad Here
RE: 2 class SVM Code for Mammogram Classification
(09-28-2011 02:07 PM)expert.here Wrote:  
Code MATLAB :
 
svmStruct = svmtrain(T,newClass,'showplot',true,'Kernel_Function','polynomial','Polyorder',2);
% T is the train vectors. Here you must replace T with F.
% newClass is C in your case. C should be a Nx1 matrix containing 0 and 1
% F should be NxP matrix where P is number of features
result_class = svmclassify(svmStruct,tst,'showplot',true);
 
% where tst is the test feature.
 
if (result_class==0)
{FNAMEL}.html">disp('Normal')
else
{FNAMEL}.html">disp('abnormal')
end
%where 0 and 1 depends upon how you have conceived normal and abnormal classes
 
 
 
Thank you. I will try on it to get more accurate result Smile

Find all posts by this user
Quote this message in a reply
   

10-02-2011, 12:17 PM
Post: #37
Your Google Ad Here
RE: 2 class SVM Code for Mammogram Classification
(09-28-2011 02:07 PM)expert.here Wrote:  
Code MATLAB :
 
svmStruct = svmtrain(T,newClass,'showplot',true,'Kernel_Function','polynomial','Polyorder',2);
% T is the train vectors. Here you must replace T with F.
% newClass is C in your case. C should be a Nx1 matrix containing 0 and 1
% F should be NxP matrix where P is number of features
result_class = svmclassify(svmStruct,tst,'showplot',true);
 
% where tst is the test feature.
 
if (result_class==0)
{FNAMEL}.html">disp('Normal')
else
{FNAMEL}.html">disp('abnormal')
end
%where 0 and 1 depends upon how you have conceived normal and abnormal classes
 
 
 

Hi all
I get the output error msg below:
??? Error using ==> svmtrain
Too many input arguments.
Error in ==> svmtrain at 6
svmStruct = svmtrain(F, C, 'showplot', true, 'Kernel_Function', 'polynomial', 'Polyorder', 2);
Error in ==> Main at 19
svmStruct = svmtrain(F, C);
What is the problem? Thank you.

Find all posts by this user
Quote this message in a reply
   

10-02-2011, 12:41 PM
Post: #38
Your Google Ad Here
RE: Mammogram classification by using Matlab code
put snapshot of T and newClass. seems a small problem!


Don't be shy to share what you know! Knowledge grows that way!
[Image: wink.gif]
Help Us to Help You better Read More
[Image: wink.gif]
Find all posts by this user
Quote this message in a reply
   

10-02-2011, 01:40 PM
Post: #39
Your Google Ad Here
RE: Mammogram classification by using Matlab code
(10-02-2011 12:41 PM)admin Wrote:  put snapshot of T and newClass. seems a small problem!
       
Thank you.

Find all posts by this user
Quote this message in a reply
   

10-02-2011, 02:05 PM
Post: #40
Your Google Ad Here
RE: Mammogram classification by using Matlab code
try with this

svmStruct = svmtrain(T,newClass,'showplot',true); instead of above svm train command


Don't be shy to share what you know! Knowledge grows that way!
[Image: wink.gif]
Help Us to Help You better Read More
[Image: wink.gif]
Find all posts by this user
Quote this message in a reply
   

Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Image source or Camera identification using MATLAB for Cannon and Nikkon DSLR Camera jithin 19 6,573 07-16-2018 03:28 PM
Last Post: ninest123
  Help: Pectoral Muscle removal from Mammogram by using Matlab oooivanooo 29 17,964 07-16-2018 03:15 PM
Last Post: ninest123
Lightbulb ECG Classification using artificial immune system roza 33 14,002 06-30-2018 05:32 PM
Last Post: ninest123
  set threshold for histogram comparison in matlab preethiraj 2 2,367 05-17-2018 07:22 PM
Last Post: ninest123
  Breast Skin-Line Estimation in Mammogram using Matlab hieuiph 2 2,012 05-17-2018 05:43 PM
Last Post: ninest123
  mini-Mias Mammogram database lesion extraction amithbhaskar 0 965 06-17-2015 01:07 PM
Last Post: amithbhaskar
  Classification of mammograms using Chebyshev moment Kamaleshforyou 6 4,096 10-29-2014 01:56 AM
Last Post: sara736
  classification of mammogram images using svm daya 2 5,483 06-14-2014 11:08 AM
Last Post: linzhenhua21
Question Matlab Loop Amira 7 3,069 06-15-2012 02:02 PM
Last Post: Rupam
  differnce between images in matlab preethiraj 3 4,917 05-24-2012 09:18 AM
Last Post: expert.here

Forum Jump:


User(s) browsing this thread: 1 Guest(s)