230 likes | 321 Views
June 5, 2007. Parallel Image Segmenter. CSE 262 Spring 2007 Project Final Presentation. Outline of Presentation. Project Overview Image Segmentation Stability Clustering Algorithm Overview Parallel Image Segmentation Program Performance Future Work Lessons Learned and Conclusion.
E N D
June 5, 2007 Parallel Image Segmenter CSE 262 Spring 2007 Project Final Presentation
Outline of Presentation • Project Overview • Image Segmentation • Stability Clustering Algorithm Overview • Parallel Image Segmentation Program • Performance • Future Work • Lessons Learned and Conclusion
Overview of Image Segmentation • Image segmentation • Partition an image into a given number of sets (model order k) • Group pixels with similar qualities together • Given k sets, group pixels to maximize an objective function
Revised Goals • Provide segmentations of 2D point sets using the distance between points and density of the points • Scale program to run on ~1000 processors • Design program to be easily extendable to take in different inputs.
Overview of algorithm • Cue combination • Take as input two or more properties (cues) of pixels • Normalize each cue and combine into a single matrix, with particular weights • Stability-based clustering • Cluster the data set using some k • Perturb distances by some small amount, cluster dataset again • Repeat this x number of times (50 in our case) • Measure stability (more on this later)
Image Segmentation Program: High Level Design • Written in C • Communicates using MPI • Scales depending on the available processors • Broken up into 5 modules • Main • Input • Noise • K-Medoids • Cues
Image Segmentation Program: Cues • Clustering and segmentation is based on two cues • Proximity • Calculate Euclidean (straight line) distance between every pair of points • Store all values in a matrix • Density • Count all points that fall within a box centered around a particular point • Width of the box is variable
Image Segmentation Program: K-medoids • In the end, we used K-medoids • Easier to use in a proof of concept • Our k-medoids implementation is serial • Can easily be converted to K-means by image-segmentation developers without parallel computing experience • Randomly picks starting medoids and runs k-medoids algorithm multiple times
Image Segmentation Program: Grouping Stability After computing the distance (based on the proximity and density cues) and before running k-medoids, we add noise to the values. Values are slightly perturbed and then regrouped - 50 times Slight optimization: perturbing distance matrix rather than original data Groupings must be relabeled in order to accurately measure stability Each grouping is used as the “anchor” grouping once Stability calculated according to following equation:
Image Segmentation Program: Parallelization • Parallelized based on K, relative weight, and density box size values. • Process ID is used to determine K, weight, and box size values to use. • For example, if there are 10 values for K, weight, and box size then: • process #365 has indexes k=3, weight=6, box=5. • Each slave process communicates to the master process it's stability value. • The results are the parameter combinations that have stability above a configurable threshold (default is 90%).
Performance • Ran over 1000 parameter combination on a 65 data point set in ~18 seconds on DataStar • The per-processor performance is slower than image segmenter written in MATLAB (by Andrew Rabinovich). However the MATLAB implementation took 46 minutes total. • Still can be further optimized • Use k-means instead of k-medoids. • Parallelize writing the segmentation output file. • Improve the parameter search space.
Future Work • Segmenting images • Image can be viewed as and M x N set of points • Dense point set • Much more data • Can start by just adding more/different cues • Color, brightness, texture, contours… • Stability is the key to get through the image • Heuristics to eliminate parts of search space • More and/or different parallelization schemes?
Lessons Learned • Differences in MPI compilers/environments • Unreported errors • Verifying sections with equations • Value of test code, particularly on parallel applications • Print statements not always adequate • Verifying small portions of complex algorithm • Parallel computing is scary until you start doing it
Conclusion • Not quite at real time image processing • With further performance tuning, could perform image processing interactively • Program is laid out to allow for further improvement with relative ease
Acknowledgements • Professor Scott Baden • Assistance with getting started on Valkyrie and Datastar machines • Guidance on parallel computing aspects of project • Professor Serge Belongie • Initial idea of multiple stable segmentation across parallel processors • Provided guidance on algorithm and scope of project • Andrew Rabinovich • Assistance with stability clustering algorithm • Assistance with relabeling and bipartite matching algorithm
References • A. Rabinovich et al. “Model Order Selection and Cue Combination for Image Segmentation.” 2006 IEEE Computer Society Conference on Computer Vision and Pattern Recognition - Volume 1 (CVPR'06), pp. 1130-1137 • A. Rabinovich et al. “Objects in Context”. 2007 IEEE International Conference on Computer Vision submission.