Skip to content
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

Implementation of TridentNet #3313

Merged
merged 33 commits into from
Dec 15, 2020
Merged

Conversation

Chrisfsj2051
Copy link
Contributor

@Chrisfsj2051 Chrisfsj2051 commented Jul 15, 2020

Implementation of TridentNet.

Please note that this implementation refers to the implementation in detectron2, which is slightly different from the origin paper. In paper, the author use r50 to conduct abaltion study, but report final results based on r101. While in detectron2, all experiments are conducted with r50. Besides, the author use all 3 branches to yield best performance, but detectron2 only uses the middle branch (index=1, dilation=2).

This implementation is still work in progress, for slightly lower accuracy comparing to detectron2. The unit test will be added after accuracy meets expect.

backbone schedule mAP-mmdet mAP-detr2
r50 1x 37.8 38.0
r50 3x 40.3 40.6
r101 3x Out of Memory 43.6

Update 7.20: The faster-rcnn C4 baseline with 3x schedule failed to reach the accuracy in detectron2.

type schedule mAP-mmdet mAP-detr2
frcnn-c4-r50 3x 37.8 38.4

@hezhu1996
Copy link

Hi @Chrisfsj2051 , I'm very interested in TridentNet as well. Is it runable in your repository?

@Chrisfsj2051
Copy link
Contributor Author

Hi @TWDH , Sorry for the Late Reply. Sure, it is already runnable.

@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #3313 (6a0862b) into master (fb287b1) will decrease coverage by 0.07%.
The diff coverage is 61.84%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3313      +/-   ##
==========================================
- Coverage   62.66%   62.59%   -0.08%     
==========================================
  Files         232      235       +3     
  Lines       17597    17818     +221     
  Branches     2942     2983      +41     
==========================================
+ Hits        11028    11153     +125     
- Misses       6031     6123      +92     
- Partials      538      542       +4     
Flag Coverage Δ
unittests 62.56% <61.84%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...mdet/core/bbox/iou_calculators/iou2d_calculator.py 96.77% <ø> (ø)
mmdet/datasets/pipelines/formating.py 66.37% <ø> (ø)
mmdet/models/backbones/resnet.py 99.30% <ø> (ø)
mmdet/models/dense_heads/gfl_head.py 27.35% <ø> (ø)
mmdet/models/dense_heads/yolo_head.py 34.04% <ø> (ø)
mmdet/models/necks/pafpn.py 39.58% <0.00%> (-3.60%) ⬇️
mmdet/models/roi_heads/trident_roi_head.py 23.63% <23.63%> (ø)
mmdet/core/post_processing/bbox_nms.py 85.96% <33.33%> (-3.13%) ⬇️
mmdet/models/detectors/trident_faster_rcnn.py 43.33% <43.33%> (ø)
mmdet/datasets/samplers/distributed_sampler.py 33.33% <50.00%> (+3.92%) ⬆️
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb287b1...95f6287. Read the comment docs.

@Chrisfsj2051
Copy link
Contributor Author

Hi @Johnson-Wang and @hellock ,

I tried to train TridentNet (as well as FRCNN-C4) with both Iteration-Based and Epoch-Based to see the difference, here's the result:

setting x-based schedule mAP-mmdet
mmdet-trident epoch 1x 37.8
mmdet-trident iter 1x 37.9
detr2-trident iter 1x 38.0
mmdet-trident epoch 3x 42.2
mmdet-trident iter 3x 42.1
detr2-trident iter 3x 42.6
mmdet-FrcnnC4 epoch 3x 38.1
mmdet-FrcnnC4 iter 3x 38.1
detr2-FrcnnC4 iter 3x 38.4

As shown in this table, with iteration-based 1x schedule (~12.3 epoch), this implementation yield 37.9mAP (0.1 lower than detr2). However, under 3x schedule, TridentNet is ~0.4 lower than detr2 and Frcnn-C4 is ~0.3 lower than detr2.

I'm wondering if it is qualified to be viewed or merged?

@Chrisfsj2051 Chrisfsj2051 changed the title WIP: Implementation of TridentNet Implementation of TridentNet Jul 27, 2020
@hezhu1996
Copy link

Hi @TWDH , Sorry for the Late Reply. Sure, it is already runnable.

@Chrisfsj2051 Hi, Thanks for reply. I have a question: What's your baseline's mAP? As far as I know, the official FasterRCNN in mmedetection is already 37.8% at https://github.com/open-mmlab/mmdetection/tree/master/configs/faster_rcnn. detectron2 improves the performance from 35.7 to 38. Does you code have the same improvement? Thanks, just curious.

@Chrisfsj2051
Copy link
Contributor Author

Hi @TWDH , Sorry for the Late Reply. Sure, it is already runnable.

@Chrisfsj2051 Hi, Thanks for reply. I have a question: What's your baseline's mAP? As far as I know, the official FasterRCNN in mmedetection is already 37.8% at https://github.com/open-mmlab/mmdetection/tree/master/configs/faster_rcnn. detectron2 improves the performance from 35.7 to 38. Does you code have the same improvement? Thanks, just curious.

Hi @TWDH , the 35.7 mAP FRCNN in detectron2 is FRCNN-C4. The 37.8 mAP FRCNN in mmdet that you mentioned above, however, is FRCNN-FPN, which has 37.9 mAP in detectron2 implementation (R50-FPN). TridentNet is based on FRCNN C4.

@hellock
Copy link
Member

hellock commented Sep 15, 2020

Task linked: CU-4btyv9 TridentNet PR review & Merge

@Chrisfsj2051
Copy link
Contributor Author

Task linked: CU-4btyv9 TridentNet PR review & Merge

It shows "You do not have access to this task code: ACCESS_083" with account "fangshijie@sensetime.com"

@CuongNN218
Copy link

@Chrisfsj2051 I'm really interested in your work, especially ResNet101-deformable. How can i use your work? I'm a github novice. thanks

@Chrisfsj2051
Copy link
Contributor Author

Using all of 3 branches for inference, we can improve the mAP of mstrain-3x setting model from 40.3 to 40.6.

@ZwwWayne ZwwWayne merged commit 4e921b2 into open-mmlab:master Dec 15, 2020
@Chrisfsj2051 Chrisfsj2051 deleted the tridentnet branch February 1, 2021 11:57
FANGAreNotGnu pushed a commit to FANGAreNotGnu/mmdetection that referenced this pull request Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants