GithubHelp home page GithubHelp logo

izarrios / image-segmentation-with-clustering Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nourheshamshaheen/image-segmentation-with-clustering

1.0 0.0 0.0 109.53 MB

Shell 0.01% C++ 0.40% C 0.02% MATLAB 0.07% Jupyter Notebook 99.51%

image-segmentation-with-clustering's Introduction

Image Segmentation with Clustering

This repository explores the suitability of clustering methods for the task of image segmentation on the BSR dataset.

Problem Statement

We intend to perform image segmentation. Image segmentation means that we can group similar pixels together and give these grouped pixels the same label. The grouping problem is a clustering problem. We want to study the use of K-means on the Berkeley Segmentation Benchmark. Below we will show the needed steps to achieve this goal.

1. Download the Dataset and Understand the Format

We will use Berkeley Segmentation Benchmark. The data is available at the following link.

http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/BSR/BSR_bsds500.tgz.

The dataset has 500 images. The test set is 200 images only. We will report our results on the first 50 images of the test set only.

2. Visualize the image and the ground truth segmentation

We wrote our own function that reads an image and display an image with its associated ground truth segmentation(s).

3. Segmentation using K-means

Every image pixel is a feature vector of 3-dimension {R, G, B}. We used this feature representation to do the segmentation. We changed the K of the K-means algorithm between {3,5,7,9,11} clusters.

We implemented the Kmeans algorithm as well as compared it with the SKlearn Kmeans function.

We evaluated the result segmentation using F-measure, Conditional Entropy for image I with M available ground-truth

4. Big Picture

We selected a set of five images and displayed their corresponding ground truth against our segmentation results using K-means at K=5.

We then implemented an Normalized-cut algorithm with a similarity matrix built using the 5-Nearest Neighbours graph at K=5, and compared our results with both the Ground Truth segmentations and the Kmeans predictions.

5. Extra

In the previous parts, we used the color features RGB. We did not encode the layout of the pixels. We want to modify that for K-means clustering to encode the spatial layout of the pixels. We added two features to the RGB image: x and y positions.

6. Check our report!

A report detailing our background research as well as our work exists in the repo!

image-segmentation-with-clustering's People

Contributors

izarrios avatar nourheshamshaheen avatar

Stargazers

 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.