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
custom dataset with 4 classes #17
Comments
Hi @SuzannaLin For your dataset, how much labeled instances you have? and is the bg class the dominant class? |
I haven't done a pixel count yet, but the BG is the biggest one, object label 1 is least present. There are lots of images with only BG present. Would that be the reason? |
{
} |
Hi @SuzannaLin I must say, the low mIoU of the second class is expected, you can see the pixel count is a bit low, can you train with a standard CE instead of abCE ? can you also use a larger batch size to help with batch norm fine-tuning. |
I'll run with CE and see what happens. I can't increase the batch size due to low memory. |
Can you train for a bit longer (say 100 epochs) with a lower LR. |
Yes, I think the model overfits to the frequent classes quickly, maybe try using a higher abCE loss threshold ( |
@SuzannaLin glad things improved. |
@SuzannaLin, hello ! You've mentioned labels from 0-3 for 4 classes. Where should I add this change ? I am trying to train on my own dataset. But got mIoU 0 for another class. Thank you ! |
You can change it in the dalaloarder function. |
Yes, indeed. In dataloaders/voc.py, you can set the number of classes.
|
@SuzannaLin Hello, my dataset num_ Classes = 2 (0-1, where 0 is the background) In the inference process, the target object result is 1:0.0. Only when num_ When classes = 21, there will be normal inference results. How to solve this problem? Thank you. |
@00000022234 which loss function are you using? I used Focal Loss because my objects were very small and I had mostly background pixels. If you want to try Focal Loss, set "sup_loss": "FL" in the config file. You can use the function get_alpha or choose your own alpha values for your BG and object class. |
@SuzannaLin Thank you very much for your reply. I used your method to solve the above problems. How to adjust the parameters of the number of decoders in the code? And how to adjust the parameters of the number of noise? Thank you! |
The number of decoders is set in the config file: |
@SuzannaLin Thank you very much for your reply. I have solved the problem that has bothered me for a long time. |
Thank you so far for all your great help.
I have an issue that I also found in the closed issues, but for me it isn't solved.
I have my own custom data set with 4 classes (background and 3 objects, labeled 0-3), so I changed num_classes = 4 in voc.py
The results with training fully supervised are as shown in the image below. There is one class with an IoU of 0.0.
I ran multiple tests, using semi and weakly supervised settings, the results are unpredictable and often show 0.0 for the object classes. Only the background has good results.
Is there something I need to adjust in the code?
The text was updated successfully, but these errors were encountered: