GithubHelp home page GithubHelp logo

nkashani / seismic-imaging-segmentation-cnn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from des137/seismic-imaging-segmentation-cnn

0.0 0.0 0.0 3.89 MB

Home Page: https://www.kaggle.com/c/tgs-salt-identification-challenge

Shell 0.32% Python 99.68%

seismic-imaging-segmentation-cnn's Introduction

SeismicSaltDetector

Contents

1. Background

2. Effectiveness of Convolutional Neural Networks

3. U-Net architecture

4. Hyperparameter Tuning

5. Metric for Image Segmentation

6. Results

7. About Me

Reflection seismology is one of the most important techniques to uncover the interiors of the earth for oil and gas explorations. Seismic images are obtained by sending artificial seismic waves (earthquakes) inside the earth to accurately probe its interiors.

Since, sending mechanical instruments inside the earth is extremely costly and technologically challenging, refection seismology remains the only reliable, cost-effective, and feasible technique for such endeavors. Thus, geophysics industries rely heavily on accurate imaging and analysis of these seismic images to gain information regarding the whereabouts of hydrocarbons (trapped almost hundreds of kilometers deep inside the earth).

The raw images which are obtained by combining multiple signals require a lot of preprocessing. This is performed using estimations of sound waves inside the earth using complex geophysical models of the earth. After the preprocessing, these seismic images (an exmaple shown below) are in one-to-one correspondence with the true structure of the subsurface.

An extremely difficult task that follows the preprocessing step is the interpretation of these seismic images. Accurate interpretation of the seismic images requires years of experience in the field of geophysics. The mistakes are costly. Wrong interpretations can cost millions of dollars to oil and gas companies, if they dig into the earth with false predictions of hydrocarbons. Additionally, there are multiple risks involved while sending the mechanical instruments inside the earth. A very important question in this business, therefore, is whether we can leverage the power of computers to help geophysicists accurately map out the regions in the images that correspond to the presence of hydrocarbons. I take an initial step in this direction by training a neural network on seismic images with training set of 4000 seismic images and predicting the outcomes of the network on test set of 18000 images, made available via Kaggle. The given seismic images are grayscale images, and each image corresponds to the size of 101 by 101 (total 10201 pixels).

So in this regard, the question that I tackle is: given an image of size 101 by 101 with a grayscale intensity from 1 to 255, can I accurately segment the region of the images that correspond to the presence of hydrocarbons? (Note that the presence of salts inside the earth is an indicator of the presence of hydrocarbons, therefore, I will use the terms 'salt-detection' and 'hydrocarbon-detection', interchangeably).

The problem mentioned above, when phrased in different words is: for each of the pixels from the original image, can I classify it as containing salt or not? Such problems are termed 'image segmentations' or 'dense predictions' (since each pixel of the image needs prediction). As is well known, the image analysis problems are not properly suited for a regular (dense) neural network, since the input vector grows exponentially with the size of the image. 'Convolutional neural networks', on the other hand, have proved immensely effective in image, speech, natural language processing tasks. These networks mimic the architecture of the visual cortex of the brain that is responsible for the image recognition.

The image below shows all the component that enter in the U-net architecture.

CNNs are mainly used for image classifications. Therefore CNN architecture, in general, involves a contracting path that captures the context of the images layer by layer. U-Net, on the other hand, adds a symmetric expanding path that helps in the localization of the original image. Since, for image segmentation problem one usually requires an output image to be of the same size as the original image, U-Net architecture is particularly well-suited for this analysis. Similar to a CNN, U-Net architecture implements few convolutional layers (with a non-linear activation function) followed by a pooling layer. A single convolutional layer consists of multiple feature maps, each generated by applying a specific filter (weights) to one of the feature maps from the previous convolutional or pooling layer.

A U-Net allows for an experimentation of a set of different hyperparmeters given below (the particular set of hyperparamters which were used in this realization of U-net and ones that produced the best meanIOU (explained below) on seismic images are also shown in the square brackets).

  1. Number of filters/Number of feature maps [32, 64 ....1024.....32]
  2. Size of a filter/kernal size [3x3, 2x2 in the contracting path, 3x3 in the expnding path]
  3. Optimizers [Adam]
  4. Padding [Same]

Since the number of images provided was really low, image augmentation was applied to increase the size of training set. Augmented images simply were the reflections of the original images along the vertical axis. Note, the reflections along the horizontal axis looses the context, since the structure of the earth is uniform along the horizontal direction, but not along the vertical direction.

The metric that is generally used for the image segmentation problems is called 'mean intersection over union' or meanIOU. This metric relates to the familiar classification related notions, and the ralationship is given by the ratio of true positives (TP) over the sum of true positives, false positives, and false negatives (TP+FP+FN).

The U-net architecture performed really well in the image segmentation task. The meanIOU obtained was 77.4%. The following images are from the validation set. Images in the first column are actual seismic images. The second and third columns show the corresponding labeled masks and the masks predicted by CNNs, respectively.

How to run this code on your personal computer:

  1. SeismicSaltDetector can be run by simply typing the following commands in terminal:
git clone https://github.com/des137/SeismicSaltDetector.git
cd SeismicSaltDetector/src
./run.sh

Due to the size of the images, only about 1% of the total images are provided here. The rest of the images can be downloaded from Kaggle.

My name is Amol Deshmukh. I am a physicist and a data scientist. During my PhD, I investigated magnetic properties of neutrons and protons (and other less-known particles called 'hyperons'). I am extremely passionate about applying my skills that physics has taught me over the years to tackle challenging business-oriented problems in data science and machine learning.

seismic-imaging-segmentation-cnn's People

Contributors

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