Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about distance, boundary, segmentation and watershed algorithm. #7

Open
0ozzy0 opened this issue Sep 21, 2022 · 0 comments
Open

Comments

@0ozzy0
Copy link

0ozzy0 commented Sep 21, 2022

Hello, at first, i like to thank you about the code that you have shared. My question is, how can we obtain 1) the probability of belonging to a field; 2) the probability
of belonging to a boundary; and 3) the distance to the closest
boundary with the corresponding code and have you used watershed algorithm as the resunet article suggests.

`dist = ZeroPadding2D(padding=1)(x1)
dist = Conv2D(32, 3)(dist)
dist = self.normalization(dist, self.layer_norm)
dist = Activation('relu')(dist)
dist = ZeroPadding2D(padding=1)(dist)
dist = Conv2D(32, 3)(dist)
dist = self.normalization(dist, self.layer_norm)
dist = Activation('relu')(dist)
dist = Conv2D(self.num_classes, 1, activation='softmax', name = 'distance')(dist)

    bound = Concatenate(axis=-1)([x, dist])
    bound = ZeroPadding2D(padding=1)(bound)
    bound = Conv2D(32, 3)(bound)
    bound = self.normalization(bound, self.layer_norm)
    bound = Activation('relu')(bound)
    bound = Conv2D(self.num_classes, 1, activation='sigmoid', name = 'boundary')(bound)

    seg = Concatenate(axis=-1)([x,bound,dist])
    seg = ZeroPadding2D(padding=1)(seg)
    seg = Conv2D(32, 3)(seg)
    seg = self.normalization(seg, self.layer_norm)
    seg = Activation('relu')(seg)
    seg = ZeroPadding2D(padding=1)(seg)
    seg = Conv2D(32, 3)(seg)
    seg = self.normalization(seg, self.layer_norm)
    seg = Activation('relu')(seg)
    seg = Conv2D(self.num_classes, 1, activation='softmax', name = 'segmentation')(seg)

    model = Model(inputs = input, outputs={'seg': seg, 'bound': bound, 'dist': dist})`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant