Giter Club home page Giter Club logo

ai4cma's Introduction

Introduction

This repo contains the code for the solution proposed by Gaussian Solutions LLC for the DARPA's challenge 'AI for Critical Mineral Assessment Competition'. More about the competition can be read [here] https://criticalminerals.darpa.mil/Leaderboard

Approach

Please refer the Technical brief for an overview of the approach.

Setting up the environment

conda create -n env_cma python=3.9
conda activate env_cma
git clone https://github.com/sureshgaussian/ai4cma.git
cd ai4cma
pip install -r requirements.txt

Preparing inputs

All the parameters required to process the inputs, run the experiments, generate predictions are defined in config.py file.
Specify the ROOT_PATH in config.py. This directory is used to hold the raw and preprocessed data, model checkpoints, and results.
Extract the training and validation data to $ROOT_PATH/data/

ROOT_PATH 
├── data
│   ├── training
│   ├── validation

Run the below script to generate the input descriptors and tiled inputs.

python prepare.py -d challenge -o prepare_inputs

This creates a folder structure as shown below


ROOT_PATH    
├── tiled_inputs
│   ├── info
│   │   ├── challenge_training_files.csv (holds meta data of each binary raster file)
│   │   ├── challenge_testing_files.csv
│   ├── challenge_training
│   │   ├── info
│   │   │   ├── all_tiles.csv (holds the tile information)
│   │   │   ├── balanced_tiles.csv
│   │   ├── inputs
│   │   ├── legends
│   │   ├── masks
│   ├── challenge_testing
│   │   ├── info
│   │   │   ├── all_tiles.csv (holds the tile information)
│   │   │   ├── balanced_tiles.csv
│   │   ├── inputs
│   │   ├── legends
│   │   ├── masks
│   ├── ...

Training

Parameters related to training are specified in $ROOT_PATH/config.py.

python train.py -d challenge

Saves the model checkpoints under $ROOT_PATH/temp.

Inference

Download the trained models from here and place them under $ROOT_PATH/temp. Run the script to generate tiles for each validation file, run the inference and save the stitched predictions under $ROOT_PATH/results/ Note: For any inference task, please place the files under 'validation' folder for the script to pick up the files. This is a limitation of how we coded the path set up, relative paths etc, and not the algorithm limitation.

python inference.py -d challenge -s validation 
ROOT_PATH  
├── results
│   ├── testing
│   ├── validation
│   │   ├── ArthurTaylor_1990_Fig28_contour_line.tif
│   │   ├── pp1410b_Lower_Mesozoic_diaba_pt.tif
│   │   .
│   │   .

Postprocessing

Step-1 of post processing to remove false positives within the map region. Erodes the line predictions

python postprocessing.py
ROOT_PATH  
├── results_pp_within_map
│   ├── testing
│   ├── validation
│   │   ├── ArthurTaylor_1990_Fig28_contour_line.tif
│   │   ├── pp1410b_Lower_Mesozoic_diaba_pt.tif
│   │   .
│   │   .

Step-2 of post-processing to remove false positives outside the map region.

python filter_non_map_region/inference_map.py
python postprocessing_submission.py
ROOT_PATH  
├── results_pp_outside_map
│   ├── testing
│   ├── validation
│   │   ├── ArthurTaylor_1990_Fig28_contour_line.tif
│   │   ├── pp1410b_Lower_Mesozoic_diaba_pt.tif
│   │   .
│   │   .

Visualize results

Run the below command for qualitative analysis of predictions. Sample visualizations are available in $ROOT_PATH/sample_viz.

python generate_visualizations.py 
ROOT_PATH  
├── results_contours

ai4cma's People

Contributors

rtgunti avatar sureshgaussian avatar

Watchers

 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.