Genetic Algorithms for clustering problem Pasi Fränti 7.4.2016.

Slides:



Advertisements
Similar presentations
Clustering k-mean clustering Genome 559: Introduction to Statistical and Computational Genomics Elhanan Borenstein.
Advertisements

Variable Metric For Binary Vector Quantization UNIVERSITY OF JOENSUU DEPARTMENT OF COMPUTER SCIENCE JOENSUU, FINLAND Ismo Kärkkäinen and Pasi Fränti.
CS6800 Advanced Theory of Computation
Using Parallel Genetic Algorithm in a Predictive Job Scheduling
Genetic Algorithms Contents 1. Basic Concepts 2. Algorithm
Content Based Image Clustering and Image Retrieval Using Multiple Instance Learning Using Multiple Instance Learning Xin Chen Advisor: Chengcui Zhang Department.
Clustering… in General In vector space, clusters are vectors found within  of a cluster vector, with different techniques for determining the cluster.
© University of Minnesota Data Mining for the Discovery of Ocean Climate Indices 1 CSci 8980: Data Mining (Fall 2002) Vipin Kumar Army High Performance.
Spatial and Temporal Data Mining
Clustering Color/Intensity
Clustering.
1 Partitioning Algorithms: Basic Concepts  Partition n objects into k clusters Optimize the chosen partitioning criterion Example: minimize the Squared.
Chapter 6: Transform and Conquer Genetic Algorithms The Design and Analysis of Algorithms.
Birch: An efficient data clustering method for very large databases
Clustering Unsupervised learning Generating “classes”
Genetic Algorithm.
Clustering Methods: Part 2d Pasi Fränti Speech & Image Processing Unit School of Computing University of Eastern Finland Joensuu, FINLAND Swap-based.
Clustering methods Course code: Pasi Fränti Speech & Image Processing Unit School of Computing University of Eastern Finland Joensuu,
SOFT COMPUTING (Optimization Techniques using GA) Dr. N.Uma Maheswari Professor/CSE PSNA CET.
1 Local search and optimization Local search= use single current state and move to neighboring states. Advantages: –Use very little memory –Find often.
Self-organizing map Speech and Image Processing Unit Department of Computer Science University of Joensuu, FINLAND Pasi Fränti Clustering Methods: Part.
Professor: S. J. Wang Student : Y. S. Wang
Hierarchical Distributed Genetic Algorithm for Image Segmentation Hanchuan Peng, Fuhui Long*, Zheru Chi, and Wanshi Siu {fhlong, phc,
Cut-based & divisive clustering Clustering algorithms: Part 2b Pasi Fränti Speech & Image Processing Unit School of Computing University of Eastern.
Intro. ANN & Fuzzy Systems Lecture 36 GENETIC ALGORITHM (1)
Zorica Stanimirović Faculty of Mathematics, University of Belgrade
Boltzmann Machine (BM) (§6.4) Hopfield model + hidden nodes + simulated annealing BM Architecture –a set of visible nodes: nodes can be accessed from outside.
Design & Analysis of Algorithms Combinatory optimization SCHOOL OF COMPUTING Pasi Fränti
Optimal resource assignment to maximize multistate network reliability for a computer network Yi-Kuei Lin, Cheng-Ta Yeh Advisor : Professor Frank Y. S.
tch?v=Y6ljFaKRTrI Fireflies.
1 Motivation Web query is usually two or three words long. –Prone to ambiguity –Example “keyboard” –Input device of computer –Musical instruments How can.
Genetic Algorithm Using Iterative Shrinking for Solving Clustering Problems UNIVERSITY OF JOENSUU DEPARTMENT OF COMPUTER SCIENCE FINLAND Pasi Fränti and.
GENETIC ALGORITHMS FOR THE UNSUPERVISED CLASSIFICATION OF SATELLITE IMAGES Ankush Khandelwal( ) Vaibhav Kedia( )
Fast search methods Pasi Fränti Clustering methods: Part 5 Speech and Image Processing Unit School of Computing University of Eastern Finland
Clustering What is clustering? Also called “unsupervised learning”Also called “unsupervised learning”
A genetic approach to the automatic clustering problem Author : Lin Yu Tseng Shiueng Bien Yang Graduate : Chien-Ming Hsiao.
Dimension reduction : PCA and Clustering Slides by Agnieszka Juncker and Chris Workman modified by Hanne Jarmer.
Chapter 9 DTW and VQ Algorithm  9.1 Basic idea of DTW  9.2 DTW algorithm  9.3 Basic idea of VQ  9.4 LBG algorithm  9.5 Improvement of VQ.
Last lecture summary. SOM supervised x unsupervised regression x classification Topology? Main features? Codebook vector? Output from the neuron?
Genetic algorithms (GA) for clustering Pasi Fränti Clustering Methods: Part 2e Speech and Image Processing Unit School of Computing University of Eastern.
By Timofey Shulepov Clustering Algorithms. Clustering - main features  Clustering – a data mining technique  Def.: Classification of objects into sets.
Genetic Algorithms What is a GA Terms and definitions Basic algorithm.
METAHEURISTICS Genetic Algorithm Jacques A. Ferland Department of Informatique and Recherche Opérationnelle Université de Montréal
ECE 103 Engineering Programming Chapter 52 Generic Algorithm Herbert G. Mayer, PSU CS Status 6/4/2014 Initial content copied verbatim from ECE 103 material.
EE749 I ntroduction to Artificial I ntelligence Genetic Algorithms The Simple GA.
CS 8751 ML & KDDData Clustering1 Clustering Unsupervised learning Generating “classes” Distance/similarity measures Agglomerative methods Divisive methods.
Vector Quantization CAP5015 Fall 2005.
D Nagesh Kumar, IIScOptimization Methods: M8L5 1 Advanced Topics in Optimization Evolutionary Algorithms for Optimization and Search.
Discovering Interesting Patterns for Investment Decision Making with GLOWER-A Genetic Learner Overlaid With Entropy Reduction Advisor : Dr. Hsu Graduate.
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:
Multilevel thresholding by fast PNN based algorithm UNIVERSITY OF JOENSUU DEPARTMENT OF COMPUTER SCIENCE FINLAND Olli Virmajoki and Pasi Fränti.
Selection and Recombination Temi avanzati di Intelligenza Artificiale - Lecture 4 Prof. Vincenzo Cutello Department of Mathematics and Computer Science.
Clustering Wei Wang. Outline What is clustering Partitioning methods Hierarchical methods Density-based methods Grid-based methods Model-based clustering.
How to cluster data Algorithm review Extra material for DAA Prof. Pasi Fränti Speech & Image Processing Unit School of Computing University.
Genetic Algorithms An Evolutionary Approach to Problem Solving.
Genetic Algorithm. Outline Motivation Genetic algorithms An illustrative example Hypothesis space search.
S.R.Subramanya1 Outline of Vector Quantization of Images.
Agglomerative clustering (AC)
Genetic Algorithms.
Evolutionary Algorithms Jim Whitehead
Random Swap algorithm Pasi Fränti
Random Swap algorithm Pasi Fränti
Design & Analysis of Algorithms Combinatorial optimization
Aiman H. El-Maleh Sadiq M. Sait Syed Z. Shazli
Clustering Wei Wang.
Boltzmann Machine (BM) (§6.4)
Density-Based Image Vector Quantization Using a Genetic Algorithm
Searching for solutions: Genetic Algorithms
Pasi Fränti and Sami Sieranoja
Presentation transcript:

Genetic Algorithms for clustering problem Pasi Fränti

General structure Genetic Algorithm: Generate S initial solutions REPEAT Z iterations Select best solutions Create new solutions by crossover Mutate solutions END-REPEAT

Main principle

Components of GA Representation of solution Selection method Crossover method Mutation Most critical !

Representation

Representation of solution Partition (P): – Optimal centroid can be calculated from P – Only local changes can be made Codebook (C): – Optimal partition can be calculated from C – Calculation of P takes O(NM)  slow Combined (C, P): – Both data structures are needed anyway – Computationally more efficient

Selection method To select which solutions will be used in crossover for generating new solutions Main principle: good solutions should be used rather than weak solutions Two main strategies: – Roulette wheel selection – Elitist selection Exact implementation not so important

Roulette wheel selection Select two candidate solutions for the crossover randomly. Probability for a solution to be selected is weighted according to its distortion:

Elitist selection Elitist approach using zigzag scanning among the best solutions Main principle: select all possible pairs among the best candidates.

Crossover

Crossover methods Different variants for crossover: Random crossover Centroid distance Pairwise crossover Largest partitions PNN Local fine-tuning: All methods give new allocation of the centroids. Local fine-tuning must be made by K-means. Two iterations of K-means is enough.

Random crossover Solution 1Solution 2 + Select M/2 centroids randomly from the two parent.

New Solution: How to create a new solution? Picking M/2 randomly chosen cluster centroids from each of the two parents in turn. How many solutions are there? 36 possibilities how to create a new solution. Probability to select a good one? Not high, some are good but K-Means is needed, most are bad. See statistics. Parent solution A Parent solution B Data point Centroid Explanation M – number of clusters Parent AParent BRating c 2, c 4 c 1, c 4 Optimal c 1, c 2 c 3, c 4 Good (K-Means) c 2, c 3 Bad Some possibilities: M = 4 c1c1 c4c4 c3c3 c2c c1c1 c4c4 c3c3 c2c2 Rough statistics: Optimal: 1 Good: 7 Bad:28

c1c1 c4c4 c3c3 c2c c1c1 c4c4 c3c3 c2c2 c1c1 c3c3 c2c2 c4c4 Child solution (optimal) Child solution (good) Child solution (bad) c1c1 c3c3 c2c2 c4c4 c1c1 c2c2 c4c4 c3c3 Parent solution A Parent solution B

Centroid distance crossover [Pan, McInnes, Jack, 1995: Electronics Letters ] [Scheunders, 1997: Pattern Recognition Letters ] For each centroid, calculate its distance to the center point of the entire data set. Sort the centroids according to the distance. Divide into two sets: central vectors (M/2 closest) and distant vectors (M/2 furthest). Take central vectors from one codebook and distant vectors from the other.

Parent solution A Parent solution B New solution: Variant (a) Take cental vectors from parent solution A and distant vectors from parent solution B OR Variant (b) Take distant vectors from parent solution A and central vectors from parent solution B Data point Centroid Explanation M – number of clusters Centroid of entire dataset A: d(c 4, C ed ) < d(c 2, C ed ) < d(c 1, C ed ) < d(c 3, C ed ) B: d(c 1, C ed ) < d(c 3, C ed ) < d(c 2, C ed ) < d(c 4, C ed ) 1) Distances d(c i, C ed ): 2) Sort centroids according to the distance: A: c 4, c 2, c 1, c 3, B: c 1, c 3, c 2, c 4 3) Divide into two sets (M = 4): A: central vectors: c 4, c 2, distant vectors: c 1, c 3 B: central vectors: c 1, c 3, distant vectors: c 2, c c1c1 c2c2 c3c3 c4c4 C ed c1c1 c2c2 c3c3 c4c4 c2c2 c4c4 c2c2 c4c4 c1c1 c3c3 c1c1 c3c

