Comments (4)
If you would closely, the examples are designed so that you never train with unclassified values. In the ISPRS dataset, there are 6 classes, 'unclassified' is not one of them.
Now, as far as I understand, you want to perform binary classification with undefined labels. So, what you should have is ignore_label: 2
in your prototxt file (assuming that 0 is 'A', 1 is 'B' and 2 is 'unclassified').
However, the number of outputs in the last convolutional layer has to match the number of labels, even if you ignore the last label. So, if you want to train with A, B and undefined, your final layers should be like those :
layer {
name: "conv1_1_D"
type: "Convolution"
bottom: "conv1_2_D"
top: "conv1_1_D"
param {
lr_mult: 1
decay_mult: 1
}
convolution_param {
num_output: 3 ### because you have 3 labels = A, B, undefined
pad: 1
kernel_size: 3
weight_filler {
type: "msra"
}
}
}
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "conv1_1_D"
bottom: "label"
top: "loss"
ignore_label: 2 ### Do not compute the loss (and do not train) on the 'undefined' labels
}
I hope this is clear enough.
from deepnetsforeo.
Yes, it's clear. I had tried something similar before, but it fails building the net, because "caffe.LayerParameter has no field named "ignore_label".
So, what I tried now is the following:
layer {
name: "conv1_1_D"
type: "Convolution"
bottom: "conv1_2_D"
top: "conv1_1_D"
param {
lr_mult: 1
decay_mult: 1
}
convolution_param {
num_output: 3 ### because you have 3 labels = A, B, undefined
pad: 1
kernel_size: 3
weight_filler {
type: "msra"
}
}
}
layer {
name: "loss"
type: "SoftmaxWithLoss"
bottom: "conv1_1_D"
bottom: "label"
top: "loss"
accuracy_param {
ignore_label: 2 ### Do not compute the loss (and do not train) on the 'undefined' labels
}
}
Is this correct?
from deepnetsforeo.
After all, i suppose that I also have to modify the net in the inference step.
Is this true?
from deepnetsforeo.
Yes, but it's not mandatory. What's important is that you do not train on unclassified labels. In the inference steps, unclassified labels should not be predicted anyway, although you can add the "ignore_label" parameter in the inference network so that you compute the accuracy and loss without taking those pixels into account.
from deepnetsforeo.
Related Issues (20)
- prediction on my image HOT 1
- Typos to load Potsdam data HOT 3
- Problem to get the dataset HOT 1
- Low accuracy during training HOT 2
- Operation on cpu HOT 5
- PyTorch 4.0 compliance
- Data set present in the link does not match the code HOT 1
- Value Error: Axes don't match array! HOT 1
- problems with SGDSolver HOT 1
- Using images with with nodata pixels HOT 4
- Error with train: invalid index of a 0-dim tensor
- nDSM DATA of Vaihingen Dataset HOT 3
- accuracy of your SegNet model HOT 4
- Initialization of V-fusenet HOT 2
- downloading dataset HOT 5
- code for the fusion of DSM data and RGB image HOT 1
- Datasets HOT 1
- DSM, NDSM and NDVI Part HOT 1
- error during model training HOT 7
- the use of another dataset
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 deepnetsforeo.