bernard24 / RIS

Implementation of the approach described in the paper "Recurrent Instance Segmentation" https://arxiv.org/abs/1511.08250.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pretrained model

montyhall opened this issue · comments

hi @bernard24

2 quick questions

1- do you have a pretrained model for the leaf segmentation problem that I can experiment with? I am training RIS on my own dataset but it is very slow and RAM hungry. See below for my training config.

2- I am not using curriculum learning (and learning directly on 20 seq), since my test images have potentially many many leaves. Could I run a NxN sliding window over my original large image with potentially many plants and give the window image as input to the trained RIS?

cmd:option('-seq_length', 20, 'Maximum number of RNN iterations at training stage')
cmd:option('-lambda', 1, 'Hyperparameter pondering the classification accuracy term.')
cmd:option('-pass_output', 0, 'Pass previous output as input')
cmd:option('-non_object_iterations', 1, 'Number of iterations over the number of objects apearing in an image')
cmd:option('-height', 530, 'Height of the resized images')
cmd:option('-width', 500, 'Width of the resized images')
cmd:option('-learn_pre', 0, 'Whether learning Pre-CNN model')
cmd:option('-learn_cnn', 1, 'Whether learning CNN model')
cmd:option('-learn_lstm', 1, 'Whether learning LSTM model')
cmd:option('-learn_post_lstm', 1, 'Whether learning post-LSTM model')
cmd:option('-learning_rate', 10^-4, 'Learning rate')
cmd:option('-data_dir', '/scratch/.../plant/train/', 'Data directory')
cmd:option('-rnn_channels', 30, 'Number of channels of the rnn state')
cmd:option('-rnn_layers', 2, 'Number of layers of the rnn')
cmd:option('-rnn_filter_size', 3, 'Size of the filter of the rnn')
cmd:option('-cnn_filter_size', 3, 'Size of the filter of the cnn')
cmd:option('-it', 1000, 'Training iterations')

best

Peyman

Hi @montyhall,

1- You can download a pretrained dataset in convnet before the convlstm and convlstm.
However, keep in mind that the training set for this model is quite specific for the set of leaves in http://www.plant-phenotyping.org/CVPPP2014-dataset, and may not generalize to yours.

2- I would not discard curriculum learning in your case, it may make the training process faster. Regarding using a sliding window for big images, it is probably worth trying, but some caveats come to mind. One is that as a result of cropping, many of the leaves will be cropped too, adding another factor of variability in the input (one more reason to train with your own data, using the same sliding window). Also joining a posteriori different pieces of the same instance from different crops may be nontrivial.

Hope it helps!

hi @bernard24

Thank you for the models. I am getting the following error when loading the plants_convlstm.model

/home/.../torch/install/bin/luajit: /home/.../torch/install/share/lua/5.1/torch/File.lua:343: unknown Torch class <nn.IoU4Criterion>
stack traceback:
        [C]: in function 'error'
        /home/faratin/torch/install/share/lua/5.1/torch/File.lua:343: in function 'readObject'
        /home/faratin/torch/install/share/lua/5.1/torch/File.lua:369: in function 'readObject'
        /home/faratin/torch/install/share/lua/5.1/torch/File.lua:409: in function 'load'
        infer2.lua:24: in main chunk
        [C]: in function 'dofile'
        ...atin/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
        [C]: at 0x004064f0

thank you

hi @montyhall, it is difficult to know what is going on with the error message. Is infer2.lua there some modification of infer_example.lua in the plants_learning directory? Could you copy here line 24?

Thanks @montyhall
When running that code, which line is the one where the error is reported? (I guess line 14? or another one?)

Hi @bernard24

from the error msg pasted above its line 24...

protos = torch.load('/home/xxx/git/RIS/plants_learning/models/plants_convlstm.model')

My hypothesis is the model was built using nn.IoU4Criterion which is not part of the repo. Please see above for the error message.

best

Peyman

Hi @montyhall,
It is what you mention quite likely.
I'm trying to reproduce the error, but at the present moment I don't have access to gpu+torch. In the meantime, could you please try to replace the name of MatchCriterion.lua to IoU4Criterion.lua, replacing each of the 5 appearances of MatchCriterion to IoU4Criterion inside? (a hack, but easy to try :)

Hi @bernard24

Changing all references from MatchCriterion to IoU4Criterion did work. However, the results are low quality. can you share the parameters that were used to train the pretrained model you shared above?

thank you for your help Bernard

Peyman

Hi @montyhall
Sorry I forgot to answer this! The parameters are the ones mentioned in Sec. 4.1 in the paper. Let me know if there is anything unclear or missing.
The low quality results you are getting are on the validation set? or on a dataset of your own?