Monday, April 25, 2011

Semaine 5 lundi

~ lundi ~

Test data: 3 classes, each 19 images
bibimbap
pasta
sushi
Some images cropped to include most relevant area


Bibimbap (incomplete, collage needs to be updated):

Pasta:

Sushi:

Baseline 1: Global Color Histogram

20 bins
63.2 %




Baseline 2: EMD (in progress)

Clustered with # id:


Each cluster's (r, g, b) values saved as a 1D matrix, each labeled as an ingredient, total ~6 ingredients, global.

Load each cluster for each image, where an ingredient doesn't exist in an image, the matrix value is -1. Calculate the EMD between each pair of clusters (ingredients) in 1 image.

Ground truth is loaded from a manually labeled file, with each cluster labeled as an ingredient.

Each grayscale image is outputted with a cluster ID number to make labeling more convenient, so that the labeler can match up the cluster # with ingredient #. Noisy clusters are discarded and labeled as -1. Background cluster is labeled as -1, i.e. no ingredient.

Training data layout:

matrix dimension (number of ingredient samples from all images) x types of  ingredients
Each column is the EMD distance to all the ingredients in this image.
If non-existent, distance -1.
Distance to self is 0.

img 1 ing 1: EMD to ing1(0), ing2(-1), ing3, ing4(-1), ing5(-1), ing6 | 1
img 1 ing 3: EMD to ing1, ing2(-1), ing3(0), ing4(-1), ing5(-1), ing6 | 3
img 1 ing 6: EMD to ing1, ing2(-1), ing3, ing4(-1), ing5(-1), ing6(0) | 6
img 2 ing 2: EMD to ing1(-1), ing2(0), ing3(-1), ing4(-1), ing5, ing6(-1) | 2
img 2 ing 5: EMD to ing1(-1), ing2, ing3(-1), ing4(-1), ing5(0), ing6(-1) | 5
img 3 ... : ...
...


(
Plan for later:

Save each image as 1 row in training data, row format:

| ing1 emd dist to ing2 3 4 5 | ing2 dist to 1 3 4 5 | ing3 nonexist | ing4 dist to 1 2 3 5 | ing5 nonexist |
)



EMD and training matrix are implemented.
Currently dealing with some memory issues at runtime, using valgrind to help.


Still need to label all the image clusters with the corresponding ingredient id.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home