Digest on《Havard Happiness》 –1

Preface

    During my undergraduate years, one of my friends recommended me a book named ”How to be happier?” by Prof. Ben Tal-Shahar, Harvard University. The book provideded a brand new perspecitive towards our knowledge of well-being and happiness, from which I gained a lot a inspiration . Luckily enough, a few weeks ago, I came across the online open course presented by Prof. Tal-Shahar. After watching several lectures and combining with the materials from the book that I have read before, I tended to come up with some thoughts toward these abstract concepts, which indeed are intrinsically correlated with our lives. Therefore, I decided to write down those occationally shining sparks within our minds.

Chapter 1. Introduction of Positive Psychology and Happiness

  Currently popular self-help movement are always over promising and under delivering, while acdemic research are rigrous and systematic, yet sometimes too professional and not well received. On average, a journal artical is only read by 7 people.

  The goal of Positive Psychology is to build a bridge between academia and self-help movements, to deliver science that works.

 

   Some study tips to gain better understanding of happiness:

  •  Take active notes and engage in the material
  • Time-ins to introspect into your inner mind, cause silence and reflection can help to retain the memory and gain the deepest thoughts.

  

  Positive Psychology is descendented from humanistic psychology and psychoanalysis, related more to humanistic view, which focus on spirit and soul that assign more dignity and value to human, than behavoristic view which studies the response of human to outside simulation.  It’s more about kindness, goodness, and optimism, focus on health and salutogenesis (the origin of health).

 

5 essential elements of being happy:

  • Physically and mentally healthy
  • Loving social relationships
  • A self-concordant life goal
  • Grateful attitude to the take-for-granted, resillience to unavoidable negative emotions
  • External material conditions to cover basic needs, like food and shetlter 

  Happiness is more concerned with our state of mind, instead of the status of bank account. It’s diffcult to decide whether you are happy or not right now, but it’s possible your level of happiness increases gradually through the time. That’s why we are asking “how to become happier”.

    Concerned with cultural difference in pursuing happiness, we were focusing too much on difference, while ignoring the more similarity between them, there are much in common across cultures.

   Our brain is just like a container, when information is drawn from outside and filled in, the form of our brain decides the shape of the world we perceive. To different minds, the same information can have different interpretations, such interpretation is in fact a kind of transformation of our minds. So in order to change the perceived world, we need to reshape the form of our brain.

    The sole grows more by subtraction than addition. Chip away the limitations, and our potentials emerge.

    The biggest mistakes in the process of pursuing happiness is not asking the right questions, but always seeking the right answers.

    Charateristic of successful and happy people:

  • Deep faith in themselves
  • Always asking new questions, strong curiosity
Posted in Life Retrospect | Leave a comment

Online Reresourses for Pattern Recognition

Standard/Open databases for performance benchmarking of algorithms ans systems

–Face Recognition: http://www.face-rec.org/

- Yale Face Database: http://vision.ucsd.edu/~leekc/ExtYaleDatabase/

–Handwritten Digits: http://yann.lecun.com/exdb/mnist/
–Objects and Scenes: http://web.mit.edu/torralba/www/database.html

–Content-based Image Retrieval: http://www.cs.washington.edu/research/imagedatabase/

–Cross Language Image Retrieval: http://imageclef.org/
–UC Irvine Machine Learning Repository:http://archive.ics.uci.edu/ml/

Posted in Research Links | Leave a comment

Project-Lazy Snapping

1.     Introduction

“Lazy snapping” is an interactive image segmentation technique. It separates coarse and fine scale processing, making object specification and detailed adjustment easy. Moreover, Lazy Snapping provides instant visual feedback, snapping the cutout contour to the true object boundary efficiently despite the presence of ambiguous or low contrast edges. Instant feedback is made possible by a novel image segmentation algorithm which combines graph cut with pre-computed over-segmentation. In this project, we will implement this algorithm and evaluate its performance.

2.     Project Objective

Understand the graph cut algorithm as an efficient minimization tool.

Be able to segment the foreground of an image through Lazy Snapping technique.

In this project, we are provided with several example pictures each with some given foreground pixels (marked in red) and background pixels (marked in blue). Our program is required to compute the precise segmentation boundary of the foreground object.

3.    Algorithm and Implementation Details

In the Lazy Snapping paper, the image is initially segmented using a watershed algorithm. In my implementation, I’ve simplified this by merely downsampling the image using Matlab’s imresize function. After scaling down the image (I settled on a scale of 1/8), it is passed into the following graph cutting algorithm.

