Git Product home page Git Product logo

crater-detection's Introduction

Lunar Orbit Navigation Using Ellipse R-CNN and Crater Pattern Matching

Crater Detection Sample

This repository contains the necessary components to compose a Terrain-Relative Navigation (TRN) pipeline for navigating around the moon at altitudes below 500km. It utilizes a crater rim detection method based on Faster R-CNN & Ellipse R-CNN which is then trained to perform its task on simulated monocular camera images. These images are generated using SurRender, and the training mask is created by projecting the apparent ellipses of craters into the image plane. Identification is done using the method as described in Christian et al., 2020, which allows the system to create a database of projective invariants that are unique to each (approximately) coplanar crater triad.

Note: The notebooks in this repository are for development purposes and contain deprecated code - they will be updated in the future to demonstrate the capabilities of the package.

Model description

Crater detector

Instructions

This repository uses git LFS.

Dataset creation (SurRender server required)

usage: create_dataset.py [-h] [--n_train N_TRAIN] [--n_val N_VAL]
                         [--n_test N_TEST] [--identifier IDENTIFIER]
                         [--resolution RESOLUTION] [--fov FOV]
                         [--min_sol_incidence MIN_SOL_INCIDENCE]
                         [--max_sol_incidence MAX_SOL_INCIDENCE]
                         [--ellipse_limit ELLIPSE_LIMIT] [--filled FILLED]
                         [--mask_thickness MASK_THICKNESS]

Create dataset containing input images and relevant ellipses using SurRender.

optional arguments:
  -h, --help            show this help message and exit
  --n_train N_TRAIN     Number of training images (default: 20000)
  --n_val N_VAL         Number of validation images (default: 1000)
  --n_test N_TEST       Number of testing images (default: 1000)
  --identifier IDENTIFIER
                        Number of testing images (default: None)
  --resolution RESOLUTION
                        Camera resolution (default: (256, 256))
  --fov FOV             Camera FoV (default: 45)
  --min_sol_incidence MIN_SOL_INCIDENCE
                        Minimum solar incidence angle (default: 10)
  --max_sol_incidence MAX_SOL_INCIDENCE
                        Maximum solar incidence angle (default: 80)
  --ellipse_limit ELLIPSE_LIMIT
                        Maximum ellipticity for gt ellipse shapes
                        (selenographic) (default: 1.3)
  --filled FILLED       Whether to fill the crater masks or not (default:
                        True)
  --mask_thickness MASK_THICKNESS
                        How thick to make the mask rim if not filled (default:

Model training

Start MLflow server using:

mlflow server --backend-store-uri=sqlite:///mlruns.db --default-artifact-root=artifacts

After installing all required packages and retrieving the dataset, start training using train_model.py:

usage: train_model.py [-h] [--epochs EPOCHS] [--batch_size BATCH_SIZE]
                      [--num_workers NUM_WORKERS]
                      [--learning_rate [LEARNING_RATE]] [--backbone BACKBONE]
                      [--run_id [RUN_ID]] [--dataset DATASET]
                      [--momentum MOMENTUM] [--weight_decay WEIGHT_DECAY]
                      [--device DEVICE]

Train the crater detection model on images and target ellipses

optional arguments:
  -h, --help            show this help message and exit
  --epochs EPOCHS       Number of epochs (default: 20)
  --batch_size BATCH_SIZE
                        Batch size (default: 8)
  --num_workers NUM_WORKERS
                        Number of workers for training dataloader (default: 4)
  --learning_rate [LEARNING_RATE]
                        Learning rate (default: 0.001)
  --backbone BACKBONE   Model backbone ResNet type. (default: resnet50)
  --run_id [RUN_ID]     Resume from MLflow run checkpoint (default: None)
  --dataset DATASET     Dataset path (default:
                        data/dataset_crater_detection_40k.h5)
  --momentum MOMENTUM   Momentum input for SGD optimizer. (default: 0.9)
  --weight_decay WEIGHT_DECAY
                        Weight decay input for SGD optimizer. (default: 1e-07)
  --device DEVICE       Device to train model on (`cpu` or `cuda`) (default:
                        cuda)

crater-detection's People

Contributors

wdoppenberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

crater-detection's Issues

CV Approaches

Very promising: DeepMoon

Model doesn't contain layers that are unsupported by OpenVINO, therefore an ideal candidate. Worthwhile to examine the post-processing methodology. Available code + datasets are very complete.

Using OpenCV's thresholding, convex hull generation, and ellipse fitting a functional crater detection pipeline was generated.

Replace NumPy with PyTorch for all subsystems

For convenience, acceleration, and consistency, it is favourable to have all tensor operations written in PyTorch.

It is somewhat limited by PyTorch's ability to handle broadcasted linear algebra compared to NumPy, but
release 1.9 promises a better linalg module.

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.