Comments (5)
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.
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.
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.
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.
@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)
- weights/mobilenetv2/custom_logits_semantic_kernel.npy HOT 1
- How can I get the result images? HOT 1
- Problems in training my dataset HOT 3
- Where is the last layer (1280 channels) in MobileNetV2 implementation? HOT 1
- Upsampling Issue HOT 1
- Loading weights from deeplabv3_mnv2_dm05_pascal_trainaug
- Batch inference slow HOT 1
- Training on custom dataset, I get AttributeError: 'Tensor' object has no attribute 'numpy' HOT 1
- How can I get inference with OS=8 after training with OS=16? HOT 1
- Prediction not working, received error 'cuda could not initialize prediction'
- AttributeError: 'int' object has no attribute 'value' HOT 1
- AttributeError: 'int' object has no attribute 'value' at deeplab_model = Deeplabv3() HOT 1
- Problem Training HOT 1
- IndexError: arrays used as indices must be of integer (or boolean) type
- Model not learning anything HOT 1
- tf.compat.v1.image.resize_images
- Citation in Journal HOT 1
- 左电极与有电极无法区分
- Exit Flow atrous rate in XCeption backbone
- Order of the convolution
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 keras-deeplab-v3-plus.