We use the max-flow min-cut algorithm, like in the previous graph cut project. However, the values plugged in are changed significantly. Ultimately, we are trying to solve the following minimization problem:

 

E(X)=\sum_{i\in V}E_1(x_i)+\lambda \sum_{(i,j)\in E}E_2(x_i,x_j)

In this project, we used the MATLAB wrapper of the GMEX graph cut library, and implement our algorithm by MATLAB.

Our algorithm is as follows:

1)      Extract the marked foreground and background pixels

2)      Cluster the foreground and background into several clusters by K-Mean algorithm

3)      Use a Gaussian model to fit every cluster, and build a Gaussian Mixture model to represent the foreground and background, respectively.

4)      Calculate the probability of the pixels belonging to foreground and background.

5)      Calculate the parameters of  data cost and smooth cost, which are ‘class’, ‘unary’,’pairwise’ and ‘labelcost’.

6)      Segment the graph using graph cut function

7)      [labels , E, Eafter] = GCMex(double(class’), single(unary), pairwise, single(labelcost),0)

CLASS: An 1xN vector which specifies the initial labels of each of the N nodes in the graph

UNARY: A CxN matrix specifying the potentials (data term) for each of the C possible classes at each of the N nodes.

PAIRWISE:: An NxN sparse matrix specifying the graph structure and cost

for each link between nodes in the graph.

LABELCOST:: A CxC matrix specifying the fixed label cost for the labels of each adjacent node in the graph.

EXPANSION:: A 0-1 flag which determines if the swap or expansion method is used to solve the minimization. 0 == swap, 1 == expansion. If omitted, defaults to swap.

8)      Segment the image according to the labels. Label  is 0 for the foreground and 1 for the background.

4.    Experiments

 

The following figures are the results of our implementation. For each example set, in the first column are the original images with corresponding stokes on them, in the second column are the results.

From the figures we could see that our algorithm works best for dog and dance and relatively worse for Van Gogh and Mona Lisa, while medium for the lady set, since for the first two sets, the difference between the foreground and background is relatively larger than the latter two.

In the dance, lady and Mona Lisa sets, the results of the first row are much better than the second row, since the first row has more strokes for both the foreground and background, than those of the second row, which as a consequence leading to a more accurate Gaussian mixture model to approximate the probability of the image pixels belonging to foreground and background.

In the dog set, the hair of a person at the upper right corner of the image is mistakenly segmented as the foreground, because it’s great similarity in color and texture with the dog region. It can also be observed in other sets that background regions that are similar to the foreground in color and texture are quite possible classified as foreground.

The performance on Mona Lisa and Van Gogh sets are much worse, since the great similarity between much of the background regions and the foreground, especially the lower part.

In conclusion, what really matter in the lazy snapping procedures is the size of the samples and the distinction of foreground in both color and textures. In order to get good  performance, we must make sure that our strokes are rich enough, inclusive of different color patches in foreground and background. For those images with low contrast between foreground and background, we need to draw more strokes.

Since the initial node weights are based on color, segmentation is very easy on subjects that are a very different color from the background, like the dog picture. It is also helpful when the fore- or background is a solid color. When there is a lot of discontinuous color, it means more lines will be needed to correctly segment the image.

In addition, in the MATLAB implementation, the pairwise matrix, denoting the graph structure of the image with corresponding link or edge costs, is an N by N sparse matrix, where N is the number of pixels in the images, usually thousands of thousands. The calculation of this matrix slows down the whole lazy snapping process, taking about two minutes on average for each segmentation task, which is far away from the real time segmentation proposed by Microsoft. 

5.    Conclusions and Possible Improvements

 In this project, we learnt how to segment a picture using lazy snapping, a very efficient and interesting technique. However, based on the implementation, I think there are several parts need to be improved.

Since our algorithm is sensitive to the color discontinuity, while the edge cost is based on the color difference. This leads to many noisy discontinuity and noise holes in the result. Therefore, in the future, we could add some spatial distance in the distance vector only based on color, because the further a pixel is to a marked foreground or background, the less likely they belong to the same group. By combining the color and space distance, we could get better results.

The segmentation in our algorithm is coarse, so in order to get smooth boundary, we may do some edge editing after lazy snapping.

As for the speed, we should come up with some more efficient ways to calculate that huge sparse matrix, or simply re-implement the whole algorithm with C\C++, directly calling the library functions rather than the MATLAB wrappers.

 



 

Posted in My research | Leave a comment

Matrix decomposition and Compressive sensing

Here is a nice portal for the matrix decomposition problem: http://perception.csl.uiuc.edu/matrix-rank/home.html

