Git Product home page Git Product logo

detectron2's Introduction

Object Detection을 위한 신경망 모델의 Feature Map 분석

  • 본 프로젝트에선 Object Detection 모델의 다양한 layer의 feature map을 열화시켰을 때 object detection에 어떤 영향을 끼쳤는지에 대해 연구하였다.
  • bilinearInterplate 기법을 사용하여 feature map을 열화시켰다.
    • 이때 압축 scale이 4라는 것은, feature map을 1/4배로 축소시킨 후, 기존 feature map 크기로 복구시켰다는 것을 의미한다.

관련 자료

[보고서]

About Codes

train_net.py --cr int int int int int int (왼쪽부터 p2~p6의 압축 scale)
ex) train_net.py --cr 1 1 1 1 1 4 (p6만 압축 scale 4, p2 ~ p5는 scale 1 (열화x))

다양한 조합에 대해 실험을 진행해야 하기 때문에 각 feature map에 대한 압축 scale을 작성해주면, 입력 scale 대로 열화하여 성능 확인 및 json파일로 결과를 저장하도록 코드를 변경해주었다.

        for f, ratio in zip(self.in_features,self.compress_ratio):
            h,w = features[f].shape[-2:]
            if ratio == 1:
                up_sample = features[f]
            else:
                down_sample = torch.nn.functional.interpolate(features[f], (int(h//ratio), int(w//ratio)),mode='bilinear')
                up_sample = torch.nn.functional.interpolate(down_sample, (int(h),int(w)),mode='bilinear')
            new_features.append(up_sample)
        features = new_features
        if comm.is_main_process():
            verify_results(cfg, res)
            # expn = f"2-{args.cr[0]}_3-{args.cr[1]}_4-{args.cr[2]}-5_{args.cr[3]}-6_{args.cr[4]}"
            result = [vars(args),res]
            expn = f"final_p4-3_p3_{args.cr[0]}-p5_{args.cr[1]}-mix"
            with open(f'/root/workspace/test_d/output/cr_output/{expn}.json', 'w') as outfile:
                # json.dump(vars(args),outfile,indent=4)
                # json.dump(res,outfile, indent=4)
                json.dump(result,outfile, indent=4)
        return res

Experiment Descriptions

Proposed Method

  • Feature Pyramid에서 물체 판별에 큰 영향이 있는 key feature maps만 전달함.
  • 그 후, key feature maps의 정보를 활용하여 feature pyramid를 복구함. image

압축률에 따른 object scale 별 Average Precision

image

  • 각 Object 별 성능 영향도가 높은 Feature Map
    • Small Object: P2, P3
    • Medium Object: P4, P5
    • Large Object: P5, P6

물체 크기별 영향도가 높은 Feature Map들을 최대 열화시켰을 때의 성능

image

  • 각 Object Scale에 크게 관여하는 두 Feature Map을 모두 최대 열화시켰을 때, 상당한 성능 drop.
    • Small Object, Medium Object: -10AP
    • Large Object: -1.8AP
    • (P2,P3), (P4,P5), (P5,P6) 조합으로 제거하면 상당한 성능 drop을 가지게 됨.

Key Feature Map 분석

image

Conclusion

  • 본 연구에서는 Feature Pyramid의 각 Feature들을 열화시켜 해당 Feature의 실제 모델 성능의 영향도를 분석함.
  • 분석을 통해, 물체 사이즈에 따라 영향을 받는 Feature Map이 다르다는 것을 파악하였고, 모든 물체 사이즈에 대한 판별을 고려하여 Key Feature Map을 추출하였음.
  • 이후, Key Feature Map만을 활용하여 전달되지 않은 feature map을 대체해 Feature Pyramid를 복구시켜 1.4% AP drop으로 7.96배의 데이터량을 감소시킴.

detectron2's People

Contributors

ppwwyyxx avatar vkhalidov avatar marcszafraniec avatar wat3rbro avatar alexander-kirillov avatar bowenc0221 avatar wenliangzhao2018 avatar lyttonhao avatar patricklabatut avatar chenbohua3 avatar dbwp031 avatar rbgirshick avatar superirabbit avatar theschnitz avatar mrparosk avatar sampepose avatar hannamao avatar jonmorton avatar maxfrei750 avatar wangg12 avatar kondela avatar bryant1410 avatar raymondcm avatar newstzpz avatar jss367 avatar chengyangfu avatar obendidi avatar rajprateek avatar sstsai-adl avatar puhuk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.