Comments (3)
Hello,
Thanks for your interest! Since we are predicting masks after cropping the image using the extreme points, there will be an imbalance on the number of foreground and background pixels. There will be way more foreground pixels than background ones which can bias the network on being overconfident about foreground. In order to alleviate that problem, we use the class balancing that was originally introduced in [1].
[1]: Holistically-Nested Edge Detection
from dextr-pytorch.
Hi, thanks for your reply.
I read the reference paper, the paper introduces a bias weight to two terms in the formula, which corresponds to your num_labels_neg/num_total and num_labels_pos/num_total. But it still exists a gap with your implementation. I am not so clear about the loss_val calculation.
following is copied from your code.
output_gt_zero = torch.ge(output, 0).float()
loss_val = torch.mul(output, (labels - output_gt_zero)) - torch.log(1 + torch.exp(output - 2 * torch.mul(output, output_gt_zero)))
I wonder why it is not as follows:
loss_val = torch.mul(label, torch.log(1/(1+torch.exp(-output)))) + torch.mul(1.-label, torch.log(1-1/(1+torch.exp(-output))))
Thank you.
from dextr-pytorch.
Hello,
The loss that you describe would be the theoretical definition (you can find it here in one of our previous projects). However, that can be unstable during training and the formulation is rearranged so it behaves better during training. You can find here a similar derivation from the theoretical to the practical one (it's not exactly the same, but you should be able to derive ours from there).
Also, note also that the actual class balancing happens here.
Let me know if you have any other question!
from dextr-pytorch.
Related Issues (20)
- MS Coco Training Code HOT 1
- UR CODE WAS COPIED FOR SELL NOW HOT 1
- PASCAL Context Background (Stuff) Classes dataloader
- Results of dextr_pascal and dextr_coco models HOT 2
- Training time of PASCAL VOC 2012 HOT 1
- What if generated mask is not correct? HOT 1
- I can't click the extreme points in the picture HOT 1
- IndexError: index 0 is out of bounds for axis 0 with size 0 HOT 3
- RuntimeError: ONNX export failed: Couldn't export operator aten::adaptive_avg_pool2d
- Issue with running the demo file HOT 2
- Results on background classes of PASCAL Context HOT 1
- OSError: [WinError 126] The specified module could not be found HOT 1
- Speed metrics ? HOT 2
- How to train this model on other dataset? HOT 1
- Performance of DEXTR with 2 or 3 points HOT 3
- process about clicks more than 4 points HOT 1
- demo.py blocks at line 49
- List out of range HOT 2
- Train on Custom dataset in COCO style annotation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dextr-pytorch.