In particular, if you click on the “Sample Code” link, you will see Matlab implementation of 4 algorithms that do the decomposition. As you can see, all you have to do is to pass in the data matrix, and a weighting factor. These functions will return you the low rank and sparse matrices. We can discuss more about the weighting factor when we meet up next time.

As part of your education in optimization, you can refer to Boyd’s lecture, slides and pdf book on optimization. These resources are useful for you to learn CVX, as a handy tool for solving small optimization problems.

http://www.stanford.edu/class/ee364a/

As part of your background reading on compressive sensing, the following papers are nice, gentle introductions:

http://dsp.rice.edu/files/cs/baraniukCSlecture07.pdf

http://dsp.rice.edu/files/cs/CSintro.pdf

Even though we are looking at rank minimization, there are many shared concepts with L1 minimization. You can get a good intuition of rank minimization by first looking at L1 minimization.

Posted in Research Links | Leave a comment

Resourse links

Video talks on mathematical background & general vision topics

 

Stephen Boyd, Lieven Vandenberghe: Convex Optimization, Cambridge University Press, Cambridge, 2004.  (you can view the video lecture from YouTube)

 

If you need some background for graph cut and level set, the following website may be of help

http://www.cs.washington.edu/education/courses/577/04sp/contents.html#BP containing videos of talks by:

1.        R. Zabih : A Selective Overview of Graph Cut Energy Minimization Algorithms

2.        G Sapiro; Level Sets and Partial Differential Equations in Image Sciences

 

If you want to know more about BP (belief propagation):

  1. Chapter 8 Graphical Models from Bishop’s Book: Machine Learning and Pattern Recognition http://research.microsoft.com/en-us/um/people/cmbishop/PRML/Bishop-PRML-sample.pdf (more detailed coverage of the basics)
  2. Understanding Belief Propagation and its. Generalizations. Jonathan S. Yedidia, William T. Freeman, and Yair Weiss. MERL TR-2001-22. www.merl.com/papers/docs/TR2001-22.pdf
  3. Efficient belief propagation for higher-order cliques using linear constraint nodes, CVIU(112), No. 1, October 2008, pp. 39-54.

 

If you want to know more about spectral clustering (upon which the Normalized-Cut technique is based):

  1. A tutorial on spectral clustering, Statistics and Computing. Volume 17, Issue 4 (December 2007). Pages: 395 – 416

 

Finally, this website at Mathematical Sciences Research Institute hosts many video talks by experts in the field of computer vision:

http://www.msri.org/calendar/workshops/WorkshopInfo/298/show_workshop

http://www.msri.org/calendar/workshops/WorkshopInfo/270/show_workshop

http://www.msri.org/calendar/workshops/WorkshopInfo/273/show_workshop

 

Maths & SoC Seminars

http://ww1.math.nus.edu.sg/seminars.aspx 

http://www.comp.nus.edu.sg/cs/csseminar.html

 

Resources

 

Gary Bradski, Adrian Kaehler. Learning OpenCV: Computer Vision with the OpenCV Library. 2008.

This book would be most useful to someone who already has a fundamental understanding of computer vision and image processing and wants to see how the open source OpenCV will make their programming tasks easier.

 

OpenCV Library (General purpose and opensource, currently actively maintained and provides C, C++, Python, and Octave interfaces)

Piotr’s Image and Video Toolbox for Matlab

Peter’s Matlab Functions for Computer Vision

 

There is matlab code available for computing optical flow:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17500&objectType=File

 

It is based on the work of Weickert’s group: High Accuracy Optical Flow Estimation Based on a Theory for Warping 

Thomas Brox, Andres Bruhn, Nils Papenberg, and Joachim Weickert

Which is essentially the same as the IJCV2005 paper (When Lucas & Kanade meets Horn &Schunck)

 

The optical flow codes from MIT is also available:

Peter Sand, Seth Teller, “Particle Video: Long-Range Motion Estimation using Point Trajectories,” cvpr, pp. 2195-2202, 2006

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17500&objectType=File

 

http://phototour.cs.washington.edu/bundler/

Bundler takes a set of images, image features, and image matches as input, and produces a 3D reconstruction of camera and (sparse) scene geometry as output. The system reconstructs the scene incrementally, a few images at a time, using a modified version of the Sparse Bundle Adjustment package of Lourakis and Argyros as the underlying optimization engine. Bundler has been successfully run on many Internet photo collections, as well as more structured collections.

 

Here are the links that provide numerous motion sequences, some of which have ground truth.

 

