Shank2358 / GGHL

This is the implementation of GGHL (A General Gaussian Heatmap Label Assignment for Arbitrary-Oriented Object Detection)
GNU General Public License v3.0
624 stars 112 forks source link

demo #1

Closed trungpham2606 closed 2 years ago

trungpham2606 commented 2 years ago

Thank you @Shank2358 for sharing a great work. Iam trying to visualize the detection with your work. But when I normally ran the test.py file, it popped up an error about e2cnn. So can you show me the reference of e2cnn. Thank in advance.

Shank2358 commented 2 years ago

@Shank2358 Actually It was trained 243/500, not 500 (I stopped it). Iam ignoring the classes as you suggested and It output some results. I will draw the rotate boxes to see the results clearly.

Oh i didnt update it :((. I will retrain to see.

I'm sorry, this bug appeared in the version a few days ago, I forgot to remind you. It seems that there is a problem with classification. I have a few suggestions, maybe you can try them. 1) The ID of the category starts from 0, is it correct? 2) The classified loss is mainly composed of three parts. pos_loss represents the loss of the positive category, and negative_loss represents the loss of the negative category. Your neg_loss=0, I guess there is only one category? (If I guess wrong, maybe you need to check 1) carefully). If there are multiple categories, neg_loss will not always be 0. cls_loss represents the classic BCEloss (this is not used in our paper), adding it may converge more stable. Or you can use BCEloss instead of pos_loss and neg_loss. This is the most common classification loss. Good luck.

There are some updates to the details of the code. You'd better update the three files of dataloader, agmentation, and loss. thanks.

trungpham2606 commented 2 years ago

@Shank2358

  1. it starts from 0.
  2. this dataset has 1 class only.
  3. and when i tried to get the bboxes in evaluator, the shape of coors_rota seems not correct image

it should be (8, *) right ?

trungpham2606 commented 2 years ago

oh i will pull the latest code and re-train.

Shank2358 commented 2 years ago

3. ta seems not c

1 and 2 ar OK

  1. coors=[xmin,ymin,xmax,ymax], coors_rota=[s1,s2,s3,s4], s1-s4 are in (0,1).

If you want to get the bbox, it may be more appropriate at this position, they are the decoded boxes

image

Here is the result of decoding bbox=[x1,y1,x2,y2,x3,y3,x4,y4] according to coors=[xmin,ymin,xmax,ymax] and coors_rota=[s1,s2,s3,s4]

Shank2358 commented 2 years ago

oh i will pull the latest code and re-train.

If there is no problem with the positioning and the results can be displayed, you can try to retrain and see. If there is still a problem with bbox positioning, you may need to continue to troubleshoot the bug first.

trungpham2606 commented 2 years ago

@Shank2358 Got it. Thank you!!!

trungpham2606 commented 2 years ago

@Shank2358 The loss_cls is still so high and doesnt decrease at all.

Shank2358 commented 2 years ago

@Shank2358 The loss_cls is still so high and doesnt decrease at all.

Do loss_cls and loss_pos not decreased? Or is there only one loss that does not decrease? Have you tried loss_pos+loss_neg+loss_cls loss_pos + loss_neg loss_cls Do these loss combinations do not work? It seems that this should not be the case for single classification tasks, because in fact, only confdence is required to detect the target. Can you show me the loss? Or can you please check if the loss is consistent with the screenshot above. Or I will take a few similar pictures tomorrow and try it out for training?

Shank2358 commented 2 years ago

@Shank2358 The loss_cls is still so high and doesnt decrease at all.

Did you run out of the result of the toy dataset yesterday? If you can get results similar to mine, it means that our code is consistent.

trungpham2606 commented 2 years ago

@Shank2358 The loss_cls doesnt decrease while the other loss (loss_l, loss_m, loss_s) decrease but not small as what I had shown to you. I think the best way is I send you the data to train to see whether you meet the same issue as mine.

Shank2358 commented 2 years ago

@Shank2358 The loss_cls doesnt decrease while the other loss (loss_l, loss_m, loss_s) decrease but not small as what I had shown to you. I think the best way is I send you the data to train to see whether you meet the same issue as mine.

Thanks. I will try to train and give you feedback as soon as possible.

Shank2358 commented 2 years ago

@Shank2358 The loss_cls doesnt decrease while the other loss (loss_l, loss_m, loss_s) decrease but not small as what I had shown to you. I think the best way is I send you the data to train to see whether you meet the same issue as mine.

The loss when training 12 epochs. image

It seems to converge. I will give you feedback after all training in a while. Then I will email you all the codes, weights and logs of my training. It seems that there are still some problems in your code. In addition, I will keep your data confidential.

trungpham2606 commented 2 years ago

@Shank2358 I see, thank you !

Shank2358 commented 2 years ago

@Shank2358 I see, thank you !

I have trained it for 185 epochs. This is part of the result of the visualization, it seems that the object can be detected. I will send the complete code, weights and training log to your email tomorrow.

image

However, it is indeed difficult to detect such long objects, especially when returning to s1-s4. I increased the loss of this part by 3 times. Like most rotating object detection methods, GGHL does not perform as well as expected in the detection of such extremely long objects. For such objects, maybe you can try the PIOU algorithm. At least the experiment at this stage proves that GGHL can work.

For this type of object, I adjusted some hyperparameters. You can see the details in the code I sent you. In the label assignment process, these objects are relatively large, so they are all assigned to the mask_l layer. Therefore, it is not necessary to use a 3-layer FPN structure if there are only such objects, only one layer is OK. Maybe you can change the model structure.

Regarding the improvement and adjustment of the model, we can continue to discuss if you are interested.

Next, maybe you need to see where there are errors in your code based on the code I sent you, and then adjust the parameters and try again. The dataset is relatively small, I also suggest that you can try a smaller model, such as resnet18. Then there are many excellent rotating object detection methods that are also worth trying. Adjust and select the appropriate model according to your task needs.

Thanks.

trungpham2606 commented 2 years ago

@Shank2358 Thank you so much !!! PIou is a nice approach for coping with this long objects. I will try applying it after getting the same results as yours ^^

Shank2358 commented 2 years ago

@Shank2358 Thank you so much !!! PIou is a nice approach for coping with this long objects. I will try applying it after getting the same results as yours ^^

You're welcome~