home Forums Media: Applications, Publications, Videos, Links and Examples Fuzzy Inference Systems in image processing

This topic contains 5 replies, has 4 voices, and was last updated by  MSub93 1 year, 8 months ago.

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1040

    bodnaar
    Participant

    I’ve only found this page about a week ago, so I don’t have public projects using fuzzylite yet, however, I’d like to encourage every reader to use fuzzy logic in their area of interest, if possible.

    I’m currently a PhD student and my area of interest is image processing, feature extraction, pattern and object recognition and classification. I just made some experiments using a Fuzzy Inference System (FIS) for a feature extraction task, and preliminary results are very promising. I wouldn’t like to go into details as long as a publication of the task is not assembled and reviewed in a conference, however, I’d like to tell FIS seems to be efficient so far. There are many humanly observeable features of object or textures in the image domain that can be expressed using fuzzy membership functions, and rule-based decisions are perfectly suitable for classification of images or image parts.

    Juan: I’d also like to ask a question, since I’ve read in your CV that you are an expert of AI. Have you ever used/thought about using neuro-fuzzy implementations, or any hybrid solutions where a FIS is not only designed by human knowledge base, but they are reinforced by machine learning? The strength of rules and the parameters of membership functions can be optimized, maybe even the number and shape of memberships and the rules themselves. So my question is, have you ever worked with hybrid solutions like that? If so, please let me know by giving literature or anything about how ML and FIS can be efficiently bound together. Thank you in advance.

    #1042
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Hi bodnaar,

    thank you for your post.

    I remember I did some experiments with hybrids between fuzzy controllers and evolutionary algorithms. I used Particle Swarm Optimization to evolve the set of rules of a fuzzy logic controller for classification of datasets. I do not have any literature to refer you to, but I remember I used both Michigan and Pittsburgh approaches to evolve and optimize the fuzzy rules of the controller.

    #1800

    MSub93
    Participant

    Good day Juan,

    I would like to appreciate your efforts in coming up with fuzzylite. It is in indeed a very powerful tool that has is its scope in establishing an ease of implementation of fuzzy logic on image processing. I have been trying to utilize it to implement fuzzy edge detection algorithms. However, I have rather faced one issue and that is the use of engine->process() instruction inside a loop parsing the image coordinates and taking the pixel values at (j,i) as the input to two fuzzy variables. The loop does work but even for a small region of interest, it takes considerably long time.

    Here is the code block I am using:

    for(int i = 50; i ++; 300;i++)
    {
    for(int j = 50; j ++; 300;j++)
    {
    engine->setInputValue(“Ix”,Ix_result.at<uchar>(j,i));
    engine->setInputValue(“Iy”,Iy_result.at<uchar>(j,i));
    engine->process();

    fuzzy_result.at<uchar>;(j,i) = (uchar)Io->getOutputValue();
    }

    }

    It takes long to finish. Is there any mistake in the way I am looping the engine process or is there any other problem at hand? to Any alternatives to it..? Regards.

    PS: I am using openCVv2.0 and I am using only two rules to run my FIS. Thanks.

    #1801
    Juan Rada-Vilela
    Juan Rada-Vilela
    Keymaster

    Hi,

    thank you for your kind words and your post.

    Could you please export your engine in FLL and post it? One way to improve processing time is by reducing the resolution of the IntegralDefuzzifier, the default is 300 (I think), but this could be further reduced (sacrificing accuracy). If you are using a WeightedDefuzzifier, you should set its type to TakagiSugeno to improve performance.

    Oh, you should definitely change the way you are setting the input values. You should get the variables outside the loops and set their values inside:

    InputVariable* lx = engine->getInputVariable("lx");
    InputVariable* ly = engine->getInputVariable("ly");
    for ...:
      for ...:
        scalar value = lx_result.at(j,i);
        lx->setInputValue(value);
        ly->setInputValue(value);
        engine->process();
    

    Also, what data structure is fuzzy_result? you should avoid linked-list-based data structures, but rather use random-access-list structures like std::vector.

    Cheers,

    Juan

    #1847

    syara
    Participant

    Hye, have a good day.

    currently i am building a system based on fuzzy logic in matlab with GUI. but i am facing a problem on creating the fis in M file format. would you like show me some examples or show me what is wrong on my fis in m file format. i do really hope you can help me. thanks.

    %create new FIS
    a = newfis(‘5152′);

    %add input 1
    a= addvar(a, ‘input’, ‘Penyeliaan’, [0 45]);
    a= addmf(a,’input’,1,’Memuaskan’,’trimf’,[-18 0 18]);
    a= addmf(a,’input’,1,’Baik’,’trimf’,[4.5 22.5 40.5]);
    a= addmf(a,’input’,1,’Cemerlang’,’trimf’,[27 45 63]);

    a= rmmf(a,’input’,1,’mf’,1);
    a= rmmf(a,’input’,1,’mf’,1);
    a= rmmf(a,’input’,1,’mf’,1);

    %add input 2
    a= addvar(a, ‘input’, ‘Penerbitan’, [0 10]);
    a= addmf(a,’input’,2,’Memuaskan’,’trimf’,[-4 0 4]);
    a= addmf(a,’input’,2,’Baik’,’trimf’,[1 5 9]);
    a= addmf(a,’input’,2,’Cemerlang’,’trimf’,[6 10 14]);

    a= rmmf(a,’input’,2,’mf’,1);
    a= rmmf(a,’input’,2,’mf’,1);
    a= rmmf(a,’input’,2,’mf’,1);

    %add input 3
    a= addvar(a,’input’, ‘Perundingan’, [0 2]);
    a= addmf(a,’input’,3,’Tidak_Aktif’,’gaussmf’,[0.85 0.002167]);
    a= addmf(a,’input’,3,’Aktif’,’gaussmf’,[0.8494 2]);

    a= rmmf(a,’input’,3,’mf’,1);
    a= rmmf(a,’input’,3,’mf’,1);

    %add input 4
    a= addvar(a, ‘input’, ‘KhidmatMasyarakat’, [0 3]);
    a= addmf(a,’input’,4,’Tidak_Aktif’,’trimf’,[-1.2 0 1.2]);
    a= addmf(a,’input’,4,’Kurang_Aktif’,’trimf’,[0.3 1.5 2.7]);
    a= addmf(a,’input’,4,’Aktif’,’trimf’,[1.8 3 4.2]);

    a= rmmf(a,’input’,4,’mf’,1);
    a= rmmf(a,’input’,4,’mf’,1);
    a= rmmf(a,’input’,4,’mf’,1);

    %add input 5
    a= addvar(a, ‘input’, ‘Penyelidikan’, [0 15]);
    a= addmf(a,’input’,5,’Kurang_Memuaskan’,’trimf’,[-3.75 -4.164e-17 3.75]);
    a= addmf(a,’input’,5,’Memuaskan’,’trimf’,[0 3.75 7.5]);
    a= addmf(a,’input’,5,’Baik’,’trimf’,[3.75 7.5 11.25]);
    a= addmf(a,’input’,5,’Cemerlang’,’trimf’,[7.5 11.25 15]);
    a= addmf(a,’input’,5,’Sangat_Cemerlang’,’trimf’,[11.25 15 18.75]);

    a= rmmf(a,’input’,5,’mf’,1);
    a= rmmf(a,’input’,5,’mf’,1);
    a= rmmf(a,’input’,5,’mf’,1);
    a= rmmf(a,’input’,5,’mf’,1);
    a= rmmf(a,’input’,5,’mf’,1);

    %add input 6
    a= addvar(a, ‘input’, ‘Pengajaran’, [0 20]);
    a= addmf(a,’input’,6,’Perlukan_Pemantauan’,’trimf’,[-5 0 5]);
    a= addmf(a,’input’,6,’Kurang_Memuaskan’,’trimf’,[0 5 10]);
    a= addmf(a,’input’,6,’Memuaskan’,’trimf’,[5 10 15]);
    a= addmf(a,’input’,6,’Baik’,’trimf’,[10 15 20]);
    a= addmf(a,’input’,6,’Sangat_Baik’,’trimf’,[14.98 19.98 24.98]);

    a= rmmf(a,’input’,6,’mf’,1);
    a= rmmf(a,’input’,6,’mf’,1);
    a= rmmf(a,’input’,6,’mf’,1);
    a= rmmf(a,’input’,6,’mf’,1);
    a= rmmf(a,’input’,6,’mf’,1);

    %add input 7
    a= addvar(a, ‘input’, ‘SanjunganDanKepimpinanAkademik’, [0 2]);
    a= addmf(a,’input’,7,’Tidak_Aktif’,’gaussmf’,[0.8494 0]);
    a= addmf(a,’input’,7,’Aktif’,’gaussmf’,[0.8494 2]);

    a= rmmf(a,’input’,7,’mf’,1);
    a= rmmf(a,’input’,7,’mf’,1);

    %add input 8
    a= addvar(a, ‘input’, ‘KhidmatUniversiti’, [0 3]);
    a= addmf(a,’input’,8,’Tidak_Aktif’,’trimf’,[-1.2 0 1.2]);
    a= addmf(a,’input’,8,’Kurang_Aktif’,’trimf’,[0.3 1.5 2.7]);
    a= addmf(a,’input’,8,’Aktif’,’trimf’,[1.8 3 4.2]);

    a= rmmf(a,’input’,8,’mf’,1);
    a= rmmf(a,’input’,8,’mf’,1);
    a= rmmf(a,’input’,8,’mf’,1);

    %add output
    a=addvar(a,’output’,’Keputusan_Kelayakan’,[0 100]);
    a=addmf(a,’output’,1,’Tidak_Layak’,’trimf’,[-50 -4.441e-16 50]);
    a=addmf(a,’output’,1,’Dalam_Pemerhatian’,’trimf’,[0 50 100]);
    a=addmf(a,’output’,1,’Layak’,’trimf’,[50 100 150]);

    a=rmmf(a,’output’,1,’mf’,1);
    a=rmmf(a,’output’,1,’mf’,1);
    a=rmmf(a,’output’,1,’mf’,1);

    %construct rules
    ruleList = [1 1 1 1 1 1 1 1 ; 1 1 1 1 2 2 1 1 ; 2 2 2 2 3 3 2 2 ; 3 3 2 3 4 4 2 3 ; 3 3 2 3 5 5 2 3 ] ;
    a= addrule(a,ruleList);

    %show fis structure
    showfis(a);
    plotfis(a);

    %visualize membership function
    figure,plotmf(a,’input’,1);
    figure,plotmf(a,’output’,1);

    %visualize surface relationship
    gensurf(a);

    #1848

    MSub93
    Participant

    I apologize for the very late reply Juan, I got the code running faster by reducing the IntegralDefuzzifier as you told but to maintain a certain level of accuracy , the resolution I have set still takes about 10 to 15 secs. I believe I am not using the library api’s well. I’ll send you my code on your email jcrada@fuzzylite.com. Please let me know of the code blocks that have to be improved.

    Thanks for your prompt reply earlier,
    Regards.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.