Clustering Color/Intensity

Slides:



Advertisements
Similar presentations
Filling Algorithms Pixelwise MRFsChaos Mosaics Patch segments are pasted, overlapping, across the image. Then either: Ambiguities are removed by smoothing.
Advertisements

Unsupervised Learning Clustering K-Means. Recall: Key Components of Intelligent Agents Representation Language: Graph, Bayes Nets, Linear functions Inference.
Histogram Analysis to Choose the Number of Clusters for K Means By: Matthew Fawcett Dept. of Computer Science and Engineering University of South Carolina.
K-means clustering Hongning Wang
Machine Learning and Data Mining Clustering
Discrete geometry Lecture 2 1 © Alexander & Michael Bronstein
Lecture 6 Image Segmentation
Clustering II.
EE 7730 Image Segmentation.
Announcements Quiz solutions on the web page. Problem Set 5 on the web page. Due Thursday, April 1. Results from Problem Set 4.
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
Image Segmentation Chapter 14, David A. Forsyth and Jean Ponce, “Computer Vision: A Modern Approach”.
Segmentation and Clustering. Segmentation: Divide image into regions of similar contentsSegmentation: Divide image into regions of similar contents Clustering:
Motion Analysis (contd.) Slides are from RPI Registration Class.
Segmentation CSE P 576 Larry Zitnick Many slides courtesy of Steve Seitz.
Problem Sets Problem Set 3 –Distributed Tuesday, 3/18. –Due Thursday, 4/3 Problem Set 4 –Distributed Tuesday, 4/1 –Due Tuesday, 4/15. Probably a total.
Segmentation Divide the image into segments. Each segment:
Clustering.
Lecture 4 Unsupervised Learning Clustering & Dimensionality Reduction
Segmentation and Clustering. Déjà Vu? Q: Haven’t we already seen this with snakes?Q: Haven’t we already seen this with snakes? A: no, that was about boundaries,
Unsupervised Learning
What is Cluster Analysis?
K-means Clustering. What is clustering? Why would we want to cluster? How would you determine clusters? How can you do this efficiently?
Clustering and greedy algorithms Prof. Noah Snavely CS1114
Clustering Unsupervised learning Generating “classes”
Tal Mor  Create an automatic system that given an image of a room and a color, will color the room walls  Maintaining the original texture.
Image Segmentation Image segmentation is the operation of partitioning an image into a collection of connected sets of pixels. 1. into regions, which usually.
Computer Vision James Hays, Brown
CSE 185 Introduction to Computer Vision Pattern Recognition.
Region Segmentation Readings: Chapter 10: 10.1 Additional Materials Provided K-means Clustering (text) EM Clustering (paper) Graph Partitioning (text)
COMMON EVALUATION FINAL PROJECT Vira Oleksyuk ECE 8110: Introduction to machine Learning and Pattern Recognition.
CSC321: Neural Networks Lecture 12: Clustering Geoffrey Hinton.
CSE 185 Introduction to Computer Vision Pattern Recognition 2.
START OF DAY 8 Reading: Chap. 14. Midterm Go over questions General issues only Specific issues: visit with me Regrading may make your grade go up OR.
1 Motivation Web query is usually two or three words long. –Prone to ambiguity –Example “keyboard” –Input device of computer –Musical instruments How can.
Image segmentation Prof. Noah Snavely CS1114
EECS 274 Computer Vision Segmentation by Clustering II.
MACHINE LEARNING 8. Clustering. Motivation Based on E ALPAYDIN 2004 Introduction to Machine Learning © The MIT Press (V1.1) 2  Classification problem:
CS654: Digital Image Analysis
Mixture of Gaussians This is a probability distribution for random variables or N-D vectors such as… –intensity of an object in a gray scale image –color.
Lecture 6 Spring 2010 Dr. Jianjun Hu CSCE883 Machine Learning.
CS 8751 ML & KDDData Clustering1 Clustering Unsupervised learning Generating “classes” Distance/similarity measures Agglomerative methods Divisive methods.
CSSE463: Image Recognition Day 23 Midterm behind us… Midterm behind us… Foundations of Image Recognition completed! Foundations of Image Recognition completed!
Machine Learning Queens College Lecture 7: Clustering.
Compiled By: Raj Gaurang Tiwari Assistant Professor SRMGPC, Lucknow Unsupervised Learning.
Flat clustering approaches
Chapter 13 (Prototype Methods and Nearest-Neighbors )
Clustering (1) Chapter 7. Outline Introduction Clustering Strategies The Curse of Dimensionality Hierarchical k-means.
CZ5211 Topics in Computational Biology Lecture 4: Clustering Analysis for Microarray Data II Prof. Chen Yu Zong Tel:
Photoconsistency constraint C2 q C1 p l = 2 l = 3 Depth labels If this 3D point is visible in both cameras, pixels p and q should have similar intensities.
Color Image Segmentation Mentor : Dr. Rajeev Srivastava Students: Achit Kumar Ojha Aseem Kumar Akshay Tyagi.
May 2003 SUT Color image segmentation – an innovative approach Amin Fazel May 2003 Sharif University of Technology Course Presentation base on a paper.
Machine Learning and Data Mining Clustering
CSSE463: Image Recognition Day 21
Clustering and Segmentation
Classification of unlabeled data:
Clustering (3) Center-based algorithms Fuzzy k-means
Latent Variables, Mixture Models and EM
AIM: Clustering the Data together
CSSE463: Image Recognition Day 23
Seam Carving Project 1a due at midnight tonight.
Announcements Project 4 questions Evaluations.
CSSE463: Image Recognition Day 23
Image Segmentation.
Machine Learning and Data Mining Clustering
CSSE463: Image Recognition Day 23
EM Algorithm and its Applications
Machine Learning and Data Mining Clustering
Presentation transcript:

