Giter Site home page Giter Site logo

Comments (5)

bonlime avatar bonlime commented on July 26, 2024 2

It depends on your loss function and classes topology.
If classes are mutually exclusive you can add background class and use softmax at the top. During training at Imagenet authors of original paper used this way.
But you can use sigmoid as activation at the last layer without adding background and it also will work

from keras-deeplab-v3-plus.

vodp avatar vodp commented on July 26, 2024 1

As @bonlime said if you background contains other classes you may not want to assign it as a 'background' class, rather just ignore it as 'ignore_label'. Of course in detection the network segments every pixel so that you won't have background being classified.

If background is really irrelevant objects, then you may want to add it as an additional class.

In VOC pascal the Deeplabv3 used background class as it was defined in the dataset.
In city datasets, background class is absent because dense segmentation was designed for those datasets.

from keras-deeplab-v3-plus.

vodp avatar vodp commented on July 26, 2024 1

You need to write a custom loss function, addressing ignore_label and do not include the loss incurred by ignore_label into the total loss.

from keras-deeplab-v3-plus.

ad12 avatar ad12 commented on July 26, 2024

Thank you @bonlime and @vodp !

In the case that the pixels are mutually exclusive, would my prediction mask have 4 channels? Or would I make the mask non binary (i.e. each pixel has a value of 0-num_classes for the corresponding pixel value?

In other words, assuming my input image is of shape (288, 288, 1), then would my corresponding mask for 4 classes (not including background) have a shape of (288, 288, 1, 4) if I want the network to predict each mask separately?

from keras-deeplab-v3-plus.

ad12 avatar ad12 commented on July 26, 2024

@vodp I am planning on not adding a background class, but how do I ignore the pixel? Is there a way to specify it as ignore_label?

I am also not getting a binary mask after training. Are there any changes that I need to make for this?

from keras-deeplab-v3-plus.

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.