Ask Your Question
0

Is it possible if the input image is the result of Image Segmentation in CNN Method ?

asked 2018-09-06 13:48:39 -0600

updated 2018-09-06 14:02:35 -0600

Hello,

I just want to ask about Input Image in CNN Method

I want to recognize type of Wood based Wood Fiber with CNN (Wood fiber can be detected with Edge Detection Method)

But, all i know is, the input image of CNN usually is the original image, can I make the input image of CNN is the result of Image Segmentation (Edge Detection) ??

So i will make the process like this

Input Image (Wood) => Grayscale + Smoothing => Edge Detection => Threshold => Morphological (Erosion/Dilation) => CNN

And what do you think ? Is it accurate or not ?

Thanks a lot

God bless you all

edit retag flag offensive close merge delete

Comments

1

Yes you can, however, CNNs are usually better off with continuous-tone input images because of their convolutional nature.

MikeTronix gravatar imageMikeTronix ( 2018-09-06 13:54:38 -0600 )edit
1

can you explain the nature of your cnn ? what does it do, exactly ?

maybe all your preprocessing is counter-productive here ?

berak gravatar imageberak ( 2018-09-07 00:20:16 -0600 )edit

+1 to both comments - i would advice to not preprocess("feature loss") the data but train on original image directly. Its also easier this way (less code / less complexity). And thx for cleaning up berak.

holger gravatar imageholger ( 2018-09-07 01:44:55 -0600 )edit

Input Image (Wood) => Grayscale + Smoothing => Edge Detection => Threshold => Morphological (Erosion/Dilation) => CNN

After that, the predict process will be like this

Test Image => Grayscale + Smoothing => Edge Detection => Threshold => Morphological => Predict

Is that make sense ?

Vajrayudha Ristiawanto gravatar imageVajrayudha Ristiawanto ( 2018-09-09 10:14:40 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
3

answered 2018-09-07 07:00:47 -0600

kbarni gravatar image

All the operations you are doing in preprocessing are in fact convolutions. So in fact you are building a CNN with N+5 layers where you fix the weights the first 5 layers.

So you can do the preprocessing if you consider that you found the best operations to recognize the type of wood.

Otherwise leave the network to train all the layers using the original RGB image as input, and it will try to learn the best descriptors (weights) from the provided samples for providing the best results.

On the other hand, doing preprocessing or fixing the weights on the first layers are both used in the training of CNNs. Having less layers to train will speed up the training process and helps to avoid overfitting.

edit flag offensive delete link more

Comments

+1 to the convolution/fixed weight part for preprocessing - i never looked at it at that angle. Well explained!

holger gravatar imageholger ( 2018-09-07 07:35:02 -0600 )edit

Yes, i know Sir

This is about my final year assignment, but my lecturer said that she was making a model with original image of wood as input CNN But the accuracy was so small

So I think, if I will put the Pre-processing image (Edge Detection) as an input in CNN , I think it will increase the accuracy

Vajrayudha Ristiawanto gravatar imageVajrayudha Ristiawanto ( 2018-09-09 10:12:56 -0600 )edit

It depends on your wood scenario. If you want to detect wood shapes (planks, boxes) i would always go for a unpreprocessed solution.

If its about detecting the texture of one specific kind of wood, maybe preprocessing can lead to better results. But these are only wild guesses from my side and i am no expert.

As you need to prepare a dataset anyway: Just try out without preprocessing first(easier). If its not working - try to augment input data.

holger gravatar imageholger ( 2018-09-09 14:02:01 -0600 )edit
1

...my lecturer said that she was making a model with original image of wood as input CNN But the accuracy was so small So I think, if I will put the Pre-processing image as an input in CNN , I think it will increase the accuracy

Dont' think but try!

I suggest to build the network in Keras (probably the simplest framework for CNN). Do two tests: a training/validation with the original (RGB) and another with the preprocessed images. Implementing the preprocessing is not too hard. Change the number of convolutional layers, the convolutional kernel size, etc. Retraining and testing the network shouldn't take a lot of time.

Like this you will see for yourself which method gives you the best results. Going through a rigorous approach is also good for your final report.

kbarni gravatar imagekbarni ( 2018-09-10 03:43:27 -0600 )edit
1

One more thing: CNNs are very powerful at image classification.

If you get very low accuracy, it might be a warning for not doing something well: like not normalizing the images, choosing a bad learning rate, overfitting, using an unadapted network architecture, etc.

kbarni gravatar imagekbarni ( 2018-09-10 03:49:01 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-09-06 13:48:39 -0600

Seen: 554 times

Last updated: Sep 07 '18