Comments (3)
Hi @dsheacanopy,
This is an interesting question. There are many ways to help minority classes. In my current implementation, you have two options (that you can use separately or combine).
The first is using the option use_potentials=False
when creating the S3DISDataset. For S3DIS, I have designed two dataloader strategies.
use_potentials=True
: this strategy uses values on every points that I call potentials, when I pick an input sphere in the dataset, I update the potential value by incrementing them. And the next sphere will be picked at the minimum of potentials. This strategy ensure a geometric consistency in the sphere picking. We pick every part of the point cloud the same amount of time, compared to a random picking, where in practice, some part of the point cloud could actually never be picked, especially if they have low density.use_potentials=False
: This strategy is similar to thebalanced_class=True
in SemanticKitti.py. It is a random picking of the input sphere, but balanced by class. If the epoch need N sphere, we choose N/C sphere centered on a point of each class (where C is the number of classes). This strategy ensures that the network sees the minority class more often.
The second strategy is the one you are looking for, but remember it will be affected by varying densities as it remains a random picking.
The second option for you is to use the parameter class_w
, which controls the weight of each class in the loss. There is an example where I try using that here:
KPConv-PyTorch/train_SemanticKitti.py
Lines 186 to 188 in ccb820b
If you use the first option, you can find a function to compute the class proportion as seen by your loss here:
KPConv-PyTorch/datasets/SemanticKitti.py
Line 1420 in ccb820b
Don't hesitate to share your results here. I am curious to know if you manage to predict your minority class and how. In my case, class_w had nearly no effect, and the first option was the one which help the most.
Best,
Hugues
from kpconv-pytorch.
Thank you so much for your help! I was able to get it to make predictions on the minority class by using both approaches simultaneously. I did have some success with each approach by itself, but it appears that both together seem to have produced the best improvement in results.
I will close this issue since the core problem is resolved, but I did have to make a couple small changes on my side to get it to run. In particular:
https://github.com/HuguesTHOMAS/KPConv-PyTorch/blob/master/datasets/S3DIS.py#L513
https://github.com/HuguesTHOMAS/KPConv-PyTorch/blob/master/utils/trainer.py#L587
These were raising an IndexError when setting use_potentials=False
so I ended up just breaking on the exception. I don't know if this is the preferred workaround, or if that should have been happening at all, but it appears to have worked for me.
Thanks again!
from kpconv-pytorch.
Hi @dsheacanopy
I am trying to do something similar. Could you please let me know how you got to make predictions for the minority classes?
This would really be helpful.
Thank you in advance.
from kpconv-pytorch.
Related Issues (20)
- Caught IndexError in DataLoader worker process 0 HOT 9
- using Kpconv semantic segmentation for the room segmentation HOT 3
- Batch clone HOT 1
- the meaning of neighborhood_limits HOT 4
- Slow training on custom dataset with a several validation datasets HOT 2
- the huge time required by segmentation_inputs function HOT 1
- how can we do data fusion after model training and inferecing is done?
- the exit() problem when using cpp_neighbors.batch_query() function HOT 2
- AttributeError: module 'cpp_wrappers.cpp_neighbors.neighbors' has no attribute 'batch_query' HOT 1
- Issue of apparent infinite loop while testing the model using test_models.py after utilizing the NPM3D dataset. HOT 1
- Invalid argument in training? HOT 1
- Pretrained model for Toronto3D HOT 1
- Train a custom point cloud dataset with 50 more features HOT 3
- max_pool return shape
- S3DIS Dataset HOT 1
- Toronto3d .tar Trained model is not Unzipping
- Dataset only containes empty input spheres error during calibration
- How to decide the "in_feature_dim" of train_**.py? HOT 1
- Why is in_features_dim = 5 for S3DIS? HOT 3
- 您好,我在运行 python train_SemanticKitti.py这个程序的时候显示了以下错误,可是我的数据集并还没有pose.txt文件
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 kpconv-pytorch.