http://vasc.ri.cmu.edu/idb/html/motion/index.html

http://www.robots.ox.ac.uk/~vgg/data.html

http://www-cvr.ai.uiuc.edu/ponce_grp/data/

http://vis-www.cs.umass.edu/~vislib/Motion/

http://research.microsoft.com/en-us/um/people/zhang/Calib/

 

CODES

 

For region segmentation:

http://www.cis.upenn.edu/~jshi/software/ Normalized cut using intervening contours (earliest version as well as a multiscale CVPR2005 version)

http://www.cs.berkeley.edu/~fowlkes/BSE/BSE-1.2/ & http://www.cs.berkeley.edu/~fowlkes/BSE/BSE-1.2/util/  codes for PAMI 2004 paper: D. Martin, C. Fowlkes, J. Malik. “Learning to Detect Natural Image Boundaries Using Local Brightness, Color and Texture Cues”, TPAMI 26 (5) p.530-549

http://www.eecs.berkeley.edu/Research/Projects/CS/vision/stellayu/code.html various normalized codes from the same group (including constrained ncut)

http://www.eecs.berkeley.edu/Research/Projects/CS/vision/grouping/segbench/ edge detection based on brightness/color/texture .

 

http://www.caip.rutgers.edu/riul/research/code.html mean-shift segmentation

 

For C/C++ codes on sparse bundle adjustment, refer to http://www.ics.forth.gr/~lourakis/sba/ by Manolis Lourakis and Antonis Argyros

 

Graph cut optimization: http://www.csd.uwo.ca/faculty/olga/code.html

 

Various Computer vision codes:

http://www.csse.uwa.edu.au/~pk/Research/MatlabFns/

Andrew Zisserman’s MATLAB Functions for Multiple View Geometry

Jean-Yves Bouguet’s MATLAB Calibration Software

Peter Corke’s Machine Vision Toolbox he also has a well regarded Robotics Toolbox.

Libor Masek’s Iris Recognition Code

Epipolar Geometry Toolbox by Gian Luca Mariottini and Domenico Prattichizzo.

MathWorks’ links to sites containing MATLAB vision functions

 

Feature Extraction

  • VLFeat (SIFT, MSER, plus fast kmeans, hierarchical kmeans … )
  • SIFT Demo by David Lowe (closed-source)
  • SURF (Speeded Up Robust Features, original implementation, closed-source)
  • OpenSURF (An opensource implementation of SURF)

Machine Learning Algorithms

  • LIBSVM (A Library for Support Vector Machines)
  • SVMlight (Another popular implementation of SVM)
  • shogun (A large-scale ML toolbox, specialized in SVM. It provides unified interface for several popular SVM implementations, and features supports for Multiple Kernel Learning. )

Sparse Coding / Representation

  • Sparse modeling software package (General-purpose package for various sparsity-related problems, include Lasso, elastic-net, and sparse dictionary learning. Closed-source)

 

 

Posted in Research Links | Leave a comment

Some theoretic links

Dedicated research websites of interest

Events/Workshops/Tutorials of interest

Wonderful reference books that are online

Posted in Research Links | Leave a comment

Useful Softwares

CV Software

This page collects wonderful resource for computer vision research (mostly software packages/tools) and technical references.  Closed-source software tools are explicitly noted, otherwise opensource. (Update: June 11 2010)

General Purpose

  • OpenCV Library (General purpose and opensource, currently actively maintained and provides C, C++, Python, and Octave interfaces)

Specialized

Classic Vision Algorithms and Related

Feature Extraction

  • VLFeat (SIFT, MSER, plus fast kmeans, hierarchical kmeans … )
  • SIFT Demo by David Lowe (closed-source)
  • SURF (Speeded Up Robust Features, original implementation, closed-source)
  • OpenSURF (An opensource implementation of SURF)

Support Vector Machines (SVM)

  • LIBSVM (A Library for Support Vector Machines)
  • SVMlight (Another popular implementation of SVM)
  • shogun (A large-scale ML toolbox, specialized in SVM. It provides unified interface for several popular SVM implementations, and features supports for Multiple Kernel Learning. )

Graphical Models and Inference Algorithms

Nearest Neighbor Search in High-Dimensions

Nonlinear Dimensionality Reduction

Optimization Packages

Sparse Coding / Representation

  • Sparse modeling software package (General-purpose package for various sparsity-related problems, include Lasso, elastic-net, and sparse dictionary learning. Closed-source)

GPU Programming for CV (Don’t have a GPU on your PC? You’re out …)

Posted in Software Package | Leave a comment