Git Product home page Git Product logo

crater-scraper's Introduction

Crater-Scraper / Crater Classification

Identifying Craters left from wepons test using Convolutional Neural Network.

Crater Scraping is an ongoing research project that seeks to train a Convolutional Neural Network to identify and classify nuclear weapons test sites. Crater Scraping works by utilizing information from FOIA requests and research from military historians to scrape satellite imagery of weapons test sites. Images are then used to train a Neural Network to identify and classify man made geological events from satellite imagery.

Alt text Alt text Alt text Alt text Alt text


Installation:

  1. Install dlib, scikit-image and tensorflow.

  2. Install the node prerequisites and create a directory to hold images:

    cd scripts/node
    npm install googlemaps easyimage fast-csv turf @turf/invariant
    mkdir -p ../../images/crater ../../images/no_crater
    
  3. Generate a Google Static Maps API key by going to the Google Static Maps API page and clicking the "GET KEY" button. Put the key in scripts/node/config.js.

  4. Run scraper.js to gather nuclear test site images:

    node scraper.js
    

    This should take about 10 minutes to collect approximately 2000 images.

  5. Run random_scraper.js to gather satellite imagery of random places.

  6. Convert the PNG images to JPG:

    cd images/crater
    find . -type f -print0 | xargs -0 -n 1 -P 6 -I {} sh -c "gm convert {} -quality 90 {}.jpg && rm {}"
    cd ../images/no_crater
    find . -type f -print0 | xargs -0 -n 1 -P 6 -I {} sh -c "gm convert {} -quality 90 {}.jpg && rm {}"
    
  7. Train the model:

    python ~/tensorflow/tensorflow/examples/image_retraining/retrain.py \
      --how_many_training_steps 4000 \
      --output_graph=crater_graph.pb \
      --output_labels=crater_labels.txt \
      --image_dir=images
    
  8. Run the classifier on a new image:

    $ ~/tensorflow/bazel-bin/tensorflow/examples/label_image/label_image \
      --graph=crater_graph.pb \
      --labels=crater_labels.txt \
      --output_layer=final_result \
      --image=1.jpg \
      --input_layer=Mul
    2017-04-05 15:58:38.495479: I tensorflow/examples/label_image/main.cc:206] crater (1): 0.938558
    2017-04-05 15:58:38.495497: I tensorflow/examples/label_image/main.cc:206] no crater (0): 0.0614419
    

  • 11/23/2016 - Script to collect a google map of crater site and save as cropped image.
  • 11/24/2016 - Script to convert crater images into Histogram of Oriented Gradients.
  • 11/25/2016 - Compiled CSVs of nuclear tests and coordinates
  • 11/26/2016 - Gathered all images...around 2000
  • 12/3/2016 - Convolution with Tensorflow
  • 12/5/2016 - Neural Net with tensor flow
  • 12/7/2016 - retrain.py to train the final layer of a pretrained inception model
  • 12/9/2016 - classifying images

Current status

This works to identify craters with better than average results. However, it is easy to fool if you feed an image of a desert to the network. Still is valuable code if all you want to do is scrape all 2000 images.

Thanks to johnston archives.

http://www.johnstonsarchive.net/nuclear/tests/

crater-scraper's People

Contributors

dmehrotra avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  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.