dhaaru laavu
dhaaru laavu

Reputation: 21

Superpixels input to CNN

How to give superpixels as input to CNN? I used SLIC algorithm to segment the images into superpixels.

How can I use this for classification using CNN?

Upvotes: -1

Views: 669

Answers (1)

Luan Souza
Luan Souza

Reputation: 175

I will try to help you. CNN (Convolutional Neural Networks) work with unique datas of input, not matrices (superpixel is a matrix). So, for this, you need to remove each superpixel and make it its own image. So, in other words, if you segment your image in 300 superpixels, after, you need to create 300 new images, one of each superpixel. After this it's notorious that each new image, perhaps, will have differents sizes. You can't work like that, because the number of neurons of input in the CNN can't change. For this, you can centralize each "new image" in a background NxN ('N' must be enough to cover all new images). WIth a centralized superpixel (new images centralized), each pixel will be input of your CNN.In other words: 1) Each centralized superpixel will be input one at a time; 2) The quantity of inputs in the CNN will be X*Y, being X the shape[0] of the superpixel centralized, and Y the shape[1] of the superpixel centralized; 3) Whereas 300 superpixels centralized, your CNN must calculate the output for each one.

Ilustration: https://i.sstatic.net/O7nD6.jpg

Look the ilustration and good luck! :)

Upvotes: 0

Related Questions