Giter Site home page Giter Site logo

jgera / aco-image-segmentation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cptanalatriste/aco-image-segmentation

0.0 2.0 0.0 1.13 MB

Image Segmentation using Ant Colony algorithms.

Home Page: http://cptanalatriste.github.io/isula/

Java 100.00%

aco-image-segmentation's Introduction

aco-image-segmentation

A Java Program to identify segments on an image using an Ant Colony optimization algorithm. It is a two-phase procedure:

The Ant-Colony Algorithm

The Ant Colony algorithm used to extract segments of the image is based on Max-Min Ant System, as was proposed by Salima Ouadfel in the paper "Unsupervised image segmentation using a colony of cooperating ants". To implement it, we used the Isula Framework:

    ConfigurationProvider configurationProvider = ProblemConfiguration
        .getInstance();
    EnvironmentForImageSegmentation environment = new EnvironmentForImageSegmentation(
        imageGraph, ProblemConfiguration.getInstance().getNumberOfClusters());

    ImageSegmentationAntColony antColony = new ImageSegmentationAntColony(
        configurationProvider.getNumberOfAnts(),
        environment.getNumberOfClusters());
    antColony.buildColony(environment);

    problemSolver = new AcoProblemSolver<ClusteredPixel>();

    problemSolver.setConfigurationProvider(configurationProvider);
    problemSolver.setEnvironment(environment);
    problemSolver.setAntColony(antColony);

    problemSolver.addDaemonActions(
        new StartPheromoneMatrixForMaxMin<ClusteredPixel>(),
        new ImageSegmentationUpdatePheromoneMatrix());
    antColony.addAntPolicies(new ImageSegmentationNodeSelection());

    problemSolver.solveProblem();
    ClusteredPixel[] bestPartition = problemSolver.getBestSolution();

The implemented process has the following characteristics:

  • The components of the solution are Clustered Pixels, that is, each pixel of the image will be assigned to one of three clusters.
  • The Ant class avaible in Isula was extended to support this image clustering class. The ants for this problems have memory of the current position in the image, as well as a Map for Cluster storage. Since the calculation of the Solution Quality is expensive, it was also added as an instance variable.
  • These Ants are built so they only consider Cerebrum pixels. That information was provided but the previous binary thresholding algorithm.
  • The Max-Min Ant System policies available in Isula were reused with minor customization. This includes pheromone update and node selection.

The results

We use an MR Brain image as an input. This was provided by the BrainWeb Database: http://brainweb.bic.mni.mcgill.ca/brainweb/

Original Image

The program extracts three segments from the image: Brain Matter, White Matter and CLF. Here's the segment corresponding to the Grey Matter:

Segments

How to use this code

The code uploaded to this GitHub Repository corresponds to a Java Project developed on the Eclipse IDE. You should be able to import it as an existing project to your current workspace.

This project depends on the Isula Framework. You need to download first the Isula Framework Project available on this Github Repository: https://github.com/cptanalatriste/isula

This project also depends on an ACO-based procedure for image thresholding. The aco-image-thresholding project that contains it is available on this Github Repository: https://github.com/cptanalatriste/aco-image-thresholding

Keep in mind that several file and folder locations were configured on the ProblemConfiguration.java file. You need to set values according to your environment in order to avoid a FileNotFoundException.

More about Isula

Visit the Isula Framework site: http://cptanalatriste.github.io/isula/

Review the Isula JavaDoc: http://cptanalatriste.github.io/isula/doc/

Questions, issues or support?

Feel free to contact me at [email protected].

aco-image-segmentation's People

Contributors

cptanalatriste avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.