Git Product home page Git Product logo

anchor-optimization's Introduction

Introduction

Anchor optimization for RetinaNet based on Improving RetinaNet for CT Lesion Detection with Dense Masks from Weak RECIST Labels by Martin Zlocha, Qi Dou and Ben Glocker. Implementation makes heavy use of keras-retinanet.

For questions and discussion join the Keras Slack and either message me directly (username: martinzlocha) or join the #keras-retinanet channel.

Setup

  1. Clone this repository
  2. pip install .
  3. python setup.py build_ext --inplace

Usage

Basic usage:

  1. Define your own dataset in a csv format, for more information follow the guide in keras-retinanet.
  2. Run python optimize_anchors.py PATH_TO_CSV

Additional options:

  • scales and ratios parameters allows you to define the number scales and ratios in your anchor configuration.
  • objective parameter allows you to specify how the objective function is calculated. The avg parameter optimizes the average overlap between the anchors and the ground truth. We suggest that you use the focal parameter (default) instead because it ensures that there are less ground truth lesions with lower than 0.5 IoU with an anchor.
  • popsize parameter allows you to specify the population multiplier used by differential evolution. Higher values result in better results however the computation will also be slower.
  • By default the images and the detected objects are resized using the same method as in keras-retinanet implementation. If you do not wish to resize the image use the no-resize flag or specify different image-min-side and image-max-side.
  • By default we ignore strides when optimizing the anchor configuration, this makes it feasible to optimize the anchors for a large number of objects in a short time. We have recently added an include-stride flag. This makes the computation much slower however it is more accurate. We suggest you only use it if your dataset is small.

To reproduce our results:

python optimize_anchors.py PATH_TO_CSV --ratios=5 --no-resize

Notes

  • This repository has been tested on python 3.7.
  • This repository relies on keras-retinanet 0.5.1.

Contributions to this repository are welcome.

Citation

If you find the code or the optimized anchors useful for your research, please consider citing our paper.

@article{zlocha2019improving,
  title={Improving RetinaNet for CT Lesion Detection with Dense Masks from Weak RECIST Labels},
  author={Zlocha, Martin and Dou, Qi and Glocker, Ben},
  journal={arXiv preprint arXiv:1906.02283},
  year={2019}
}

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.