Clustering Color/Intensity Group together pixels of similar color/intensity.

Agglomerative Clustering Cluster = connected pixels with similar color. Optimal decomposition may be hard. For example, find k connected components of image with least color variation. Greedy algorithm to make this fast.

Clustering Algorithm Initialize: Each pixel is a region with color of that pixel and neighbors = neighboring pixels. Loop Find adjacent two regions with most similar color. Merge to form new region with: all pixels of these regions average color of these regions. All neighbors of either region. Stopping condition: No regions similar Find k regions.

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 23 25 19 21 18 22 24.5 24 20 26 28 3 7 8 1 5 4

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 23 25 19 21 18 22 24.33 20 26 28 3 7 8 1 5 4 24

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 23 25 19 21 18 22 24.33 19.5 26 28 3 7 8 1 5 4 24

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 23 25 19 21 18 22 24.33 19.5 26 28 3 7.5 1 5 4 24

Example …

Example 23 25 19 21 18 22 24 20 26 28 3 7 8 1 5 4 22.9 4.25

Clustering complexity n pixels. Initializing: O(n) time to compute regions. Loop: O(n) time to find closest neighbors (could speed up). O(n) time to update distance to all neighbors. At most n times through loop so O(n*n) time total.

Agglomerative Clustering: Discussion Start with definition of good clusters. Simple initialization. Greedy: take steps that seem to most improve clustering. This is a very general, reasonable strategy. Can be applied to almost any problem. But, not guaranteed to produce good quality answer.

Parametric Clustering Each cluster has a mean color/intensity, and a radius of possible colors. For intensity, this is just dividing histogram into regions. For color, like grouping 3D points into spheres.

K-means clustering Brute force difficult because many spheres, many pixels. Assume all spheres same radius; just need sphere centers. Iterative method. If we knew centers, it would be easy to assign pixels to clusters. If we knew which pixels in each cluster, it would be easy to find centers. So guess centers, assign pixels to clusters, pick centers for clusters, assign pixels to clusters, …. matlab

K-means Algorithm Initialize – Pick k random cluster centers Pick centers near data. Heuristics: uniform distribution in range of data; randomly select data points. Assign each point to nearest center. Make each center average of pts assigned to it. Go to step 2.

Let’s consider a simple example Let’s consider a simple example. Suppose we want to cluster black and white intensities, and we have the intensities: 1 3 8 11. Suppose we start with centers c1 = 7 and c2=10. We assign 1, 3, 8 to c1, 11 to c2. Then we update c1 = (1+3+8)/3 = 4, c2 = 11. Then we assign 1,3 to c1 and 8 and 11 to c2. Then we update c1 = 2, c2 = 9 ½. Then the algorithm has converged. No assignments change, so the centers don’t change.

K-means Properties We can think of this as trying to find the optimal solution to: Given points p1… pn, find centers c1…ck and find mapping f:{p1…pn}->{c1…ck} that minimizes C = (p1-f(p1))^2 + …+ (pn-f(pn))^2. Every step reduces C. The mean is the pt that minimizes sum of squared distance to a set of points. So changing the center to be the mean reduces this distance. When we reassign a point to a closer center, we reduce its distance to its cluster center. Convergence: since there are only a finite set of possible assignments.

Local Minima However, algorithm might not find the best possible assignments and centers. Consider points 0, 20, 32. K-means can converge to centers at 10, 32. Or to centers at 0, 26.

E-M Like K-means with soft assignment. Assign point partly to all clusters based on probability it belongs to each. Compute weighted averages (cj) and variance (s). Cluster centers are cj.

Example Matlab: tutorial2 Fuzzy assignment allows cluster to creep towards nearby points and capture them.

E-M/K-Means domains Used color/intensity as example. But same methods can be applied whenever a group is described by parameters and distances. Lines (circles, ellipses); independent motions; textures (a little harder).