Child - variant (a) Child – variant (b) New solution: Variant (a) Take cental vectors from parent solution A and distant vectors from parent solution B OR Variant (b) Take distant vectors from parent solution A and central vectors from parent solution B Data point Centroid Explanation M – number of clusters Centroid of entire dataset c2c2 c4c4 c2c2 c4c4 c1c1 c3c3 c1c1 c3c c1c1 c2c2 c3c3 c4c4 C ed c1c1 c2c2 c3c3 c4c4

Pairwise crossover [Fränti et al, 1997: Computer Journal] Greedy approach: For each centroid, find its nearest centroid in the other parent solution that is not yet used. Among all pairs, select one of the two randomly. Small improvement: No reason to consider the parents as separate solutions. Take union of all centroids. Make the pairing independent of parent.

Initial parent solutions Pairwise crossover example MSE=8.79  10 9 MSE=11.92  10 9

Pairwise crossover example Pairing between parent solutions MSE=7.34  10 9

Pairing without restrictions MSE=4.76  10 9 Pairwise crossover example

Largest partitions [Fränti et al, 1997: Computer Journal] Crossover algorithm: Each cluster in the solutions A and B is assigned with a number, cluster size S, indicating how many data objects belong to it. In each phase we pick the centroid of the largest cluster. Assume that cluster i was chosen from A. The cluster centroid C i is removed from A to avoid its reselection. For the same reason we update the cluster sizes of B by removing the effect of those data objects in B that were assigned to the chosen cluster i in A.

Largest partitions [Fränti et al, 1997: Computer Journal] Data point Centroid Explanation Parent solution B S=100 S=50 S=30 S=20 Parent solution A S=50 S=30 S=20 c1c1 S=100

PNN crossover for GA [Fränti et al, 1997: The Computer Journal] Initial 2 After PNN Union Combined Initial 1 PNN

The PNN crossover method (1) [Fränti, 2000: Pattern Recognition Letters]

The PNN crossover method (2)

Importance of K-means (Random crossover) Best Worst Bridge

Effect of crossover method (with k-means iterations) Bridge

Effect of crossover method (with k-means iterations) Binary data Bridge2

Mutations

Purpose is to implement small random changes to the solutions. Happens with a small probability. Sensible approach: change the location of one centroid by the random swap! Role of mutations is to simulate local search. If mutations are needed  crossover method is not very good.

Effect of k-means and mutations Mutations alone better than random crossover! K-means improves but less vital

GAIS – Going extreme

Agglomerative clustering PNN: Pairwise Nearest Neigbor method – Merges two clusters – Preserves hierarchy of clusters IS: Iterative shrinking method Removes one cluster Repartition data vectors in removed cluster

Iterative shrinking

Pseudo code

Local optimization of IS Removal cost of single vector: Finding secondary cluster:

Example (1)

Example (2)

Pseudo code of GAIS [Virmajoki & Fränti, 2006: Pattern Recognition]

PNN vs. IS crossovers Further improvement of about 1%

Optimized GAIS variants GAIS short (optimized for speed): -Create new generations only as long as the best solution keeps improving (T=*). -Use a small population size (Z=10) -Apply two iterations of k ‑ means (G=2). GAIS long (optimized for quality): -Create a large number of generations (T=100) -Large population size (Z=100) -Iterate k ‑ means relatively long (G=10).

Comparison with image data Popular Previous GA BEST! Simplest of the good ones

What does it cost? Bridge Random:~0 s K-means:8 s SOM: 6 minutes GA-PNN:13 minutes GAIS – short:~1 hour GAIS – long:~3 days

Comparison of algorithms

Variation of the result

Time vs. quality comparison Bridge

Conclusions Best clustering obtained by GA Crossover method most important Mutations not needed

References 1.P. Fränti and O. Virmajoki, "Iterative shrinking method for clustering problems", Pattern Recognition, 39 (5), , May P. Fränti, "Genetic algorithm with deterministic crossover for vector quantization", Pattern Recognition Letters, 21 (1), 61-68, January P. Fränti, J. Kivijärvi, T. Kaukoranta and O. Nevalainen, "Genetic algorithms for large scale clustering problems", The Computer Journal, 40 (9), , J. Kivijärvi, P. Fränti and O. Nevalainen, "Self-adaptive genetic algorithm for clustering", Journal of Heuristics, 9 (2), , J.S. Pan, F.R. McInnes and M.A. Jack, VQ codebook design using genetic algorithms. Electronics Letters, 31, , August P. Scheunders, A genetic Lloyd-Max quantization algorithm. Pattern Recognition Letters, 17, , 1996.

Working space Text box