Coder Social home page Coder Social logo

Comments (15)

cjnolet avatar cjnolet commented on July 24, 2024

from synthtext.

Jayhello avatar Jayhello commented on July 24, 2024

@cjnolet how about jaderberg's approach? where to find it ? thank you。。

from synthtext.

cjnolet avatar cjnolet commented on July 24, 2024

from synthtext.

biggerlambda avatar biggerlambda commented on July 24, 2024

@cjnolet please consider posting synopsis of your steps on github. Would be helpful.

from synthtext.

cjnolet avatar cjnolet commented on July 24, 2024

from synthtext.

cjnolet avatar cjnolet commented on July 24, 2024

Ankush,

I believe I have this network coded up in Keras how you described it in the paper. One thing that would be nice would be to know if I coded up the loss layer properly.

Would you mind providing some quick pseudocode in this ticket for how you determined the final loss and the weighted loss? I believe your final loss was multiplied by 0.01 if c == 0 (and also only the c values were used in the calculation of the loss by that point) where the weighting was increased during each epoch. If c == 1, I believe you calculated the loss as usual. Does this sound right?

Thank you!

from synthtext.

ankush-me avatar ankush-me commented on July 24, 2024

@Jayhello : We are in the process of sharing the FCRN; it might still take a few weeks.

@cjnolet : Your understanding of FCRN and the loss is correct. FCRN is a fully-convolutional network which takes in the whole image, and for each cell regresses a confidence score and bounding box dimensions.

The loss is again as you describe in your second comment: L2 loss on all parameters (confidence + bb-params); No loss on bb-params if c==0. Further, c==0 confidence score losses are weighed down initially (for balancing negatives against the small number of positives) and this weight is gradually increased to 1 during training. L2-loss on both confidence + bb-params for the positive cells.

from synthtext.

Jayhello avatar Jayhello commented on July 24, 2024

thank you very much! if you implement it , can you give us a noice?

from synthtext.

ankush-me avatar ankush-me commented on July 24, 2024

Certainly.

from synthtext.

cjnolet avatar cjnolet commented on July 24, 2024

I got the approval to release my Keras code for my FCRN + Loss Function and I've posted it here:

https://github.com/cjnolet/textbox_proposals_fcrn

I'm hoping maybe some of you that are wanting to use it could let me know if you think the math (given how Theano does the calculation of the gradients behind the scenes) looks correct. Ankush, I don't know if you are familiar with Keras but the loss function is right underneath the imports and it would be nice to get quick feedback from you as well.

If you want to use this, it assumes you have a directory of h5py dbs each with a group called "/data" and where each record's data is the numpy array of the (greyscaled) 512x512 input image and an attribute called "label" has a 16x16x7 tensor representing the training label. (Note it's 16x16x7 just because it was easier for me to create this and transpose it then it was to create the 7x16x16 from the start).

from synthtext.

ankush-me avatar ankush-me commented on July 24, 2024

Hi @cjnolet, thank you for this contribution!

I looked through the loss function; I haven't worked with Keras before, so I can only guess that you are discounting the loss on bounding box coordinates for the negative cells here. Is this correct?
Only the "score" loss on the negatives should be discounted, and the bounding box loss for negatives should be ignored.

Again, thanks for sharing.

from synthtext.

cjnolet avatar cjnolet commented on July 24, 2024

from synthtext.

ankush-me avatar ankush-me commented on July 24, 2024

Thanks @cjnolet. Good to know that it is training with this loss.

Can you please help me understand the code again:

c = y_true[i, 6, :,:].reshape((1, delta, delta))   # The last feature map in the true vals is the 'c' matrix
final_c = (c * loss[i,6,:,:])
c = T.set_subtensor(c[(c<=0.0).nonzero()], d.get_value())
# Element-wise multiply of the c feature map against all feature maps in the loss
final_loss_parts = [(c * loss[i, j, :, :].reshape((1, delta, delta))).reshape((1, delta, delta)) for j in range(0, 6)]
  1. On line 2 above, you multiply c with the final channel of the loss (i.e., score), which zeros out score-loss for the negatives. Shouldn't you multiply with the discount factor (d in your code) instead ? Note that the negatives in c are set to the discount factor only later in line 3 above.
  2. On line 4 you multiply the bounding-box losses corresponding to the negatives with d. Shouldn't you multiply with 0 (or just c)?

from synthtext.

cjnolet avatar cjnolet commented on July 24, 2024

from synthtext.

ankush-me avatar ankush-me commented on July 24, 2024

Thank you for the clarification, and again for sharing your code!

from synthtext.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.