open-mmlab / mmdetection

OpenMMLab Detection Toolbox and Benchmark
https://mmdetection.readthedocs.io
Apache License 2.0
29.12k stars 9.38k forks source link

Weakly-supervised object detection #667

Closed burakceng closed 4 years ago

burakceng commented 5 years ago

Hello, there!

I was going through some research papers on Weakly-supervised object detection (no bounding boxes in ground truths, only labels). I wonder if I can apply it to this repository. I was thinking of doing the following at least (I guess):

Up until this point I was stuck at several places about this bbox regression loss cancellation.

The papers I read are https://arxiv.org/abs/1511.02853 , https://arxiv.org/abs/1704.00138 .

Thanks for your efforts for this repo.

Kind regards,

Burak

hellock commented 5 years ago

That depends on the pipeline you adopt. If you want to implement different data preprocessing, then you need to write a new dataset (which can also inherit from existing ones), If you only change the box prediction, you need to write another bbox head. If you change the whole pipeline, then you need to implement a new detector.

BurakHocaoglu commented 5 years ago

Now, I am planning on constructing my dataset on top of the original COCO dataset by adding another field gt_counts. I think its easy to integrate it to the dataset loader of pytorch; however, the signatures of forward() methods of models seem to be fixed and if I try to add another keyword argument to, for example, BBoxHead.forward() method, I won't be able to make it work at all. So my question is, where can I find the line of code that calls the forward method of a specific detector model (e.g. FasterRCNN.forward())?

The training api shows a model(**data), which I believe serves for what I am asking, but it is closed, so I cannot get into it. Probably, I'm missing something and I accidentally put myself into a messy situation, because of the details. So, in other words, how can I pass my new field of annotation to my training, especially when computing losses?

Sorry for bad explanation and thanks in advance...

Burak

burakceng commented 5 years ago

I guess I dealt with it. Closing...

burakceng commented 5 years ago

Hello again,

Sorry for re-opening this issue, but opening another issue would be more messy. This time I have a couple questions regarding the mechanics of training rather than implementation.

First of all, I have 2 custom datasets, namely WeakCocoDataset and WeakVocDataset. Normally, they should have only the labels that I am going to give, but I thought, for simplicity of mAP calculation, I should have the original label and bbox annotations intact; therefore, both datasets are pretty much the same as their fully-supervised counterparts with an addition of my labels. I am not gonna use any of those annotations in my training, though. Only the one associated with my task is used in training, which is instance counts of each class in the dataset in a particular image.

Secondly, I have a custom pipeline which resembles Faster R-CNN pretty much, but its trained with weak supervision and the implementation follows accordingly. Short overview of my model:

My problems are:

Any advices ??

Sorry for that adventurous explanation and if I created plot holes.

Thanks in advance...

Burak